Compare commits
88
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed5c03070f | ||
|
|
7dfc1071ec | ||
|
|
4d2223a79d | ||
|
|
59b5f0b7aa | ||
|
|
7fd46961cd | ||
|
|
0b572399d0 | ||
|
|
cfe81f1ac0 | ||
|
|
c6fdd28797 | ||
|
|
007f7c558a | ||
|
|
348264f1b0 | ||
|
|
47840eea15 | ||
|
|
b8ba8ff29b | ||
|
|
0392461608 | ||
|
|
c30e8e41a0 | ||
|
|
a4d1703ca1 | ||
|
|
af7921a9bf | ||
|
|
7a370d81a0 | ||
|
|
1a92ccf000 | ||
|
|
bfe1c448d2 | ||
|
|
a537603acf | ||
|
|
bbcfc27596 | ||
|
|
141b2d4a4b | ||
|
|
a3fc41295d | ||
|
|
73d14a4e7f | ||
|
|
29389c21d8 | ||
|
|
645ba2512e | ||
|
|
06d5667084 | ||
|
|
c28d646d64 | ||
|
|
612f0a723d | ||
|
|
93eb45c00a | ||
|
|
4a862fb21b | ||
|
|
bc644896cb | ||
|
|
907b109f97 | ||
|
|
99a83cd563 | ||
|
|
d4c815b3d1 | ||
|
|
53c0ac21d3 | ||
|
|
487fdc438f | ||
|
|
a363dac827 | ||
|
|
f5c5979d81 | ||
|
|
cb338d2897 | ||
|
|
32dbc2a3ce | ||
|
|
e73f2cbc2e | ||
|
|
ef448c2390 | ||
|
|
62750cf513 | ||
|
|
e2f2ccdd0e | ||
|
|
a086d6440e | ||
|
|
54154fbb9e | ||
|
|
698c134501 | ||
|
|
18a54f6750 | ||
|
|
ae42bcbf9e | ||
|
|
c728aec31c | ||
|
|
e8266711b8 | ||
|
|
a53cc62bcd | ||
|
|
ebd40e2791 | ||
|
|
e4a7a517ed | ||
|
|
ded9c5f89c | ||
|
|
92dd55ee88 | ||
|
|
e99c8ad182 | ||
|
|
72e16b17ee | ||
|
|
d0441cb5bf | ||
|
|
90e3d4ba26 | ||
|
|
4c3a4c1d24 | ||
|
|
f43ed8b8ac | ||
|
|
dc16c4e117 | ||
|
|
06f3f5a182 | ||
|
|
97094a1150 | ||
|
|
a1ea09a13d | ||
|
|
4867ef1631 | ||
|
|
b5f1c4826c | ||
|
|
24388f5cf3 | ||
|
|
ab25ecef28 | ||
|
|
5f8dd6a614 | ||
|
|
01ef08ab2b | ||
|
|
3d892f6eb0 | ||
|
|
d24e458c84 | ||
|
|
a9dda619e9 | ||
|
|
c028d1475c | ||
|
|
b6971d6650 | ||
|
|
4e82db64c4 | ||
|
|
a74537417f | ||
|
|
7af147222c | ||
|
|
71efc5725a | ||
|
|
8fc41c9ae1 | ||
|
|
271c330355 | ||
|
|
6d7284eec4 | ||
|
|
2888fc143b | ||
|
|
a1c97c4f63 | ||
|
|
27501b8ce8 |
@@ -1,3 +1,82 @@
|
||||
2002-01-24 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* tests/platform.test (platform-2.1): Added test to make sure that
|
||||
the meaning of tcl_platform(wordSize) is what I think it is.
|
||||
|
||||
2001-12-02 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* tests/platform.test (platform-1.1):
|
||||
* tests/safe.test (safe-6.3): These two tests are trivially
|
||||
affected.
|
||||
* doc/tclvars.n: Doc'd change.
|
||||
* generic/tclBasic.c (Tcl_CreateInterp): Added an entry "wordSize"
|
||||
to the tcl_platform array to describe the size of the machine word
|
||||
(in units of whatever size_t returns.) Suggested by Arjen Markus,
|
||||
and this may be useful in all sorts of scripts where the word size
|
||||
is not guaranteed.
|
||||
|
||||
2001-11-27 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* generic/tclTest.c (PretendTclpStat): Fixed so that it will
|
||||
compile on native 64-bit platforms. Ooops!
|
||||
|
||||
2001-11-26 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* generic/tclTest.c (PretendTclpStat): Yet more buffer type
|
||||
juggling, because the test suite uses the 'obsolete fs hooks' even
|
||||
though the rest of the core doesn't.
|
||||
(TestStatProc1, TestStatProc2, TestStatProc3): Type fix.
|
||||
* generic/tclInt.h: Changed declaration of TclStatProc_ back to
|
||||
what it was originally.
|
||||
* generic/tclIOUtil.c (Tcl_FSStat): Updated to use old-style stat
|
||||
buffers for the 'obsolete fs hooks' for better interim prowrap and
|
||||
mktclapp support. (Thanks to Vince Darley for feedback.)
|
||||
|
||||
2001-11-25 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* doc/FileSystem.3:
|
||||
* doc/Access.3: Minor correction, and more explanation about why
|
||||
Tcl_FSStat is better than either stat or Tcl_Stat.
|
||||
|
||||
* generic/tclIOUtil.c (Tcl_Stat): Whoops! st_ino is an unsigned
|
||||
field...
|
||||
|
||||
2001-11-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* generic/tclExecute.c: Removed duplicate declaration of LLONG_MIN
|
||||
and LLONG_MAX which are now in tclPort.h instead.
|
||||
|
||||
* generic/tcl.h: Added extra forward declaration for picky
|
||||
compilers.
|
||||
|
||||
* generic/tclFCmd.c (FileCopyRename): Fixed comment.
|
||||
|
||||
* generic/tcl.decls (Tcl_Stat):
|
||||
* generic/tclIOUtil.c (Tcl_Stat): Reworked so as to use old style
|
||||
'struct stat' declaration for improved backward-compatability.
|
||||
|
||||
2001-10-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* win/tclWinMtherr.c (_matherr): Better handling of selected
|
||||
Borland C++ math errors, from hgiese@ratiosoft.com
|
||||
|
||||
* generic/tclIndexObj.c (STRING_AT): Fixed so that it builds with
|
||||
SunPro CC on Solaris, which refuses to perform address arithmetic
|
||||
on void*, despite the fact that that is necessary to get the
|
||||
correct behaviour on Crays...
|
||||
|
||||
* generic/tclTestObj.c (TestindexobjCmd): Fixed assumptions
|
||||
relating to internal representation of index objects.
|
||||
|
||||
2001-10-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* doc/GetIndex.3: Added note that table of strings must be ASCII
|
||||
strings, which they seem to be in all currrent uses. Things break
|
||||
horribly otherwise since the matching code is not UTF-8 aware.
|
||||
* generic/tclIndexObj.c: Assorted changes to make
|
||||
Tcl_GetIndexFromObj() more likely to work on platforms like a Cray
|
||||
PVP following feedback from Len Makin <len@hpc.csiro.au>
|
||||
|
||||
2001-09-24 Donal K. Fellows <fellowsd@cs.man.ac.uk>
|
||||
|
||||
* tools/encoding/cp1252.txt: File was missing part of the encoding
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* strtoll.c --
|
||||
*
|
||||
* Source code for the "strtoll" library procedure.
|
||||
*
|
||||
* Copyright (c) 1988 The Regents of the University of California.
|
||||
* Copyright (c) 1994 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: strtoll.c,v 1.1.2.2 2001/10/19 12:52:33 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
#include "tclPort.h"
|
||||
#include <ctype.h>
|
||||
|
||||
#define TCL_WIDEINT_MAX (((Tcl_WideUInt)Tcl_LongAsWide(-1))>>1)
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* strtol --
|
||||
*
|
||||
* Convert an ASCII string into an integer.
|
||||
*
|
||||
* Results:
|
||||
* The return value is the integer equivalent of string. If endPtr
|
||||
* is non-NULL, then *endPtr is filled in with the character
|
||||
* after the last one that was part of the integer. If string
|
||||
* doesn't contain a valid integer value, then zero is returned
|
||||
* and *endPtr is set to string.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_WideInt
|
||||
strtoll(string, endPtr, base)
|
||||
char *string; /* String of ASCII digits, possibly
|
||||
* preceded by white space. For bases
|
||||
* greater than 10, either lower- or
|
||||
* upper-case digits may be used.
|
||||
*/
|
||||
char **endPtr; /* Where to store address of terminating
|
||||
* character, or NULL. */
|
||||
int base; /* Base for conversion. Must be less
|
||||
* than 37. If 0, then the base is chosen
|
||||
* from the leading characters of string:
|
||||
* "0x" means hex, "0" means octal, anything
|
||||
* else means decimal.
|
||||
*/
|
||||
{
|
||||
register char *p;
|
||||
Tcl_WideInt result;
|
||||
Tcl_WideUInt uwResult;
|
||||
|
||||
/*
|
||||
* Skip any leading blanks.
|
||||
*/
|
||||
|
||||
p = string;
|
||||
while (isspace(*p)) {
|
||||
p += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a sign.
|
||||
*/
|
||||
|
||||
if (*p == '-') {
|
||||
p += 1;
|
||||
uwResult = strtoull(p, endPtr, base);
|
||||
if (errno != ERANGE) {
|
||||
if (uwResult > TCL_WIDEINT_MAX+1) {
|
||||
errno = ERANGE;
|
||||
return Tcl_LongAsWide(-1);
|
||||
} else if (uwResult > TCL_WIDEINT_MAX) {
|
||||
return ~((Tcl_WideInt)TCL_WIDEINT_MAX);
|
||||
} else {
|
||||
result = -uwResult;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (*p == '+') {
|
||||
p += 1;
|
||||
}
|
||||
uwResult = strtoull(p, endPtr, base);
|
||||
if (errno != ERANGE) {
|
||||
if (uwResult > TCL_WIDEINT_MAX) {
|
||||
errno = ERANGE;
|
||||
return Tcl_LongAsWide(-1);
|
||||
} else {
|
||||
result = uwResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((result == 0) && (endPtr != 0) && (*endPtr == p)) {
|
||||
*endPtr = string;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* strtoull.c --
|
||||
*
|
||||
* Source code for the "strtoull" library procedure.
|
||||
*
|
||||
* Copyright (c) 1988 The Regents of the University of California.
|
||||
* Copyright (c) 1994 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: strtoull.c,v 1.1.2.3 2001/10/19 12:52:33 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
#include "tclPort.h"
|
||||
#include <ctype.h>
|
||||
|
||||
/*
|
||||
* The table below is used to convert from ASCII digits to a
|
||||
* numerical equivalent. It maps from '0' through 'z' to integers
|
||||
* (100 for non-digit characters).
|
||||
*/
|
||||
|
||||
static char cvtIn[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */
|
||||
100, 100, 100, 100, 100, 100, 100, /* punctuation */
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
||||
30, 31, 32, 33, 34, 35,
|
||||
100, 100, 100, 100, 100, 100, /* punctuation */
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'a' - 'z' */
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
||||
30, 31, 32, 33, 34, 35};
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* strtoull --
|
||||
*
|
||||
* Convert an ASCII string into an integer.
|
||||
*
|
||||
* Results:
|
||||
* The return value is the integer equivalent of string. If endPtr
|
||||
* is non-NULL, then *endPtr is filled in with the character
|
||||
* after the last one that was part of the integer. If string
|
||||
* doesn't contain a valid integer value, then zero is returned
|
||||
* and *endPtr is set to string.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_WideUInt
|
||||
strtoull(string, endPtr, base)
|
||||
char *string; /* String of ASCII digits, possibly
|
||||
* preceded by white space. For bases
|
||||
* greater than 10, either lower- or
|
||||
* upper-case digits may be used.
|
||||
*/
|
||||
char **endPtr; /* Where to store address of terminating
|
||||
* character, or NULL. */
|
||||
int base; /* Base for conversion. Must be less
|
||||
* than 37. If 0, then the base is chosen
|
||||
* from the leading characters of string:
|
||||
* "0x" means hex, "0" means octal, anything
|
||||
* else means decimal.
|
||||
*/
|
||||
{
|
||||
register char *p;
|
||||
register Tcl_WideUInt result = 0;
|
||||
register unsigned digit;
|
||||
register Tcl_WideUInt shifted;
|
||||
int anyDigits = 0, negative = 0;
|
||||
|
||||
/*
|
||||
* Skip any leading blanks.
|
||||
*/
|
||||
|
||||
p = string;
|
||||
while (isspace(*p)) { /* INTL: locale-dependent */
|
||||
p += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a sign.
|
||||
*/
|
||||
|
||||
if (*p == '-') {
|
||||
p += 1;
|
||||
negative = 1;
|
||||
} else {
|
||||
if (*p == '+') {
|
||||
p += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If no base was provided, pick one from the leading characters
|
||||
* of the string.
|
||||
*/
|
||||
|
||||
if (base == 0) {
|
||||
if (*p == '0') {
|
||||
p += 1;
|
||||
if (*p == 'x' || *p == 'X') {
|
||||
p += 1;
|
||||
base = 16;
|
||||
} else {
|
||||
|
||||
/*
|
||||
* Must set anyDigits here, otherwise "0" produces a
|
||||
* "no digits" error.
|
||||
*/
|
||||
|
||||
anyDigits = 1;
|
||||
base = 8;
|
||||
}
|
||||
} else {
|
||||
base = 10;
|
||||
}
|
||||
} else if (base == 16) {
|
||||
|
||||
/*
|
||||
* Skip a leading "0x" from hex numbers.
|
||||
*/
|
||||
|
||||
if ((p[0] == '0') && (p[1] == 'x' || *p == 'X')) {
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sorry this code is so messy, but speed seems important. Do
|
||||
* different things for base 8, 10, 16, and other.
|
||||
*/
|
||||
|
||||
if (base == 8) {
|
||||
for ( ; ; p += 1) {
|
||||
digit = *p - '0';
|
||||
if (digit > 7) {
|
||||
break;
|
||||
}
|
||||
shifted = result << 3;
|
||||
if ((shifted >> 3) != result) {
|
||||
goto overflow;
|
||||
}
|
||||
result = shifted + digit;
|
||||
anyDigits = 1;
|
||||
}
|
||||
} else if (base == 10) {
|
||||
for ( ; ; p += 1) {
|
||||
digit = *p - '0';
|
||||
if (digit > 9) {
|
||||
break;
|
||||
}
|
||||
shifted = 10 * result;
|
||||
if ((shifted / 10) != result) {
|
||||
goto overflow;
|
||||
}
|
||||
result = shifted + digit;
|
||||
anyDigits = 1;
|
||||
}
|
||||
} else if (base == 16) {
|
||||
for ( ; ; p += 1) {
|
||||
digit = *p - '0';
|
||||
if (digit > ('z' - '0')) {
|
||||
break;
|
||||
}
|
||||
digit = cvtIn[digit];
|
||||
if (digit > 15) {
|
||||
break;
|
||||
}
|
||||
shifted = result << 4;
|
||||
if ((shifted >> 4) != result) {
|
||||
goto overflow;
|
||||
}
|
||||
result = shifted + digit;
|
||||
anyDigits = 1;
|
||||
}
|
||||
} else {
|
||||
for ( ; ; p += 1) {
|
||||
digit = *p - '0';
|
||||
if (digit > ('z' - '0')) {
|
||||
break;
|
||||
}
|
||||
digit = cvtIn[digit];
|
||||
if (digit >= base) {
|
||||
break;
|
||||
}
|
||||
shifted = result * base;
|
||||
if ((shifted/base) != result) {
|
||||
goto overflow;
|
||||
}
|
||||
result = shifted + digit;
|
||||
anyDigits = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Negate if we found a '-' earlier.
|
||||
*/
|
||||
|
||||
if (negative) {
|
||||
result = (Tcl_WideUInt)(-((Tcl_WideInt)result));
|
||||
}
|
||||
|
||||
/*
|
||||
* See if there were any digits at all.
|
||||
*/
|
||||
|
||||
if (!anyDigits) {
|
||||
p = string;
|
||||
}
|
||||
|
||||
if (endPtr != 0) {
|
||||
*endPtr = p;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
/*
|
||||
* On overflow generate the right output
|
||||
*/
|
||||
|
||||
overflow:
|
||||
errno = ERANGE;
|
||||
if (endPtr != 0) {
|
||||
for ( ; ; p += 1) {
|
||||
digit = *p - '0';
|
||||
if (digit > ('z' - '0')) {
|
||||
break;
|
||||
}
|
||||
digit = cvtIn[digit];
|
||||
if (digit >= base) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*endPtr = p;
|
||||
}
|
||||
return (Tcl_WideUInt)Tcl_LongAsWide(-1);
|
||||
}
|
||||
+4
-3
@@ -4,7 +4,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: Access.3,v 1.4 2001/07/31 19:12:05 vincentdarley Exp $
|
||||
'\" RCS: @(#) $Id: Access.3,v 1.4.6.1 2001/11/25 17:27:48 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Access 3 8.1 Tcl "Tcl Library Procedures"
|
||||
@@ -21,7 +21,7 @@ int
|
||||
int
|
||||
\fBTcl_Stat\fR(\fIpath\fR, \fIstatPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS stat *statPtr in
|
||||
.AS "struct stat" *statPtr in
|
||||
.AP char *path in
|
||||
Native name of the file to check the attributes of.
|
||||
.AP int mode in
|
||||
@@ -29,7 +29,7 @@ Mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. R_OK,
|
||||
W_OK and X_OK request checking whether the file exists and has read,
|
||||
write and execute permissions, respectively. F_OK just requests
|
||||
checking for the existence of the file.
|
||||
.AP stat *statPtr out
|
||||
.AP "struct stat" *statPtr out
|
||||
The structure that contains the result.
|
||||
.BE
|
||||
|
||||
@@ -73,3 +73,4 @@ given.
|
||||
|
||||
.SH KEYWORDS
|
||||
stat access
|
||||
|
||||
|
||||
+18
-7
@@ -4,13 +4,13 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: FileSystem.3,v 1.6 2001/09/08 14:05:09 vincentdarley Exp $
|
||||
'\" RCS: @(#) $Id: FileSystem.3,v 1.6.6.2 2001/11/25 17:27:48 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_FSCopyFile 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_FSRegister, Tcl_FSUnregister, Tcl_FSData, Tcl_FSCopyFile, Tcl_FSCopyDirectory, Tcl_FSCreateDirectory, Tcl_FSDeleteFile, Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSListVolumes, Tcl_FSEvalFile, Tcl_FSLoadFile, Tcl_FSMatchInDirectory, Tcl_FSLink, Tcl_FSLstat, Tcl_FSUtime, Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSStat, Tcl_FSAccess, Tcl_FSOpenFileChannel, Tcl_FSGetCwd, Tcl_FSChdir, Tcl_FSPathSeparator, Tcl_FSJoinPath, Tcl_FSSplitPath, Tcl_FSEqualPaths, Tcl_FSGetNormalizedPath, Tcl_FSJoinToPath, Tcl_FSConvertToPathType, Tcl_FSGetInternalRep, Tcl_FSGetTranslatedPath, Tcl_FSGetTranslatedStringPath, Tcl_FSNewNativePath, Tcl_FSGetNativePath, Tcl_FSFileSystemInfo \- procedures to interact with any filesystem
|
||||
Tcl_FSRegister, Tcl_FSUnregister, Tcl_FSData, Tcl_FSCopyFile, Tcl_FSCopyDirectory, Tcl_FSCreateDirectory, Tcl_FSDeleteFile, Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSListVolumes, Tcl_FSEvalFile, Tcl_FSLoadFile, Tcl_FSMatchInDirectory, Tcl_FSLink, Tcl_FSLstat, Tcl_FSUtime, Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSStat, Tcl_FSAccess, Tcl_FSOpenFileChannel, Tcl_FSGetCwd, Tcl_FSChdir, Tcl_FSPathSeparator, Tcl_FSJoinPath, Tcl_FSSplitPath, Tcl_FSEqualPaths, Tcl_FSGetNormalizedPath, Tcl_FSJoinToPath, Tcl_FSConvertToPathType, Tcl_FSGetInternalRep, Tcl_FSGetTranslatedPath, Tcl_FSGetTranslatedStringPath, Tcl_FSNewNativePath, Tcl_FSGetNativePath, Tcl_FSFileSystemInfo, Tcl_AllocStatBuf \- procedures to interact with any filesystem
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -125,6 +125,9 @@ char*
|
||||
.sp
|
||||
Tcl_Obj*
|
||||
\fBTcl_FSFileSystemInfo\fR(\fIpathPtr\fR)
|
||||
.sp
|
||||
Tcl_StatBuf*
|
||||
\fBTcl_AllocStatBuf\fR()
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Filesystem *fsPtr in
|
||||
.AP Tcl_Filesystem *fsPtr in
|
||||
@@ -178,7 +181,7 @@ Mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. R_OK,
|
||||
W_OK and X_OK request checking whether the file exists and has read,
|
||||
write and execute permissions, respectively. F_OK just requests
|
||||
checking for the existence of the file.
|
||||
.AP stat *statPtr out
|
||||
.AP Tcl_StatBuf *statPtr out
|
||||
The structure that contains the result of a stat or lstat operation.
|
||||
.AP char *sym1 in
|
||||
Name of a procedure to look up in the file's symbol table
|
||||
@@ -234,6 +237,10 @@ registered, the 'files' may, to give two examples, be remote (e.g.
|
||||
situated on a remote ftp server) or archived (e.g. lying inside a .zip
|
||||
archive). Such registered filesystems provide a lookup table of
|
||||
functions to implement all or some of the functionality listed here.
|
||||
Finally, the \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR calls abstract
|
||||
away from what the 'struct stat' buffer buffer is actually declared to
|
||||
be, allowing the same code to be used both on systems with and systems
|
||||
without support for files larger than 2GB in size.
|
||||
.PP
|
||||
The \fBTcl_FS...\fR are objectified and may cache internal
|
||||
representations and other path-related strings (e.g. the current
|
||||
@@ -544,6 +551,12 @@ further categorization of files.
|
||||
A valid list object is returned, unless the path object is not
|
||||
recognized, when NULL will be returned.
|
||||
.PP
|
||||
\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system
|
||||
heap (which may be deallocated by being passed to \fBckfree\fR.) This
|
||||
allows extensions to invoke \fBTcl_FSStat\fR and \fBTcl_FSLStat\fR
|
||||
without being dependent on the size of the buffer. That in turn
|
||||
depends on the flags used to build Tcl.
|
||||
.PP
|
||||
|
||||
.SH TCL_FILESYSTEM
|
||||
.PP
|
||||
@@ -797,7 +810,7 @@ See the documentation of '
|
||||
.CS
|
||||
typedef int Tcl_FSStatProc(
|
||||
Tcl_Obj *\fIpathPtr\fR,
|
||||
struct stat *\fIstatPtr\fR);
|
||||
Tcl_StatBuf *\fIstatPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fBTcl_FSStatProc\fR fills the stat structure \fIstatPtr\fR with
|
||||
@@ -1071,7 +1084,7 @@ it need only be implemented if a filesystem can differentiate between
|
||||
.CS
|
||||
typedef int Tcl_FSLstatProc(
|
||||
Tcl_Obj *\fIpathPtr\fR,
|
||||
struct stat *\fIstatPtr\fR);
|
||||
Tcl_StatBuf *\fIstatPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The behavior of this function is very similar to that of the
|
||||
@@ -1221,5 +1234,3 @@ directory to the value specified in \fIpathPtr\fR. The function returns
|
||||
|
||||
.SH KEYWORDS
|
||||
stat access filesystem vfs
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: GetIndex.3,v 1.6 2000/07/24 00:03:02 jenglish Exp $
|
||||
'\" RCS: @(#) $Id: GetIndex.3,v 1.6.12.1 2001/10/19 15:45:22 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
@@ -34,7 +34,7 @@ The string value of this object is used to search through \fItablePtr\fR.
|
||||
The internal representation is modified to hold the index of the matching
|
||||
table entry.
|
||||
.AP char **tablePtr in
|
||||
An array of null-terminated strings. The end of the array is marked
|
||||
An array of null-terminated ASCII strings. The end of the array is marked
|
||||
by a NULL string pointer.
|
||||
.VS
|
||||
.AP int offset in
|
||||
|
||||
+17
-4
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: LinkVar.3,v 1.3 2000/04/14 23:01:51 hobbs Exp $
|
||||
'\" RCS: @(#) $Id: LinkVar.3,v 1.3.16.1 2001/11/07 13:35:21 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_LinkVar 3 7.5 Tcl "Tcl Library Procedures"
|
||||
@@ -34,6 +34,9 @@ temporary modifications to it while parsing the variable name.
|
||||
Address of C variable that is to be linked to \fIvarName\fR.
|
||||
.AP int type in
|
||||
Type of C variable. Must be one of TCL_LINK_INT, TCL_LINK_DOUBLE,
|
||||
.VS 8.4
|
||||
TCL_LINK_WIDE_INT,
|
||||
.VE 8.4
|
||||
TCL_LINK_BOOLEAN, or TCL_LINK_STRING, optionally OR'ed with
|
||||
TCL_LINK_READ_ONLY to make Tcl variable read-only.
|
||||
.BE
|
||||
@@ -58,17 +61,27 @@ TCL_LINK_READ_ONLY:
|
||||
\fBTCL_LINK_INT\fR
|
||||
The C variable is of type \fBint\fR.
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetInt\fR; attempts to write
|
||||
form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write
|
||||
non-integer values into \fIvarName\fR will be rejected with
|
||||
Tcl errors.
|
||||
.TP
|
||||
\fBTCL_LINK_DOUBLE\fR
|
||||
The C variable is of type \fBdouble\fR.
|
||||
Any value written into the Tcl variable must have a proper real
|
||||
form acceptable to \fBTcl_GetDouble\fR; attempts to write
|
||||
form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write
|
||||
non-real values into \fIvarName\fR will be rejected with
|
||||
Tcl errors.
|
||||
.TP
|
||||
\fBTCL_LINK_WIDE_INT\fR
|
||||
.VS 8.4
|
||||
The C variable is of type \fBTcl_WideInt\fR (which is an integer type
|
||||
at least 64-bits wide on all platforms that can support it.)
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write
|
||||
non-integer values into \fIvarName\fR will be rejected with
|
||||
Tcl errors.
|
||||
.VE 8.4
|
||||
.TP
|
||||
\fBTCL_LINK_BOOLEAN\fR
|
||||
The C variable is of type \fBint\fR.
|
||||
If its value is zero then it will read from Tcl as ``0'';
|
||||
@@ -76,7 +89,7 @@ otherwise it will read from Tcl as ``1''.
|
||||
Whenever \fIvarName\fR is
|
||||
modified, the C variable will be set to a 0 or 1 value.
|
||||
Any value written into the Tcl variable must have a proper boolean
|
||||
form acceptable to \fBTcl_GetBoolean\fR; attempts to write
|
||||
form acceptable to \fBTcl_GetBooleanFromObj\fR; attempts to write
|
||||
non-boolean values into \fIvarName\fR will be rejected with
|
||||
Tcl errors.
|
||||
.TP
|
||||
|
||||
+54
-2
@@ -4,7 +4,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: binary.n,v 1.6 2000/09/07 14:27:46 poenitz Exp $
|
||||
'\" RCS: @(#) $Id: binary.n,v 1.6.12.1 2001/10/04 13:55:18 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH binary n 8.0 Tcl "Tcl Built-In Commands"
|
||||
@@ -199,6 +199,30 @@ For example,
|
||||
will return a string equivalent to
|
||||
\fB\\x00\\x00\\x00\\x03\\xff\\xff\\xff\\xfd\\x00\\x01\\x00\\x00\fR
|
||||
.RE
|
||||
.IP \fBw\fR 5
|
||||
.VS 8.4
|
||||
This form is the same as \fBw\fR except that it stores one or more
|
||||
64-bit integers in little-endian byte order in the output string. The
|
||||
low-order 64-bits of each integer are stored as an eight-byte value at
|
||||
the cursor position with the least significant byte stored first. For
|
||||
example,
|
||||
.RS
|
||||
.CS
|
||||
\fBbinary format w 7810179016327718216\fR
|
||||
.CE
|
||||
will return the string \fBHelloTcl\fR
|
||||
.RE
|
||||
.IP \fBW\fR 5
|
||||
This form is the same as \fBw\fR except that it stores one or more one
|
||||
or more 64-bit integers in big-endian byte order in the output string.
|
||||
For example,
|
||||
.RS
|
||||
.CS
|
||||
\fBbinary format W 4785469626960341345\fR
|
||||
.CE
|
||||
will return the string \fBBigEndian\fR
|
||||
.VE
|
||||
.RE
|
||||
.IP \fBf\fR 5
|
||||
This form is the same as \fBc\fR except that it stores one or more one
|
||||
or more single-precision floating in the machine's native
|
||||
@@ -458,11 +482,39 @@ as \fIcount\fR 32-bit signed integers represented in big-endian byte
|
||||
order. For example,
|
||||
.RS
|
||||
.CS
|
||||
\fBbinary \\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x07\\xff\\xff\\xff\\xf0 I2I* var1 var2\fR
|
||||
\fBbinary scan \\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x07\\xff\\xff\\xff\\xf0 I2I* var1 var2\fR
|
||||
.CE
|
||||
will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR
|
||||
stored in \fBvar2\fR.
|
||||
.RE
|
||||
.IP \fBw\fR 5
|
||||
.VS 8.4
|
||||
The data is interpreted as \fIcount\fR 64-bit signed integers
|
||||
represented in little-endian byte order. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
|
||||
all of the remaining bytes in \fBstring\fR will be scanned. If
|
||||
\fIcount\fR is omitted, then one 64-bit integer will be scanned. For
|
||||
example,
|
||||
.RS
|
||||
.CS
|
||||
\fBbinary scan \\x05\\x00\\x00\\x00\\x07\\x00\\x00\\x00\\xf0\\xff\\xff\\xff wi* var1 var2\fR
|
||||
.CE
|
||||
will return \fB2\fR with \fB30064771077\fR stored in \fBvar1\fR and
|
||||
\fB-16\fR stored in \fBvar2\fR. Note that the integers returned are
|
||||
signed and cannot be represented by Tcl as unsigned values.
|
||||
.RE
|
||||
.IP \fBW\fR 5
|
||||
This form is the same as \fBw\fR except that the data is interpreted
|
||||
as \fIcount\fR 64-bit signed integers represented in big-endian byte
|
||||
order. For example,
|
||||
.RS
|
||||
.CS
|
||||
\fBbinary scan \\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x07\\xff\\xff\\xff\\xf0 WI* var1 var2\fR
|
||||
.CE
|
||||
will return \fB2\fR with \fB21474836487\fR stored in \fBvar1\fR and \fB-16\fR
|
||||
stored in \fBvar2\fR.
|
||||
.VE
|
||||
.RE
|
||||
.IP \fBf\fR 5
|
||||
The data is interpreted as \fIcount\fR single-precision floating point
|
||||
numbers in the machine's native representation. The floating point
|
||||
|
||||
+20
-3
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: expr.n,v 1.5 2000/09/07 14:27:47 poenitz Exp $
|
||||
'\" RCS: @(#) $Id: expr.n,v 1.5.12.1 2001/10/12 12:58:48 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH expr n 8.4 Tcl "Tcl Built-In Commands"
|
||||
@@ -55,6 +55,13 @@ If no numeric interpretation is possible, then an operand is left
|
||||
as a string (and only a limited set of operators may be applied to
|
||||
it).
|
||||
.PP
|
||||
.VS 8.4
|
||||
On 32-bit systems, integer values MAX_INT (0x7FFFFFFF) and MIN_INT
|
||||
(-0x80000000) will be represented as 32-bit values, and integer values
|
||||
outside that range will be represented as 64-bit values (if that is
|
||||
possible at all.)
|
||||
.VE 8.4
|
||||
.PP
|
||||
Operands may be specified in any of the following ways:
|
||||
.IP [1]
|
||||
As an numeric value, either integer or floating-point.
|
||||
@@ -249,8 +256,12 @@ Computes the length of the hypotenuse of a right-angled triangle
|
||||
(\fIx\fR*\fIx\fR+\fIy\fR*\fIy\fR).
|
||||
.TP
|
||||
\fBint(\fIarg\fB)\fR
|
||||
If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts
|
||||
\fIarg\fR to integer by truncation and returns the converted value.
|
||||
.VS 8.4
|
||||
If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise
|
||||
converts \fIarg\fR to an integer (of the same size as a machine word,
|
||||
i.e. 32-bits on 32-bit systems, and 64-bits on 64-bit systems) by
|
||||
truncation and returns the converted value.
|
||||
.VE 8.4
|
||||
.TP
|
||||
\fBlog(\fIarg\fB)\fR
|
||||
Returns the natural logarithm of \fIarg\fR. \fIArg\fR must be a
|
||||
@@ -294,6 +305,12 @@ Returns the tangent of \fIarg\fR, measured in radians.
|
||||
.TP
|
||||
\fBtanh(\fIarg\fB)\fR
|
||||
Returns the hyperbolic tangent of \fIarg\fR.
|
||||
.TP
|
||||
\fBwide(\fIarg\fB)\fR
|
||||
.VS 8.4
|
||||
Converts \fIarg\fR to a value at least 64-bits wide (by sign-extension
|
||||
if \fIarg\fR is a 32-bit number.)
|
||||
.VE 8.4
|
||||
.PP
|
||||
In addition to these predefined functions, applications may
|
||||
define additional functions using \fBTcl_CreateMathFunc\fR().
|
||||
|
||||
+5
-2
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: format.n,v 1.5 2000/09/07 14:27:48 poenitz Exp $
|
||||
'\" RCS: @(#) $Id: format.n,v 1.5.12.1 2001/10/12 12:58:48 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH format n 8.1 Tcl "Tcl Built-In Commands"
|
||||
@@ -131,7 +131,10 @@ which must be \fBh\fR or \fBl\fR.
|
||||
If it is \fBh\fR it specifies that the numeric value should be
|
||||
truncated to a 16-bit value before converting.
|
||||
This option is rarely useful.
|
||||
The \fBl\fR modifier is ignored.
|
||||
.VS 8.4
|
||||
If it is \fBl\fR it specifies that the numeric value should be (at
|
||||
least) a 64-bit value.
|
||||
.VE
|
||||
.PP
|
||||
The last thing in a conversion specifier is an alphabetic character
|
||||
that determines what kind of conversion to perform.
|
||||
|
||||
+39
-17
@@ -6,10 +6,10 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: scan.n,v 1.7 2000/12/10 03:27:03 hobbs Exp $
|
||||
'\" RCS: @(#) $Id: scan.n,v 1.7.12.1 2001/10/12 12:58:48 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH scan n 8.3 Tcl "Tcl Built-In Commands"
|
||||
.TH scan n 8.4 Tcl "Tcl Built-In Commands"
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
@@ -28,13 +28,11 @@ to be parsed and \fIformat\fR indicates how to parse it, using \fB%\fR
|
||||
conversion specifiers as in \fBsscanf\fR. Each \fIvarName\fR gives the
|
||||
name of a variable; when a field is scanned from \fIstring\fR the result is
|
||||
converted back into a string and assigned to the corresponding variable.
|
||||
.VS 8.3
|
||||
If no \fIvarName\fR variables are specified, then \fBscan\fR works in an
|
||||
inline manner, returning the data that would otherwise be stored in the
|
||||
variables as a list. In the inline case, an empty string is returned when
|
||||
the end of the input string is reached before any conversions have been
|
||||
performed.
|
||||
.VE 8.3
|
||||
|
||||
.SH "DETAILS ON SCANNING"
|
||||
.PP
|
||||
@@ -46,10 +44,13 @@ Otherwise, if it isn't a \fB%\fR character then it
|
||||
must match the next character of \fIstring\fR.
|
||||
When a \fB%\fR is encountered in \fIformat\fR, it indicates
|
||||
the start of a conversion specifier.
|
||||
.VS 8.4
|
||||
A conversion specifier contains up to four fields after the \fB%\fR:
|
||||
a \fB*\fR, which indicates that the converted value is to be discarded
|
||||
instead of assigned to a variable; a XPG3 position specifier; a number
|
||||
indicating a maximum field width; and a conversion character.
|
||||
indicating a maximum field width; a field size modifier; and a
|
||||
conversion character.
|
||||
.VE 8.4
|
||||
All of these fields are optional except for the conversion character.
|
||||
The fields that are present must appear in the order given above.
|
||||
.PP
|
||||
@@ -75,33 +76,56 @@ The following conversion characters are supported:
|
||||
\fBd\fR
|
||||
The input field must be a decimal integer.
|
||||
It is read in and the value is stored in the variable as a decimal string.
|
||||
.VS 8.4
|
||||
If the \fBl\fR or \fBL\fR field size modifier is given, the scanned
|
||||
value will have an internal representation that is at least 64-bits in
|
||||
size.
|
||||
.VE 8.4
|
||||
.TP 10
|
||||
\fBo\fR
|
||||
The input field must be an octal integer. It is read in and the
|
||||
value is stored in the variable as a decimal string.
|
||||
.VS 8.4
|
||||
If the \fBl\fR or \fBL\fR field size modifier is given, the scanned
|
||||
value will have an internal representation that is at least 64-bits in
|
||||
size.
|
||||
If the value exceeds MAX_INT (017777777777 on platforms using 32-bit
|
||||
integers), it will be truncated to a signed integer. Hence, 037777777777
|
||||
will appear as -1 on a 32-bit machine.
|
||||
integers when the \fBl\fR and \fBL\fR modifiers are not given), it
|
||||
will be truncated to a signed integer. Hence, 037777777777 will
|
||||
appear as -1 on a 32-bit machine by default.
|
||||
.VE 8.4
|
||||
.TP 10
|
||||
\fBx\fR
|
||||
The input field must be a hexadecimal integer. It is read in
|
||||
and the value is stored in the variable as a decimal string.
|
||||
.VS 8.4
|
||||
If the \fBl\fR or \fBL\fR field size modifier is given, the scanned
|
||||
value will have an internal representation that is at least 64-bits in
|
||||
size.
|
||||
If the value exceeds MAX_INT (0x7FFFFFFF on platforms using 32-bit
|
||||
integers), it will be truncated to a signed integer. Hence, 0xFFFFFFFF
|
||||
will appear as -1 on a 32-bit machine.
|
||||
integers when the \fBl\fR and \fBL\fR modifiers are not given), it
|
||||
will be truncated to a signed integer. Hence, 0xFFFFFFFF will appear
|
||||
as -1 on a 32-bit machine.
|
||||
.VE 8.4
|
||||
.TP 10
|
||||
\fBu\fR
|
||||
The input field must be a decimal integer. The value is stored in the
|
||||
variable as an unsigned decimal integer string.
|
||||
.VS 8.4
|
||||
If the \fBl\fR or \fBL\fR field size modifier is given, the scanned
|
||||
value will have an internal representation that is at least 64-bits in
|
||||
size.
|
||||
.VE 8.4
|
||||
.TP 10
|
||||
\fBi\fR
|
||||
The input field must be an integer. The base (i.e. decimal, octal, or
|
||||
hexadecimal) is determined in the same fashion as described in
|
||||
\fBexpr\fR. The value is stored in the variable as a decimal string.
|
||||
.VS 8.4
|
||||
If the \fBl\fR or \fBL\fR field size modifier is given, the scanned
|
||||
value will have an internal representation that is at least 64-bits in
|
||||
size.
|
||||
.VE 8.4
|
||||
.TP 10
|
||||
\fBc\fR
|
||||
A single character is read in and its binary value is stored in
|
||||
@@ -177,16 +201,14 @@ converted to a decimal string, which is then assigned to the
|
||||
corresponding \fIvarName\fR;
|
||||
no field width may be specified for this conversion.
|
||||
.IP [3]
|
||||
The \fBl\fR, \fBh\fR, and \fBL\fR modifiers are ignored; integer
|
||||
values are always converted as if there were no modifier present
|
||||
and real values are always converted as if the \fBl\fR modifier
|
||||
were present (i.e. type \fBdouble\fR is used for the internal
|
||||
representation).
|
||||
.VS 8.4
|
||||
The \fBh\fR modifier is always ignored and the \fBl\fR and \fBL\fR
|
||||
modifiers are ignored when converting real values (i.e. type
|
||||
\fBdouble\fR is used for the internal representation).
|
||||
.VE 8.4
|
||||
.IP [4]
|
||||
.VS 8.3
|
||||
If the end of the input string is reached before any conversions have been
|
||||
performed and no variables are given, and empty string is returned.
|
||||
.VE 8.3
|
||||
performed and no variables are given, an empty string is returned.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
format(n), sscanf(3)
|
||||
|
||||
+7
-5
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: tclvars.n,v 1.9 2001/09/17 11:51:58 msofer Exp $
|
||||
'\" RCS: @(#) $Id: tclvars.n,v 1.9.2.1 2001/12/02 22:06:23 dkf Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH tclvars n 8.0 Tcl "Tcl Built-In Commands"
|
||||
@@ -245,10 +245,6 @@ retrieve any relevant information. In addition, extensions
|
||||
and applications may add additional values to the array. The
|
||||
predefined elements are:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.RS
|
||||
.VS
|
||||
.TP
|
||||
@@ -295,6 +291,12 @@ This identifies the
|
||||
current user based on the login information available on the platform.
|
||||
This comes from the USER or LOGNAME environment variable on Unix,
|
||||
and the value from GetUserName on Windows and Macintosh.
|
||||
.TP
|
||||
\fBwordSize\fR
|
||||
.VS 8.4
|
||||
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.)
|
||||
.VE 8.4
|
||||
.RE
|
||||
.TP
|
||||
\fBtcl_precision\fR
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: regc_locale.c,v 1.6 2001/05/28 04:45:43 hobbs Exp $
|
||||
* RCS: @(#) $Id: regc_locale.c,v 1.6.8.2 2001/09/27 13:38:33 dkf Exp $
|
||||
*/
|
||||
|
||||
/* ASCII character-name table */
|
||||
|
||||
+220
-198
File diff suppressed because it is too large
Load Diff
+226
-179
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -12,7 +12,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclBasic.c,v 1.35 2001/09/01 00:51:31 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclBasic.c,v 1.35.6.4 2001/12/02 22:06:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -523,6 +523,9 @@ Tcl_CreateInterp()
|
||||
((order.c[0] == 1) ? "littleEndian" : "bigEndian"),
|
||||
TCL_GLOBAL_ONLY);
|
||||
|
||||
Tcl_SetVar2Ex(interp, "tcl_platform", "wordSize",
|
||||
Tcl_NewLongObj((long) sizeof(long)), TCL_GLOBAL_ONLY);
|
||||
|
||||
/*
|
||||
* Set up other variables such as tcl_version and tcl_library
|
||||
*/
|
||||
|
||||
+72
-5
@@ -10,11 +10,11 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclBinary.c,v 1.8 2001/08/23 14:22:49 dkf Exp $
|
||||
* RCS: @(#) $Id: tclBinary.c,v 1.8.6.5 2001/10/03 15:16:05 dkf Exp $
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "tclInt.h"
|
||||
#include <math.h>
|
||||
#include "tclPort.h"
|
||||
|
||||
/*
|
||||
@@ -644,6 +644,11 @@ Tcl_BinaryObjCmd(dummy, interp, objc, objv)
|
||||
size = 4;
|
||||
goto doNumbers;
|
||||
}
|
||||
case 'w':
|
||||
case 'W': {
|
||||
size = 8;
|
||||
goto doNumbers;
|
||||
}
|
||||
case 'f': {
|
||||
size = sizeof(float);
|
||||
goto doNumbers;
|
||||
@@ -924,6 +929,8 @@ Tcl_BinaryObjCmd(dummy, interp, objc, objv)
|
||||
case 'S':
|
||||
case 'i':
|
||||
case 'I':
|
||||
case 'w':
|
||||
case 'W':
|
||||
case 'd':
|
||||
case 'f': {
|
||||
int listc, i;
|
||||
@@ -1179,6 +1186,11 @@ Tcl_BinaryObjCmd(dummy, interp, objc, objv)
|
||||
size = 4;
|
||||
goto scanNumber;
|
||||
}
|
||||
case 'w':
|
||||
case 'W': {
|
||||
size = 8;
|
||||
goto scanNumber;
|
||||
}
|
||||
case 'f': {
|
||||
size = sizeof(float);
|
||||
goto scanNumber;
|
||||
@@ -1395,8 +1407,11 @@ FormatNumber(interp, type, src, cursorPtr)
|
||||
{
|
||||
long value;
|
||||
double dvalue;
|
||||
Tcl_WideInt wvalue;
|
||||
|
||||
if ((type == 'd') || (type == 'f')) {
|
||||
switch (type) {
|
||||
case 'd':
|
||||
case 'f':
|
||||
/*
|
||||
* For floating point types, we need to copy the data using
|
||||
* memcpy to avoid alignment issues.
|
||||
@@ -1425,7 +1440,38 @@ FormatNumber(interp, type, src, cursorPtr)
|
||||
memcpy((VOID *) *cursorPtr, (VOID *) &fvalue, sizeof(float));
|
||||
*cursorPtr += sizeof(float);
|
||||
}
|
||||
} else {
|
||||
return TCL_OK;
|
||||
|
||||
/*
|
||||
* Next cases separate from other integer cases because we
|
||||
* need a different API to get a wide.
|
||||
*/
|
||||
case 'w':
|
||||
case 'W':
|
||||
if (Tcl_GetWideIntFromObj(interp, src, &wvalue) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (type == 'w') {
|
||||
*(*cursorPtr)++ = (unsigned char) wvalue;
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 8);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 16);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 24);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 32);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 40);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 48);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 56);
|
||||
} else {
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 56);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 48);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 40);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 32);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 24);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 16);
|
||||
*(*cursorPtr)++ = (unsigned char) (wvalue >> 8);
|
||||
*(*cursorPtr)++ = (unsigned char) wvalue;
|
||||
}
|
||||
return TCL_OK;
|
||||
default:
|
||||
if (Tcl_GetLongFromObj(interp, src, &value) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1448,8 +1494,8 @@ FormatNumber(interp, type, src, cursorPtr)
|
||||
*(*cursorPtr)++ = (unsigned char) (value >> 8);
|
||||
*(*cursorPtr)++ = (unsigned char) value;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1476,6 +1522,7 @@ ScanNumber(buffer, type)
|
||||
int type; /* Format character from "binary scan" */
|
||||
{
|
||||
long value;
|
||||
Tcl_WideInt wvalue;
|
||||
|
||||
/*
|
||||
* We cannot rely on the compiler to properly sign extend integer values
|
||||
@@ -1536,6 +1583,26 @@ ScanNumber(buffer, type)
|
||||
}
|
||||
return Tcl_NewLongObj(value);
|
||||
}
|
||||
case 'w':
|
||||
value = (long) (buffer[4]
|
||||
| (buffer[5] << 8)
|
||||
| (buffer[6] << 16)
|
||||
| (buffer[7] << 24));
|
||||
wvalue = ((Tcl_WideInt) value) << 32 | (buffer[0]
|
||||
| (buffer[1] << 8)
|
||||
| (buffer[2] << 16)
|
||||
| (buffer[3] << 24));
|
||||
return Tcl_NewWideIntObj(wvalue);
|
||||
case 'W':
|
||||
value = (long) (buffer[3]
|
||||
| (buffer[2] << 8)
|
||||
| (buffer[1] << 16)
|
||||
| (buffer[0] << 24));
|
||||
wvalue = ((Tcl_WideInt) value) << 32 | (buffer[7]
|
||||
| (buffer[6] << 8)
|
||||
| (buffer[5] << 16)
|
||||
| (buffer[4] << 24));
|
||||
return Tcl_NewWideIntObj(wvalue);
|
||||
case 'f': {
|
||||
float fvalue;
|
||||
memcpy((VOID *) &fvalue, (VOID *) buffer, sizeof(float));
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* This code contributed by Karl Lehenbauer and Mark Diekhans
|
||||
*
|
||||
* RCS: @(#) $Id: tclCkalloc.c,v 1.12 2001/04/04 16:07:20 kennykb Exp $
|
||||
* RCS: @(#) $Id: tclCkalloc.c,v 1.12.12.1 2001/09/27 15:09:36 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -449,7 +449,7 @@ Tcl_DbCkalloc(size, file, line)
|
||||
char *
|
||||
Tcl_AttemptDbCkalloc(size, file, line)
|
||||
unsigned int size;
|
||||
char *file;
|
||||
CONST char *file;
|
||||
int line;
|
||||
{
|
||||
struct mem_header *result;
|
||||
@@ -662,7 +662,7 @@ char *
|
||||
Tcl_AttemptDbCkrealloc(ptr, size, file, line)
|
||||
char *ptr;
|
||||
unsigned int size;
|
||||
char *file;
|
||||
CONST char *file;
|
||||
int line;
|
||||
{
|
||||
char *new;
|
||||
@@ -1036,7 +1036,7 @@ Tcl_AttemptAlloc (size)
|
||||
char *
|
||||
Tcl_AttemptDbCkalloc(size, file, line)
|
||||
unsigned int size;
|
||||
char *file;
|
||||
CONST char *file;
|
||||
int line;
|
||||
{
|
||||
char *result;
|
||||
@@ -1114,7 +1114,7 @@ char *
|
||||
Tcl_AttemptDbCkrealloc(ptr, size, file, line)
|
||||
char *ptr;
|
||||
unsigned int size;
|
||||
char *file;
|
||||
CONST char *file;
|
||||
int line;
|
||||
{
|
||||
char *result;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclClock.c,v 1.11 2000/08/18 18:02:16 ericm Exp $
|
||||
* RCS: @(#) $Id: tclClock.c,v 1.11.12.3 2001/09/27 13:38:33 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
+102
-85
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCmdAH.c,v 1.16 2001/09/20 01:03:08 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclCmdAH.c,v 1.16.2.10 2001/10/18 14:19:38 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -26,10 +26,10 @@ static int CheckAccess _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, int mode));
|
||||
static int GetStatBuf _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, Tcl_FSStatProc *statProc,
|
||||
struct stat *statPtr));
|
||||
Tcl_StatBuf *statPtr));
|
||||
static char * GetTypeFromMode _ANSI_ARGS_((int mode));
|
||||
static int StoreStatData _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
char *varName, struct stat *statPtr));
|
||||
char *varName, Tcl_StatBuf *statPtr));
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -93,9 +93,8 @@ Tcl_CaseObjCmd(dummy, interp, objc, objv)
|
||||
Tcl_Obj *CONST objv[]; /* Argument objects. */
|
||||
{
|
||||
register int i;
|
||||
int body, result;
|
||||
int body, result, caseObjc;
|
||||
char *string, *arg;
|
||||
int caseObjc;
|
||||
Tcl_Obj *CONST *caseObjv;
|
||||
Tcl_Obj *armPtr;
|
||||
|
||||
@@ -724,6 +723,7 @@ Tcl_ExprObjCmd(dummy, interp, objc, objv)
|
||||
* Create a new object holding the concatenated argument strings.
|
||||
*/
|
||||
|
||||
/*** QUESTION: Do we need to copy the slow way? ***/
|
||||
bytes = Tcl_GetStringFromObj(objv[1], &length);
|
||||
objPtr = Tcl_NewStringObj(bytes, length);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
@@ -823,7 +823,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
|
||||
switch ((enum options) index) {
|
||||
case FILE_ATIME: {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
struct utimbuf tval;
|
||||
|
||||
if ((objc < 3) || (objc > 4)) {
|
||||
@@ -917,7 +917,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
case FILE_ISDIRECTORY: {
|
||||
int value;
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 3) {
|
||||
goto only3Args;
|
||||
@@ -931,7 +931,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
case FILE_ISFILE: {
|
||||
int value;
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 3) {
|
||||
goto only3Args;
|
||||
@@ -956,7 +956,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
case FILE_LSTAT: {
|
||||
char *varName;
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "name varName");
|
||||
@@ -969,7 +969,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
return StoreStatData(interp, varName, &buf);
|
||||
}
|
||||
case FILE_MTIME: {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
struct utimbuf tval;
|
||||
|
||||
if ((objc < 3) || (objc > 4)) {
|
||||
@@ -1044,7 +1044,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
case FILE_OWNED: {
|
||||
int value;
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 3) {
|
||||
goto only3Args;
|
||||
@@ -1164,7 +1164,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
return TCL_OK;
|
||||
}
|
||||
case FILE_SIZE: {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 3) {
|
||||
goto only3Args;
|
||||
@@ -1172,7 +1172,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
if (GetStatBuf(interp, objv[2], Tcl_FSStat, &buf) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetLongObj(Tcl_GetObjResult(interp), (long) buf.st_size);
|
||||
Tcl_SetWideIntObj(Tcl_GetObjResult(interp), buf.st_size);
|
||||
return TCL_OK;
|
||||
}
|
||||
case FILE_SPLIT: {
|
||||
@@ -1184,7 +1184,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
case FILE_STAT: {
|
||||
char *varName;
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "stat name varName");
|
||||
@@ -1253,7 +1253,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
|
||||
return TCL_OK;
|
||||
}
|
||||
case FILE_TYPE: {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (objc != 3) {
|
||||
goto only3Args;
|
||||
@@ -1350,7 +1350,7 @@ GetStatBuf(interp, objPtr, statProc, statPtr)
|
||||
Tcl_Obj *objPtr; /* Path name to examine. */
|
||||
Tcl_FSStatProc *statProc; /* Either stat() or lstat() depending on
|
||||
* desired behavior. */
|
||||
struct stat *statPtr; /* Filled with info about file obtained by
|
||||
Tcl_StatBuf *statPtr; /* Filled with info about file obtained by
|
||||
* calling (*statProc)(). */
|
||||
{
|
||||
int status;
|
||||
@@ -1396,66 +1396,50 @@ StoreStatData(interp, varName, statPtr)
|
||||
Tcl_Interp *interp; /* Interpreter for error reports. */
|
||||
char *varName; /* Name of associative array variable
|
||||
* in which to store stat results. */
|
||||
struct stat *statPtr; /* Pointer to buffer containing
|
||||
Tcl_StatBuf *statPtr; /* Pointer to buffer containing
|
||||
* stat data to store in varName. */
|
||||
{
|
||||
char string[TCL_INTEGER_SPACE];
|
||||
Tcl_Obj *var = Tcl_NewStringObj(varName, -1);
|
||||
Tcl_Obj *field = Tcl_NewObj();
|
||||
Tcl_Obj *value;
|
||||
register unsigned short mode;
|
||||
|
||||
TclFormatInt(string, (long) statPtr->st_dev);
|
||||
if (Tcl_SetVar2(interp, varName, "dev", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_ino);
|
||||
if (Tcl_SetVar2(interp, varName, "ino", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (unsigned short) statPtr->st_mode);
|
||||
if (Tcl_SetVar2(interp, varName, "mode", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_nlink);
|
||||
if (Tcl_SetVar2(interp, varName, "nlink", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_uid);
|
||||
if (Tcl_SetVar2(interp, varName, "uid", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_gid);
|
||||
if (Tcl_SetVar2(interp, varName, "gid", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
sprintf(string, "%lu", (unsigned long) statPtr->st_size);
|
||||
if (Tcl_SetVar2(interp, varName, "size", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_atime);
|
||||
if (Tcl_SetVar2(interp, varName, "atime", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_mtime);
|
||||
if (Tcl_SetVar2(interp, varName, "mtime", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclFormatInt(string, (long) statPtr->st_ctime);
|
||||
if (Tcl_SetVar2(interp, varName, "ctime", string, TCL_LEAVE_ERR_MSG)
|
||||
== NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_SetVar2(interp, varName, "type",
|
||||
GetTypeFromMode((unsigned short) statPtr->st_mode),
|
||||
TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
return TCL_ERROR;
|
||||
/*
|
||||
* Assume Tcl_ObjSetVar2() does not keep a copy of the field name!
|
||||
*/
|
||||
#define STORE_ARY(fieldName, object) \
|
||||
Tcl_SetStringObj(field, (fieldName), -1); \
|
||||
value = (object); \
|
||||
if (Tcl_ObjSetVar2(interp,var,field,value,TCL_LEAVE_ERR_MSG) == NULL) { \
|
||||
Tcl_DecrRefCount(var); \
|
||||
Tcl_DecrRefCount(field); \
|
||||
Tcl_DecrRefCount(value); \
|
||||
return TCL_ERROR; \
|
||||
}
|
||||
|
||||
Tcl_IncrRefCount(var);
|
||||
Tcl_IncrRefCount(field);
|
||||
STORE_ARY("dev", Tcl_NewLongObj((long)statPtr->st_dev));
|
||||
/*
|
||||
* Watch out porters; the inode is meant to be an *unsigned* value,
|
||||
* so the cast might fail when there isn't a real arithmentic 'long
|
||||
* long' type...
|
||||
*/
|
||||
STORE_ARY("ino", Tcl_NewWideIntObj((Tcl_WideInt)statPtr->st_ino));
|
||||
STORE_ARY("nlink", Tcl_NewLongObj((long)statPtr->st_nlink));
|
||||
STORE_ARY("uid", Tcl_NewLongObj((long)statPtr->st_uid));
|
||||
STORE_ARY("gid", Tcl_NewLongObj((long)statPtr->st_gid));
|
||||
STORE_ARY("size", Tcl_NewWideIntObj((Tcl_WideInt)statPtr->st_size));
|
||||
#ifdef HAVE_ST_BLOCKS
|
||||
STORE_ARY("blocks",Tcl_NewWideIntObj((Tcl_WideInt)statPtr->st_blocks));
|
||||
#endif
|
||||
STORE_ARY("atime", Tcl_NewLongObj((long)statPtr->st_atime));
|
||||
STORE_ARY("mtime", Tcl_NewLongObj((long)statPtr->st_mtime));
|
||||
STORE_ARY("ctime", Tcl_NewLongObj((long)statPtr->st_ctime));
|
||||
mode = (unsigned short) statPtr->st_mode;
|
||||
STORE_ARY("mode", Tcl_NewIntObj(mode));
|
||||
STORE_ARY("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1));
|
||||
#undef STORE_ARY
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -1634,17 +1618,17 @@ Tcl_ForeachObjCmd(dummy, interp, objc, objv)
|
||||
Tcl_Obj **argObjv = argObjStorage;
|
||||
|
||||
#define STATIC_LIST_SIZE 4
|
||||
int indexArray[STATIC_LIST_SIZE]; /* Array of value list indices */
|
||||
int varcListArray[STATIC_LIST_SIZE]; /* # loop variables per list */
|
||||
Tcl_Obj **varvListArray[STATIC_LIST_SIZE]; /* Array of var name lists */
|
||||
int argcListArray[STATIC_LIST_SIZE]; /* Array of value list sizes */
|
||||
Tcl_Obj **argvListArray[STATIC_LIST_SIZE]; /* Array of value lists */
|
||||
int indexArray[STATIC_LIST_SIZE];
|
||||
int varcListArray[STATIC_LIST_SIZE];
|
||||
Tcl_Obj **varvListArray[STATIC_LIST_SIZE];
|
||||
int argcListArray[STATIC_LIST_SIZE];
|
||||
Tcl_Obj **argvListArray[STATIC_LIST_SIZE];
|
||||
|
||||
int *index = indexArray;
|
||||
int *varcList = varcListArray;
|
||||
Tcl_Obj ***varvList = varvListArray;
|
||||
int *argcList = argcListArray;
|
||||
Tcl_Obj ***argvList = argvListArray;
|
||||
int *index = indexArray; /* Array of value list indices */
|
||||
int *varcList = varcListArray; /* # loop variables per list */
|
||||
Tcl_Obj ***varvList = varvListArray; /* Array of var name lists */
|
||||
int *argcList = argcListArray; /* Array of value list sizes */
|
||||
Tcl_Obj ***argvList = argvListArray; /* Array of value lists */
|
||||
|
||||
if (objc < 4 || (objc%2 != 0)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
@@ -1844,9 +1828,9 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
{
|
||||
char *format; /* Used to read characters from the format
|
||||
* string. */
|
||||
int formatLen; /* The length of the format string */
|
||||
int formatLen; /* The length of the format string */
|
||||
char *endPtr; /* Points to the last char in format array */
|
||||
char newFormat[40]; /* A new format specifier is generated here. */
|
||||
char newFormat[43]; /* A new format specifier is generated here. */
|
||||
int width; /* Field width from field specifier, or 0 if
|
||||
* no width given. */
|
||||
int precision; /* Field precision from field specifier, or 0
|
||||
@@ -1860,6 +1844,10 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
* it's a one-word value. */
|
||||
double doubleValue; /* Used to hold value to pass to sprintf if
|
||||
* it's a double value. */
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_WideInt wideValue; /* Used to hold value to pass to sprintf if
|
||||
* it's a 'long long' value. */
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
int whichValue; /* Indicates which of intValue, ptrValue,
|
||||
* or doubleValue has the value to pass to
|
||||
* sprintf, according to the following
|
||||
@@ -1869,6 +1857,7 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
# define PTR_VALUE 2
|
||||
# define DOUBLE_VALUE 3
|
||||
# define STRING_VALUE 4
|
||||
# define WIDE_VALUE 5
|
||||
# define MAX_FLOAT_SIZE 320
|
||||
|
||||
Tcl_Obj *resultPtr; /* Where result is stored finally. */
|
||||
@@ -1897,6 +1886,9 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
* been set for the current field. */
|
||||
int gotZero; /* Non-zero indicates that a zero flag has
|
||||
* been seen in the current field. */
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
int useWide; /* Value to be printed is Tcl_WideInt. */
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
|
||||
/*
|
||||
* This procedure is a bit nasty. The goal is to use sprintf to
|
||||
@@ -1926,6 +1918,9 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
|
||||
width = precision = noPercent = useShort = 0;
|
||||
gotZero = gotMinus = gotPrecision = 0;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
useWide = 0;
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
whichValue = PTR_VALUE;
|
||||
|
||||
/*
|
||||
@@ -2069,6 +2064,11 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
}
|
||||
if (*format == 'l') {
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
useWide = 1;
|
||||
strcpy(newPtr, TCL_LL_MODIFIER);
|
||||
newPtr += TCL_LL_MODIFIER_SIZE;
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
format++;
|
||||
} else if (*format == 'h') {
|
||||
useShort = 1;
|
||||
@@ -2090,7 +2090,18 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
case 'u':
|
||||
case 'x':
|
||||
case 'X':
|
||||
if (Tcl_GetLongFromObj(interp, /* INTL: Tcl source. */
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
if (useWide) {
|
||||
if (Tcl_GetWideIntFromObj(interp, /* INTL: Tcl source. */
|
||||
objv[objIndex], &wideValue) != TCL_OK) {
|
||||
goto fmtError;
|
||||
}
|
||||
whichValue = WIDE_VALUE;
|
||||
size = 40 + precision;
|
||||
break;
|
||||
}
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
if (Tcl_GetLongFromObj(interp, /* INTL: Tcl source. */
|
||||
objv[objIndex], &intValue) != TCL_OK) {
|
||||
goto fmtError;
|
||||
}
|
||||
@@ -2187,6 +2198,12 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv)
|
||||
sprintf(dst, newFormat, doubleValue); /* INTL: user locale. */
|
||||
break;
|
||||
}
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
case WIDE_VALUE: {
|
||||
sprintf(dst, newFormat, wideValue);
|
||||
break;
|
||||
}
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
case INT_VALUE: {
|
||||
if (useShort) {
|
||||
sprintf(dst, newFormat, (short) intValue);
|
||||
|
||||
+27
-1
@@ -14,7 +14,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCmdIL.c,v 1.33 2001/07/31 19:12:06 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclCmdIL.c,v 1.33.6.4 2001/10/23 09:46:53 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -316,10 +316,36 @@ Tcl_IncrObjCmd(dummy, interp, objc, objv)
|
||||
if (objc == 2) {
|
||||
incrAmount = 1;
|
||||
} else {
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
if (Tcl_GetLongFromObj(interp, objv[2], &incrAmount) != TCL_OK) {
|
||||
Tcl_AddErrorInfo(interp, "\n (reading increment)");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* Need to be a bit cautious to ensure that [expr]-like rules
|
||||
* are enforced for interpretation of wide integers, despite
|
||||
* the fact that the underlying API itself is a 'long' only one.
|
||||
*/
|
||||
if (objv[2]->typePtr == &tclIntType) {
|
||||
incrAmount = objv[2]->internalRep.longValue;
|
||||
} else if (objv[2]->typePtr == &tclWideIntType) {
|
||||
incrAmount = Tcl_WideAsLong(objv[2]->internalRep.wideValue);
|
||||
} else {
|
||||
Tcl_WideInt wide;
|
||||
|
||||
if (Tcl_GetWideIntFromObj(interp, objv[2], &wide) != TCL_OK) {
|
||||
Tcl_AddErrorInfo(interp, "\n (reading increment)");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
incrAmount = Tcl_WideAsLong(wide);
|
||||
if ((wide <= Tcl_LongAsWide(LONG_MAX))
|
||||
&& (wide >= Tcl_LongAsWide(LONG_MIN))) {
|
||||
objv[2]->typePtr = &tclIntType;
|
||||
objv[2]->internalRep.longValue = incrAmount;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+10
-2
@@ -13,7 +13,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCmdMZ.c,v 1.45 2001/09/13 23:49:57 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclCmdMZ.c,v 1.45.2.4 2001/10/12 12:57:43 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -1496,7 +1496,11 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
|
||||
*/
|
||||
if (TclLooksLikeInt(string1, length1)) {
|
||||
errno = 0;
|
||||
strtoul(string1, &stop, 0);
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
strtoul(string1, &stop, 0); /* INTL: Tcl source. */
|
||||
#else
|
||||
strtoull(string1, &stop, 0); /* INTL: Tcl source. */
|
||||
#endif
|
||||
if (stop == end) {
|
||||
if (errno == ERANGE) {
|
||||
result = 0;
|
||||
@@ -1550,7 +1554,11 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
|
||||
*/
|
||||
result = 0;
|
||||
errno = 0;
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
strtoul(string1, &stop, 0); /* INTL: Tcl source. */
|
||||
#else
|
||||
strtoull(string1, &stop, 0); /* INTL: Tcl source. */
|
||||
#endif
|
||||
if (errno == ERANGE) {
|
||||
/*
|
||||
* if (errno == ERANGE), then it was an over/underflow
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCompCmds.c,v 1.14 2001/09/19 18:17:54 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclCompCmds.c,v 1.14.2.2 2001/09/27 13:46:00 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCompExpr.c,v 1.6 2000/05/26 08:53:40 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclCompExpr.c,v 1.6.12.2 2001/09/27 13:46:00 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCompile.c,v 1.25 2001/09/19 18:18:16 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclCompile.c,v 1.25.2.3 2001/09/27 13:46:00 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclCompile.h,v 1.16 2001/09/17 11:51:58 msofer Exp $
|
||||
* RCS: @(#) $Id: tclCompile.h,v 1.16.2.2 2001/10/08 14:31:37 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLCOMPILATION
|
||||
@@ -511,6 +511,7 @@ typedef struct ByteCode {
|
||||
#define INST_LIST_INDEX 80
|
||||
#define INST_LIST_LENGTH 81
|
||||
|
||||
/* Opcodes 82 to 87 */
|
||||
#define INST_APPEND_SCALAR1 82
|
||||
#define INST_APPEND_SCALAR4 83
|
||||
#define INST_APPEND_ARRAY1 84
|
||||
@@ -518,6 +519,7 @@ typedef struct ByteCode {
|
||||
#define INST_APPEND_ARRAY_STK 86
|
||||
#define INST_APPEND_STK 87
|
||||
|
||||
/* Opcodes 88 to 93 */
|
||||
#define INST_LAPPEND_SCALAR1 88
|
||||
#define INST_LAPPEND_SCALAR4 89
|
||||
#define INST_LAPPEND_ARRAY1 90
|
||||
@@ -590,8 +592,9 @@ extern InstructionDesc instructionTable[];
|
||||
#define BUILTIN_FUNC_RAND 22
|
||||
#define BUILTIN_FUNC_ROUND 23
|
||||
#define BUILTIN_FUNC_SRAND 24
|
||||
#define BUILTIN_FUNC_WIDE 25
|
||||
|
||||
#define LAST_BUILTIN_FUNC 24
|
||||
#define LAST_BUILTIN_FUNC 25
|
||||
|
||||
/*
|
||||
* Table describing the built-in math functions. Entries in this table are
|
||||
|
||||
+80
-24
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclDecls.h,v 1.58 2001/09/13 11:56:19 msofer Exp $
|
||||
* RCS: @(#) $Id: tclDecls.h,v 1.58.2.5 2001/11/23 22:56:24 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLDECLS
|
||||
@@ -174,7 +174,7 @@ EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
Tcl_Obj ** objPtrPtr));
|
||||
/* 47 */
|
||||
EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
Tcl_Obj * listPtr, int * intPtr));
|
||||
Tcl_Obj * listPtr, int * lengthPtr));
|
||||
/* 48 */
|
||||
EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
Tcl_Obj * listPtr, int first, int count,
|
||||
@@ -711,8 +711,8 @@ EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char * str,
|
||||
EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char * str,
|
||||
int length, int * flagPtr));
|
||||
/* 220 */
|
||||
EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, int offset,
|
||||
int mode));
|
||||
EXTERN int Tcl_SeekOld _ANSI_ARGS_((Tcl_Channel chan,
|
||||
int offset, int mode));
|
||||
/* 221 */
|
||||
EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void));
|
||||
/* 222 */
|
||||
@@ -787,7 +787,7 @@ EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
EXTERN int Tcl_StringMatch _ANSI_ARGS_((CONST char * str,
|
||||
CONST char * pattern));
|
||||
/* 246 */
|
||||
EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan));
|
||||
EXTERN int Tcl_TellOld _ANSI_ARGS_((Tcl_Channel chan));
|
||||
/* 247 */
|
||||
EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
char * varName, int flags,
|
||||
@@ -1343,13 +1343,14 @@ EXTERN void Tcl_UntraceCommand _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
EXTERN char * Tcl_AttemptAlloc _ANSI_ARGS_((unsigned int size));
|
||||
/* 429 */
|
||||
EXTERN char * Tcl_AttemptDbCkalloc _ANSI_ARGS_((unsigned int size,
|
||||
char * file, int line));
|
||||
CONST char * file, int line));
|
||||
/* 430 */
|
||||
EXTERN char * Tcl_AttemptRealloc _ANSI_ARGS_((char * ptr,
|
||||
unsigned int size));
|
||||
/* 431 */
|
||||
EXTERN char * Tcl_AttemptDbCkrealloc _ANSI_ARGS_((char * ptr,
|
||||
unsigned int size, char * file, int line));
|
||||
unsigned int size, CONST char * file,
|
||||
int line));
|
||||
/* 432 */
|
||||
EXTERN int Tcl_AttemptSetObjLength _ANSI_ARGS_((
|
||||
Tcl_Obj * objPtr, int length));
|
||||
@@ -1401,7 +1402,7 @@ EXTERN int Tcl_FSMatchInDirectory _ANSI_ARGS_((
|
||||
Tcl_Obj * pathPtr, char * pattern,
|
||||
Tcl_GlobTypeData * types));
|
||||
/* 446 */
|
||||
EXTERN Tcl_Obj* Tcl_FSLink _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
EXTERN Tcl_Obj * Tcl_FSLink _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
Tcl_Obj * toPtr));
|
||||
/* 447 */
|
||||
EXTERN int Tcl_FSRemoveDirectory _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
@@ -1411,7 +1412,7 @@ EXTERN int Tcl_FSRenameFile _ANSI_ARGS_((Tcl_Obj * srcPathPtr,
|
||||
Tcl_Obj * destPathPtr));
|
||||
/* 449 */
|
||||
EXTERN int Tcl_FSLstat _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
struct stat * buf));
|
||||
Tcl_StatBuf * buf));
|
||||
/* 450 */
|
||||
EXTERN int Tcl_FSUtime _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
struct utimbuf * tval));
|
||||
@@ -1428,7 +1429,7 @@ EXTERN char** Tcl_FSFileAttrStrings _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
Tcl_Obj ** objPtrRef));
|
||||
/* 454 */
|
||||
EXTERN int Tcl_FSStat _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
struct stat * buf));
|
||||
Tcl_StatBuf * buf));
|
||||
/* 455 */
|
||||
EXTERN int Tcl_FSAccess _ANSI_ARGS_((Tcl_Obj * pathPtr,
|
||||
int mode));
|
||||
@@ -1504,6 +1505,26 @@ EXTERN void Tcl_FSMountsChanged _ANSI_ARGS_((
|
||||
EXTERN int Tcl_EvalTokensStandard _ANSI_ARGS_((
|
||||
Tcl_Interp * interp, Tcl_Token * tokenPtr,
|
||||
int count));
|
||||
/* 482 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewWideIntObj _ANSI_ARGS_((
|
||||
Tcl_WideInt wideValue, CONST char * file,
|
||||
int line));
|
||||
/* 483 */
|
||||
EXTERN int Tcl_GetWideIntFromObj _ANSI_ARGS_((
|
||||
Tcl_Interp * interp, Tcl_Obj * objPtr,
|
||||
Tcl_WideInt * widePtr));
|
||||
/* 484 */
|
||||
EXTERN Tcl_Obj * Tcl_NewWideIntObj _ANSI_ARGS_((Tcl_WideInt wideValue));
|
||||
/* 485 */
|
||||
EXTERN void Tcl_SetWideIntObj _ANSI_ARGS_((Tcl_Obj * objPtr,
|
||||
Tcl_WideInt wideValue));
|
||||
/* 486 */
|
||||
EXTERN Tcl_StatBuf * Tcl_AllocStatBuf _ANSI_ARGS_((void));
|
||||
/* 487 */
|
||||
EXTERN Tcl_WideInt Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan,
|
||||
Tcl_WideInt offset, int mode));
|
||||
/* 488 */
|
||||
EXTERN Tcl_WideInt Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan));
|
||||
|
||||
typedef struct TclStubHooks {
|
||||
struct TclPlatStubs *tclPlatStubs;
|
||||
@@ -1578,7 +1599,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_ListObjAppendElement) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, Tcl_Obj * objPtr)); /* 44 */
|
||||
int (*tcl_ListObjGetElements) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * objcPtr, Tcl_Obj *** objvPtr)); /* 45 */
|
||||
int (*tcl_ListObjIndex) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj ** objPtrPtr)); /* 46 */
|
||||
int (*tcl_ListObjLength) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * intPtr)); /* 47 */
|
||||
int (*tcl_ListObjLength) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int * lengthPtr)); /* 47 */
|
||||
int (*tcl_ListObjReplace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 48 */
|
||||
Tcl_Obj * (*tcl_NewBooleanObj) _ANSI_ARGS_((int boolValue)); /* 49 */
|
||||
Tcl_Obj * (*tcl_NewByteArrayObj) _ANSI_ARGS_((CONST unsigned char* bytes, int length)); /* 50 */
|
||||
@@ -1783,7 +1804,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_ResetResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 217 */
|
||||
int (*tcl_ScanElement) _ANSI_ARGS_((CONST char * str, int * flagPtr)); /* 218 */
|
||||
int (*tcl_ScanCountedElement) _ANSI_ARGS_((CONST char * str, int length, int * flagPtr)); /* 219 */
|
||||
int (*tcl_Seek) _ANSI_ARGS_((Tcl_Channel chan, int offset, int mode)); /* 220 */
|
||||
int (*tcl_SeekOld) _ANSI_ARGS_((Tcl_Channel chan, int offset, int mode)); /* 220 */
|
||||
int (*tcl_ServiceAll) _ANSI_ARGS_((void)); /* 221 */
|
||||
int (*tcl_ServiceEvent) _ANSI_ARGS_((int flags)); /* 222 */
|
||||
void (*tcl_SetAssocData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_InterpDeleteProc * proc, ClientData clientData)); /* 223 */
|
||||
@@ -1809,7 +1830,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_SplitPath) _ANSI_ARGS_((CONST char * path, int * argcPtr, char *** argvPtr)); /* 243 */
|
||||
void (*tcl_StaticPackage) _ANSI_ARGS_((Tcl_Interp * interp, char * pkgName, Tcl_PackageInitProc * initProc, Tcl_PackageInitProc * safeInitProc)); /* 244 */
|
||||
int (*tcl_StringMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern)); /* 245 */
|
||||
int (*tcl_Tell) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */
|
||||
int (*tcl_TellOld) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */
|
||||
int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */
|
||||
int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */
|
||||
char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_DString * bufferPtr)); /* 249 */
|
||||
@@ -1992,9 +2013,9 @@ typedef struct TclStubs {
|
||||
int (*tcl_TraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 426 */
|
||||
void (*tcl_UntraceCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_CommandTraceProc * proc, ClientData clientData)); /* 427 */
|
||||
char * (*tcl_AttemptAlloc) _ANSI_ARGS_((unsigned int size)); /* 428 */
|
||||
char * (*tcl_AttemptDbCkalloc) _ANSI_ARGS_((unsigned int size, char * file, int line)); /* 429 */
|
||||
char * (*tcl_AttemptDbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char * file, int line)); /* 429 */
|
||||
char * (*tcl_AttemptRealloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 430 */
|
||||
char * (*tcl_AttemptDbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, char * file, int line)); /* 431 */
|
||||
char * (*tcl_AttemptDbCkrealloc) _ANSI_ARGS_((char * ptr, unsigned int size, CONST char * file, int line)); /* 431 */
|
||||
int (*tcl_AttemptSetObjLength) _ANSI_ARGS_((Tcl_Obj * objPtr, int length)); /* 432 */
|
||||
Tcl_ThreadId (*tcl_GetChannelThread) _ANSI_ARGS_((Tcl_Channel channel)); /* 433 */
|
||||
Tcl_UniChar * (*tcl_GetUnicodeFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int * lengthPtr)); /* 434 */
|
||||
@@ -2009,15 +2030,15 @@ typedef struct TclStubs {
|
||||
int (*tcl_FSDeleteFile) _ANSI_ARGS_((Tcl_Obj * pathPtr)); /* 443 */
|
||||
int (*tcl_FSLoadFile) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr, char * sym1, char * sym2, Tcl_PackageInitProc ** proc1Ptr, Tcl_PackageInitProc ** proc2Ptr, ClientData * clientDataPtr, Tcl_FSUnloadFileProc ** unloadProcPtr)); /* 444 */
|
||||
int (*tcl_FSMatchInDirectory) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * result, Tcl_Obj * pathPtr, char * pattern, Tcl_GlobTypeData * types)); /* 445 */
|
||||
Tcl_Obj* (*tcl_FSLink) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_Obj * toPtr)); /* 446 */
|
||||
Tcl_Obj * (*tcl_FSLink) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_Obj * toPtr)); /* 446 */
|
||||
int (*tcl_FSRemoveDirectory) _ANSI_ARGS_((Tcl_Obj * pathPtr, int recursive, Tcl_Obj ** errorPtr)); /* 447 */
|
||||
int (*tcl_FSRenameFile) _ANSI_ARGS_((Tcl_Obj * srcPathPtr, Tcl_Obj * destPathPtr)); /* 448 */
|
||||
int (*tcl_FSLstat) _ANSI_ARGS_((Tcl_Obj * pathPtr, struct stat * buf)); /* 449 */
|
||||
int (*tcl_FSLstat) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_StatBuf * buf)); /* 449 */
|
||||
int (*tcl_FSUtime) _ANSI_ARGS_((Tcl_Obj * pathPtr, struct utimbuf * tval)); /* 450 */
|
||||
int (*tcl_FSFileAttrsGet) _ANSI_ARGS_((Tcl_Interp * interp, int index, Tcl_Obj * pathPtr, Tcl_Obj ** objPtrRef)); /* 451 */
|
||||
int (*tcl_FSFileAttrsSet) _ANSI_ARGS_((Tcl_Interp * interp, int index, Tcl_Obj * pathPtr, Tcl_Obj * objPtr)); /* 452 */
|
||||
char** (*tcl_FSFileAttrStrings) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_Obj ** objPtrRef)); /* 453 */
|
||||
int (*tcl_FSStat) _ANSI_ARGS_((Tcl_Obj * pathPtr, struct stat * buf)); /* 454 */
|
||||
int (*tcl_FSStat) _ANSI_ARGS_((Tcl_Obj * pathPtr, Tcl_StatBuf * buf)); /* 454 */
|
||||
int (*tcl_FSAccess) _ANSI_ARGS_((Tcl_Obj * pathPtr, int mode)); /* 455 */
|
||||
Tcl_Channel (*tcl_FSOpenFileChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * pathPtr, char * modeString, int permissions)); /* 456 */
|
||||
Tcl_Obj* (*tcl_FSGetCwd) _ANSI_ARGS_((Tcl_Interp * interp)); /* 457 */
|
||||
@@ -2045,6 +2066,13 @@ typedef struct TclStubs {
|
||||
int (*tcl_OutputBuffered) _ANSI_ARGS_((Tcl_Channel chan)); /* 479 */
|
||||
void (*tcl_FSMountsChanged) _ANSI_ARGS_((Tcl_Filesystem * fsPtr)); /* 480 */
|
||||
int (*tcl_EvalTokensStandard) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 481 */
|
||||
Tcl_Obj * (*tcl_DbNewWideIntObj) _ANSI_ARGS_((Tcl_WideInt wideValue, CONST char * file, int line)); /* 482 */
|
||||
int (*tcl_GetWideIntFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_WideInt * widePtr)); /* 483 */
|
||||
Tcl_Obj * (*tcl_NewWideIntObj) _ANSI_ARGS_((Tcl_WideInt wideValue)); /* 484 */
|
||||
void (*tcl_SetWideIntObj) _ANSI_ARGS_((Tcl_Obj * objPtr, Tcl_WideInt wideValue)); /* 485 */
|
||||
Tcl_StatBuf * (*tcl_AllocStatBuf) _ANSI_ARGS_((void)); /* 486 */
|
||||
Tcl_WideInt (*tcl_Seek) _ANSI_ARGS_((Tcl_Channel chan, Tcl_WideInt offset, int mode)); /* 487 */
|
||||
Tcl_WideInt (*tcl_Tell) _ANSI_ARGS_((Tcl_Channel chan)); /* 488 */
|
||||
} TclStubs;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -2968,9 +2996,9 @@ extern TclStubs *tclStubsPtr;
|
||||
#define Tcl_ScanCountedElement \
|
||||
(tclStubsPtr->tcl_ScanCountedElement) /* 219 */
|
||||
#endif
|
||||
#ifndef Tcl_Seek
|
||||
#define Tcl_Seek \
|
||||
(tclStubsPtr->tcl_Seek) /* 220 */
|
||||
#ifndef Tcl_SeekOld
|
||||
#define Tcl_SeekOld \
|
||||
(tclStubsPtr->tcl_SeekOld) /* 220 */
|
||||
#endif
|
||||
#ifndef Tcl_ServiceAll
|
||||
#define Tcl_ServiceAll \
|
||||
@@ -3072,9 +3100,9 @@ extern TclStubs *tclStubsPtr;
|
||||
#define Tcl_StringMatch \
|
||||
(tclStubsPtr->tcl_StringMatch) /* 245 */
|
||||
#endif
|
||||
#ifndef Tcl_Tell
|
||||
#define Tcl_Tell \
|
||||
(tclStubsPtr->tcl_Tell) /* 246 */
|
||||
#ifndef Tcl_TellOld
|
||||
#define Tcl_TellOld \
|
||||
(tclStubsPtr->tcl_TellOld) /* 246 */
|
||||
#endif
|
||||
#ifndef Tcl_TraceVar
|
||||
#define Tcl_TraceVar \
|
||||
@@ -4013,6 +4041,34 @@ extern TclStubs *tclStubsPtr;
|
||||
#define Tcl_EvalTokensStandard \
|
||||
(tclStubsPtr->tcl_EvalTokensStandard) /* 481 */
|
||||
#endif
|
||||
#ifndef Tcl_DbNewWideIntObj
|
||||
#define Tcl_DbNewWideIntObj \
|
||||
(tclStubsPtr->tcl_DbNewWideIntObj) /* 482 */
|
||||
#endif
|
||||
#ifndef Tcl_GetWideIntFromObj
|
||||
#define Tcl_GetWideIntFromObj \
|
||||
(tclStubsPtr->tcl_GetWideIntFromObj) /* 483 */
|
||||
#endif
|
||||
#ifndef Tcl_NewWideIntObj
|
||||
#define Tcl_NewWideIntObj \
|
||||
(tclStubsPtr->tcl_NewWideIntObj) /* 484 */
|
||||
#endif
|
||||
#ifndef Tcl_SetWideIntObj
|
||||
#define Tcl_SetWideIntObj \
|
||||
(tclStubsPtr->tcl_SetWideIntObj) /* 485 */
|
||||
#endif
|
||||
#ifndef Tcl_AllocStatBuf
|
||||
#define Tcl_AllocStatBuf \
|
||||
(tclStubsPtr->tcl_AllocStatBuf) /* 486 */
|
||||
#endif
|
||||
#ifndef Tcl_Seek
|
||||
#define Tcl_Seek \
|
||||
(tclStubsPtr->tcl_Seek) /* 487 */
|
||||
#endif
|
||||
#ifndef Tcl_Tell
|
||||
#define Tcl_Tell \
|
||||
(tclStubsPtr->tcl_Tell) /* 488 */
|
||||
#endif
|
||||
|
||||
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclEncoding.c,v 1.7 2001/07/31 19:12:06 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclEncoding.c,v 1.7.6.4 2001/09/27 13:49:07 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclEvent.c,v 1.13 2001/09/11 01:31:24 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclEvent.c,v 1.13.4.3 2001/09/27 13:49:07 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+818
-241
File diff suppressed because it is too large
Load Diff
+8
-8
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclFCmd.c,v 1.13 2001/09/08 14:05:09 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclFCmd.c,v 1.13.6.5 2001/11/23 22:56:24 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -111,7 +111,7 @@ FileCopyRename(interp, objc, objv, copyFlag)
|
||||
* rename them. */
|
||||
{
|
||||
int i, result, force;
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
Tcl_Obj *target;
|
||||
|
||||
i = FileForceOption(interp, objc - 2, objv + 2, &force);
|
||||
@@ -229,7 +229,7 @@ TclFileMakeDirsCmd(interp, objc, objv)
|
||||
int result, i, j, pobjc;
|
||||
Tcl_Obj *split = NULL;
|
||||
Tcl_Obj *target = NULL;
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
|
||||
errfile = NULL;
|
||||
|
||||
@@ -250,9 +250,9 @@ TclFileMakeDirsCmd(interp, objc, objv)
|
||||
target = Tcl_FSJoinPath(split, j + 1);
|
||||
Tcl_IncrRefCount(target);
|
||||
/*
|
||||
* Call Tcl_Stat() so that if target is a symlink that points
|
||||
* to a directory we will create subdirectories in that
|
||||
* directory.
|
||||
* Call Tcl_FSStat() so that if target is a symlink that
|
||||
* points to a directory we will create subdirectories in
|
||||
* that directory.
|
||||
*/
|
||||
|
||||
if (Tcl_FSStat(target, &statBuf) == 0) {
|
||||
@@ -333,7 +333,7 @@ TclFileDeleteCmd(interp, objc, objv)
|
||||
result = TCL_OK;
|
||||
|
||||
for ( ; i < objc; i++) {
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
|
||||
errfile = objv[i];
|
||||
if (Tcl_FSConvertToPathType(interp, objv[i]) != TCL_OK) {
|
||||
@@ -448,7 +448,7 @@ CopyRenameOneFile(interp, source, target, copyFlag, force)
|
||||
{
|
||||
int result;
|
||||
Tcl_Obj *errfile, *errorBuffer;
|
||||
struct stat sourceStatBuf, targetStatBuf;
|
||||
Tcl_StatBuf sourceStatBuf, targetStatBuf;
|
||||
|
||||
if (Tcl_FSConvertToPathType(interp, source) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
|
||||
+26
-2
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclFileName.c,v 1.20 2001/09/04 18:06:34 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclFileName.c,v 1.20.6.4 2001/09/27 14:14:06 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -2485,7 +2485,7 @@ TclDoGlob(interp, separators, headPtr, tail, types)
|
||||
*/
|
||||
|
||||
Tcl_Obj *nameObj;
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
/* Used to deal with one special case pertinent to MacOS */
|
||||
int macSpecialCase = 0;
|
||||
|
||||
@@ -2615,3 +2615,27 @@ TclFileDirname(interp, pathPtr)
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
return splitResultPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_AllocStatBuf
|
||||
*
|
||||
* This procedure allocates a Tcl_StatBuf on the heap. It exists
|
||||
* so that extensions may be used unchanged on systems where
|
||||
* largefile support is optional.
|
||||
*
|
||||
* Results:
|
||||
* A pointer to a Tcl_StatBuf which may be deallocated by being
|
||||
* passed to ckfree().
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_StatBuf *
|
||||
Tcl_AllocStatBuf() {
|
||||
return (Tcl_StatBuf *) ckalloc(sizeof(Tcl_StatBuf));
|
||||
}
|
||||
|
||||
+69
-34
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclIO.c,v 1.35 2001/09/06 09:35:39 dkf Exp $
|
||||
* RCS: @(#) $Id: tclIO.c,v 1.35.6.5 2001/11/05 14:23:16 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -92,8 +92,7 @@ static int CopyAndTranslateBuffer _ANSI_ARGS_((
|
||||
ChannelState *statePtr, char *result,
|
||||
int space));
|
||||
static int CopyBuffer _ANSI_ARGS_((
|
||||
Channel *chanPtr, char *result,
|
||||
int space));
|
||||
Channel *chanPtr, char *result, int space));
|
||||
static int CopyData _ANSI_ARGS_((CopyState *csPtr, int mask));
|
||||
static void CopyEventProc _ANSI_ARGS_((ClientData clientData,
|
||||
int mask));
|
||||
@@ -130,8 +129,8 @@ static int ReadBytes _ANSI_ARGS_((ChannelState *statePtr,
|
||||
Tcl_Obj *objPtr, int charsLeft,
|
||||
int *offsetPtr));
|
||||
static int ReadChars _ANSI_ARGS_((ChannelState *statePtr,
|
||||
Tcl_Obj *objPtr, int charsLeft, int *offsetPtr,
|
||||
int *factorPtr));
|
||||
Tcl_Obj *objPtr, int charsLeft,
|
||||
int *offsetPtr, int *factorPtr));
|
||||
static void RecycleBuffer _ANSI_ARGS_((ChannelState *statePtr,
|
||||
ChannelBuffer *bufPtr, int mustDiscard));
|
||||
static int StackSetBlockMode _ANSI_ARGS_((Channel *chanPtr,
|
||||
@@ -140,11 +139,11 @@ static int SetBlockMode _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Channel *chanPtr, int mode));
|
||||
static void StopCopy _ANSI_ARGS_((CopyState *csPtr));
|
||||
static int TranslateInputEOL _ANSI_ARGS_((ChannelState *statePtr,
|
||||
char *dst, CONST char *src, int *dstLenPtr,
|
||||
int *srcLenPtr));
|
||||
char *dst, CONST char *src,
|
||||
int *dstLenPtr, int *srcLenPtr));
|
||||
static int TranslateOutputEOL _ANSI_ARGS_((ChannelState *statePtr,
|
||||
char *dst, CONST char *src, int *dstLenPtr,
|
||||
int *srcLenPtr));
|
||||
char *dst, CONST char *src,
|
||||
int *dstLenPtr, int *srcLenPtr));
|
||||
static void UpdateInterest _ANSI_ARGS_((Channel *chanPtr));
|
||||
static int WriteBytes _ANSI_ARGS_((Channel *chanPtr,
|
||||
CONST char *src, int srcLen));
|
||||
@@ -2946,7 +2945,7 @@ WriteBytes(chanPtr, src, srcLen)
|
||||
ChannelState *statePtr = chanPtr->state; /* state info for channel */
|
||||
ChannelBuffer *bufPtr;
|
||||
char *dst;
|
||||
int dstLen, dstMax, sawLF, savedLF, total, toWrite;
|
||||
int dstMax, sawLF, savedLF, total, dstLen, toWrite;
|
||||
|
||||
total = 0;
|
||||
sawLF = 0;
|
||||
@@ -3034,8 +3033,8 @@ WriteChars(chanPtr, src, srcLen)
|
||||
ChannelState *statePtr = chanPtr->state; /* state info for channel */
|
||||
ChannelBuffer *bufPtr;
|
||||
char *dst, *stage;
|
||||
int saved, savedLF, sawLF, total, toWrite, flags;
|
||||
int dstWrote, dstLen, stageLen, stageMax, stageRead;
|
||||
int saved, savedLF, sawLF, total, flags, dstLen, stageMax, dstWrote;
|
||||
int stageLen, toWrite, stageRead;
|
||||
Tcl_Encoding encoding;
|
||||
char safe[BUFFER_PADDING];
|
||||
|
||||
@@ -3418,11 +3417,10 @@ Tcl_GetsObj(chan, objPtr)
|
||||
Channel *chanPtr = (Channel *) chan;
|
||||
ChannelState *statePtr = chanPtr->state; /* state info for channel */
|
||||
ChannelBuffer *bufPtr;
|
||||
int inEofChar, skip, copiedTotal;
|
||||
int inEofChar, skip, copiedTotal, oldLength, oldFlags, oldRemoved;
|
||||
Tcl_Encoding encoding;
|
||||
char *dst, *dstEnd, *eol, *eof;
|
||||
Tcl_EncodingState oldState;
|
||||
int oldLength, oldFlags, oldRemoved;
|
||||
|
||||
/*
|
||||
* This operation should occur at the top of a channel stack.
|
||||
@@ -3660,8 +3658,9 @@ Tcl_GetsObj(chan, objPtr)
|
||||
statePtr->inputEncodingState = gs.state;
|
||||
Tcl_ExternalToUtf(NULL, gs.encoding, bufPtr->buf + bufPtr->nextRemoved,
|
||||
gs.rawRead, statePtr->inputEncodingFlags,
|
||||
&statePtr->inputEncodingState, dst, eol - dst + skip + TCL_UTF_MAX,
|
||||
&gs.rawRead, NULL, &gs.charsWrote);
|
||||
&statePtr->inputEncodingState, dst,
|
||||
eol - dst + skip + TCL_UTF_MAX, &gs.rawRead, NULL,
|
||||
&gs.charsWrote);
|
||||
bufPtr->nextRemoved += gs.rawRead;
|
||||
|
||||
/*
|
||||
@@ -4105,7 +4104,7 @@ Tcl_Read(chan, dst, bytesToRead)
|
||||
int
|
||||
Tcl_ReadRaw(chan, bufPtr, bytesToRead)
|
||||
Tcl_Channel chan; /* The channel from which to read. */
|
||||
char *bufPtr; /* Where to store input read. */
|
||||
char *bufPtr; /* Where to store input read. */
|
||||
int bytesToRead; /* Maximum number of bytes to read. */
|
||||
{
|
||||
Channel *chanPtr = (Channel *) chan;
|
||||
@@ -4432,7 +4431,7 @@ ReadBytes(statePtr, objPtr, bytesToRead, offsetPtr)
|
||||
* output, filled with how many bytes are now
|
||||
* being used. */
|
||||
{
|
||||
int toRead, srcLen, srcRead, dstWrote, offset, length;
|
||||
int toRead, srcLen, offset, length, srcRead, dstWrote;
|
||||
ChannelBuffer *bufPtr;
|
||||
char *src, *dst;
|
||||
|
||||
@@ -4540,8 +4539,8 @@ ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
|
||||
* UTF-8. On output, contains another guess
|
||||
* based on the data seen so far. */
|
||||
{
|
||||
int toRead, factor, offset, spaceLeft, length;
|
||||
int srcLen, srcRead, dstNeeded, dstRead, dstWrote, numChars;
|
||||
int toRead, factor, offset, spaceLeft, length, srcLen, dstNeeded;
|
||||
int srcRead, dstWrote, numChars, dstRead;
|
||||
ChannelBuffer *bufPtr;
|
||||
char *src, *dst;
|
||||
Tcl_EncodingState oldState;
|
||||
@@ -4554,7 +4553,7 @@ ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
|
||||
srcLen = bufPtr->nextAdded - bufPtr->nextRemoved;
|
||||
|
||||
toRead = charsToRead;
|
||||
if ((unsigned) toRead > (unsigned) srcLen) {
|
||||
if ((unsigned)toRead > (unsigned)srcLen) {
|
||||
toRead = srcLen;
|
||||
}
|
||||
|
||||
@@ -5243,17 +5242,17 @@ GetInput(chanPtr)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_WideInt
|
||||
Tcl_Seek(chan, offset, mode)
|
||||
Tcl_Channel chan; /* The channel on which to seek. */
|
||||
int offset; /* Offset to seek to. */
|
||||
Tcl_WideInt offset; /* Offset to seek to. */
|
||||
int mode; /* Relative to which location to seek? */
|
||||
{
|
||||
Channel *chanPtr = (Channel *) chan; /* The real IO channel. */
|
||||
ChannelState *statePtr = chanPtr->state; /* state info for channel */
|
||||
int inputBuffered, outputBuffered;
|
||||
int result; /* Of device driver operations. */
|
||||
int curPos; /* Position on the device. */
|
||||
Tcl_WideInt curPos; /* Position on the device. */
|
||||
int wasAsync; /* Was the channel nonblocking before the
|
||||
* seek operation? If so, must restore to
|
||||
* nonblocking mode after the seek. */
|
||||
@@ -5362,7 +5361,7 @@ Tcl_Seek(chan, offset, mode)
|
||||
*/
|
||||
|
||||
curPos = (chanPtr->typePtr->seekProc) (chanPtr->instanceData,
|
||||
(long) offset, mode, &result);
|
||||
offset, mode, &result);
|
||||
if (curPos == -1) {
|
||||
Tcl_SetErrno(result);
|
||||
}
|
||||
@@ -5405,7 +5404,7 @@ Tcl_Seek(chan, offset, mode)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_WideInt
|
||||
Tcl_Tell(chan)
|
||||
Tcl_Channel chan; /* The channel to return pos for. */
|
||||
{
|
||||
@@ -5413,7 +5412,7 @@ Tcl_Tell(chan)
|
||||
ChannelState *statePtr = chanPtr->state; /* state info for channel */
|
||||
int inputBuffered, outputBuffered;
|
||||
int result; /* Of calling device driver. */
|
||||
int curPos; /* Position on device. */
|
||||
Tcl_WideInt curPos; /* Position on device. */
|
||||
|
||||
if (CheckChannelErrors(statePtr, TCL_WRITABLE | TCL_READABLE) != 0) {
|
||||
return -1;
|
||||
@@ -5465,7 +5464,7 @@ Tcl_Tell(chan)
|
||||
*/
|
||||
|
||||
curPos = (chanPtr->typePtr->seekProc) (chanPtr->instanceData,
|
||||
(long) 0, SEEK_CUR, &result);
|
||||
Tcl_LongAsWide(0), SEEK_CUR, &result);
|
||||
if (curPos == -1) {
|
||||
Tcl_SetErrno(result);
|
||||
return -1;
|
||||
@@ -5476,6 +5475,46 @@ Tcl_Tell(chan)
|
||||
return (curPos + outputBuffered);
|
||||
}
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SeekOld, Tcl_TellOld --
|
||||
*
|
||||
* Backward-compatability versions of the seek/tell interface that
|
||||
* do not support 64-bit offsets.
|
||||
*
|
||||
* Results:
|
||||
* As for Tcl_Seek and Tcl_Tell respectively.
|
||||
*
|
||||
* Side effects:
|
||||
* As for Tcl_Seek and Tcl_Tell respectively.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_SeekOld(chan, offset, mode)
|
||||
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);
|
||||
}
|
||||
|
||||
int
|
||||
Tcl_TellOld(chan)
|
||||
Tcl_Channel chan; /* The channel to return pos for. */
|
||||
{
|
||||
Tcl_WideInt wResult;
|
||||
|
||||
wResult = Tcl_Tell(chan);
|
||||
return (int)Tcl_WideAsLong(wResult);
|
||||
}
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
@@ -7306,14 +7345,10 @@ CopyData(csPtr, mask)
|
||||
int mask; /* Current channel event flags. */
|
||||
{
|
||||
Tcl_Interp *interp;
|
||||
Tcl_Obj *cmdPtr, *errObj = NULL;
|
||||
Tcl_Obj *cmdPtr, *errObj = NULL, *bufObj = NULL;
|
||||
Tcl_Channel inChan, outChan;
|
||||
ChannelState *inStatePtr, *outStatePtr;
|
||||
int result = TCL_OK;
|
||||
int size;
|
||||
int total;
|
||||
int sizeb;
|
||||
Tcl_Obj* bufObj = NULL;
|
||||
int result = TCL_OK, size, total, sizeb;
|
||||
char* buffer;
|
||||
|
||||
int inBinary, outBinary, sameEncoding; /* Encoding control */
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclIO.h,v 1.3 2001/03/30 23:06:40 andreas_kupries Exp $
|
||||
* RCS: @(#) $Id: tclIO.h,v 1.3.12.2 2001/09/27 14:25:42 dkf Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+8
-8
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclIOCmd.c,v 1.10 2001/09/19 00:50:23 andreas_kupries Exp $
|
||||
* RCS: @(#) $Id: tclIOCmd.c,v 1.10.2.4 2001/09/28 14:29:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -425,8 +425,9 @@ Tcl_SeekObjCmd(clientData, interp, objc, objv)
|
||||
Tcl_Obj *CONST objv[]; /* Argument objects. */
|
||||
{
|
||||
Tcl_Channel chan; /* The channel to tell on. */
|
||||
int offset, mode; /* Where to seek? */
|
||||
int result; /* Of calling Tcl_Seek. */
|
||||
Tcl_WideInt offset; /* Where to seek? */
|
||||
int mode; /* How to seek? */
|
||||
Tcl_WideInt result; /* Of calling Tcl_Seek. */
|
||||
char *chanName;
|
||||
int optionIndex;
|
||||
static char *originOptions[] = {"start", "current", "end", (char *) NULL};
|
||||
@@ -441,7 +442,7 @@ Tcl_SeekObjCmd(clientData, interp, objc, objv)
|
||||
if (chan == (Tcl_Channel) NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_GetIntFromObj(interp, objv[2], &offset) != TCL_OK) {
|
||||
if (Tcl_GetWideIntFromObj(interp, objv[2], &offset) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
mode = SEEK_SET;
|
||||
@@ -454,7 +455,7 @@ Tcl_SeekObjCmd(clientData, interp, objc, objv)
|
||||
}
|
||||
|
||||
result = Tcl_Seek(chan, offset, mode);
|
||||
if (result == -1) {
|
||||
if (result == Tcl_LongAsWide(-1)) {
|
||||
Tcl_AppendResult(interp, "error during seek on \"",
|
||||
chanName, "\": ", Tcl_PosixError(interp), (char *) NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -504,7 +505,7 @@ Tcl_TellObjCmd(clientData, interp, objc, objv)
|
||||
if (chan == (Tcl_Channel) NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetIntObj(Tcl_GetObjResult(interp), Tcl_Tell(chan));
|
||||
Tcl_SetWideIntObj(Tcl_GetObjResult(interp), Tcl_Tell(chan));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -731,8 +732,7 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv)
|
||||
|
||||
#define NUM_ARGS 20
|
||||
Tcl_Obj *resultPtr;
|
||||
char **argv;
|
||||
char *string;
|
||||
char **argv, *string;
|
||||
Tcl_Channel chan;
|
||||
char *argStorage[NUM_ARGS];
|
||||
int argc, background, i, index, keepNewline, result, skip, length;
|
||||
|
||||
+24
-27
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* CVS: $Id: tclIOGT.c,v 1.3 2000/09/29 21:42:19 hobbs Exp $
|
||||
* CVS: $Id: tclIOGT.c,v 1.3.12.3 2001/09/27 14:07:45 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -28,13 +28,13 @@ static int TransformBlockModeProc _ANSI_ARGS_ ((
|
||||
static int TransformCloseProc _ANSI_ARGS_ ((
|
||||
ClientData instanceData, Tcl_Interp* interp));
|
||||
static int TransformInputProc _ANSI_ARGS_ ((
|
||||
ClientData instanceData,
|
||||
char* buf, int toRead, int* errorCodePtr));
|
||||
ClientData instanceData, char* buf,
|
||||
int toRead, int* errorCodePtr));
|
||||
static int TransformOutputProc _ANSI_ARGS_ ((
|
||||
ClientData instanceData,
|
||||
char* buf, int toWrite, int* errorCodePtr));
|
||||
static int TransformSeekProc _ANSI_ARGS_ ((
|
||||
ClientData instanceData, long offset,
|
||||
ClientData instanceData, char* buf,
|
||||
int toWrite, int* errorCodePtr));
|
||||
static Tcl_WideInt TransformSeekProc _ANSI_ARGS_ ((
|
||||
ClientData instanceData, Tcl_WideInt offset,
|
||||
int mode, int* errorCodePtr));
|
||||
static int TransformSetOptionProc _ANSI_ARGS_((
|
||||
ClientData instanceData, Tcl_Interp *interp,
|
||||
@@ -156,8 +156,8 @@ static Tcl_ChannelType transformChannelType = {
|
||||
|
||||
struct ResultBuffer {
|
||||
unsigned char* buf; /* Reference to the buffer area */
|
||||
int allocated; /* Allocated size of the buffer area */
|
||||
int used; /* Number of bytes in the buffer, <= allocated */
|
||||
int allocated; /* Allocated size of the buffer area */
|
||||
int used; /* Number of bytes in the buffer, <= allocated */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -357,11 +357,11 @@ TclChannelTransform(interp, chan, cmdObjPtr)
|
||||
|
||||
static int
|
||||
ExecuteCallback (dataPtr, interp, op, buf, bufLen, transmit, preserve)
|
||||
TransformChannelData* dataPtr; /* Transformation with the callback */
|
||||
TransformChannelData* dataPtr; /* Transformation with the callback */
|
||||
Tcl_Interp* interp; /* Current interpreter, possibly NULL */
|
||||
unsigned char* op; /* Operation invoking the callback */
|
||||
unsigned char* buf; /* Buffer to give to the script. */
|
||||
int bufLen; /* Ands its length */
|
||||
int bufLen; /* Ands its length */
|
||||
int transmit; /* Flag, determines whether the result
|
||||
* of the callback is sent to the
|
||||
* underlying channel or not. */
|
||||
@@ -377,16 +377,14 @@ ExecuteCallback (dataPtr, interp, op, buf, bufLen, transmit, preserve)
|
||||
* arguments. Feather's curried commands would come in handy here.
|
||||
*/
|
||||
|
||||
Tcl_Obj* resObj; /* See below, switch (transmit) */
|
||||
int resLen;
|
||||
unsigned char* resBuf;
|
||||
Tcl_Obj* resObj; /* See below, switch (transmit) */
|
||||
int resLen;
|
||||
unsigned char* resBuf;
|
||||
Tcl_SavedResult ciSave;
|
||||
|
||||
int res = TCL_OK;
|
||||
Tcl_Obj* command = Tcl_DuplicateObj (dataPtr->command);
|
||||
Tcl_Obj* temp;
|
||||
|
||||
|
||||
if (preserve) {
|
||||
Tcl_SaveResult (dataPtr->interp, &ciSave);
|
||||
}
|
||||
@@ -641,7 +639,7 @@ static int
|
||||
TransformInputProc (instanceData, buf, toRead, errorCodePtr)
|
||||
ClientData instanceData;
|
||||
char* buf;
|
||||
int toRead;
|
||||
int toRead;
|
||||
int* errorCodePtr;
|
||||
{
|
||||
TransformChannelData* dataPtr = (TransformChannelData*) instanceData;
|
||||
@@ -764,8 +762,7 @@ TransformInputProc (instanceData, buf, toRead, errorCodePtr)
|
||||
*/
|
||||
|
||||
res = ExecuteCallback (dataPtr, NO_INTERP, A_READ,
|
||||
UCHARP (buf), read, TRANSMIT_IBUF,
|
||||
P_PRESERVE);
|
||||
UCHARP (buf), read, TRANSMIT_IBUF, P_PRESERVE);
|
||||
|
||||
if (res != TCL_OK) {
|
||||
*errorCodePtr = EINVAL;
|
||||
@@ -797,7 +794,7 @@ static int
|
||||
TransformOutputProc (instanceData, buf, toWrite, errorCodePtr)
|
||||
ClientData instanceData;
|
||||
char* buf;
|
||||
int toWrite;
|
||||
int toWrite;
|
||||
int* errorCodePtr;
|
||||
{
|
||||
TransformChannelData* dataPtr = (TransformChannelData*) instanceData;
|
||||
@@ -846,12 +843,12 @@ TransformOutputProc (instanceData, buf, toWrite, errorCodePtr)
|
||||
*------------------------------------------------------*
|
||||
*/
|
||||
|
||||
static int
|
||||
static Tcl_WideInt
|
||||
TransformSeekProc (instanceData, offset, mode, errorCodePtr)
|
||||
ClientData instanceData; /* The channel to manipulate */
|
||||
long offset; /* Size of movement. */
|
||||
int mode; /* How to move */
|
||||
int* errorCodePtr; /* Location of error flag. */
|
||||
ClientData instanceData; /* The channel to manipulate */
|
||||
Tcl_WideInt offset; /* Size of movement. */
|
||||
int mode; /* How to move */
|
||||
int* errorCodePtr; /* Location of error flag. */
|
||||
{
|
||||
int result;
|
||||
TransformChannelData* dataPtr = (TransformChannelData*) instanceData;
|
||||
@@ -1274,7 +1271,7 @@ static int
|
||||
ResultCopy (r, buf, toRead)
|
||||
ResultBuffer* r; /* The buffer to read from */
|
||||
unsigned char* buf; /* The buffer to copy into */
|
||||
int toRead; /* Number of requested bytes */
|
||||
int toRead; /* Number of requested bytes */
|
||||
{
|
||||
if (r->used == 0) {
|
||||
/* Nothing to copy in the case of an empty buffer.
|
||||
@@ -1337,7 +1334,7 @@ static void
|
||||
ResultAdd (r, buf, toWrite)
|
||||
ResultBuffer* r; /* The buffer to extend */
|
||||
unsigned char* buf; /* The buffer to read from */
|
||||
int toWrite; /* The number of bytes in 'buf' */
|
||||
int toWrite; /* The number of bytes in 'buf' */
|
||||
{
|
||||
if ((r->used + toWrite) > r->allocated) {
|
||||
/* Extension of the internal buffer is required.
|
||||
|
||||
+76
-10
@@ -17,7 +17,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclIOUtil.c,v 1.20 2001/09/08 14:05:09 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclIOUtil.c,v 1.20.6.8 2001/11/27 09:48:25 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -77,15 +77,63 @@ extern CONST TclFileAttrProcs tclpFileAttrProcs[];
|
||||
|
||||
/* Obsolete */
|
||||
int
|
||||
Tcl_Stat(path, buf)
|
||||
Tcl_Stat(path, oldStyleBuf)
|
||||
CONST char *path; /* Path of file to stat (in current CP). */
|
||||
struct stat *buf; /* Filled with results of stat call. */
|
||||
struct stat *oldStyleBuf; /* Filled with results of stat call. */
|
||||
{
|
||||
int ret;
|
||||
Tcl_StatBuf buf;
|
||||
Tcl_Obj *pathPtr = Tcl_NewStringObj(path,-1);
|
||||
|
||||
Tcl_IncrRefCount(pathPtr);
|
||||
ret = Tcl_FSStat(pathPtr,buf);
|
||||
ret = Tcl_FSStat(pathPtr, &buf);
|
||||
Tcl_DecrRefCount(pathPtr);
|
||||
if (ret != -1) {
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
# define OUT_OF_RANGE(x) \
|
||||
(((Tcl_WideInt)(x)) < Tcl_LongAsWide(LONG_MIN) || \
|
||||
((Tcl_WideInt)(x)) > Tcl_LongAsWide(LONG_MAX))
|
||||
# define OUT_OF_URANGE(x) \
|
||||
(((Tcl_WideUInt)(x)) > (Tcl_WideUInt)ULONG_MAX)
|
||||
|
||||
/*
|
||||
* Perform the result-buffer overflow check manually.
|
||||
*
|
||||
* Note that ino_t/ino64_t is unsigned...
|
||||
*/
|
||||
|
||||
if (OUT_OF_URANGE(buf.st_ino) || OUT_OF_RANGE(buf.st_size)
|
||||
|| OUT_OF_RANGE(buf.st_blocks)) {
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
||||
# undef OUT_OF_RANGE
|
||||
# undef OUT_OF_URANGE
|
||||
#endif /* !TCL_WIDE_INT_IS_LONG */
|
||||
|
||||
/*
|
||||
* Copy across all supported fields, with possible type
|
||||
* coercions on those fields that change between the normal
|
||||
* and lf64 versions of the stat structure (on Solaris at
|
||||
* least.) This is slow when the structure sizes coincide,
|
||||
* but that's what you get for using an obsolete interface.
|
||||
*/
|
||||
|
||||
oldStyleBuf->st_mode = buf.st_mode;
|
||||
oldStyleBuf->st_ino = (ino_t) buf.st_ino;
|
||||
oldStyleBuf->st_dev = buf.st_dev;
|
||||
oldStyleBuf->st_rdev = buf.st_rdev;
|
||||
oldStyleBuf->st_nlink = buf.st_nlink;
|
||||
oldStyleBuf->st_uid = buf.st_uid;
|
||||
oldStyleBuf->st_gid = buf.st_gid;
|
||||
oldStyleBuf->st_size = (off_t) buf.st_size;
|
||||
oldStyleBuf->st_atime = buf.st_atime;
|
||||
oldStyleBuf->st_mtime = buf.st_mtime;
|
||||
oldStyleBuf->st_ctime = buf.st_ctime;
|
||||
oldStyleBuf->st_blksize = buf.st_blksize;
|
||||
oldStyleBuf->st_blocks = (blkcnt_t) buf.st_blocks;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1147,7 +1195,7 @@ Tcl_FSEvalFile(interp, fileName)
|
||||
* will be performed on this name. */
|
||||
{
|
||||
int result, length;
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
Tcl_Obj *oldScriptFile;
|
||||
Interp *iPtr;
|
||||
char *string;
|
||||
@@ -1331,11 +1379,12 @@ Tcl_PosixError(interp)
|
||||
int
|
||||
Tcl_FSStat(pathPtr, buf)
|
||||
Tcl_Obj *pathPtr; /* Path of file to stat (in current CP). */
|
||||
struct stat *buf; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *buf; /* Filled with results of stat call. */
|
||||
{
|
||||
Tcl_Filesystem *fsPtr;
|
||||
#ifdef USE_OBSOLETE_FS_HOOKS
|
||||
StatProc *statProcPtr;
|
||||
struct stat oldStyleStatBuffer;
|
||||
int retVal = -1;
|
||||
char *path;
|
||||
Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr);
|
||||
@@ -1355,11 +1404,28 @@ Tcl_FSStat(pathPtr, buf)
|
||||
Tcl_MutexLock(&obsoleteFsHookMutex);
|
||||
statProcPtr = statProcList;
|
||||
while ((retVal == -1) && (statProcPtr != NULL)) {
|
||||
retVal = (*statProcPtr->proc)(path, buf);
|
||||
retVal = (*statProcPtr->proc)(path, &oldStyleStatBuffer);
|
||||
statProcPtr = statProcPtr->nextPtr;
|
||||
}
|
||||
Tcl_MutexUnlock(&obsoleteFsHookMutex);
|
||||
if (retVal != -1) {
|
||||
/*
|
||||
* Note that EOVERFLOW is not a problem here, and these
|
||||
* assignments should all be widening (if not identity.)
|
||||
*/
|
||||
buf->st_mode = oldStyleStatBuffer.st_mode;
|
||||
buf->st_ino = (Tcl_WideUInt) Tcl_LongAsWide(oldStyleStatBuffer.st_ino);
|
||||
buf->st_dev = oldStyleStatBuffer.st_dev;
|
||||
buf->st_rdev = oldStyleStatBuffer.st_rdev;
|
||||
buf->st_nlink = oldStyleStatBuffer.st_nlink;
|
||||
buf->st_uid = oldStyleStatBuffer.st_uid;
|
||||
buf->st_gid = oldStyleStatBuffer.st_gid;
|
||||
buf->st_size = Tcl_LongAsWide(oldStyleStatBuffer.st_size);
|
||||
buf->st_atime = oldStyleStatBuffer.st_atime;
|
||||
buf->st_mtime = oldStyleStatBuffer.st_mtime;
|
||||
buf->st_ctime = oldStyleStatBuffer.st_ctime;
|
||||
buf->st_blksize = oldStyleStatBuffer.st_blksize;
|
||||
buf->st_blocks = Tcl_LongAsWide(oldStyleStatBuffer.st_blocks);
|
||||
return retVal;
|
||||
}
|
||||
#endif /* USE_OBSOLETE_FS_HOOKS */
|
||||
@@ -1397,7 +1463,7 @@ Tcl_FSStat(pathPtr, buf)
|
||||
int
|
||||
Tcl_FSLstat(pathPtr, buf)
|
||||
Tcl_Obj *pathPtr; /* Path of file to stat (in current CP). */
|
||||
struct stat *buf; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *buf; /* Filled with results of stat call. */
|
||||
{
|
||||
Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
|
||||
if (fsPtr != NULL) {
|
||||
@@ -2170,7 +2236,7 @@ Tcl_FSChdir(pathPtr)
|
||||
retVal = (*proc)(pathPtr);
|
||||
} else {
|
||||
/* Fallback on stat-based implementation */
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
/* If the file can be stat'ed and is a directory and
|
||||
* is readable, then we can chdir. */
|
||||
if ((Tcl_FSStat(pathPtr, &buf) == 0)
|
||||
@@ -3028,7 +3094,7 @@ TclCrossFilesystemCopy(interp, source, target)
|
||||
/* This is very strange, we checked this above */
|
||||
Tcl_Close(interp, out);
|
||||
} else {
|
||||
struct stat sourceStatBuf;
|
||||
Tcl_StatBuf sourceStatBuf;
|
||||
struct utimbuf tval;
|
||||
/*
|
||||
* Copy it synchronously. We might wish to add an
|
||||
|
||||
+186
-45
@@ -10,10 +10,11 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclIndexObj.c,v 1.10 2001/08/30 19:02:43 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclIndexObj.c,v 1.10.6.8 2001/10/23 13:14:38 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "tclPort.h"
|
||||
|
||||
/*
|
||||
* Prototypes for procedures defined later in this file:
|
||||
@@ -21,6 +22,10 @@
|
||||
|
||||
static int SetIndexFromAny _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr));
|
||||
static void UpdateStringOfIndex _ANSI_ARGS_((Tcl_Obj *objPtr));
|
||||
static void DupIndex _ANSI_ARGS_((Tcl_Obj *srcPtr,
|
||||
Tcl_Obj *dupPtr));
|
||||
static void FreeIndex _ANSI_ARGS_((Tcl_Obj *objPtr));
|
||||
|
||||
/*
|
||||
* The structure below defines the index Tcl object type by means of
|
||||
@@ -29,21 +34,41 @@ static int SetIndexFromAny _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
|
||||
Tcl_ObjType tclIndexType = {
|
||||
"index", /* name */
|
||||
(Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */
|
||||
(Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */
|
||||
(Tcl_UpdateStringProc *) NULL, /* updateStringProc */
|
||||
FreeIndex, /* freeIntRepProc */
|
||||
DupIndex, /* dupIntRepProc */
|
||||
UpdateStringOfIndex, /* updateStringProc */
|
||||
SetIndexFromAny /* setFromAnyProc */
|
||||
};
|
||||
|
||||
/*
|
||||
* DKF - Just noting that the data format used in objects with the
|
||||
* above type is that the ptr1 field will contain a pointer to the
|
||||
* table that the last lookup was performed in, and the ptr2 field
|
||||
* will contain the sizeof(char) offset of the string within that
|
||||
* table. Note that we assume that each table is only ever called
|
||||
* with a single offset, but this is a pretty safe assumption in
|
||||
* practise...
|
||||
* The definition of the internal representation of the "index"
|
||||
* object; The internalRep.otherValuePtr field of an object of "index"
|
||||
* type will be a pointer to one of these structures.
|
||||
*
|
||||
* Keep this structure declaration in sync with tclTestObj.c
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
VOID *tablePtr; /* Pointer to the table of strings */
|
||||
int offset; /* Offset between table entries */
|
||||
int index; /* Selected index into table. */
|
||||
} IndexRep;
|
||||
|
||||
/*
|
||||
* SunPro CC is annoying!
|
||||
*/
|
||||
#ifdef __sparc
|
||||
# define STRING_AT(table, offset, index) \
|
||||
(*((char **)(((char *)(table)) + ((offset) * (index)))))
|
||||
#else
|
||||
# define STRING_AT(table, offset, index) \
|
||||
(*((char **)(((VOID *)(table)) + (ptrdiff_t)((offset) * (index)))))
|
||||
#endif
|
||||
#define NEXT_ENTRY(table, offset) \
|
||||
(&(STRING_AT(table, offset, 1)))
|
||||
#define EXPAND_OF(indexRep) \
|
||||
STRING_AT((indexRep)->tablePtr, (indexRep)->offset, (indexRep)->index)
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -91,11 +116,17 @@ Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr)
|
||||
* is cached).
|
||||
*/
|
||||
|
||||
if ((objPtr->typePtr == &tclIndexType)
|
||||
&& (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr)) {
|
||||
*indexPtr = ((int) objPtr->internalRep.twoPtrValue.ptr2)
|
||||
/ sizeof(char *);
|
||||
return TCL_OK;
|
||||
if (objPtr->typePtr == &tclIndexType) {
|
||||
IndexRep *indexRep = (IndexRep *) objPtr->internalRep.otherValuePtr;
|
||||
/*
|
||||
* Here's hoping we don't get hit by unfortunate packing
|
||||
* constraints on odd platforms like a Cray PVP...
|
||||
*/
|
||||
if (indexRep->tablePtr == (VOID *)tablePtr &&
|
||||
indexRep->offset == sizeof(char *)) {
|
||||
*indexPtr = indexRep->index;
|
||||
return TCL_OK;
|
||||
}
|
||||
}
|
||||
return Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, sizeof(char *),
|
||||
msg, flags, indexPtr);
|
||||
@@ -148,15 +179,18 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags,
|
||||
int index, length, i, numAbbrev;
|
||||
char *key, *p1, *p2, **entryPtr;
|
||||
Tcl_Obj *resultPtr;
|
||||
IndexRep *indexRep;
|
||||
|
||||
/*
|
||||
* See if there is a valid cached result from a previous lookup.
|
||||
*/
|
||||
|
||||
if ((objPtr->typePtr == &tclIndexType)
|
||||
&& (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr)) {
|
||||
*indexPtr = ((int) objPtr->internalRep.twoPtrValue.ptr2) / offset;
|
||||
return TCL_OK;
|
||||
if (objPtr->typePtr == &tclIndexType) {
|
||||
indexRep = (IndexRep *) objPtr->internalRep.otherValuePtr;
|
||||
if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
|
||||
*indexPtr = indexRep->index;
|
||||
return TCL_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -172,19 +206,25 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags,
|
||||
* The key should not be empty, otherwise it's not a match.
|
||||
*/
|
||||
|
||||
if (key[0] == '\0') {
|
||||
if (*key == '\0') {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Scan the table looking for one of:
|
||||
* - An exact match (always preferred)
|
||||
* - A single abbreviation (allowed depending on flags)
|
||||
* - Several abbreviations (never allowed, but overridden by exact match)
|
||||
*/
|
||||
for (entryPtr = tablePtr, i = 0; *entryPtr != NULL;
|
||||
entryPtr = (char **) ((char *) entryPtr + offset), i++) {
|
||||
entryPtr = NEXT_ENTRY(entryPtr, offset), i++) {
|
||||
for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) {
|
||||
if (*p1 == 0) {
|
||||
if (*p1 == '\0') {
|
||||
index = i;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
if (*p1 == 0) {
|
||||
if (*p1 == '\0') {
|
||||
/*
|
||||
* The value is an abbreviation for this entry. Continue
|
||||
* checking other entries to make sure it's unique. If we
|
||||
@@ -197,35 +237,51 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags,
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check if we were instructed to disallow abbreviations.
|
||||
*/
|
||||
if ((flags & TCL_EXACT) || (numAbbrev != 1)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
done:
|
||||
if ((objPtr->typePtr != NULL)
|
||||
&& (objPtr->typePtr->freeIntRepProc != NULL)) {
|
||||
objPtr->typePtr->freeIntRepProc(objPtr);
|
||||
}
|
||||
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tablePtr;
|
||||
done:
|
||||
/*
|
||||
* Make sure to account for offsets != sizeof(char *). [Bug 5153]
|
||||
* Cache the found representation. Note that we want to avoid
|
||||
* allocating a new internal-rep if at all possible since that is
|
||||
* potentially a slow operation.
|
||||
*/
|
||||
objPtr->internalRep.twoPtrValue.ptr2 = (VOID *) (index * offset);
|
||||
objPtr->typePtr = &tclIndexType;
|
||||
if (objPtr->typePtr == &tclIndexType) {
|
||||
indexRep = (IndexRep *) objPtr->internalRep.otherValuePtr;
|
||||
} else {
|
||||
if ((objPtr->typePtr != NULL)
|
||||
&& (objPtr->typePtr->freeIntRepProc != NULL)) {
|
||||
objPtr->typePtr->freeIntRepProc(objPtr);
|
||||
}
|
||||
indexRep = (IndexRep *) ckalloc(sizeof(IndexRep));
|
||||
objPtr->internalRep.otherValuePtr = (VOID *) indexRep;
|
||||
objPtr->typePtr = &tclIndexType;
|
||||
}
|
||||
indexRep->tablePtr = tablePtr;
|
||||
indexRep->offset = offset;
|
||||
indexRep->index = index;
|
||||
|
||||
*indexPtr = index;
|
||||
return TCL_OK;
|
||||
|
||||
error:
|
||||
error:
|
||||
if (interp != NULL) {
|
||||
/*
|
||||
* Produce a fancy error message.
|
||||
*/
|
||||
int count;
|
||||
resultPtr = Tcl_GetObjResult(interp);
|
||||
Tcl_AppendStringsToObj(resultPtr,
|
||||
(numAbbrev > 1) ? "ambiguous " : "bad ", msg, " \"",
|
||||
key, "\": must be ", *tablePtr, (char *) NULL);
|
||||
for (entryPtr = (char **) ((char *) tablePtr + offset), count = 0;
|
||||
for (entryPtr = NEXT_ENTRY(tablePtr, offset), count = 0;
|
||||
*entryPtr != NULL;
|
||||
entryPtr = (char **) ((char *) entryPtr + offset), count++) {
|
||||
if ((*((char **) ((char *) entryPtr + offset))) == NULL) {
|
||||
entryPtr = NEXT_ENTRY(entryPtr, offset), count++) {
|
||||
if (*NEXT_ENTRY(entryPtr, offset) == NULL) {
|
||||
Tcl_AppendStringsToObj(resultPtr,
|
||||
(count > 0) ? ", or " : " or ", *entryPtr,
|
||||
(char *) NULL);
|
||||
@@ -269,6 +325,94 @@ SetIndexFromAny(interp, objPtr)
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* UpdateStringOfIndex --
|
||||
*
|
||||
* This procedure is called to convert a Tcl object from index
|
||||
* internal form to its string form. No abbreviation is ever
|
||||
* generated.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The string representation of the object is updated.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
UpdateStringOfIndex(objPtr)
|
||||
Tcl_Obj *objPtr;
|
||||
{
|
||||
IndexRep *indexRep = (IndexRep *) objPtr->internalRep.otherValuePtr;
|
||||
register char *buf;
|
||||
register unsigned len;
|
||||
register char *indexStr = EXPAND_OF(indexRep);
|
||||
|
||||
len = strlen(indexStr);
|
||||
buf = (char *) ckalloc(len + 1);
|
||||
memcpy(buf, indexStr, len+1);
|
||||
objPtr->bytes = buf;
|
||||
objPtr->length = len;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* DupIndex --
|
||||
*
|
||||
* This procedure is called to copy the internal rep of an index
|
||||
* Tcl object from to another object.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The internal representation of the target object is updated
|
||||
* and the type is set.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
DupIndex(srcPtr, dupPtr)
|
||||
Tcl_Obj *srcPtr, *dupPtr;
|
||||
{
|
||||
IndexRep *srcIndexRep = (IndexRep *) srcPtr->internalRep.otherValuePtr;
|
||||
IndexRep *dupIndexRep = (IndexRep *) ckalloc(sizeof(IndexRep));
|
||||
|
||||
memcpy(dupIndexRep, srcIndexRep, sizeof(IndexRep));
|
||||
dupPtr->internalRep.otherValuePtr = (VOID *) dupIndexRep;
|
||||
dupPtr->typePtr = &tclIndexType;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FreeIndex --
|
||||
*
|
||||
* This procedure is called to delete the internal rep of an index
|
||||
* Tcl object.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The internal representation of the target object is deleted.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
FreeIndex(objPtr)
|
||||
Tcl_Obj *objPtr;
|
||||
{
|
||||
ckfree((char *) objPtr->internalRep.otherValuePtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -306,8 +450,8 @@ Tcl_WrongNumArgs(interp, objc, objv, message)
|
||||
* message may be NULL. */
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
char **tablePtr;
|
||||
int i, offset;
|
||||
int i;
|
||||
register IndexRep *indexRep;
|
||||
|
||||
objPtr = Tcl_GetObjResult(interp);
|
||||
Tcl_AppendToObj(objPtr, "wrong # args: should be \"", -1);
|
||||
@@ -319,11 +463,8 @@ Tcl_WrongNumArgs(interp, objc, objv, message)
|
||||
*/
|
||||
|
||||
if (objv[i]->typePtr == &tclIndexType) {
|
||||
tablePtr = ((char **) objv[i]->internalRep.twoPtrValue.ptr1);
|
||||
offset = ((int) objv[i]->internalRep.twoPtrValue.ptr2);
|
||||
Tcl_AppendStringsToObj(objPtr,
|
||||
*((char **)(((char *)tablePtr)+offset)),
|
||||
(char *) NULL);
|
||||
indexRep = (IndexRep *) objv[i]->internalRep.otherValuePtr;
|
||||
Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), (char *) NULL);
|
||||
} else {
|
||||
Tcl_AppendStringsToObj(objPtr, Tcl_GetString(objv[i]),
|
||||
(char *) NULL);
|
||||
|
||||
+89
-90
@@ -10,7 +10,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: tclInt.decls,v 1.31 2001/09/10 17:17:41 andreas_kupries Exp $
|
||||
# RCS: @(#) $Id: tclInt.decls,v 1.31.4.3 2001/09/27 14:56:34 dkf Exp $
|
||||
|
||||
library tcl
|
||||
|
||||
@@ -41,7 +41,7 @@ declare 3 generic {
|
||||
# int TclChdir(Tcl_Interp *interp, char *dirName)
|
||||
# }
|
||||
declare 5 {unix win} {
|
||||
int TclCleanupChildren(Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, \
|
||||
int TclCleanupChildren(Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr,
|
||||
Tcl_Channel errorChan)
|
||||
}
|
||||
declare 6 generic {
|
||||
@@ -51,15 +51,15 @@ declare 7 generic {
|
||||
int TclCopyAndCollapse(int count, CONST char *src, char *dst)
|
||||
}
|
||||
declare 8 generic {
|
||||
int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan, \
|
||||
int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan,
|
||||
Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr)
|
||||
}
|
||||
|
||||
# TclCreatePipeline unofficially exported for use by BLT.
|
||||
|
||||
declare 9 {unix win} {
|
||||
int TclCreatePipeline(Tcl_Interp *interp, int argc, char **argv, \
|
||||
Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, \
|
||||
int TclCreatePipeline(Tcl_Interp *interp, int argc, char **argv,
|
||||
Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr,
|
||||
TclFile *errFilePtr)
|
||||
}
|
||||
declare 10 generic {
|
||||
@@ -74,7 +74,7 @@ declare 12 generic {
|
||||
void TclDeleteVars(Interp *iPtr, Tcl_HashTable *tablePtr)
|
||||
}
|
||||
declare 13 generic {
|
||||
int TclDoGlob(Tcl_Interp *interp, char *separators, \
|
||||
int TclDoGlob(Tcl_Interp *interp, char *separators,
|
||||
Tcl_DString *headPtr, char *tail, Tcl_GlobTypeData *types)
|
||||
}
|
||||
declare 14 generic {
|
||||
@@ -104,8 +104,8 @@ declare 16 generic {
|
||||
# int TclFileRenameCmd(Tcl_Interp *interp, int argc, char **argv)
|
||||
#}
|
||||
declare 22 generic {
|
||||
int TclFindElement(Tcl_Interp *interp, CONST char *listStr, \
|
||||
int listLength, CONST char **elementPtr, CONST char **nextPtr, \
|
||||
int TclFindElement(Tcl_Interp *interp, CONST char *listStr,
|
||||
int listLength, CONST char **elementPtr, CONST char **nextPtr,
|
||||
int *sizePtr, int *bracePtr)
|
||||
}
|
||||
declare 23 generic {
|
||||
@@ -122,14 +122,14 @@ declare 25 generic {
|
||||
# char * TclGetCwd(Tcl_Interp *interp)
|
||||
# }
|
||||
declare 27 generic {
|
||||
int TclGetDate(char *p, unsigned long now, long zone, \
|
||||
int TclGetDate(char *p, unsigned long now, long zone,
|
||||
unsigned long *timePtr)
|
||||
}
|
||||
declare 28 generic {
|
||||
Tcl_Channel TclpGetDefaultStdChannel(int type)
|
||||
}
|
||||
declare 29 generic {
|
||||
Tcl_Obj * TclGetElementOfIndexedArray(Tcl_Interp *interp, \
|
||||
Tcl_Obj * TclGetElementOfIndexedArray(Tcl_Interp *interp,
|
||||
int localIndex, Tcl_Obj *elemPtr, int flags)
|
||||
}
|
||||
# Replaced by char * TclGetEnv(CONST char *name, Tcl_DString *valuePtr) in 8.1:
|
||||
@@ -146,11 +146,11 @@ declare 33 generic {
|
||||
TclCmdProcType TclGetInterpProc(void)
|
||||
}
|
||||
declare 34 generic {
|
||||
int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, \
|
||||
int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
int endValue, int *indexPtr)
|
||||
}
|
||||
declare 35 generic {
|
||||
Tcl_Obj * TclGetIndexedScalar(Tcl_Interp *interp, int localIndex, \
|
||||
Tcl_Obj * TclGetIndexedScalar(Tcl_Interp *interp, int localIndex,
|
||||
int flags)
|
||||
}
|
||||
declare 36 generic {
|
||||
@@ -160,9 +160,9 @@ declare 37 generic {
|
||||
int TclGetLoadedPackages(Tcl_Interp *interp, char *targetName)
|
||||
}
|
||||
declare 38 generic {
|
||||
int TclGetNamespaceForQualName(Tcl_Interp *interp, CONST char *qualName, \
|
||||
Namespace *cxtNsPtr, int flags, Namespace **nsPtrPtr, \
|
||||
Namespace **altNsPtrPtr, Namespace **actualCxtPtrPtr, \
|
||||
int TclGetNamespaceForQualName(Tcl_Interp *interp, CONST char *qualName,
|
||||
Namespace *cxtNsPtr, int flags, Namespace **nsPtrPtr,
|
||||
Namespace **altNsPtrPtr, Namespace **actualCxtPtrPtr,
|
||||
CONST char **simpleNamePtr)
|
||||
}
|
||||
declare 39 generic {
|
||||
@@ -190,19 +190,19 @@ declare 46 generic {
|
||||
int TclInExit(void)
|
||||
}
|
||||
declare 47 generic {
|
||||
Tcl_Obj * TclIncrElementOfIndexedArray(Tcl_Interp *interp, \
|
||||
Tcl_Obj * TclIncrElementOfIndexedArray(Tcl_Interp *interp,
|
||||
int localIndex, Tcl_Obj *elemPtr, long incrAmount)
|
||||
}
|
||||
declare 48 generic {
|
||||
Tcl_Obj * TclIncrIndexedScalar(Tcl_Interp *interp, int localIndex, \
|
||||
Tcl_Obj * TclIncrIndexedScalar(Tcl_Interp *interp, int localIndex,
|
||||
long incrAmount)
|
||||
}
|
||||
declare 49 generic {
|
||||
Tcl_Obj * TclIncrVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, \
|
||||
Tcl_Obj * TclIncrVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr, long incrAmount, int part1NotParsed)
|
||||
}
|
||||
declare 50 generic {
|
||||
void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, \
|
||||
void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr,
|
||||
Namespace *nsPtr)
|
||||
}
|
||||
declare 51 generic {
|
||||
@@ -212,11 +212,11 @@ declare 52 generic {
|
||||
int TclInvoke(Tcl_Interp *interp, int argc, char **argv, int flags)
|
||||
}
|
||||
declare 53 generic {
|
||||
int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp, \
|
||||
int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp,
|
||||
int argc, char **argv)
|
||||
}
|
||||
declare 54 generic {
|
||||
int TclInvokeStringCommand(ClientData clientData, Tcl_Interp *interp, \
|
||||
int TclInvokeStringCommand(ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
}
|
||||
declare 55 generic {
|
||||
@@ -224,8 +224,8 @@ declare 55 generic {
|
||||
}
|
||||
# Replaced with TclpLoadFile in 8.1:
|
||||
# declare 56 generic {
|
||||
# int TclLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, \
|
||||
# char *sym2, Tcl_PackageInitProc **proc1Ptr, \
|
||||
# int TclLoadFile(Tcl_Interp *interp, char *fileName, char *sym1,
|
||||
# char *sym2, Tcl_PackageInitProc **proc1Ptr,
|
||||
# Tcl_PackageInitProc **proc2Ptr)
|
||||
# }
|
||||
# Signature changed to take a length in 8.1:
|
||||
@@ -233,13 +233,13 @@ declare 55 generic {
|
||||
# int TclLooksLikeInt(char *p)
|
||||
# }
|
||||
declare 58 generic {
|
||||
Var * TclLookupVar(Tcl_Interp *interp, char *part1, char *part2, \
|
||||
int flags, char *msg, int createPart1, int createPart2, \
|
||||
Var * TclLookupVar(Tcl_Interp *interp, char *part1, char *part2,
|
||||
int flags, char *msg, int createPart1, int createPart2,
|
||||
Var **arrayPtrPtr)
|
||||
}
|
||||
# Replaced by Tcl_FSMatchInDirectory in 8.4
|
||||
#declare 59 generic {
|
||||
# int TclpMatchFiles(Tcl_Interp *interp, char *separators, \
|
||||
# int TclpMatchFiles(Tcl_Interp *interp, char *separators,
|
||||
# Tcl_DString *dirPtr, char *pattern, char *tail)
|
||||
#}
|
||||
declare 60 generic {
|
||||
@@ -252,15 +252,15 @@ declare 62 generic {
|
||||
int TclObjCommandComplete(Tcl_Obj *cmdPtr)
|
||||
}
|
||||
declare 63 generic {
|
||||
int TclObjInterpProc(ClientData clientData, Tcl_Interp *interp, \
|
||||
int TclObjInterpProc(ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
}
|
||||
declare 64 generic {
|
||||
int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], \
|
||||
int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[],
|
||||
int flags)
|
||||
}
|
||||
declare 65 generic {
|
||||
int TclObjInvokeGlobal(Tcl_Interp *interp, int objc, \
|
||||
int TclObjInvokeGlobal(Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *CONST objv[], int flags)
|
||||
}
|
||||
declare 66 generic {
|
||||
@@ -280,7 +280,7 @@ declare 69 generic {
|
||||
# int TclpCopyFile(CONST char *source, CONST char *dest)
|
||||
#}
|
||||
#declare 71 generic {
|
||||
# int TclpCopyDirectory(CONST char *source, CONST char *dest, \
|
||||
# int TclpCopyDirectory(CONST char *source, CONST char *dest,
|
||||
# Tcl_DString *errorPtr)
|
||||
#}
|
||||
#declare 72 generic {
|
||||
@@ -310,14 +310,14 @@ declare 78 generic {
|
||||
#}
|
||||
# Replaced by Tcl_FSOpenFileChannel in 8.4:
|
||||
#declare 80 generic {
|
||||
# Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp, char *fileName, \
|
||||
# Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp, char *fileName,
|
||||
# char *modeString, int permissions)
|
||||
#}
|
||||
declare 81 generic {
|
||||
char * TclpRealloc(char *ptr, unsigned int size)
|
||||
}
|
||||
#declare 82 generic {
|
||||
# int TclpRemoveDirectory(CONST char *path, int recursive, \
|
||||
# int TclpRemoveDirectory(CONST char *path, int recursive,
|
||||
# Tcl_DString *errorPtr)
|
||||
#}
|
||||
#declare 83 generic {
|
||||
@@ -325,26 +325,26 @@ declare 81 generic {
|
||||
#}
|
||||
# Removed in 8.1:
|
||||
# declare 84 generic {
|
||||
# int TclParseBraces(Tcl_Interp *interp, char *str, char **termPtr, \
|
||||
# int TclParseBraces(Tcl_Interp *interp, char *str, char **termPtr,
|
||||
# ParseValue *pvPtr)
|
||||
# }
|
||||
# declare 85 generic {
|
||||
# int TclParseNestedCmd(Tcl_Interp *interp, char *str, int flags, \
|
||||
# int TclParseNestedCmd(Tcl_Interp *interp, char *str, int flags,
|
||||
# char **termPtr, ParseValue *pvPtr)
|
||||
# }
|
||||
# declare 86 generic {
|
||||
# int TclParseQuotes(Tcl_Interp *interp, char *str, int termChar, \
|
||||
# int TclParseQuotes(Tcl_Interp *interp, char *str, int termChar,
|
||||
# int flags, char **termPtr, ParseValue *pvPtr)
|
||||
# }
|
||||
# declare 87 generic {
|
||||
# void TclPlatformInit(Tcl_Interp *interp)
|
||||
# }
|
||||
declare 88 generic {
|
||||
char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp, \
|
||||
char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
|
||||
char *name1, char *name2, int flags)
|
||||
}
|
||||
declare 89 generic {
|
||||
int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp, \
|
||||
int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp,
|
||||
Tcl_Command cmd)
|
||||
}
|
||||
# Removed in 8.1 (only available if compiled with TCL_COMPILE_DEBUG):
|
||||
@@ -355,20 +355,20 @@ declare 91 generic {
|
||||
void TclProcCleanupProc(Proc *procPtr)
|
||||
}
|
||||
declare 92 generic {
|
||||
int TclProcCompileProc(Tcl_Interp *interp, Proc *procPtr, \
|
||||
Tcl_Obj *bodyPtr, Namespace *nsPtr, CONST char *description, \
|
||||
int TclProcCompileProc(Tcl_Interp *interp, Proc *procPtr,
|
||||
Tcl_Obj *bodyPtr, Namespace *nsPtr, CONST char *description,
|
||||
CONST char *procName)
|
||||
}
|
||||
declare 93 generic {
|
||||
void TclProcDeleteProc(ClientData clientData)
|
||||
}
|
||||
declare 94 generic {
|
||||
int TclProcInterpProc(ClientData clientData, Tcl_Interp *interp, \
|
||||
int TclProcInterpProc(ClientData clientData, Tcl_Interp *interp,
|
||||
int argc, char **argv)
|
||||
}
|
||||
# Replaced by Tcl_FSStat in 8.4:
|
||||
#declare 95 generic {
|
||||
# int TclpStat(CONST char *path, struct stat *buf)
|
||||
# int TclpStat(CONST char *path, Tcl_StatBuf *buf)
|
||||
#}
|
||||
declare 96 generic {
|
||||
int TclRenameCommand(Tcl_Interp *interp, char *oldName, char *newName)
|
||||
@@ -380,11 +380,11 @@ declare 98 generic {
|
||||
int TclServiceIdle(void)
|
||||
}
|
||||
declare 99 generic {
|
||||
Tcl_Obj * TclSetElementOfIndexedArray(Tcl_Interp *interp, \
|
||||
int localIndex, Tcl_Obj *elemPtr, Tcl_Obj *objPtr, int flags)
|
||||
Tcl_Obj * TclSetElementOfIndexedArray(Tcl_Interp *interp, int localIndex,
|
||||
Tcl_Obj *elemPtr, Tcl_Obj *objPtr, int flags)
|
||||
}
|
||||
declare 100 generic {
|
||||
Tcl_Obj * TclSetIndexedScalar(Tcl_Interp *interp, int localIndex, \
|
||||
Tcl_Obj * TclSetIndexedScalar(Tcl_Interp *interp, int localIndex,
|
||||
Tcl_Obj *objPtr, int flags)
|
||||
}
|
||||
declare 101 {unix win} {
|
||||
@@ -394,7 +394,7 @@ declare 102 generic {
|
||||
void TclSetupEnv(Tcl_Interp *interp)
|
||||
}
|
||||
declare 103 generic {
|
||||
int TclSockGetPort(Tcl_Interp *interp, char *str, char *proto, \
|
||||
int TclSockGetPort(Tcl_Interp *interp, char *str, char *proto,
|
||||
int *portPtr)
|
||||
}
|
||||
declare 104 {unix win} {
|
||||
@@ -402,7 +402,7 @@ declare 104 {unix win} {
|
||||
}
|
||||
# Replaced by Tcl_FSStat in 8.4:
|
||||
#declare 105 generic {
|
||||
# int TclStat(CONST char *path, struct stat *buf)
|
||||
# int TclStat(CONST char *path, Tcl_StatBuf *buf)
|
||||
#}
|
||||
declare 106 generic {
|
||||
int TclStatDeleteProc(TclStatProc_ *proc)
|
||||
@@ -425,54 +425,54 @@ declare 109 generic {
|
||||
# defined here instead of in tcl.decls since they are not stable yet.
|
||||
|
||||
declare 111 generic {
|
||||
void Tcl_AddInterpResolvers(Tcl_Interp *interp, char *name, \
|
||||
Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, \
|
||||
void Tcl_AddInterpResolvers(Tcl_Interp *interp, char *name,
|
||||
Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc,
|
||||
Tcl_ResolveCompiledVarProc *compiledVarProc)
|
||||
}
|
||||
declare 112 generic {
|
||||
int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \
|
||||
int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 113 generic {
|
||||
Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, CONST char *name, \
|
||||
Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, CONST char *name,
|
||||
ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc)
|
||||
}
|
||||
declare 114 generic {
|
||||
void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr)
|
||||
}
|
||||
declare 115 generic {
|
||||
int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, char *pattern, \
|
||||
int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, char *pattern,
|
||||
int resetListFirst)
|
||||
}
|
||||
declare 116 generic {
|
||||
Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, CONST char *name, \
|
||||
Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, CONST char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags)
|
||||
}
|
||||
declare 117 generic {
|
||||
Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, char *name, \
|
||||
Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags)
|
||||
}
|
||||
declare 118 generic {
|
||||
int Tcl_GetInterpResolvers(Tcl_Interp *interp, char *name, \
|
||||
int Tcl_GetInterpResolvers(Tcl_Interp *interp, char *name,
|
||||
Tcl_ResolverInfo *resInfo)
|
||||
}
|
||||
declare 119 generic {
|
||||
int Tcl_GetNamespaceResolvers(Tcl_Namespace *namespacePtr, \
|
||||
int Tcl_GetNamespaceResolvers(Tcl_Namespace *namespacePtr,
|
||||
Tcl_ResolverInfo *resInfo)
|
||||
}
|
||||
declare 120 generic {
|
||||
Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, char *name, \
|
||||
Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags)
|
||||
}
|
||||
declare 121 generic {
|
||||
int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \
|
||||
int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
char *pattern)
|
||||
}
|
||||
declare 122 generic {
|
||||
Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 123 generic {
|
||||
void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command, \
|
||||
void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command,
|
||||
Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 124 generic {
|
||||
@@ -482,26 +482,26 @@ declare 125 generic {
|
||||
Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp)
|
||||
}
|
||||
declare 126 generic {
|
||||
void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable, \
|
||||
void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable,
|
||||
Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 127 generic {
|
||||
int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, \
|
||||
int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
char *pattern, int allowOverwrite)
|
||||
}
|
||||
declare 128 generic {
|
||||
void Tcl_PopCallFrame(Tcl_Interp* interp)
|
||||
}
|
||||
declare 129 generic {
|
||||
int Tcl_PushCallFrame(Tcl_Interp* interp, Tcl_CallFrame *framePtr, \
|
||||
int Tcl_PushCallFrame(Tcl_Interp* interp, Tcl_CallFrame *framePtr,
|
||||
Tcl_Namespace *nsPtr, int isProcCallFrame)
|
||||
}
|
||||
declare 130 generic {
|
||||
int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, char *name)
|
||||
}
|
||||
declare 131 generic {
|
||||
void Tcl_SetNamespaceResolvers(Tcl_Namespace *namespacePtr, \
|
||||
Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, \
|
||||
void Tcl_SetNamespaceResolvers(Tcl_Namespace *namespacePtr,
|
||||
Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc,
|
||||
Tcl_ResolveCompiledVarProc *compiledVarProc)
|
||||
}
|
||||
declare 132 generic {
|
||||
@@ -511,7 +511,7 @@ declare 133 generic {
|
||||
struct tm * TclpGetDate(TclpTime_t time, int useGMT)
|
||||
}
|
||||
declare 134 generic {
|
||||
size_t TclpStrftime(char *s, size_t maxsize, CONST char *format, \
|
||||
size_t TclpStrftime(char *s, size_t maxsize, CONST char *format,
|
||||
CONST struct tm *t)
|
||||
}
|
||||
declare 135 generic {
|
||||
@@ -527,8 +527,8 @@ declare 138 generic {
|
||||
char * TclGetEnv(CONST char *name, Tcl_DString *valuePtr)
|
||||
}
|
||||
#declare 139 generic {
|
||||
# int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, \
|
||||
# char *sym2, Tcl_PackageInitProc **proc1Ptr, \
|
||||
# int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1,
|
||||
# char *sym2, Tcl_PackageInitProc **proc1Ptr,
|
||||
# Tcl_PackageInitProc **proc2Ptr, ClientData *clientDataPtr)
|
||||
#}
|
||||
declare 140 generic {
|
||||
@@ -539,15 +539,15 @@ declare 141 generic {
|
||||
char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr)
|
||||
}
|
||||
declare 142 generic {
|
||||
int TclSetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr, \
|
||||
int TclSetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
CompileHookProc *hookProc, ClientData clientData)
|
||||
}
|
||||
declare 143 generic {
|
||||
int TclAddLiteralObj(struct CompileEnv *envPtr, Tcl_Obj *objPtr, \
|
||||
int TclAddLiteralObj(struct CompileEnv *envPtr, Tcl_Obj *objPtr,
|
||||
LiteralEntry **litPtrPtr)
|
||||
}
|
||||
declare 144 generic {
|
||||
void TclHideLiteral(Tcl_Interp *interp, struct CompileEnv *envPtr, \
|
||||
void TclHideLiteral(Tcl_Interp *interp, struct CompileEnv *envPtr,
|
||||
int index)
|
||||
}
|
||||
declare 145 generic {
|
||||
@@ -576,7 +576,7 @@ declare 150 generic {
|
||||
int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re)
|
||||
}
|
||||
declare 151 generic {
|
||||
void TclRegExpRangeUniChar(Tcl_RegExp re, int index, int *startPtr, \
|
||||
void TclRegExpRangeUniChar(Tcl_RegExp re, int index, int *startPtr,
|
||||
int *endPtr)
|
||||
}
|
||||
|
||||
@@ -593,13 +593,12 @@ declare 153 generic {
|
||||
# Tcl_Interp *interp, int argc, char **argv)
|
||||
#}
|
||||
#declare 155 generic {
|
||||
# int TclTestChannelEventCmd(ClientData clientData, \
|
||||
# int TclTestChannelEventCmd(ClientData clientData,
|
||||
# Tcl_Interp *interp, int argc, char **argv)
|
||||
#}
|
||||
|
||||
declare 156 generic {
|
||||
void TclRegError (Tcl_Interp *interp, char *msg, \
|
||||
int status)
|
||||
void TclRegError (Tcl_Interp *interp, char *msg, int status)
|
||||
}
|
||||
declare 157 generic {
|
||||
Var * TclVarTraceExists (Tcl_Interp *interp, char *varName)
|
||||
@@ -611,13 +610,13 @@ declare 159 generic {
|
||||
char *TclGetStartupScriptFileName(void)
|
||||
}
|
||||
#declare 160 generic {
|
||||
# int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators, \
|
||||
# int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators,
|
||||
# Tcl_DString *dirPtr, char *pattern, char *tail, GlobTypeData *types)
|
||||
#}
|
||||
|
||||
# new in 8.3.2/8.4a2
|
||||
declare 161 generic {
|
||||
int TclChannelTransform(Tcl_Interp *interp, Tcl_Channel chan, \
|
||||
int TclChannelTransform(Tcl_Interp *interp, Tcl_Channel chan,
|
||||
Tcl_Obj *cmdObjPtr)
|
||||
}
|
||||
declare 162 generic {
|
||||
@@ -660,7 +659,7 @@ declare 5 mac {
|
||||
int FSpSetDefaultDir(FSSpecPtr theSpec)
|
||||
}
|
||||
declare 6 mac {
|
||||
OSErr FSpFindFolder(short vRefNum, OSType folderType, \
|
||||
OSErr FSpFindFolder(short vRefNum, OSType folderType,
|
||||
Boolean createFolder, FSSpec *spec)
|
||||
}
|
||||
declare 7 mac {
|
||||
@@ -672,15 +671,15 @@ declare 7 mac {
|
||||
# however. The first set are from the MoreFiles package.
|
||||
|
||||
declare 8 mac {
|
||||
pascal OSErr FSpGetDirectoryID(CONST FSSpec *spec, long *theDirID, \
|
||||
pascal OSErr FSpGetDirectoryID(CONST FSSpec *spec, long *theDirID,
|
||||
Boolean *isDirectory)
|
||||
}
|
||||
declare 9 mac {
|
||||
pascal short FSpOpenResFileCompat(CONST FSSpec *spec, \
|
||||
pascal short FSpOpenResFileCompat(CONST FSSpec *spec,
|
||||
SignedByte permission)
|
||||
}
|
||||
declare 10 mac {
|
||||
pascal void FSpCreateResFileCompat(CONST FSSpec *spec, OSType creator, \
|
||||
pascal void FSpCreateResFileCompat(CONST FSSpec *spec, OSType creator,
|
||||
OSType fileType, ScriptCode scriptTag)
|
||||
}
|
||||
|
||||
@@ -691,7 +690,7 @@ declare 11 mac {
|
||||
int FSpLocationFromPath(int length, CONST char *path, FSSpecPtr theSpec)
|
||||
}
|
||||
declare 12 mac {
|
||||
OSErr FSpPathFromLocation(FSSpecPtr theSpec, int *length, \
|
||||
OSErr FSpPathFromLocation(FSSpecPtr theSpec, int *length,
|
||||
Handle *fullPath)
|
||||
}
|
||||
|
||||
@@ -719,7 +718,7 @@ declare 19 mac {
|
||||
int TclMacTimerExpired(void *timerToken)
|
||||
}
|
||||
declare 20 mac {
|
||||
int TclMacRegisterResourceFork(short fileRef, Tcl_Obj *tokenPtr, \
|
||||
int TclMacRegisterResourceFork(short fileRef, Tcl_Obj *tokenPtr,
|
||||
int insert)
|
||||
}
|
||||
declare 21 mac {
|
||||
@@ -749,11 +748,11 @@ declare 1 win {
|
||||
void TclWinConvertWSAError(DWORD errCode)
|
||||
}
|
||||
declare 2 win {
|
||||
struct servent * TclWinGetServByName(CONST char *nm, \
|
||||
struct servent * TclWinGetServByName(CONST char *nm,
|
||||
CONST char *proto)
|
||||
}
|
||||
declare 3 win {
|
||||
int TclWinGetSockOpt(SOCKET s, int level, int optname, \
|
||||
int TclWinGetSockOpt(SOCKET s, int level, int optname,
|
||||
char FAR * optval, int FAR *optlen)
|
||||
}
|
||||
declare 4 win {
|
||||
@@ -767,7 +766,7 @@ declare 6 win {
|
||||
u_short TclWinNToHS(u_short ns)
|
||||
}
|
||||
declare 7 win {
|
||||
int TclWinSetSockOpt(SOCKET s, int level, int optname, \
|
||||
int TclWinSetSockOpt(SOCKET s, int level, int optname,
|
||||
CONST char FAR * optval, int optlen)
|
||||
}
|
||||
declare 8 win {
|
||||
@@ -790,15 +789,15 @@ declare 12 win {
|
||||
int TclpCloseFile(TclFile file)
|
||||
}
|
||||
declare 13 win {
|
||||
Tcl_Channel TclpCreateCommandChannel(TclFile readFile, \
|
||||
Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr)
|
||||
}
|
||||
declare 14 win {
|
||||
int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe)
|
||||
}
|
||||
declare 15 win {
|
||||
int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv, \
|
||||
TclFile inputFile, TclFile outputFile, TclFile errorFile, \
|
||||
int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv,
|
||||
TclFile inputFile, TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr)
|
||||
}
|
||||
# Signature changed in 8.1:
|
||||
@@ -858,15 +857,15 @@ declare 1 unix {
|
||||
int TclpCloseFile(TclFile file)
|
||||
}
|
||||
declare 2 unix {
|
||||
Tcl_Channel TclpCreateCommandChannel(TclFile readFile, \
|
||||
Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr)
|
||||
}
|
||||
declare 3 unix {
|
||||
int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe)
|
||||
}
|
||||
declare 4 unix {
|
||||
int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv, \
|
||||
TclFile inputFile, TclFile outputFile, TclFile errorFile, \
|
||||
int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv,
|
||||
TclFile inputFile, TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr)
|
||||
}
|
||||
# Signature changed in 8.1:
|
||||
|
||||
+10
-8
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclInt.h,v 1.64 2001/09/08 14:05:09 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclInt.h,v 1.64.6.7 2001/11/26 23:10:31 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLINT
|
||||
@@ -27,12 +27,12 @@
|
||||
* needed by stdlib.h in some configurations.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef _TCL
|
||||
#include "tcl.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#ifdef NO_LIMITS_H
|
||||
# include "../compat/limits.h"
|
||||
@@ -1185,7 +1185,7 @@ typedef struct Interp {
|
||||
|
||||
/*
|
||||
* Information related to procedures and variables. See tclProc.c
|
||||
* and tclvar.c for usage.
|
||||
* and tclVar.c for usage.
|
||||
*/
|
||||
|
||||
int numLevels; /* Keeps track of how many nested calls to
|
||||
@@ -1572,6 +1572,9 @@ extern Tcl_ObjType tclStringType;
|
||||
extern Tcl_ObjType tclArraySearchType;
|
||||
extern Tcl_ObjType tclIndexType;
|
||||
extern Tcl_ObjType tclNsNameType;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
extern Tcl_ObjType tclWideIntType;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Variables denoting the hash key types defined in the core.
|
||||
@@ -1770,7 +1773,7 @@ EXTERN int TclOpenFileChannelInsertProc _ANSI_ARGS_((
|
||||
EXTERN int TclpObjAccess _ANSI_ARGS_((Tcl_Obj *filename,
|
||||
int mode));
|
||||
EXTERN int TclpObjLstat _ANSI_ARGS_((Tcl_Obj *pathPtr,
|
||||
struct stat *buf));
|
||||
Tcl_StatBuf *buf));
|
||||
EXTERN char * TclpAlloc _ANSI_ARGS_((unsigned int size));
|
||||
EXTERN int TclpCheckStackSpace _ANSI_ARGS_((void));
|
||||
EXTERN Tcl_Obj* TclpTempFileName _ANSI_ARGS_((void));
|
||||
@@ -1840,7 +1843,7 @@ EXTERN Tcl_Obj* TclpObjLink _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_Obj *toPtr));
|
||||
EXTERN int TclpObjChdir _ANSI_ARGS_((Tcl_Obj *pathPtr));
|
||||
EXTERN Tcl_Obj* TclFileDirname _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Tcl_Obj*pathPtr));
|
||||
EXTERN int TclpObjStat _ANSI_ARGS_((Tcl_Obj *pathPtr, struct stat *buf));
|
||||
EXTERN int TclpObjStat _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf));
|
||||
EXTERN Tcl_Channel TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Tcl_Obj *pathPtr, char *modeString,
|
||||
int permissions));
|
||||
@@ -1848,8 +1851,7 @@ EXTERN void TclpPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,
|
||||
format));
|
||||
EXTERN char * TclpReadlink _ANSI_ARGS_((CONST char *fileName,
|
||||
Tcl_DString *linkPtr));
|
||||
EXTERN char * TclpRealloc _ANSI_ARGS_((char *ptr,
|
||||
unsigned int size));
|
||||
EXTERN char * TclpRealloc _ANSI_ARGS_((char *ptr, unsigned int size));
|
||||
EXTERN void TclpReleaseFile _ANSI_ARGS_((TclFile file));
|
||||
EXTERN void TclpSetInitialEncodings _ANSI_ARGS_((void));
|
||||
EXTERN void TclpSetVariables _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclIntDecls.h,v 1.26 2001/08/30 08:53:14 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclIntDecls.h,v 1.26.6.3 2001/09/27 14:56:34 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLINTDECLS
|
||||
|
||||
+2
-2
@@ -9,11 +9,11 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclInterp.c,v 1.7 2001/09/11 00:46:35 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclInterp.c,v 1.7.4.3 2001/10/03 15:16:05 dkf Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "tclInt.h"
|
||||
#include <stdio.h>
|
||||
#include "tclPort.h"
|
||||
|
||||
/*
|
||||
|
||||
+119
-110
@@ -13,7 +13,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclLink.c,v 1.3 1999/04/16 00:46:49 stanton Exp $
|
||||
* RCS: @(#) $Id: tclLink.c,v 1.3.26.1 2001/11/07 13:35:21 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
typedef struct Link {
|
||||
Tcl_Interp *interp; /* Interpreter containing Tcl variable. */
|
||||
char *varName; /* Name of variable (must be global). This
|
||||
Tcl_Obj *varName; /* Name of variable (must be global). This
|
||||
* is needed during trace callbacks, since
|
||||
* the actual variable may be aliased at
|
||||
* that time via upvar. */
|
||||
@@ -35,6 +35,7 @@ typedef struct Link {
|
||||
union {
|
||||
int i;
|
||||
double d;
|
||||
Tcl_WideInt w;
|
||||
} lastValue; /* Last known value of C variable; used to
|
||||
* avoid string conversions. */
|
||||
int flags; /* Miscellaneous one-bit values; see below
|
||||
@@ -61,8 +62,7 @@ typedef struct Link {
|
||||
static char * LinkTraceProc _ANSI_ARGS_((ClientData clientData,
|
||||
Tcl_Interp *interp, char *name1, char *name2,
|
||||
int flags));
|
||||
static char * StringValue _ANSI_ARGS_((Link *linkPtr,
|
||||
char *buffer));
|
||||
static Tcl_Obj * ObjValue _ANSI_ARGS_((Link *linkPtr));
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -96,13 +96,12 @@ Tcl_LinkVar(interp, varName, addr, type)
|
||||
* OR'ed in. */
|
||||
{
|
||||
Link *linkPtr;
|
||||
char buffer[TCL_DOUBLE_SPACE];
|
||||
int code;
|
||||
|
||||
linkPtr = (Link *) ckalloc(sizeof(Link));
|
||||
linkPtr->interp = interp;
|
||||
linkPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1));
|
||||
strcpy(linkPtr->varName, varName);
|
||||
linkPtr->varName = Tcl_NewStringObj(varName, -1);
|
||||
Tcl_IncrRefCount(linkPtr->varName);
|
||||
linkPtr->addr = addr;
|
||||
linkPtr->type = type & ~TCL_LINK_READ_ONLY;
|
||||
if (type & TCL_LINK_READ_ONLY) {
|
||||
@@ -110,9 +109,9 @@ Tcl_LinkVar(interp, varName, addr, type)
|
||||
} else {
|
||||
linkPtr->flags = 0;
|
||||
}
|
||||
if (Tcl_SetVar(interp, varName, StringValue(linkPtr, buffer),
|
||||
if (Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
ckfree(linkPtr->varName);
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
ckfree((char *) linkPtr);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -120,7 +119,7 @@ Tcl_LinkVar(interp, varName, addr, type)
|
||||
|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, LinkTraceProc,
|
||||
(ClientData) linkPtr);
|
||||
if (code != TCL_OK) {
|
||||
ckfree(linkPtr->varName);
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
ckfree((char *) linkPtr);
|
||||
}
|
||||
return code;
|
||||
@@ -159,7 +158,7 @@ Tcl_UnlinkVar(interp, varName)
|
||||
Tcl_UntraceVar(interp, varName,
|
||||
TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
|
||||
LinkTraceProc, (ClientData) linkPtr);
|
||||
ckfree(linkPtr->varName);
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
ckfree((char *) linkPtr);
|
||||
}
|
||||
|
||||
@@ -188,7 +187,6 @@ Tcl_UpdateLinkedVar(interp, varName)
|
||||
char *varName; /* Name of global variable that is linked. */
|
||||
{
|
||||
Link *linkPtr;
|
||||
char buffer[TCL_DOUBLE_SPACE];
|
||||
int savedFlag;
|
||||
|
||||
linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY,
|
||||
@@ -198,7 +196,7 @@ Tcl_UpdateLinkedVar(interp, varName)
|
||||
}
|
||||
savedFlag = linkPtr->flags & LINK_BEING_UPDATED;
|
||||
linkPtr->flags |= LINK_BEING_UPDATED;
|
||||
Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag;
|
||||
}
|
||||
@@ -233,10 +231,9 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
int flags; /* Miscellaneous additional information. */
|
||||
{
|
||||
Link *linkPtr = (Link *) clientData;
|
||||
int changed;
|
||||
char buffer[TCL_DOUBLE_SPACE];
|
||||
int changed, valueLength;
|
||||
char *value, **pp, *result;
|
||||
Tcl_Obj *objPtr;
|
||||
Tcl_Obj *objPtr, *valueObj;
|
||||
|
||||
/*
|
||||
* If the variable is being unset, then just re-create it (with a
|
||||
@@ -245,14 +242,14 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
|
||||
if (flags & TCL_TRACE_UNSETS) {
|
||||
if (flags & TCL_INTERP_DESTROYED) {
|
||||
ckfree(linkPtr->varName);
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
ckfree((char *) linkPtr);
|
||||
} else if (flags & TCL_TRACE_DESTROYED) {
|
||||
Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
Tcl_TraceVar(interp, linkPtr->varName, TCL_GLOBAL_ONLY
|
||||
|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
|
||||
LinkTraceProc, (ClientData) linkPtr);
|
||||
Tcl_TraceVar(interp, Tcl_GetString(linkPtr->varName),
|
||||
TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES
|
||||
|TCL_TRACE_UNSETS, LinkTraceProc, (ClientData) linkPtr);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -275,21 +272,24 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
|
||||
if (flags & TCL_TRACE_READS) {
|
||||
switch (linkPtr->type) {
|
||||
case TCL_LINK_INT:
|
||||
case TCL_LINK_BOOLEAN:
|
||||
changed = *(int *)(linkPtr->addr) != linkPtr->lastValue.i;
|
||||
break;
|
||||
case TCL_LINK_DOUBLE:
|
||||
changed = *(double *)(linkPtr->addr) != linkPtr->lastValue.d;
|
||||
break;
|
||||
case TCL_LINK_STRING:
|
||||
changed = 1;
|
||||
break;
|
||||
default:
|
||||
return "internal error: bad linked variable type";
|
||||
case TCL_LINK_INT:
|
||||
case TCL_LINK_BOOLEAN:
|
||||
changed = *(int *)(linkPtr->addr) != linkPtr->lastValue.i;
|
||||
break;
|
||||
case TCL_LINK_DOUBLE:
|
||||
changed = *(double *)(linkPtr->addr) != linkPtr->lastValue.d;
|
||||
break;
|
||||
case TCL_LINK_WIDE_INT:
|
||||
changed = *(Tcl_WideInt *)(linkPtr->addr) != linkPtr->lastValue.w;
|
||||
break;
|
||||
case TCL_LINK_STRING:
|
||||
changed = 1;
|
||||
break;
|
||||
default:
|
||||
return "internal error: bad linked variable type";
|
||||
}
|
||||
if (changed) {
|
||||
Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
}
|
||||
return NULL;
|
||||
@@ -305,12 +305,12 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
*/
|
||||
|
||||
if (linkPtr->flags & LINK_READ_ONLY) {
|
||||
Tcl_SetVar(interp, linkPtr->varName, StringValue(linkPtr, buffer),
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
return "linked variable is read-only";
|
||||
}
|
||||
value = Tcl_GetVar(interp, linkPtr->varName, TCL_GLOBAL_ONLY);
|
||||
if (value == NULL) {
|
||||
valueObj = Tcl_ObjGetVar2(interp, linkPtr->varName,NULL, TCL_GLOBAL_ONLY);
|
||||
if (valueObj == NULL) {
|
||||
/*
|
||||
* This shouldn't ever happen.
|
||||
*/
|
||||
@@ -323,48 +323,62 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
result = NULL;
|
||||
|
||||
switch (linkPtr->type) {
|
||||
case TCL_LINK_INT:
|
||||
if (Tcl_GetInt(interp, value, &linkPtr->lastValue.i) != TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_SetVar(interp, linkPtr->varName,
|
||||
StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY);
|
||||
result = "variable must have integer value";
|
||||
goto end;
|
||||
}
|
||||
*(int *)(linkPtr->addr) = linkPtr->lastValue.i;
|
||||
break;
|
||||
case TCL_LINK_DOUBLE:
|
||||
if (Tcl_GetDouble(interp, value, &linkPtr->lastValue.d)
|
||||
!= TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_SetVar(interp, linkPtr->varName,
|
||||
StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY);
|
||||
result = "variable must have real value";
|
||||
goto end;
|
||||
}
|
||||
*(double *)(linkPtr->addr) = linkPtr->lastValue.d;
|
||||
break;
|
||||
case TCL_LINK_BOOLEAN:
|
||||
if (Tcl_GetBoolean(interp, value, &linkPtr->lastValue.i)
|
||||
!= TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_SetVar(interp, linkPtr->varName,
|
||||
StringValue(linkPtr, buffer), TCL_GLOBAL_ONLY);
|
||||
result = "variable must have boolean value";
|
||||
goto end;
|
||||
}
|
||||
*(int *)(linkPtr->addr) = linkPtr->lastValue.i;
|
||||
break;
|
||||
case TCL_LINK_STRING:
|
||||
pp = (char **)(linkPtr->addr);
|
||||
if (*pp != NULL) {
|
||||
ckfree(*pp);
|
||||
}
|
||||
*pp = (char *) ckalloc((unsigned) (strlen(value) + 1));
|
||||
strcpy(*pp, value);
|
||||
break;
|
||||
default:
|
||||
return "internal error: bad linked variable type";
|
||||
case TCL_LINK_INT:
|
||||
if (Tcl_GetIntFromObj(interp, valueObj, &linkPtr->lastValue.i)
|
||||
!= TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
result = "variable must have integer value";
|
||||
goto end;
|
||||
}
|
||||
*(int *)(linkPtr->addr) = linkPtr->lastValue.i;
|
||||
break;
|
||||
case TCL_LINK_WIDE_INT:
|
||||
if (Tcl_GetWideIntFromObj(interp, valueObj, &linkPtr->lastValue.w)
|
||||
!= TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
result = "variable must have integer value";
|
||||
goto end;
|
||||
}
|
||||
*(Tcl_WideInt *)(linkPtr->addr) = linkPtr->lastValue.w;
|
||||
break;
|
||||
case TCL_LINK_DOUBLE:
|
||||
if (Tcl_GetDoubleFromObj(interp, valueObj, &linkPtr->lastValue.d)
|
||||
!= TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
result = "variable must have real value";
|
||||
goto end;
|
||||
}
|
||||
*(double *)(linkPtr->addr) = linkPtr->lastValue.d;
|
||||
break;
|
||||
case TCL_LINK_BOOLEAN:
|
||||
if (Tcl_GetBooleanFromObj(interp, valueObj, &linkPtr->lastValue.i)
|
||||
!= TCL_OK) {
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
TCL_GLOBAL_ONLY);
|
||||
result = "variable must have boolean value";
|
||||
goto end;
|
||||
}
|
||||
*(int *)(linkPtr->addr) = linkPtr->lastValue.i;
|
||||
break;
|
||||
case TCL_LINK_STRING:
|
||||
value = Tcl_GetStringFromObj(valueObj, &valueLength);
|
||||
valueLength++;
|
||||
pp = (char **)(linkPtr->addr);
|
||||
if (*pp != NULL) {
|
||||
ckfree(*pp);
|
||||
}
|
||||
*pp = (char *) ckalloc((unsigned) valueLength);
|
||||
memcpy(*pp, value, (unsigned) valueLength);
|
||||
break;
|
||||
default:
|
||||
return "internal error: bad linked variable type";
|
||||
}
|
||||
end:
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
@@ -374,13 +388,13 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* StringValue --
|
||||
* ObjValue --
|
||||
*
|
||||
* Converts the value of a C variable to a string for use in a
|
||||
* Converts the value of a C variable to a Tcl_Obj* for use in a
|
||||
* Tcl variable to which it is linked.
|
||||
*
|
||||
* Results:
|
||||
* The return value is a pointer to a string that represents
|
||||
* The return value is a pointer to a Tcl_Obj that represents
|
||||
* the value of the C variable given by linkPtr.
|
||||
*
|
||||
* Side effects:
|
||||
@@ -389,42 +403,37 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static char *
|
||||
StringValue(linkPtr, buffer)
|
||||
static Tcl_Obj *
|
||||
ObjValue(linkPtr)
|
||||
Link *linkPtr; /* Structure describing linked variable. */
|
||||
char *buffer; /* Small buffer to use for converting
|
||||
* values. Must have TCL_DOUBLE_SPACE
|
||||
* bytes or more. */
|
||||
{
|
||||
char *p;
|
||||
|
||||
switch (linkPtr->type) {
|
||||
case TCL_LINK_INT:
|
||||
linkPtr->lastValue.i = *(int *)(linkPtr->addr);
|
||||
TclFormatInt(buffer, linkPtr->lastValue.i);
|
||||
return buffer;
|
||||
case TCL_LINK_DOUBLE:
|
||||
linkPtr->lastValue.d = *(double *)(linkPtr->addr);
|
||||
Tcl_PrintDouble((Tcl_Interp *) NULL, linkPtr->lastValue.d, buffer);
|
||||
return buffer;
|
||||
case TCL_LINK_BOOLEAN:
|
||||
linkPtr->lastValue.i = *(int *)(linkPtr->addr);
|
||||
if (linkPtr->lastValue.i != 0) {
|
||||
return "1";
|
||||
}
|
||||
return "0";
|
||||
case TCL_LINK_STRING:
|
||||
p = *(char **)(linkPtr->addr);
|
||||
if (p == NULL) {
|
||||
return "NULL";
|
||||
}
|
||||
return p;
|
||||
}
|
||||
case TCL_LINK_INT:
|
||||
linkPtr->lastValue.i = *(int *)(linkPtr->addr);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.i);
|
||||
case TCL_LINK_WIDE_INT:
|
||||
linkPtr->lastValue.w = *(Tcl_WideInt *)(linkPtr->addr);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.w);
|
||||
case TCL_LINK_DOUBLE:
|
||||
linkPtr->lastValue.d = *(double *)(linkPtr->addr);
|
||||
return Tcl_NewDoubleObj(linkPtr->lastValue.d);
|
||||
case TCL_LINK_BOOLEAN:
|
||||
linkPtr->lastValue.i = *(int *)(linkPtr->addr);
|
||||
return Tcl_NewBooleanObj(linkPtr->lastValue.i != 0);
|
||||
case TCL_LINK_STRING:
|
||||
p = *(char **)(linkPtr->addr);
|
||||
if (p == NULL) {
|
||||
return Tcl_NewStringObj("NULL", 4);
|
||||
}
|
||||
return Tcl_NewStringObj(p, -1);
|
||||
|
||||
/*
|
||||
* This code only gets executed if the link type is unknown
|
||||
* (shouldn't ever happen).
|
||||
*/
|
||||
|
||||
return "??";
|
||||
default:
|
||||
return Tcl_NewStringObj("??", 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclListObj.c,v 1.9 2001/04/04 16:07:21 kennykb Exp $
|
||||
* RCS: @(#) $Id: tclListObj.c,v 1.9.12.3 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclLiteral.c,v 1.8 1999/08/19 02:59:10 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclLiteral.c,v 1.8.16.3 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclLoad.c,v 1.6 2001/08/23 17:37:08 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclLoad.c,v 1.6.6.2 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclMain.c,v 1.12 2001/04/04 23:26:03 dgp Exp $
|
||||
* RCS: @(#) $Id: tclMain.c,v 1.12.12.2 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclNamesp.c,v 1.25 2001/06/28 12:43:33 msofer Exp $
|
||||
* RCS: @(#) $Id: tclNamesp.c,v 1.25.6.2 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+417
-7
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclObj.c,v 1.23 2001/06/28 01:22:21 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclObj.c,v 1.23.6.13 2001/10/23 13:14:38 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -62,6 +62,11 @@ static int SetIntFromAny _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
static void UpdateStringOfBoolean _ANSI_ARGS_((Tcl_Obj *objPtr));
|
||||
static void UpdateStringOfDouble _ANSI_ARGS_((Tcl_Obj *objPtr));
|
||||
static void UpdateStringOfInt _ANSI_ARGS_((Tcl_Obj *objPtr));
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
static int SetWideIntFromAny _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr));
|
||||
static void UpdateStringOfWideInt _ANSI_ARGS_((Tcl_Obj *objPtr));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Prototypes for the array hash key methods.
|
||||
@@ -108,6 +113,16 @@ Tcl_ObjType tclIntType = {
|
||||
SetIntFromAny /* setFromAnyProc */
|
||||
};
|
||||
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_ObjType tclWideIntType = {
|
||||
"wideInt", /* name */
|
||||
(Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */
|
||||
(Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */
|
||||
UpdateStringOfWideInt, /* updateStringProc */
|
||||
SetWideIntFromAny /* setFromAnyProc */
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The structure below defines the Tcl obj hash key type.
|
||||
*/
|
||||
@@ -151,6 +166,9 @@ TclInitObjSubsystem()
|
||||
Tcl_RegisterObjType(&tclByteArrayType);
|
||||
Tcl_RegisterObjType(&tclDoubleType);
|
||||
Tcl_RegisterObjType(&tclIntType);
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_RegisterObjType(&tclWideIntType);
|
||||
#endif
|
||||
Tcl_RegisterObjType(&tclStringType);
|
||||
Tcl_RegisterObjType(&tclListType);
|
||||
Tcl_RegisterObjType(&tclByteCodeType);
|
||||
@@ -758,11 +776,11 @@ Tcl_GetString(objPtr)
|
||||
|
||||
char *
|
||||
Tcl_GetStringFromObj(objPtr, lengthPtr)
|
||||
register Tcl_Obj *objPtr; /* Object whose string rep byte pointer
|
||||
* should be returned. */
|
||||
register int *lengthPtr; /* If non-NULL, the location where the
|
||||
* string rep's byte array length should be
|
||||
* stored. If NULL, no length is stored. */
|
||||
register Tcl_Obj *objPtr; /* Object whose string rep byte pointer should
|
||||
* be returned. */
|
||||
register int *lengthPtr; /* If non-NULL, the location where the string
|
||||
* rep's byte array length should * be stored.
|
||||
* If NULL, no length is stored. */
|
||||
{
|
||||
if (objPtr->bytes == NULL) {
|
||||
if (objPtr->typePtr->updateStringProc == NULL) {
|
||||
@@ -1024,7 +1042,6 @@ SetBooleanFromAny(interp, objPtr)
|
||||
char lowerCase[10];
|
||||
int newBool, length;
|
||||
register int i;
|
||||
double dbl;
|
||||
|
||||
/*
|
||||
* Get the string representation. Make it up-to-date if necessary.
|
||||
@@ -1080,6 +1097,24 @@ SetBooleanFromAny(interp, objPtr)
|
||||
goto badBoolean;
|
||||
}
|
||||
} else {
|
||||
double dbl;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_WideInt wide = strtoll(string, &end, 0);
|
||||
if (end != string) {
|
||||
/*
|
||||
* Make sure the string has no garbage after the end of
|
||||
* the wide int.
|
||||
*/
|
||||
while ((end < (string+length))
|
||||
&& isspace(UCHAR(*end))) { /* INTL: ISO only */
|
||||
end++;
|
||||
}
|
||||
if (end == (string+length)) {
|
||||
newBool = (wide != Tcl_LongAsWide(0));
|
||||
goto goodBoolean;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Still might be a string containing the characters representing an
|
||||
* int or double that wasn't handled above. This would be a string
|
||||
@@ -1114,6 +1149,7 @@ SetBooleanFromAny(interp, objPtr)
|
||||
* Tcl_GetStringFromObj, to use that old internalRep.
|
||||
*/
|
||||
|
||||
goodBoolean:
|
||||
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
|
||||
oldTypePtr->freeIntRepProc(objPtr);
|
||||
}
|
||||
@@ -1989,6 +2025,380 @@ Tcl_GetLongFromObj(interp, objPtr, longPtr)
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* SetWideIntFromAny --
|
||||
*
|
||||
* Attempt to generate an integer internal form for the Tcl object
|
||||
* "objPtr".
|
||||
*
|
||||
* Results:
|
||||
* The return value is a standard object Tcl result. If an error occurs
|
||||
* during conversion, an error message is left in the interpreter's
|
||||
* result unless "interp" is NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* If no error occurs, an int is stored as "objPtr"s internal
|
||||
* representation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
static int
|
||||
SetWideIntFromAny(interp, objPtr)
|
||||
Tcl_Interp *interp; /* Used for error reporting if not NULL. */
|
||||
register Tcl_Obj *objPtr; /* The object to convert. */
|
||||
{
|
||||
Tcl_ObjType *oldTypePtr = objPtr->typePtr;
|
||||
char *string, *end;
|
||||
int length;
|
||||
register char *p;
|
||||
Tcl_WideInt newWide;
|
||||
|
||||
/*
|
||||
* Get the string representation. Make it up-to-date if necessary.
|
||||
*/
|
||||
|
||||
string = Tcl_GetStringFromObj(objPtr, &length);
|
||||
|
||||
/*
|
||||
* Now parse "objPtr"s string as an int. We use an implementation here
|
||||
* that doesn't report errors in interp if interp is NULL. Note: use
|
||||
* strtoull instead of strtoll for integer conversions to allow full-size
|
||||
* unsigned numbers, but don't depend on strtoull to handle sign
|
||||
* characters; it won't in some implementations.
|
||||
*/
|
||||
|
||||
errno = 0;
|
||||
for (p = string; isspace(UCHAR(*p)); p++) { /* INTL: ISO space. */
|
||||
/* Empty loop body. */
|
||||
}
|
||||
if (*p == '-') {
|
||||
p++;
|
||||
newWide = -((Tcl_WideInt)strtoull(p, &end, 0));
|
||||
} else if (*p == '+') {
|
||||
p++;
|
||||
newWide = strtoull(p, &end, 0);
|
||||
} else {
|
||||
newWide = strtoull(p, &end, 0);
|
||||
}
|
||||
if (end == p) {
|
||||
badInteger:
|
||||
if (interp != NULL) {
|
||||
/*
|
||||
* Must copy string before resetting the result in case a caller
|
||||
* is trying to convert the interpreter's result to an int.
|
||||
*/
|
||||
|
||||
char buf[100];
|
||||
sprintf(buf, "expected integer but got \"%.50s\"", string);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendToObj(Tcl_GetObjResult(interp), buf, -1);
|
||||
TclCheckBadOctal(interp, string);
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (errno == ERANGE) {
|
||||
if (interp != NULL) {
|
||||
char *s = "integer value too large to represent";
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendToObj(Tcl_GetObjResult(interp), s, -1);
|
||||
Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (char *) NULL);
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that the string has no garbage after the end of the int.
|
||||
*/
|
||||
|
||||
while ((end < (string+length))
|
||||
&& isspace(UCHAR(*end))) { /* INTL: ISO space. */
|
||||
end++;
|
||||
}
|
||||
if (end != (string+length)) {
|
||||
goto badInteger;
|
||||
}
|
||||
|
||||
/*
|
||||
* The conversion to int succeeded. Free the old internalRep before
|
||||
* setting the new one. We do this as late as possible to allow the
|
||||
* conversion code, in particular Tcl_GetStringFromObj, to use that old
|
||||
* internalRep.
|
||||
*/
|
||||
|
||||
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
|
||||
oldTypePtr->freeIntRepProc(objPtr);
|
||||
}
|
||||
|
||||
objPtr->internalRep.wideValue = newWide;
|
||||
objPtr->typePtr = &tclWideIntType;
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* UpdateStringOfWideInt --
|
||||
*
|
||||
* Update the string representation for a wide integer object.
|
||||
* Note: This procedure does not free an existing old string rep
|
||||
* so storage will be lost if this has not already been done.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's string is set to a valid string that results from
|
||||
* the wideInt-to-string conversion.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
static void
|
||||
UpdateStringOfWideInt(objPtr)
|
||||
register Tcl_Obj *objPtr; /* Int object whose string rep to update. */
|
||||
{
|
||||
char buffer[TCL_INTEGER_SPACE+2];
|
||||
register unsigned len;
|
||||
register Tcl_WideInt wideVal = objPtr->internalRep.wideValue;
|
||||
|
||||
sprintf(buffer, "%" TCL_LL_MODIFIER "d", wideVal);
|
||||
len = strlen(buffer);
|
||||
objPtr->bytes = ckalloc((unsigned) len + 1);
|
||||
memcpy(objPtr->bytes, buffer, len + 1);
|
||||
objPtr->length = len;
|
||||
}
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_NewWideIntObj --
|
||||
*
|
||||
* If a client is compiled with TCL_MEM_DEBUG defined, calls to
|
||||
* Tcl_NewWideIntObj to create a new 64-bit integer object end up calling
|
||||
* the debugging procedure Tcl_DbNewWideIntObj instead.
|
||||
*
|
||||
* Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
|
||||
* calls to Tcl_NewWideIntObj result in a call to one of the two
|
||||
* Tcl_NewWideIntObj 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
#undef Tcl_NewWideIntObj
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewWideIntObj(wideValue)
|
||||
register Tcl_WideInt wideValue; /* Wide integer used to initialize
|
||||
* the new object. */
|
||||
{
|
||||
return Tcl_DbNewWideIntObj(wideValue, "unknown", 0);
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewWideIntObj(wideValue)
|
||||
register Tcl_WideInt wideValue; /* Wide integer used to initialize
|
||||
* the new object. */
|
||||
{
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
return Tcl_NewLongObj(wideValue);
|
||||
#else
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr->bytes = NULL;
|
||||
|
||||
objPtr->internalRep.wideValue = wideValue;
|
||||
objPtr->typePtr = &tclWideIntType;
|
||||
return objPtr;
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
}
|
||||
#endif /* if TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbNewWideIntObj --
|
||||
*
|
||||
* If a client is compiled with TCL_MEM_DEBUG defined, calls to
|
||||
* Tcl_NewWideIntObj to create new wide integer end up calling
|
||||
* the debugging procedure Tcl_DbNewWideIntObj instead. We
|
||||
* provide two implementations of Tcl_DbNewWideIntObj 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_DbNewWideIntObj calls Tcl_DbCkalloc directly with the file
|
||||
* name and line number from its caller. This simplifies
|
||||
* debugging since then the checkmem 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 procedure just returns the result of calling Tcl_NewWideIntObj.
|
||||
*
|
||||
* Results:
|
||||
* The newly created wide integer object is returned. This object
|
||||
* will have an invalid string representation. The returned object has
|
||||
* ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* Allocates memory.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_DbNewWideIntObj(wideValue, file, line)
|
||||
register Tcl_WideInt wideValue; /* Wide integer used to initialize
|
||||
* the new object. */
|
||||
CONST char *file; /* The name of the source file
|
||||
* calling this procedure; used for
|
||||
* debugging. */
|
||||
int line; /* Line number in the source file;
|
||||
* used for debugging. */
|
||||
{
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
return Tcl_DbNewLongObj(wideValue, file, line);
|
||||
#else
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclDbNewObj(objPtr, file, line);
|
||||
objPtr->bytes = NULL;
|
||||
|
||||
objPtr->internalRep.wideValue = wideValue;
|
||||
objPtr->typePtr = &tclWideIntType;
|
||||
return objPtr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_DbNewWideIntObj(wideValue, file, line)
|
||||
register Tcl_WideInt wideValue; /* Long integer used to initialize
|
||||
* the new object. */
|
||||
CONST char *file; /* The name of the source file
|
||||
* calling this procedure; used for
|
||||
* debugging. */
|
||||
int line; /* Line number in the source file;
|
||||
* used for debugging. */
|
||||
{
|
||||
return Tcl_NewWideIntObj(wideValue);
|
||||
}
|
||||
#endif /* TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetWideIntObj --
|
||||
*
|
||||
* Modify an object to be a wide integer object and to have the
|
||||
* specified wide integer value.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's old string rep, if any, is freed. Also, any old
|
||||
* internal rep is freed.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
Tcl_SetWideIntObj(objPtr, wideValue)
|
||||
register Tcl_Obj *objPtr; /* Object w. internal rep to init. */
|
||||
register Tcl_WideInt wideValue; /* Wide integer used to initialize
|
||||
* the object's value. */
|
||||
{
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_SetLongObj(objPtr, wideValue);
|
||||
#else
|
||||
register Tcl_ObjType *oldTypePtr = objPtr->typePtr;
|
||||
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
panic("Tcl_SetWideIntObj called with shared object");
|
||||
}
|
||||
|
||||
if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) {
|
||||
oldTypePtr->freeIntRepProc(objPtr);
|
||||
}
|
||||
|
||||
objPtr->internalRep.wideValue = wideValue;
|
||||
objPtr->typePtr = &tclWideIntType;
|
||||
Tcl_InvalidateStringRep(objPtr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_GetWideIntFromObj --
|
||||
*
|
||||
* Attempt to return a wide integer from the Tcl object "objPtr". If
|
||||
* the object is not already a wide int object, an attempt will be made
|
||||
* to convert it to one.
|
||||
*
|
||||
* Results:
|
||||
* The return value is a standard Tcl object result. If an error occurs
|
||||
* during conversion, an error message is left in the interpreter's
|
||||
* result unless "interp" is NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* If the object is not already an int object, the conversion will free
|
||||
* any old internal representation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_GetWideIntFromObj(interp, objPtr, wideIntPtr)
|
||||
Tcl_Interp *interp; /* Used for error reporting if not NULL. */
|
||||
register Tcl_Obj *objPtr; /* Object from which to get a wide int. */
|
||||
register Tcl_WideInt *wideIntPtr; /* Place to store resulting long. */
|
||||
{
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
/*
|
||||
* Next line is type-safe because we only do this when long = Tcl_WideInt
|
||||
*/
|
||||
return Tcl_GetLongFromObj(interp, objPtr, wideIntPtr);
|
||||
#else
|
||||
register int result;
|
||||
|
||||
if (objPtr->typePtr == &tclWideIntType) {
|
||||
*wideIntPtr = objPtr->internalRep.wideValue;
|
||||
return TCL_OK;
|
||||
}
|
||||
result = SetWideIntFromAny(interp, objPtr);
|
||||
if (result == TCL_OK) {
|
||||
*wideIntPtr = objPtr->internalRep.wideValue;
|
||||
}
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclParse.c,v 1.16 2001/09/13 11:56:20 msofer Exp $
|
||||
* RCS: @(#) $Id: tclParse.c,v 1.16.2.3 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclParseExpr.c,v 1.8 2001/04/09 09:48:41 dkf Exp $
|
||||
* RCS: @(#) $Id: tclParseExpr.c,v 1.8.10.1 2001/10/11 13:45:19 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -1514,7 +1514,11 @@ GetLexeme(infoPtr)
|
||||
startsWithDigit = isdigit(UCHAR(c)); /* INTL: digit */
|
||||
if (startsWithDigit && TclLooksLikeInt(src, -1)) {
|
||||
errno = 0;
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
(void) strtoul(src, &termPtr, 0);
|
||||
#else
|
||||
(void) strtoull(src, &termPtr, 0);
|
||||
#endif
|
||||
if (errno == ERANGE) {
|
||||
if (interp != NULL) {
|
||||
char *s = "integer value too large to represent";
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclPipe.c,v 1.3 1999/04/16 00:46:51 stanton Exp $
|
||||
* RCS: @(#) $Id: tclPipe.c,v 1.3.26.1 2001/09/26 14:23:10 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -371,7 +371,7 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
|
||||
int count;
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
Tcl_Seek(errorChan, 0L, SEEK_SET);
|
||||
Tcl_Seek(errorChan, (Tcl_WideInt)0, SEEK_SET);
|
||||
objPtr = Tcl_NewObj();
|
||||
count = Tcl_ReadChars(errorChan, objPtr, -1, 0);
|
||||
if (count < 0) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclPkg.c,v 1.7 2001/08/06 19:13:29 dgp Exp $
|
||||
* RCS: @(#) $Id: tclPkg.c,v 1.7.6.2 2001/09/27 13:56:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+17
-5
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclPort.h,v 1.5 1999/05/25 01:00:27 stanton Exp $
|
||||
* RCS: @(#) $Id: tclPort.h,v 1.5.24.1 2001/10/15 10:52:39 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLPORT
|
||||
@@ -22,10 +22,22 @@
|
||||
# include "../win/tclWinPort.h"
|
||||
#else
|
||||
# if defined(MAC_TCL)
|
||||
# include "tclMacPort.h"
|
||||
# else
|
||||
# include "../unix/tclUnixPort.h"
|
||||
# endif
|
||||
# include "tclMacPort.h"
|
||||
# else
|
||||
# include "../unix/tclUnixPort.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(TCL_WIDE_INT_IS_LONG) && !defined(LLONG_MIN)
|
||||
# ifdef LLONG_BIT
|
||||
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<(LLONG_BIT-1)))
|
||||
# else
|
||||
/* Assume we're on a system with a 64-bit 'long long' type */
|
||||
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<63))
|
||||
# endif
|
||||
/* Assume that if LLONG_MIN is undefined, then so is LLONG_MAX */
|
||||
# define LLONG_MAX (~LLONG_MIN)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _TCLPORT */
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclProc.c,v 1.28 2001/09/17 11:51:59 msofer Exp $
|
||||
* RCS: @(#) $Id: tclProc.c,v 1.28.2.3 2001/09/27 14:51:01 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -185,7 +185,7 @@ Tcl_ProcObjCmd(dummy, interp, objc, objv)
|
||||
|
||||
txt = Tcl_GetString(objv[3]);
|
||||
while(*txt != '\0') {
|
||||
if (!isspace(*txt)) {
|
||||
if (!isspace(UCHAR(*txt))) { /* INTL: ISO-space */
|
||||
goto done;
|
||||
}
|
||||
txt++;
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclRegexp.c,v 1.11 2001/05/21 22:32:01 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclRegexp.c,v 1.11.8.3 2001/09/27 13:52:28 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclResult.c,v 1.4 1999/10/21 02:16:22 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclResult.c,v 1.4.16.2 2001/09/27 13:52:28 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+101
-26
@@ -8,10 +8,14 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclScan.c,v 1.8 2001/09/20 01:03:08 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclScan.c,v 1.8.2.7 2001/10/18 14:19:39 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
/*
|
||||
* For strtoll() and strtoull() declarations on some platforms...
|
||||
*/
|
||||
#include "tclPort.h"
|
||||
|
||||
/*
|
||||
* Flag values used by Tcl_ScanObjCmd.
|
||||
@@ -29,6 +33,7 @@
|
||||
#define SCAN_PTOK 0x100 /* Decimal point is allowed. */
|
||||
#define SCAN_EXPOK 0x200 /* An exponent is allowed. */
|
||||
|
||||
#define SCAN_LONGER 0x400 /* Asked for a wide value. */
|
||||
|
||||
/*
|
||||
* The following structure contains the information associated with
|
||||
@@ -270,6 +275,7 @@ ValidateFormat(interp, format, numVars, totalSubs)
|
||||
int staticAssign[STATIC_LIST_SIZE];
|
||||
int *nassign = staticAssign;
|
||||
int objIndex, xpgSize, nspace = STATIC_LIST_SIZE;
|
||||
char buf[TCL_UTF_MAX+1];
|
||||
|
||||
/*
|
||||
* Initialize an array that records the number of times a variable
|
||||
@@ -359,10 +365,16 @@ ValidateFormat(interp, format, numVars, totalSubs)
|
||||
}
|
||||
|
||||
/*
|
||||
* Ignore size specifier.
|
||||
* Handle any size specifier.
|
||||
*/
|
||||
|
||||
if ((ch == 'l') || (ch == 'L') || (ch == 'h')) {
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
case 'L':
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
flags |= SCAN_LONGER;
|
||||
#endif
|
||||
case 'h':
|
||||
format += Tcl_UtfToUniChar(format, &ch);
|
||||
}
|
||||
|
||||
@@ -375,24 +387,45 @@ ValidateFormat(interp, format, numVars, totalSubs)
|
||||
*/
|
||||
|
||||
switch (ch) {
|
||||
case 'n':
|
||||
case 'd':
|
||||
case 'i':
|
||||
case 'o':
|
||||
case 'x':
|
||||
case 'u':
|
||||
case 'f':
|
||||
case 'e':
|
||||
case 'g':
|
||||
case 's':
|
||||
break;
|
||||
case 'c':
|
||||
if (flags & SCAN_WIDTH) {
|
||||
Tcl_SetResult(interp, "field width may not be specified in %c conversion", TCL_STATIC);
|
||||
Tcl_SetResult(interp,
|
||||
"field width may not be specified in %c conversion",
|
||||
TCL_STATIC);
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* Fall through!
|
||||
*/
|
||||
case 'n':
|
||||
case 's':
|
||||
if (flags & SCAN_LONGER) {
|
||||
invalidLonger:
|
||||
buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
"'l' modifier may not be specified in %", buf,
|
||||
" conversion", NULL);
|
||||
goto error;
|
||||
}
|
||||
/*
|
||||
* Fall through!
|
||||
*/
|
||||
case 'd':
|
||||
case 'e':
|
||||
case 'f':
|
||||
case 'g':
|
||||
case 'i':
|
||||
case 'o':
|
||||
case 'u':
|
||||
case 'x':
|
||||
break;
|
||||
/*
|
||||
* Bracket terms need special checking
|
||||
*/
|
||||
case '[':
|
||||
if (flags & SCAN_LONGER) {
|
||||
goto invalidLonger;
|
||||
}
|
||||
if (*format == '\0') {
|
||||
goto badSet;
|
||||
}
|
||||
@@ -547,6 +580,10 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv)
|
||||
int underflow = 0;
|
||||
size_t width;
|
||||
long (*fn)() = NULL;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_WideInt (*lfn)() = NULL;
|
||||
Tcl_WideInt wideValue;
|
||||
#endif
|
||||
Tcl_UniChar ch, sch;
|
||||
Tcl_Obj **objs = NULL, *objPtr = NULL;
|
||||
int flags;
|
||||
@@ -661,10 +698,16 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
/*
|
||||
* Ignore size specifier.
|
||||
* Handle any size specifier.
|
||||
*/
|
||||
|
||||
if ((ch == 'l') || (ch == 'L') || (ch == 'h')) {
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
case 'L':
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
flags |= SCAN_LONGER;
|
||||
#endif
|
||||
case 'h':
|
||||
format += Tcl_UtfToUniChar(format, &ch);
|
||||
}
|
||||
|
||||
@@ -686,27 +729,42 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv)
|
||||
op = 'i';
|
||||
base = 10;
|
||||
fn = (long (*)())strtol;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
lfn = (Tcl_WideInt (*)())strtoll;
|
||||
#endif
|
||||
break;
|
||||
case 'i':
|
||||
op = 'i';
|
||||
base = 0;
|
||||
fn = (long (*)())strtol;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
lfn = (Tcl_WideInt (*)())strtoll;
|
||||
#endif
|
||||
break;
|
||||
case 'o':
|
||||
op = 'i';
|
||||
base = 8;
|
||||
fn = (long (*)())strtoul;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
lfn = (Tcl_WideInt (*)())strtoull;
|
||||
#endif
|
||||
break;
|
||||
case 'x':
|
||||
op = 'i';
|
||||
base = 16;
|
||||
fn = (long (*)())strtoul;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
lfn = (Tcl_WideInt (*)())strtoull;
|
||||
#endif
|
||||
break;
|
||||
case 'u':
|
||||
op = 'i';
|
||||
base = 10;
|
||||
flags |= SCAN_UNSIGNED;
|
||||
fn = (long (*)())strtoul;
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
lfn = (Tcl_WideInt (*)())strtoull;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
@@ -955,17 +1013,33 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv)
|
||||
|
||||
if (!(flags & SCAN_SUPPRESS)) {
|
||||
*end = '\0';
|
||||
value = (long) (*fn)(buf, NULL, base);
|
||||
if ((flags & SCAN_UNSIGNED) && (value < 0)) {
|
||||
sprintf(buf, "%lu", value); /* INTL: ISO digit */
|
||||
objPtr = Tcl_NewStringObj(buf, -1);
|
||||
} else {
|
||||
if ((unsigned long) value > UINT_MAX) {
|
||||
objPtr = Tcl_NewLongObj(value);
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
if (flags & SCAN_LONGER) {
|
||||
wideValue = (Tcl_WideInt) (*lfn)(buf, NULL, base);
|
||||
if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
|
||||
/* INTL: ISO digit */
|
||||
sprintf(buf, "%" TCL_LL_MODIFIER "u",
|
||||
(Tcl_WideUInt)wideValue);
|
||||
objPtr = Tcl_NewStringObj(buf, -1);
|
||||
} else {
|
||||
objPtr = Tcl_NewIntObj(value);
|
||||
objPtr = Tcl_NewWideIntObj(wideValue);
|
||||
}
|
||||
} else {
|
||||
#endif /* !TCL_WIDE_INT_IS_LONG */
|
||||
value = (long) (*fn)(buf, NULL, base);
|
||||
if ((flags & SCAN_UNSIGNED) && (value < 0)) {
|
||||
sprintf(buf, "%lu", value); /* INTL: ISO digit */
|
||||
objPtr = Tcl_NewStringObj(buf, -1);
|
||||
} else {
|
||||
if ((unsigned long) value > UINT_MAX) {
|
||||
objPtr = Tcl_NewLongObj(value);
|
||||
} else {
|
||||
objPtr = Tcl_NewIntObj(value);
|
||||
}
|
||||
}
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
}
|
||||
#endif
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
objs[objIndex++] = objPtr;
|
||||
}
|
||||
@@ -980,6 +1054,7 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv)
|
||||
if ((width == 0) || (width > sizeof(buf) - 1)) {
|
||||
width = sizeof(buf) - 1;
|
||||
}
|
||||
flags &= ~SCAN_LONGER;
|
||||
flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_PTOK | SCAN_EXPOK;
|
||||
for (end = buf; width > 0; width--) {
|
||||
switch (*string) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclStringObj.c,v 1.21 2001/05/15 21:30:46 hobbs Exp $ */
|
||||
* RCS: @(#) $Id: tclStringObj.c,v 1.21.8.3 2001/09/27 13:52:28 dkf Exp $ */
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
|
||||
+10
-3
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclStubInit.c,v 1.61 2001/09/13 11:56:20 msofer Exp $
|
||||
* RCS: @(#) $Id: tclStubInit.c,v 1.61.2.2 2001/11/05 14:23:16 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -617,7 +617,7 @@ TclStubs tclStubs = {
|
||||
Tcl_ResetResult, /* 217 */
|
||||
Tcl_ScanElement, /* 218 */
|
||||
Tcl_ScanCountedElement, /* 219 */
|
||||
Tcl_Seek, /* 220 */
|
||||
Tcl_SeekOld, /* 220 */
|
||||
Tcl_ServiceAll, /* 221 */
|
||||
Tcl_ServiceEvent, /* 222 */
|
||||
Tcl_SetAssocData, /* 223 */
|
||||
@@ -643,7 +643,7 @@ TclStubs tclStubs = {
|
||||
Tcl_SplitPath, /* 243 */
|
||||
Tcl_StaticPackage, /* 244 */
|
||||
Tcl_StringMatch, /* 245 */
|
||||
Tcl_Tell, /* 246 */
|
||||
Tcl_TellOld, /* 246 */
|
||||
Tcl_TraceVar, /* 247 */
|
||||
Tcl_TraceVar2, /* 248 */
|
||||
Tcl_TranslateFileName, /* 249 */
|
||||
@@ -879,6 +879,13 @@ TclStubs tclStubs = {
|
||||
Tcl_OutputBuffered, /* 479 */
|
||||
Tcl_FSMountsChanged, /* 480 */
|
||||
Tcl_EvalTokensStandard, /* 481 */
|
||||
Tcl_DbNewWideIntObj, /* 482 */
|
||||
Tcl_GetWideIntFromObj, /* 483 */
|
||||
Tcl_NewWideIntObj, /* 484 */
|
||||
Tcl_SetWideIntObj, /* 485 */
|
||||
Tcl_AllocStatBuf, /* 486 */
|
||||
Tcl_Seek, /* 487 */
|
||||
Tcl_Tell, /* 488 */
|
||||
};
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
+150
-15
@@ -13,7 +13,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclTest.c,v 1.31 2001/09/20 01:00:10 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclTest.c,v 1.31.2.6 2001/11/27 09:54:05 dkf Exp $
|
||||
*/
|
||||
|
||||
#define TCL_TEST
|
||||
@@ -1974,22 +1974,31 @@ TestlinkCmd(dummy, interp, argc, argv)
|
||||
static int intVar = 43;
|
||||
static int boolVar = 4;
|
||||
static double realVar = 1.23;
|
||||
static Tcl_WideInt wideVar = Tcl_LongAsWide(79);
|
||||
static char *stringVar = NULL;
|
||||
static int created = 0;
|
||||
char buffer[TCL_DOUBLE_SPACE];
|
||||
char buffer[2*TCL_DOUBLE_SPACE];
|
||||
int writable, flag;
|
||||
Tcl_Obj *tmp;
|
||||
|
||||
if (argc < 2) {
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
|
||||
" option ?arg arg arg?\"", (char *) NULL);
|
||||
" option ?arg arg arg arg arg?\"", (char *) NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (strcmp(argv[1], "create") == 0) {
|
||||
if (argc != 7) {
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"",
|
||||
argv[0], " ", argv[1],
|
||||
" intRO realRO boolRO stringRO wideRO\"", (char *) NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (created) {
|
||||
Tcl_UnlinkVar(interp, "int");
|
||||
Tcl_UnlinkVar(interp, "real");
|
||||
Tcl_UnlinkVar(interp, "bool");
|
||||
Tcl_UnlinkVar(interp, "string");
|
||||
Tcl_UnlinkVar(interp, "wide");
|
||||
}
|
||||
created = 1;
|
||||
if (Tcl_GetBoolean(interp, argv[2], &writable) != TCL_OK) {
|
||||
@@ -2024,11 +2033,20 @@ TestlinkCmd(dummy, interp, argc, argv)
|
||||
TCL_LINK_STRING | flag) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_GetBoolean(interp, argv[6], &writable) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
|
||||
if (Tcl_LinkVar(interp, "wide", (char *) &wideVar,
|
||||
TCL_LINK_WIDE_INT | flag) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
} else if (strcmp(argv[1], "delete") == 0) {
|
||||
Tcl_UnlinkVar(interp, "int");
|
||||
Tcl_UnlinkVar(interp, "real");
|
||||
Tcl_UnlinkVar(interp, "bool");
|
||||
Tcl_UnlinkVar(interp, "string");
|
||||
Tcl_UnlinkVar(interp, "wide");
|
||||
created = 0;
|
||||
} else if (strcmp(argv[1], "get") == 0) {
|
||||
TclFormatInt(buffer, intVar);
|
||||
@@ -2038,11 +2056,18 @@ TestlinkCmd(dummy, interp, argc, argv)
|
||||
TclFormatInt(buffer, boolVar);
|
||||
Tcl_AppendElement(interp, buffer);
|
||||
Tcl_AppendElement(interp, (stringVar == NULL) ? "-" : stringVar);
|
||||
/*
|
||||
* Wide ints only have an object-based interface.
|
||||
*/
|
||||
tmp = Tcl_NewWideIntObj(wideVar);
|
||||
Tcl_AppendElement(interp, Tcl_GetString(tmp));
|
||||
Tcl_DecrRefCount(tmp);
|
||||
} else if (strcmp(argv[1], "set") == 0) {
|
||||
if (argc != 6) {
|
||||
if (argc != 7) {
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"",
|
||||
argv[0], " ", argv[1],
|
||||
"intValue realValue boolValue stringValue\"", (char *) NULL);
|
||||
argv[0], " ", argv[1],
|
||||
" intValue realValue boolValue stringValue wideValue\"",
|
||||
(char *) NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (argv[2][0] != 0) {
|
||||
@@ -2071,11 +2096,20 @@ TestlinkCmd(dummy, interp, argc, argv)
|
||||
strcpy(stringVar, argv[5]);
|
||||
}
|
||||
}
|
||||
if (argv[6][0] != 0) {
|
||||
tmp = Tcl_NewStringObj(argv[6], -1);
|
||||
if (Tcl_GetWideIntFromObj(interp, tmp, &wideVar) != TCL_OK) {
|
||||
Tcl_DecrRefCount(tmp);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_DecrRefCount(tmp);
|
||||
}
|
||||
} else if (strcmp(argv[1], "update") == 0) {
|
||||
if (argc != 6) {
|
||||
if (argc != 7) {
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"",
|
||||
argv[0], " ", argv[1],
|
||||
"intValue realValue boolValue stringValue\"", (char *) NULL);
|
||||
argv[0], " ", argv[1],
|
||||
"intValue realValue boolValue stringValue wideValue\"",
|
||||
(char *) NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (argv[2][0] != 0) {
|
||||
@@ -2108,6 +2142,15 @@ TestlinkCmd(dummy, interp, argc, argv)
|
||||
}
|
||||
Tcl_UpdateLinkedVar(interp, "string");
|
||||
}
|
||||
if (argv[6][0] != 0) {
|
||||
tmp = Tcl_NewStringObj(argv[6], -1);
|
||||
if (Tcl_GetWideIntFromObj(interp, tmp, &wideVar) != TCL_OK) {
|
||||
Tcl_DecrRefCount(tmp);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_DecrRefCount(tmp);
|
||||
Tcl_UpdateLinkedVar(interp, "wide");
|
||||
}
|
||||
} else {
|
||||
Tcl_AppendResult(interp, "bad option \"", argv[1],
|
||||
"\": should be create, delete, get, set, or update",
|
||||
@@ -2256,8 +2299,16 @@ TestMathFunc2(clientData, interp, args, resultPtr)
|
||||
|
||||
resultPtr->type = TCL_DOUBLE;
|
||||
resultPtr->doubleValue = ((d0 > d1)? d0 : d1);
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
} else if (args[1].type == TCL_WIDE_INT) {
|
||||
Tcl_WideInt w0 = Tcl_LongAsWide(i0);
|
||||
Tcl_WideInt w1 = args[1].wideValue;
|
||||
|
||||
resultPtr->type = TCL_WIDE_INT;
|
||||
resultPtr->wideValue = ((w0 > w1)? w0 : w1);
|
||||
#endif
|
||||
} else {
|
||||
Tcl_SetResult(interp, "T2: wrong type for arg 2", TCL_STATIC);
|
||||
Tcl_SetResult(interp, "T3: wrong type for arg 2", TCL_STATIC);
|
||||
result = TCL_ERROR;
|
||||
}
|
||||
} else if (args[0].type == TCL_DOUBLE) {
|
||||
@@ -2273,12 +2324,44 @@ TestMathFunc2(clientData, interp, args, resultPtr)
|
||||
|
||||
resultPtr->type = TCL_DOUBLE;
|
||||
resultPtr->doubleValue = ((d0 > d1)? d0 : d1);
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
} else if (args[1].type == TCL_WIDE_INT) {
|
||||
double d1 = Tcl_WideAsDouble(args[1].wideValue);
|
||||
|
||||
resultPtr->type = TCL_DOUBLE;
|
||||
resultPtr->doubleValue = ((d0 > d1)? d0 : d1);
|
||||
#endif
|
||||
} else {
|
||||
Tcl_SetResult(interp, "T2: wrong type for arg 2", TCL_STATIC);
|
||||
Tcl_SetResult(interp, "T3: wrong type for arg 2", TCL_STATIC);
|
||||
result = TCL_ERROR;
|
||||
}
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
} else if (args[0].type == TCL_WIDE_INT) {
|
||||
Tcl_WideInt w0 = args[0].wideValue;
|
||||
|
||||
if (args[1].type == TCL_INT) {
|
||||
Tcl_WideInt w1 = Tcl_LongAsWide(args[1].intValue);
|
||||
|
||||
resultPtr->type = TCL_WIDE_INT;
|
||||
resultPtr->wideValue = ((w0 > w1)? w0 : w1);
|
||||
} else if (args[1].type == TCL_DOUBLE) {
|
||||
double d0 = Tcl_WideAsDouble(w0);
|
||||
double d1 = args[1].doubleValue;
|
||||
|
||||
resultPtr->type = TCL_DOUBLE;
|
||||
resultPtr->doubleValue = ((d0 > d1)? d0 : d1);
|
||||
} else if (args[1].type == TCL_WIDE_INT) {
|
||||
Tcl_WideInt w1 = args[1].wideValue;
|
||||
|
||||
resultPtr->type = TCL_WIDE_INT;
|
||||
resultPtr->wideValue = ((w0 > w1)? w0 : w1);
|
||||
} else {
|
||||
Tcl_SetResult(interp, "T3: wrong type for arg 2", TCL_STATIC);
|
||||
result = TCL_ERROR;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
Tcl_SetResult(interp, "T2: wrong type for arg 1", TCL_STATIC);
|
||||
Tcl_SetResult(interp, "T3: wrong type for arg 1", TCL_STATIC);
|
||||
result = TCL_ERROR;
|
||||
}
|
||||
return result;
|
||||
@@ -4089,10 +4172,62 @@ static int PretendTclpStat(path, buf)
|
||||
{
|
||||
int ret;
|
||||
Tcl_Obj *pathPtr = Tcl_NewStringObj(path, -1);
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
Tcl_IncrRefCount(pathPtr);
|
||||
ret = TclpObjStat(pathPtr, buf);
|
||||
Tcl_DecrRefCount(pathPtr);
|
||||
return ret;
|
||||
#else /* TCL_WIDE_INT_IS_LONG */
|
||||
Tcl_StatBuf realBuf;
|
||||
Tcl_IncrRefCount(pathPtr);
|
||||
ret = TclpObjStat(pathPtr, &realBuf);
|
||||
Tcl_DecrRefCount(pathPtr);
|
||||
if (ret != -1) {
|
||||
# define OUT_OF_RANGE(x) \
|
||||
(((Tcl_WideInt)(x)) < Tcl_LongAsWide(LONG_MIN) || \
|
||||
((Tcl_WideInt)(x)) > Tcl_LongAsWide(LONG_MAX))
|
||||
# define OUT_OF_URANGE(x) \
|
||||
(((Tcl_WideUInt)(x)) > (Tcl_WideUInt)ULONG_MAX)
|
||||
|
||||
/*
|
||||
* Perform the result-buffer overflow check manually.
|
||||
*
|
||||
* Note that ino_t/ino64_t is unsigned...
|
||||
*/
|
||||
|
||||
if (OUT_OF_URANGE(realBuf.st_ino) || OUT_OF_RANGE(realBuf.st_size)
|
||||
|| OUT_OF_RANGE(realBuf.st_blocks)) {
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
||||
# undef OUT_OF_RANGE
|
||||
# undef OUT_OF_URANGE
|
||||
|
||||
/*
|
||||
* Copy across all supported fields, with possible type
|
||||
* coercions on those fields that change between the normal
|
||||
* and lf64 versions of the stat structure (on Solaris at
|
||||
* least.) This is slow when the structure sizes coincide,
|
||||
* but that's what you get for mixing interfaces...
|
||||
*/
|
||||
|
||||
buf->st_mode = realBuf.st_mode;
|
||||
buf->st_ino = (ino_t) realBuf.st_ino;
|
||||
buf->st_dev = realBuf.st_dev;
|
||||
buf->st_rdev = realBuf.st_rdev;
|
||||
buf->st_nlink = realBuf.st_nlink;
|
||||
buf->st_uid = realBuf.st_uid;
|
||||
buf->st_gid = realBuf.st_gid;
|
||||
buf->st_size = (off_t) realBuf.st_size;
|
||||
buf->st_atime = realBuf.st_atime;
|
||||
buf->st_mtime = realBuf.st_mtime;
|
||||
buf->st_ctime = realBuf.st_ctime;
|
||||
buf->st_blksize = realBuf.st_blksize;
|
||||
buf->st_blocks = (blkcnt_t) realBuf.st_blocks;
|
||||
}
|
||||
return ret;
|
||||
#endif /* TCL_WIDE_INT_IS_LONG */
|
||||
}
|
||||
|
||||
/* Be careful in the compares in these tests, since the Macintosh puts a
|
||||
@@ -4633,7 +4768,7 @@ TestChannelCmd(clientData, interp, argc, argv)
|
||||
TclFormatInt(buf, IOQueued);
|
||||
Tcl_AppendElement(interp, buf);
|
||||
|
||||
TclFormatInt(buf, Tcl_Tell((Tcl_Channel) chanPtr));
|
||||
TclFormatInt(buf, (int)Tcl_Tell((Tcl_Channel) chanPtr));
|
||||
Tcl_AppendElement(interp, buf);
|
||||
|
||||
TclFormatInt(buf, statePtr->refCount);
|
||||
@@ -5340,7 +5475,7 @@ TestReport(cmd, path, arg2)
|
||||
static int
|
||||
TestReportStat(path, buf)
|
||||
Tcl_Obj *path; /* Path of file to stat (in current CP). */
|
||||
struct stat *buf; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *buf; /* Filled with results of stat call. */
|
||||
{
|
||||
TestReport("stat",path, NULL);
|
||||
return Tcl_FSStat(TestReportGetNativePath(path),buf);
|
||||
@@ -5348,7 +5483,7 @@ TestReportStat(path, buf)
|
||||
static int
|
||||
TestReportLstat(path, buf)
|
||||
Tcl_Obj *path; /* Path of file to stat (in current CP). */
|
||||
struct stat *buf; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *buf; /* Filled with results of stat call. */
|
||||
{
|
||||
TestReport("lstat",path, NULL);
|
||||
return Tcl_FSLstat(TestReportGetNativePath(path),buf);
|
||||
|
||||
+21
-8
@@ -12,7 +12,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclTestObj.c,v 1.7 2000/11/24 11:27:37 dkf Exp $
|
||||
* RCS: @(#) $Id: tclTestObj.c,v 1.7.12.1 2001/10/22 09:03:33 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -406,6 +406,15 @@ TestindexobjCmd(clientData, interp, objc, objv)
|
||||
int allowAbbrev, index, index2, setError, i, result;
|
||||
char **argv;
|
||||
static char *tablePtr[] = {"a", "b", "check", (char *) NULL};
|
||||
/*
|
||||
* Keep this structure declaration in sync with tclIndexObj.c
|
||||
*/
|
||||
struct IndexRep {
|
||||
VOID *tablePtr; /* Pointer to the table of strings */
|
||||
int offset; /* Offset between table entries */
|
||||
int index; /* Selected index into table. */
|
||||
};
|
||||
struct IndexRep *indexRep;
|
||||
|
||||
if ((objc == 3) && (strcmp(Tcl_GetString(objv[1]),
|
||||
"check") == 0)) {
|
||||
@@ -415,13 +424,14 @@ TestindexobjCmd(clientData, interp, objc, objv)
|
||||
* returned on subsequent lookups.
|
||||
*/
|
||||
|
||||
Tcl_GetIndexFromObj((Tcl_Interp *) NULL, objv[1], tablePtr,
|
||||
"token", 0, &index);
|
||||
if (Tcl_GetIntFromObj(interp, objv[2], &index2) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
objv[1]->internalRep.twoPtrValue.ptr2 =
|
||||
(VOID *) (index2 * sizeof(char *));
|
||||
|
||||
Tcl_GetIndexFromObj((Tcl_Interp *) NULL, objv[1], tablePtr,
|
||||
"token", 0, &index);
|
||||
indexRep = (struct IndexRep *) objv[1]->internalRep.otherValuePtr;
|
||||
indexRep->index = index2;
|
||||
result = Tcl_GetIndexFromObj((Tcl_Interp *) NULL, objv[1],
|
||||
tablePtr, "token", 0, &index);
|
||||
if (result == TCL_OK) {
|
||||
@@ -455,9 +465,12 @@ TestindexobjCmd(clientData, interp, objc, objv)
|
||||
* the index object, clear out the object's cached state.
|
||||
*/
|
||||
|
||||
if ((objv[3]->typePtr == Tcl_GetObjType("index"))
|
||||
&& (objv[3]->internalRep.twoPtrValue.ptr1 == (VOID *) argv)) {
|
||||
objv[3]->typePtr = NULL;
|
||||
if (objv[3]->typePtr == &tclIndexType) {
|
||||
indexRep = (struct IndexRep *) objv[3]->internalRep.otherValuePtr;
|
||||
if (indexRep->tablePtr == (VOID *) argv) {
|
||||
objv[3]->typePtr->freeIntRepProc(objv[3]);
|
||||
objv[3]->typePtr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3],
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclTimer.c,v 1.3 1999/04/16 00:46:54 stanton Exp $
|
||||
* RCS: @(#) $Id: tclTimer.c,v 1.3.26.3 2001/09/27 13:52:28 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUtf.c,v 1.17 2001/09/13 19:31:04 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclUtf.c,v 1.17.2.2 2001/09/27 13:52:28 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUtil.c,v 1.23 2001/09/19 08:52:46 dkf Exp $
|
||||
* RCS: @(#) $Id: tclUtil.c,v 1.23.2.3 2001/09/27 13:52:28 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+89
-29
@@ -14,7 +14,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclVar.c,v 1.36 2001/08/10 13:10:13 msofer Exp $
|
||||
* RCS: @(#) $Id: tclVar.c,v 1.36.6.4 2001/10/11 13:45:19 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -1929,12 +1929,10 @@ TclIncrVar2(interp, part1Ptr, part2Ptr, incrAmount, flags)
|
||||
* TCL_LIST_ELEMENT, TCL_LEAVE_ERR_MSG. */
|
||||
{
|
||||
register Tcl_Obj *varValuePtr;
|
||||
Tcl_Obj *resultPtr;
|
||||
int createdNewObj; /* Set 1 if var's value object is shared
|
||||
* so we must increment a copy (i.e. copy
|
||||
* on write). */
|
||||
long i;
|
||||
int result;
|
||||
|
||||
varValuePtr = Tcl_ObjGetVar2(interp, part1Ptr, part2Ptr, flags);
|
||||
if (varValuePtr == NULL) {
|
||||
@@ -1955,24 +1953,46 @@ TclIncrVar2(interp, part1Ptr, part2Ptr, incrAmount, flags)
|
||||
varValuePtr = Tcl_DuplicateObj(varValuePtr);
|
||||
createdNewObj = 1;
|
||||
}
|
||||
result = Tcl_GetLongFromObj(interp, varValuePtr, &i);
|
||||
if (result != TCL_OK) {
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
if (Tcl_GetLongFromObj(interp, varValuePtr, &i) != TCL_OK) {
|
||||
if (createdNewObj) {
|
||||
Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Tcl_SetLongObj(varValuePtr, (i + incrAmount));
|
||||
#else
|
||||
if (varValuePtr->typePtr == &tclWideIntType) {
|
||||
Tcl_WideInt wide = varValuePtr->internalRep.wideValue;
|
||||
Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount));
|
||||
} else if (varValuePtr->typePtr == &tclIntType) {
|
||||
i = varValuePtr->internalRep.longValue;
|
||||
Tcl_SetIntObj(varValuePtr, i + incrAmount);
|
||||
} else {
|
||||
/*
|
||||
* Not an integer or wide internal-rep...
|
||||
*/
|
||||
Tcl_WideInt wide;
|
||||
if (Tcl_GetWideIntFromObj(interp, varValuePtr, &wide) != TCL_OK) {
|
||||
if (createdNewObj) {
|
||||
Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (wide <= Tcl_LongAsWide(LONG_MAX)
|
||||
&& wide >= Tcl_LongAsWide(LONG_MIN)) {
|
||||
Tcl_SetLongObj(varValuePtr, Tcl_WideAsLong(wide) + incrAmount);
|
||||
} else {
|
||||
Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Store the variable's new value and run any write traces.
|
||||
*/
|
||||
|
||||
resultPtr = Tcl_ObjSetVar2(interp, part1Ptr, part2Ptr, varValuePtr, flags);
|
||||
if (resultPtr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return resultPtr;
|
||||
return Tcl_ObjSetVar2(interp, part1Ptr, part2Ptr, varValuePtr, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2009,12 +2029,10 @@ TclIncrIndexedScalar(interp, localIndex, incrAmount)
|
||||
long incrAmount; /* Amount to be added to variable. */
|
||||
{
|
||||
register Tcl_Obj *varValuePtr;
|
||||
Tcl_Obj *resultPtr;
|
||||
int createdNewObj; /* Set 1 if var's value object is shared
|
||||
* so we must increment a copy (i.e. copy
|
||||
* on write). */
|
||||
long i;
|
||||
int result;
|
||||
|
||||
varValuePtr = TclGetIndexedScalar(interp, localIndex, TCL_LEAVE_ERR_MSG);
|
||||
if (varValuePtr == NULL) {
|
||||
@@ -2036,25 +2054,47 @@ TclIncrIndexedScalar(interp, localIndex, incrAmount)
|
||||
createdNewObj = 1;
|
||||
varValuePtr = Tcl_DuplicateObj(varValuePtr);
|
||||
}
|
||||
result = Tcl_GetLongFromObj(interp, varValuePtr, &i);
|
||||
if (result != TCL_OK) {
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
if (Tcl_GetLongFromObj(interp, varValuePtr, &i) != TCL_OK) {
|
||||
if (createdNewObj) {
|
||||
Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Tcl_SetLongObj(varValuePtr, (i + incrAmount));
|
||||
#else
|
||||
if (varValuePtr->typePtr == &tclWideIntType) {
|
||||
Tcl_WideInt wide = varValuePtr->internalRep.wideValue;
|
||||
Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount));
|
||||
} else if (varValuePtr->typePtr == &tclIntType) {
|
||||
i = varValuePtr->internalRep.longValue;
|
||||
Tcl_SetIntObj(varValuePtr, i + incrAmount);
|
||||
} else {
|
||||
/*
|
||||
* Not an integer or wide internal-rep...
|
||||
*/
|
||||
Tcl_WideInt wide;
|
||||
if (Tcl_GetWideIntFromObj(interp, varValuePtr, &wide) != TCL_OK) {
|
||||
if (createdNewObj) {
|
||||
Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (wide <= Tcl_LongAsWide(LONG_MAX)
|
||||
&& wide >= Tcl_LongAsWide(LONG_MIN)) {
|
||||
Tcl_SetLongObj(varValuePtr, Tcl_WideAsLong(wide) + incrAmount);
|
||||
} else {
|
||||
Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Store the variable's new value and run any write traces.
|
||||
*/
|
||||
|
||||
resultPtr = TclSetIndexedScalar(interp, localIndex, varValuePtr,
|
||||
return TclSetIndexedScalar(interp, localIndex, varValuePtr,
|
||||
TCL_LEAVE_ERR_MSG);
|
||||
if (resultPtr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return resultPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2095,12 +2135,10 @@ TclIncrElementOfIndexedArray(interp, localIndex, elemPtr, incrAmount)
|
||||
long incrAmount; /* Amount to be added to variable. */
|
||||
{
|
||||
register Tcl_Obj *varValuePtr;
|
||||
Tcl_Obj *resultPtr;
|
||||
int createdNewObj; /* Set 1 if var's value object is shared
|
||||
* so we must increment a copy (i.e. copy
|
||||
* on write). */
|
||||
long i;
|
||||
int result;
|
||||
|
||||
varValuePtr = TclGetElementOfIndexedArray(interp, localIndex, elemPtr,
|
||||
TCL_LEAVE_ERR_MSG);
|
||||
@@ -2123,25 +2161,47 @@ TclIncrElementOfIndexedArray(interp, localIndex, elemPtr, incrAmount)
|
||||
createdNewObj = 1;
|
||||
varValuePtr = Tcl_DuplicateObj(varValuePtr);
|
||||
}
|
||||
result = Tcl_GetLongFromObj(interp, varValuePtr, &i);
|
||||
if (result != TCL_OK) {
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
if (Tcl_GetLongFromObj(interp, varValuePtr, &i) != TCL_OK) {
|
||||
if (createdNewObj) {
|
||||
Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Tcl_SetLongObj(varValuePtr, (i + incrAmount));
|
||||
|
||||
#else
|
||||
if (varValuePtr->typePtr == &tclWideIntType) {
|
||||
Tcl_WideInt wide = varValuePtr->internalRep.wideValue;
|
||||
Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount));
|
||||
} else if (varValuePtr->typePtr == &tclIntType) {
|
||||
i = varValuePtr->internalRep.longValue;
|
||||
Tcl_SetIntObj(varValuePtr, i + incrAmount);
|
||||
} else {
|
||||
/*
|
||||
* Not an integer or wide internal-rep...
|
||||
*/
|
||||
Tcl_WideInt wide;
|
||||
if (Tcl_GetWideIntFromObj(interp, varValuePtr, &wide) != TCL_OK) {
|
||||
if (createdNewObj) {
|
||||
Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (wide <= Tcl_LongAsWide(LONG_MAX)
|
||||
&& wide >= Tcl_LongAsWide(LONG_MIN)) {
|
||||
Tcl_SetLongObj(varValuePtr, Tcl_WideAsLong(wide) + incrAmount);
|
||||
} else {
|
||||
Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Store the variable's new value and run any write traces.
|
||||
*/
|
||||
|
||||
resultPtr = TclSetElementOfIndexedArray(interp, localIndex, elemPtr,
|
||||
return TclSetElementOfIndexedArray(interp, localIndex, elemPtr,
|
||||
varValuePtr, TCL_LEAVE_ERR_MSG);
|
||||
if (resultPtr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return resultPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+12
-14
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclMacChan.c,v 1.7 2001/08/30 08:53:15 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclMacChan.c,v 1.7.6.2 2001/10/18 12:47:21 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -109,7 +109,7 @@ static int FileInput _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toRead, int *errorCode));
|
||||
static int FileOutput _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toWrite, int *errorCode));
|
||||
static int FileSeek _ANSI_ARGS_((ClientData instanceData,
|
||||
static Tcl_WideInt FileSeek _ANSI_ARGS_((ClientData instanceData,
|
||||
long offset, int mode, int *errorCode));
|
||||
static void FileSetupProc _ANSI_ARGS_((ClientData clientData,
|
||||
int flags));
|
||||
@@ -125,7 +125,7 @@ static int StdIOInput _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toRead, int *errorCode));
|
||||
static int StdIOOutput _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toWrite, int *errorCode));
|
||||
static int StdIOSeek _ANSI_ARGS_((ClientData instanceData,
|
||||
static Tcl_WideInt StdIOSeek _ANSI_ARGS_((ClientData instanceData,
|
||||
long offset, int mode, int *errorCode));
|
||||
static int StdReady _ANSI_ARGS_((ClientData instanceData,
|
||||
int mask));
|
||||
@@ -584,13 +584,12 @@ StdIOOutput(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
static Tcl_WideInt
|
||||
StdIOSeek(
|
||||
ClientData instanceData, /* Unused. */
|
||||
long offset, /* Offset to seek to. */
|
||||
int mode, /* Relative to where
|
||||
* should we seek? */
|
||||
int *errorCodePtr) /* To store error code. */
|
||||
ClientData instanceData, /* Unused. */
|
||||
Tcl_WideInt offset, /* Offset to seek to. */
|
||||
int mode, /* Relative to where should we seek? */
|
||||
int *errorCodePtr) /* To store error code. */
|
||||
{
|
||||
int newLoc;
|
||||
int fd;
|
||||
@@ -1126,13 +1125,12 @@ FileOutput(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
static Tcl_WideInt
|
||||
FileSeek(
|
||||
ClientData instanceData, /* Unused. */
|
||||
long offset, /* Offset to seek to. */
|
||||
int mode, /* Relative to where
|
||||
* should we seek? */
|
||||
int *errorCodePtr) /* To store error code. */
|
||||
Tcl_WideInt offset, /* Offset to seek to. */
|
||||
int mode, /* Relative to where should we seek? */
|
||||
int *errorCodePtr) /* To store error code. */
|
||||
{
|
||||
FileState *fileState = (FileState *) instanceData;
|
||||
IOParam pb;
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclMacFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclMacFile.c,v 1.12.6.1 2001/09/25 10:24:07 dkf Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -253,7 +253,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
typeOk = 0;
|
||||
}
|
||||
} else {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (pb.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible) {
|
||||
/* If invisible */
|
||||
@@ -728,7 +728,7 @@ TclpReadlink(
|
||||
int
|
||||
TclpObjLstat(pathPtr, buf)
|
||||
Tcl_Obj *pathPtr;
|
||||
struct stat *buf;
|
||||
Tcl_StatBuf *buf;
|
||||
{
|
||||
/* This needs to be enhanced to deal with aliases */
|
||||
return TclpObjStat(pathPtr, buf);
|
||||
@@ -753,7 +753,7 @@ TclpObjLstat(pathPtr, buf)
|
||||
int
|
||||
TclpObjStat(pathPtr, bufPtr)
|
||||
Tcl_Obj *pathPtr;
|
||||
struct stat *bufPtr;
|
||||
Tcl_StatBuf *bufPtr;
|
||||
{
|
||||
HFileInfo fpb;
|
||||
HVolumeParam vpb;
|
||||
|
||||
+28
-2
@@ -10,14 +10,14 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: binary.test,v 1.8 2000/05/26 08:50:34 hobbs Exp $
|
||||
# RCS: @(#) $Id: binary.test,v 1.8.12.1 2001/10/04 13:55:18 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
}
|
||||
|
||||
test binary-2.1 {DupByteArrayInternalRep} {
|
||||
test binary-0.1 {DupByteArrayInternalRep} {
|
||||
set hdr [binary format cc 0 0316]
|
||||
set buf hellomatt
|
||||
|
||||
@@ -1460,6 +1460,32 @@ test binary-42.1 {Tcl_BinaryObjCmd: bad arguments} {} {
|
||||
set result
|
||||
} {bad option "": must be format or scan}
|
||||
|
||||
# Wide int (guaranteed at least 64-bit) handling
|
||||
test binary-43.1 {Tcl_BinaryObjCmd: format wide int} {} {
|
||||
binary format w 7810179016327718216
|
||||
} HelloTcl
|
||||
test binary-43.2 {Tcl_BinaryObjCmd: format wide int} {} {
|
||||
binary format W 7810179016327718216
|
||||
} lcTolleH
|
||||
|
||||
test binary-44.1 {Tcl_BinaryObjCmd: scan wide int} {} {
|
||||
binary scan HelloTcl W x
|
||||
set x
|
||||
} 5216694956358656876
|
||||
test binary-44.2 {Tcl_BinaryObjCmd: scan wide int} {} {
|
||||
binary scan lcTolleH w x
|
||||
set x
|
||||
} 5216694956358656876
|
||||
|
||||
test binary-45.1 {Tcl_BinaryObjCmd: combined wide int handling} {
|
||||
binary scan [binary format sws 16450 -1 19521] c* x
|
||||
set x
|
||||
} {66 64 -1 -1 -1 -1 -1 -1 -1 -1 65 76}
|
||||
test binary-45.2 {Tcl_BinaryObjCmd: combined wide int handling} {
|
||||
binary scan [binary format sWs 16450 0x7fffffff 19521] c* x
|
||||
set x
|
||||
} {66 64 0 0 0 0 127 -1 -1 -1 65 76}
|
||||
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
|
||||
+125
-20
@@ -14,7 +14,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: execute.test,v 1.9 2001/02/23 21:41:01 msofer Exp $
|
||||
# RCS: @(#) $Id: execute.test,v 1.9.12.5 2001/10/22 10:37:08 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -33,6 +33,9 @@ set ::tcltest::testConstraints(testobj) \
|
||||
&& [info commands teststringobj] != {} \
|
||||
&& [info commands testobj] != {}}]
|
||||
|
||||
set ::tcltest::testConstraints(longIs32bit) \
|
||||
[expr {int(0x80000000) < 0}]
|
||||
|
||||
# Tests for the omnibus TclExecuteByteCode function:
|
||||
|
||||
# INST_DONE not tested
|
||||
@@ -589,6 +592,127 @@ test execute-6.2 {Evaluate an expression in a variable; compile the first time,
|
||||
set res "[a $w]:[a $w]"
|
||||
} {15:15}
|
||||
|
||||
test execute-7.0 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
|
||||
set x 0x100000000
|
||||
expr {$x && 1}
|
||||
} 1
|
||||
test execute-7.1 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
|
||||
expr {0x100000000 && 1}
|
||||
} 1
|
||||
test execute-7.2 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
|
||||
expr {1 && 0x100000000}
|
||||
} 1
|
||||
test execute-7.3 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
|
||||
expr {wide(0x100000000) && 1}
|
||||
} 1
|
||||
test execute-7.4 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
|
||||
expr {1 && wide(0x100000000)}
|
||||
} 1
|
||||
test execute-7.5 {Wide int handling in INST_EQ} {longIs32bit} {
|
||||
expr {4 == (wide(1)+wide(3))}
|
||||
} 1
|
||||
test execute-7.6 {Wide int handling in INST_EQ and [incr]} {longIs32bit} {
|
||||
set x 399999999999
|
||||
expr {400000000000 == [incr x]}
|
||||
} 1
|
||||
# wide ints have more bits of precision than doubles, but we convert anyway
|
||||
test execute-7.7 {Wide int handling in INST_EQ and [incr]} {longIs32bit} {
|
||||
set x [expr {wide(1)<<62}]
|
||||
set y [expr {$x+1}]
|
||||
expr {double($x) == double($y)}
|
||||
} 1
|
||||
test execute-7.8 {Wide int conversions can change sign} {longIs32bit} {
|
||||
set x 0x80000000
|
||||
expr {int($x) < wide($x)}
|
||||
} 1
|
||||
test execute-7.9 {Wide int handling in INST_MOD} {longIs32bit} {
|
||||
expr {(wide(1)<<60) % ((wide(47)<<45)-1)}
|
||||
} 316659348800185
|
||||
test execute-7.10 {Wide int handling in INST_MOD} {longIs32bit} {
|
||||
expr {((wide(1)<<60)-1) % 0x400000000}
|
||||
} 17179869183
|
||||
test execute-7.11 {Wide int handling in INST_LSHIFT} {longIs32bit} {
|
||||
expr wide(42)<<30
|
||||
} 45097156608
|
||||
test execute-7.12 {Wide int handling in INST_LSHIFT} {longIs32bit} {
|
||||
expr 12345678901<<3
|
||||
} 98765431208
|
||||
test execute-7.13 {Wide int handling in INST_RSHIFT} {longIs32bit} {
|
||||
expr 0x543210febcda9876>>7
|
||||
} 47397893236700464
|
||||
test execute-7.14 {Wide int handling in INST_RSHIFT} {longIs32bit} {
|
||||
expr 0x9876543210febcda>>7
|
||||
} -58286587177206407
|
||||
test execute-7.15 {Wide int handling in INST_BITOR} {longIs32bit} {
|
||||
expr 0x9876543210febcda | 0x543210febcda9876
|
||||
} -2560765885044310786
|
||||
test execute-7.16 {Wide int handling in INST_BITXOR} {longIs32bit} {
|
||||
expr 0x9876543210febcda ^ 0x543210febcda9876
|
||||
} -3727778945703861076
|
||||
test execute-7.17 {Wide int handling in INST_BITAND} {longIs32bit} {
|
||||
expr 0x9876543210febcda & 0x543210febcda9876
|
||||
} 1167013060659550290
|
||||
test execute-7.18 {Wide int handling in INST_ADD} {longIs32bit} {
|
||||
expr wide(0x7fffffff)+wide(0x7fffffff)
|
||||
} 4294967294
|
||||
test execute-7.19 {Wide int handling in INST_ADD} {longIs32bit} {
|
||||
expr 0x7fffffff+wide(0x7fffffff)
|
||||
} 4294967294
|
||||
test execute-7.20 {Wide int handling in INST_ADD} {longIs32bit} {
|
||||
expr wide(0x7fffffff)+0x7fffffff
|
||||
} 4294967294
|
||||
test execute-7.21 {Wide int handling in INST_ADD} {longIs32bit} {
|
||||
expr double(0x7fffffff)+wide(0x7fffffff)
|
||||
} 4294967294.0
|
||||
test execute-7.22 {Wide int handling in INST_ADD} {longIs32bit} {
|
||||
expr wide(0x7fffffff)+double(0x7fffffff)
|
||||
} 4294967294.0
|
||||
test execute-7.23 {Wide int handling in INST_SUB} {longIs32bit} {
|
||||
expr 0x123456789a-0x20406080a
|
||||
} 69530054800
|
||||
test execute-7.24 {Wide int handling in INST_MULT} {longIs32bit} {
|
||||
expr 0x123456789a*193
|
||||
} 15090186251290
|
||||
test execute-7.25 {Wide int handling in INST_DIV} {longIs32bit} {
|
||||
expr 0x123456789a/193
|
||||
} 405116546
|
||||
test execute-7.26 {Wide int handling in INST_UPLUS} {longIs32bit} {
|
||||
set x 0x123456871234568
|
||||
expr {+ $x}
|
||||
} 81985533099853160
|
||||
test execute-7.27 {Wide int handling in INST_UMINUS} {longIs32bit} {
|
||||
set x 0x123456871234568
|
||||
expr {- $x}
|
||||
} -81985533099853160
|
||||
test execute-7.28 {Wide int handling in INST_LNOT} {longIs32bit} {
|
||||
set x 0x123456871234568
|
||||
expr {! $x}
|
||||
} 0
|
||||
test execute-7.29 {Wide int handling in INST_BITNOT} {longIs32bit} {
|
||||
set x 0x123456871234568
|
||||
expr {~ $x}
|
||||
} -81985533099853161
|
||||
test execute-7.30 {Wide int handling in function call} {longIs32bit} {
|
||||
set x 0x12345687123456
|
||||
incr x
|
||||
expr {sin($x) == sin(double($x))}
|
||||
} 1
|
||||
test execute-7.31 {Wide int handling in abs()} {longIs32bit} {
|
||||
set x 0xa23456871234568
|
||||
incr x
|
||||
set y 0x123456871234568
|
||||
concat [expr {abs($x)}] [expr {abs($y)}]
|
||||
} {730503879441204585 81985533099853160}
|
||||
test execute-7.32 {Wide int handling} {longIs32bit} {
|
||||
expr {1024 * 1024 * 1024 * 1024}
|
||||
} 0
|
||||
test execute-7.33 {Wide int handling} {longIs32bit} {
|
||||
expr {0x1 * 1024 * 1024 * 1024 * 1024}
|
||||
} 0
|
||||
test execute-7.34 {Wide int handling} {longIs32bit} {
|
||||
expr {wide(0x1) * 1024 * 1024 * 1024 * 1024}
|
||||
} 1099511627776
|
||||
|
||||
# cleanup
|
||||
catch {eval namespace delete [namespace children :: test_ns_*]}
|
||||
catch {rename foo ""}
|
||||
@@ -600,22 +724,3 @@ catch {unset y}
|
||||
catch {unset msg}
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+17
-2
@@ -10,7 +10,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: format.test,v 1.9 2001/08/23 13:57:08 dkf Exp $
|
||||
# RCS: @(#) $Id: format.test,v 1.9.6.1 2001/10/11 14:56:21 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -481,12 +481,27 @@ for {set i 0} {$i < 290} {incr i} {
|
||||
append b $a
|
||||
}
|
||||
for {set i 290} {$i < 400} {incr i} {
|
||||
test format-15.[expr $i -290] {testing MAX_FLOAT_SIZE} {
|
||||
test format-16.[expr $i -289] {testing MAX_FLOAT_SIZE} {
|
||||
format {%s} $b
|
||||
} $b
|
||||
append b "x"
|
||||
}
|
||||
|
||||
set ::tcltest::testConstraints(64bitInts) \
|
||||
[expr {0x80000000 > 0}]
|
||||
set ::tcltest::testConstraints(wideIntExpressions) \
|
||||
[expr {wide(0x80000000) != int(0x80000000)}]
|
||||
|
||||
test format-17.1 {testing %d with wide} {64bitInts wideIntExpressions} {
|
||||
list [catch {format %d 7810179016327718216} msg] $msg
|
||||
} {1 {integer value too large to represent}}
|
||||
test format-17.2 {testing %ld with wide} {64bitInts} {
|
||||
format %ld 7810179016327718216
|
||||
} 7810179016327718216
|
||||
test format-17.3 {testing %ld with non-wide} {64bitInts} {
|
||||
format %ld 42
|
||||
} 42
|
||||
|
||||
# cleanup
|
||||
catch {unset a}
|
||||
catch {unset b}
|
||||
|
||||
+6
-6
@@ -10,7 +10,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: get.test,v 1.5 2000/04/10 17:18:59 ericm Exp $
|
||||
# RCS: @(#) $Id: get.test,v 1.5.16.2 2001/10/25 16:11:04 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -45,7 +45,7 @@ test get-1.6 {Tcl_GetInt procedure} {
|
||||
# The following tests are non-portable because they depend on
|
||||
# word size.
|
||||
|
||||
if {0x80000000 > 0} {
|
||||
if {wide(0x80000000) > wide(0)} {
|
||||
test get-1.7 {Tcl_GetInt procedure} {
|
||||
set x 44
|
||||
list [catch {incr x 18446744073709551616} msg] $msg $errorCode
|
||||
@@ -63,19 +63,19 @@ if {0x80000000 > 0} {
|
||||
list [catch {incr x -18446744073709551614} msg] $msg
|
||||
} {0 2}
|
||||
} else {
|
||||
test get-1.7 {Tcl_GetInt procedure} {
|
||||
test get-1.11 {Tcl_GetInt procedure} {
|
||||
set x 44
|
||||
list [catch {incr x 4294967296} msg] $msg $errorCode
|
||||
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
|
||||
test get-1.8 {Tcl_GetInt procedure} {
|
||||
test get-1.12 {Tcl_GetInt procedure} {
|
||||
set x 0
|
||||
list [catch {incr x 4294967294} msg] $msg
|
||||
} {0 -2}
|
||||
test get-1.9 {Tcl_GetInt procedure} {
|
||||
test get-1.13 {Tcl_GetInt procedure} {
|
||||
set x 0
|
||||
list [catch {incr x +4294967294} msg] $msg
|
||||
} {0 -2}
|
||||
test get-1.10 {Tcl_GetInt procedure} {
|
||||
test get-1.14 {Tcl_GetInt procedure} {
|
||||
set x 0
|
||||
list [catch {incr x -4294967294} msg] $msg
|
||||
} {0 2}
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: info.test,v 1.17 2001/05/30 08:57:06 dkf Exp $
|
||||
# RCS: @(#) $Id: info.test,v 1.17.8.1 2001/10/09 15:29:27 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -593,9 +593,9 @@ test info-19.5 {info vars with temporary variables} {
|
||||
|
||||
# Check whether the extra testing functions are defined...
|
||||
if {([catch {expr T1()} msg] == 1) && ($msg == {unknown math function "T1"})} {
|
||||
set functions {abs acos asin atan atan2 ceil cos cosh double exp floor fmod hypot int log log10 pow rand round sin sinh sqrt srand tan tanh}
|
||||
set functions {abs acos asin atan atan2 ceil cos cosh double exp floor fmod hypot int log log10 pow rand round sin sinh sqrt srand tan tanh wide}
|
||||
} else {
|
||||
set functions {T1 T2 T3 abs acos asin atan atan2 ceil cos cosh double exp floor fmod hypot int log log10 pow rand round sin sinh sqrt srand tan tanh}
|
||||
set functions {T1 T2 T3 abs acos asin atan atan2 ceil cos cosh double exp floor fmod hypot int log log10 pow rand round sin sinh sqrt srand tan tanh wide}
|
||||
}
|
||||
test info-20.1 {info functions option} {info functions sin} sin
|
||||
test info-20.2 {info functions option} {lsort [info functions]} $functions
|
||||
|
||||
+30
-4
@@ -12,7 +12,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: io.test,v 1.21 2001/09/11 17:30:44 andreas_kupries Exp $
|
||||
# RCS: @(#) $Id: io.test,v 1.21.2.2 2001/10/11 14:56:21 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -21,6 +21,10 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
|
||||
tcltest::testConstraint testchannel [string equal testchannel [info commands testchannel]]
|
||||
|
||||
# You need a *very* special environment to do some tests. In
|
||||
# particular, many file systems do not support large-files...
|
||||
tcltest::testConstraint largefileSupport 0
|
||||
|
||||
::tcltest::saveState
|
||||
|
||||
removeFile test1
|
||||
@@ -3798,12 +3802,12 @@ test io-32.8 {Tcl_Read, nonblocking, file} {nonBlockFiles} {
|
||||
set z [read $f1 1000000]
|
||||
close $f1
|
||||
set x ok
|
||||
set l [string length $z]]
|
||||
set z [file size longfile]]
|
||||
set l [string length $z]
|
||||
set z [file size longfile]
|
||||
if {$z != $l} {
|
||||
set x broken
|
||||
}
|
||||
set x
|
||||
set x
|
||||
} ok
|
||||
test io-32.9 {Tcl_Read, read to end of file} {
|
||||
set f1 [open longfile r]
|
||||
@@ -4304,6 +4308,28 @@ test io-34.20 {Tcl_Tell combined with writing} {
|
||||
close $f
|
||||
set l
|
||||
} {29 39 40 447}
|
||||
test io-34.21 {Tcl_Seek and Tcl_Tell on large files} {largefileSupport} {
|
||||
removeFile test3
|
||||
set f [open test3 w]
|
||||
fconfigure $f -encoding binary
|
||||
set l ""
|
||||
lappend l [tell $f]
|
||||
puts -nonewline $f abcdef
|
||||
lappend l [tell $f]
|
||||
flush $f
|
||||
lappend l [tell $f]
|
||||
# 4GB offset!
|
||||
seek $f 0x100000000
|
||||
lappend l [tell $f]
|
||||
puts -nonewline $f abcdef
|
||||
lappend l [tell $f]
|
||||
close $f
|
||||
lappend l [file size $f]
|
||||
# truncate...
|
||||
close [open test3 w]
|
||||
lappend l [file size $f]
|
||||
set l
|
||||
} {0 6 6 4294967296 4294967302 4294967302 0}
|
||||
|
||||
# Test Tcl_Eof
|
||||
|
||||
|
||||
+120
-114
@@ -11,246 +11,252 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: link.test,v 1.5 2000/04/10 17:19:01 ericm Exp $
|
||||
# RCS: @(#) $Id: link.test,v 1.5.16.1 2001/11/07 13:35:21 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
}
|
||||
|
||||
if {[info commands testlink] == {}} {
|
||||
puts "This application hasn't been compiled with the \"testlink\""
|
||||
puts "command, so I can't test Tcl_LinkVar et al."
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
}
|
||||
set ::tcltest::testConstraints(testlink) \
|
||||
[expr {[info commands testlink] != {}}]
|
||||
|
||||
foreach i {int real bool string} {
|
||||
catch {unset $i}
|
||||
}
|
||||
test link-1.1 {reading C variables from Tcl} {
|
||||
test link-1.1 {reading C variables from Tcl} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 -
|
||||
testlink create 1 1 1 1
|
||||
list $int $real $bool $string
|
||||
} {43 1.23 1 NULL}
|
||||
test link-1.2 {reading C variables from Tcl} {
|
||||
testlink set 43 1.23 4 - 12341234
|
||||
testlink create 1 1 1 1 1
|
||||
list $int $real $bool $string $wide
|
||||
} {43 1.23 1 NULL 12341234}
|
||||
test link-1.2 {reading C variables from Tcl} {testlink} {
|
||||
testlink delete
|
||||
testlink create 1 1 1 1
|
||||
testlink set -3 2 0 "A long string with spaces"
|
||||
list $int $real $bool $string $int $real $bool $string
|
||||
} {-3 2.0 0 {A long string with spaces} -3 2.0 0 {A long string with spaces}}
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set -3 2 0 "A long string with spaces" 43214321
|
||||
list $int $real $bool $string $wide $int $real $bool $string $wide
|
||||
} {-3 2.0 0 {A long string with spaces} 43214321 -3 2.0 0 {A long string with spaces} 43214321}
|
||||
|
||||
test link-2.1 {writing C variables from Tcl} {
|
||||
test link-2.1 {writing C variables from Tcl} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.21 4 -
|
||||
testlink create 1 1 1 1
|
||||
testlink set 43 1.21 4 - 56785678
|
||||
testlink create 1 1 1 1 1
|
||||
set int "00721"
|
||||
set real -10.5
|
||||
set bool true
|
||||
set string abcdef
|
||||
concat [testlink get] $int $real $bool $string
|
||||
} {465 -10.5 1 abcdef 00721 -10.5 true abcdef}
|
||||
test link-2.2 {writing bad values into variables} {
|
||||
set wide 135135
|
||||
concat [testlink get] $int $real $bool $string $wide
|
||||
} {465 -10.5 1 abcdef 135135 00721 -10.5 true abcdef 135135}
|
||||
test link-2.2 {writing bad values into variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 -
|
||||
testlink create 1 1 1 1
|
||||
testlink set 43 1.23 4 - 56785678
|
||||
testlink create 1 1 1 1 1
|
||||
list [catch {set int 09a} msg] $msg $int
|
||||
} {1 {can't set "int": variable must have integer value} 43}
|
||||
test link-2.3 {writing bad values into variables} {
|
||||
test link-2.3 {writing bad values into variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 -
|
||||
testlink create 1 1 1 1
|
||||
testlink set 43 1.23 4 - 56785678
|
||||
testlink create 1 1 1 1 1
|
||||
list [catch {set real 1.x3} msg] $msg $real
|
||||
} {1 {can't set "real": variable must have real value} 1.23}
|
||||
test link-2.4 {writing bad values into variables} {
|
||||
test link-2.4 {writing bad values into variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 -
|
||||
testlink create 1 1 1 1
|
||||
testlink set 43 1.23 4 - 56785678
|
||||
testlink create 1 1 1 1 1
|
||||
list [catch {set bool gorp} msg] $msg $bool
|
||||
} {1 {can't set "bool": variable must have boolean value} 1}
|
||||
|
||||
test link-3.1 {read-only variables} {
|
||||
test link-2.5 {writing bad values into variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 -
|
||||
testlink create 0 1 1 0
|
||||
testlink set 43 1.23 4 - 56785678
|
||||
testlink create 1 1 1 1 1
|
||||
list [catch {set wide gorp} msg] $msg $bool
|
||||
} {1 {can't set "wide": variable must have integer value} 1}
|
||||
|
||||
test link-3.1 {read-only variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 - 56785678
|
||||
testlink create 0 1 1 0 0
|
||||
list [catch {set int 4} msg] $msg $int \
|
||||
[catch {set real 10.6} msg] $msg $real \
|
||||
[catch {set bool no} msg] $msg $bool \
|
||||
[catch {set string "new value"} msg] $msg $string
|
||||
} {1 {can't set "int": linked variable is read-only} 43 0 10.6 10.6 0 no no 1 {can't set "string": linked variable is read-only} NULL}
|
||||
test link-3.2 {read-only variables} {
|
||||
[catch {set string "new value"} msg] $msg $string \
|
||||
[catch {set wide 12341234} msg] $msg $wide
|
||||
} {1 {can't set "int": linked variable is read-only} 43 0 10.6 10.6 0 no no 1 {can't set "string": linked variable is read-only} NULL 1 {can't set "wide": linked variable is read-only} 56785678}
|
||||
test link-3.2 {read-only variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set 43 1.23 4 -
|
||||
testlink create 1 0 0 1
|
||||
testlink set 43 1.23 4 - 56785678
|
||||
testlink create 1 0 0 1 1
|
||||
list [catch {set int 4} msg] $msg $int \
|
||||
[catch {set real 10.6} msg] $msg $real \
|
||||
[catch {set bool no} msg] $msg $bool \
|
||||
[catch {set string "new value"} msg] $msg $string
|
||||
} {0 4 4 1 {can't set "real": linked variable is read-only} 1.23 1 {can't set "bool": linked variable is read-only} 1 0 {new value} {new value}}
|
||||
[catch {set string "new value"} msg] $msg $string\
|
||||
[catch {set wide 12341234} msg] $msg $wide
|
||||
} {0 4 4 1 {can't set "real": linked variable is read-only} 1.23 1 {can't set "bool": linked variable is read-only} 1 0 {new value} {new value} 0 12341234 12341234}
|
||||
|
||||
test link-4.1 {unsetting linked variables} {
|
||||
test link-4.1 {unsetting linked variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set -6 -2.5 0 stringValue
|
||||
testlink create 1 1 1 1
|
||||
unset int real bool string
|
||||
testlink set -6 -2.5 0 stringValue 13579
|
||||
testlink create 1 1 1 1 1
|
||||
unset int real bool string wide
|
||||
list [catch {set int} msg] $msg [catch {set real} msg] $msg \
|
||||
[catch {set bool} msg] $msg [catch {set string} msg] $msg
|
||||
} {0 -6 0 -2.5 0 0 0 stringValue}
|
||||
test link-4.2 {unsetting linked variables} {
|
||||
[catch {set bool} msg] $msg [catch {set string} msg] $msg \
|
||||
[catch {set wide} msg] $msg
|
||||
} {0 -6 0 -2.5 0 0 0 stringValue 0 13579}
|
||||
test link-4.2 {unsetting linked variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set -6 -2.1 0 stringValue
|
||||
testlink create 1 1 1 1
|
||||
unset int real bool string
|
||||
testlink set -6 -2.1 0 stringValue 97531
|
||||
testlink create 1 1 1 1 1
|
||||
unset int real bool string wide
|
||||
set int 102
|
||||
set real 16
|
||||
set bool true
|
||||
set string newValue
|
||||
set wide 333555
|
||||
testlink get
|
||||
} {102 16.0 1 newValue}
|
||||
} {102 16.0 1 newValue 333555}
|
||||
|
||||
test link-5.1 {unlinking variables} {
|
||||
test link-5.1 {unlinking variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set -6 -2.25 0 stringValue
|
||||
testlink set -6 -2.25 0 stringValue 13579
|
||||
testlink delete
|
||||
set int xx1
|
||||
set real qrst
|
||||
set bool bogus
|
||||
set string 12345
|
||||
set wide 875421
|
||||
testlink get
|
||||
} {-6 -2.25 0 stringValue}
|
||||
test link-5.2 {unlinking variables} {
|
||||
} {-6 -2.25 0 stringValue 13579}
|
||||
test link-5.2 {unlinking variables} {testlink} {
|
||||
testlink delete
|
||||
testlink set -6 -2.25 0 stringValue
|
||||
testlink create 1 1 1 1
|
||||
testlink set -6 -2.25 0 stringValue 97531
|
||||
testlink create 1 1 1 1 1
|
||||
testlink delete
|
||||
testlink set 25 14.7 7 -
|
||||
list $int $real $bool $string
|
||||
} {-6 -2.25 0 stringValue}
|
||||
testlink set 25 14.7 7 - 999999
|
||||
list $int $real $bool $string $wide
|
||||
} {-6 -2.25 0 stringValue 97531}
|
||||
|
||||
test link-6.1 {errors in setting up link} {
|
||||
test link-6.1 {errors in setting up link} {testlink} {
|
||||
testlink delete
|
||||
catch {unset int}
|
||||
set int(44) 1
|
||||
list [catch {testlink create 1 1 1 1} msg] $msg
|
||||
list [catch {testlink create 1 1 1 1 1} msg] $msg
|
||||
} {1 {can't set "int": variable is array}}
|
||||
catch {unset int}
|
||||
|
||||
test link-7.1 {access to linked variables via upvar} {
|
||||
test link-7.1 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar int y
|
||||
unset y
|
||||
}
|
||||
testlink delete
|
||||
testlink create 1 0 0 0
|
||||
testlink set 14 {} {} {}
|
||||
testlink create 1 0 0 0 0
|
||||
testlink set 14 {} {} {} {}
|
||||
x
|
||||
list [catch {set int} msg] $msg
|
||||
} {0 14}
|
||||
test link-7.2 {access to linked variables via upvar} {
|
||||
test link-7.2 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar int y
|
||||
return [set y]
|
||||
}
|
||||
testlink delete
|
||||
testlink create 1 0 0 0
|
||||
testlink set 0 {} {} {}
|
||||
testlink create 1 0 0 0 0
|
||||
testlink set 0 {} {} {} {}
|
||||
set int
|
||||
testlink set 23 {} {} {}
|
||||
testlink set 23 {} {} {} {}
|
||||
x
|
||||
list [x] $int
|
||||
} {23 23}
|
||||
test link-7.3 {access to linked variables via upvar} {
|
||||
test link-7.3 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar int y
|
||||
set y 44
|
||||
}
|
||||
testlink delete
|
||||
testlink create 0 0 0 0
|
||||
testlink set 11 {} {} {}
|
||||
testlink create 0 0 0 0 0
|
||||
testlink set 11 {} {} {} {}
|
||||
list [catch x msg] $msg $int
|
||||
} {1 {can't set "y": linked variable is read-only} 11}
|
||||
test link-7.4 {access to linked variables via upvar} {
|
||||
test link-7.4 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar int y
|
||||
set y abc
|
||||
}
|
||||
testlink delete
|
||||
testlink create 1 1 1 1
|
||||
testlink set -4 {} {} {}
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set -4 {} {} {} {}
|
||||
list [catch x msg] $msg $int
|
||||
} {1 {can't set "y": variable must have integer value} -4}
|
||||
test link-7.5 {access to linked variables via upvar} {
|
||||
test link-7.5 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar real y
|
||||
set y abc
|
||||
}
|
||||
testlink delete
|
||||
testlink create 1 1 1 1
|
||||
testlink set -4 16.75 {} {}
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set -4 16.75 {} {} {}
|
||||
list [catch x msg] $msg $real
|
||||
} {1 {can't set "y": variable must have real value} 16.75}
|
||||
test link-7.6 {access to linked variables via upvar} {
|
||||
test link-7.6 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar bool y
|
||||
set y abc
|
||||
}
|
||||
testlink delete
|
||||
testlink create 1 1 1 1
|
||||
testlink set -4 16.3 1 {}
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set -4 16.3 1 {} {}
|
||||
list [catch x msg] $msg $bool
|
||||
} {1 {can't set "y": variable must have boolean value} 1}
|
||||
test link-7.7 {access to linked variables via upvar} {testlink} {
|
||||
proc x {} {
|
||||
upvar wide y
|
||||
set y abc
|
||||
}
|
||||
testlink delete
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set -4 16.3 1 {} 778899
|
||||
list [catch x msg] $msg $wide
|
||||
} {1 {can't set "y": variable must have integer value} 778899}
|
||||
|
||||
test link-8.1 {Tcl_UpdateLinkedVar procedure} {
|
||||
test link-8.1 {Tcl_UpdateLinkedVar procedure} {testlink} {
|
||||
proc x args {
|
||||
global x int real bool string
|
||||
lappend x $args $int $real $bool $string
|
||||
global x int real bool string wide
|
||||
lappend x $args $int $real $bool $string $wide
|
||||
}
|
||||
set x {}
|
||||
testlink create 1 1 1 1
|
||||
testlink set 14 -2.0 0 xyzzy
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set 14 -2.0 0 xyzzy 995511
|
||||
trace var int w x
|
||||
testlink update 32 4.0 3 abcd
|
||||
testlink update 32 4.0 3 abcd 113355
|
||||
trace vdelete int w x
|
||||
set x
|
||||
} {{int {} w} 32 -2.0 0 xyzzy}
|
||||
test link-8.2 {Tcl_UpdateLinkedVar procedure} {
|
||||
} {{int {} w} 32 -2.0 0 xyzzy 995511}
|
||||
test link-8.2 {Tcl_UpdateLinkedVar procedure} {testlink} {
|
||||
proc x args {
|
||||
global x int real bool string
|
||||
lappend x $args $int $real $bool $string
|
||||
global x int real bool string wide
|
||||
lappend x $args $int $real $bool $string $wide
|
||||
}
|
||||
set x {}
|
||||
testlink create 1 1 1 1
|
||||
testlink set 14 -2.0 0 xyzzy
|
||||
testlink create 1 1 1 1 1
|
||||
testlink set 14 -2.0 0 xyzzy 995511
|
||||
testlink delete
|
||||
trace var int w x
|
||||
testlink update 32 4.0 6 abcd
|
||||
testlink update 32 4.0 6 abcd 113355
|
||||
trace vdelete int w x
|
||||
set x
|
||||
} {}
|
||||
test link-8.3 {Tcl_UpdateLinkedVar procedure, read-only variable} {
|
||||
testlink create 0 0 0 0
|
||||
list [catch {testlink update 47 {} {} {}} msg] $msg $int
|
||||
test link-8.3 {Tcl_UpdateLinkedVar procedure, read-only variable} {testlink} {
|
||||
testlink create 0 0 0 0 0
|
||||
list [catch {testlink update 47 {} {} {} {}} msg] $msg $int
|
||||
} {0 {} 47}
|
||||
|
||||
testlink set 0 0 0 -
|
||||
testlink delete
|
||||
foreach i {int real bool string} {
|
||||
catch {testlink set 0 0 0 - 0}
|
||||
catch {testlink delete}
|
||||
foreach i {int real bool string wide} {
|
||||
catch {unset $i}
|
||||
}
|
||||
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+12
-12
@@ -23,19 +23,19 @@ test platform-1.1 {TclpSetVariables: tcl_platform} {
|
||||
set result [i eval {lsort [array names tcl_platform]}]
|
||||
interp delete i
|
||||
set result
|
||||
} {byteOrder machine os osVersion platform user}
|
||||
} {byteOrder machine os osVersion platform user wordSize}
|
||||
|
||||
# Test assumes twos-complement arithmetic, which is true of virtually
|
||||
# everything these days. Note that this does *not* use wide(), and
|
||||
# this is intentional since that could make Tcl's numbers wider than
|
||||
# the machine-integer on some platforms...
|
||||
test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
|
||||
set result [expr {1 << (8 * $tcl_platform(wordSize) - 1)}]
|
||||
# Result must be the largest bit in a machine word, which this checks
|
||||
# without assuming how wide the word really is
|
||||
list [expr {$result < 0}] [expr {$result ^ ($result - 1)}]
|
||||
} {1 -1}
|
||||
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-14
@@ -10,7 +10,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: safe.test,v 1.10 2000/11/17 11:06:54 dkf Exp $
|
||||
# RCS: @(#) $Id: safe.test,v 1.10.12.1 2001/12/02 22:06:23 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -185,7 +185,7 @@ test safe-6.3 {test safe interpreters knowledge of the world} {
|
||||
set r [lreplace $r $threaded $threaded]
|
||||
}
|
||||
set r
|
||||
} {byteOrder platform}
|
||||
} {byteOrder platform wordSize}
|
||||
|
||||
# more test should be added to check that hostname, nameofexecutable,
|
||||
# aren't leaking infos, but they still do...
|
||||
@@ -518,15 +518,3 @@ test safe-11.8 {testing safe encoding} {
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+10
-1
@@ -11,13 +11,16 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: scan.test,v 1.11 2000/12/10 03:27:04 hobbs Exp $
|
||||
# RCS: @(#) $Id: scan.test,v 1.11.12.1 2001/10/11 14:56:21 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
}
|
||||
|
||||
set ::tcltest::testConstraints(64bitInts) \
|
||||
[expr {0x80000000 > 0}]
|
||||
|
||||
test scan-1.1 {BuildCharSet, CharInSet} {
|
||||
list [scan foo {%[^o]} x] $x
|
||||
} {1 f}
|
||||
@@ -405,6 +408,12 @@ test scan-5.11 {integer scanning} {nonPortable} {
|
||||
[expr {$b == -16 || $b == 0x7fffffff}]
|
||||
} {2 4294967280 1}
|
||||
|
||||
test scan-5.12 {integer scanning} {64bitInts} {
|
||||
set a {}; set b {}; set c {}
|
||||
list [scan "7810179016327718216,6c63546f6c6c6548,661432506755433062510" \
|
||||
%ld,%lx,%lo a b c] $a $b $c
|
||||
} {3 7810179016327718216 7810179016327718216 7810179016327718216}
|
||||
|
||||
test scan-6.1 {floating-point scanning} {
|
||||
set a {}; set b {}; set c {}; set d {}
|
||||
list [scan "2.1 -3.0e8 .99962 a" "%f%g%e%f" a b c d] $a $b $c $d
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# RCS: @(#) $Id: string.test,v 1.29 2001/05/14 08:57:26 dkf Exp $
|
||||
# RCS: @(#) $Id: string.test,v 1.29.8.1 2001/10/12 15:02:36 dkf Exp $
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
@@ -273,7 +273,7 @@ proc largest_int {} {
|
||||
# so we can test for overflow properly below on >32 bit systems
|
||||
set int 1
|
||||
set exp 7; # assume we get at least 8 bits
|
||||
while {$int > 0} { set int [expr {1 << [incr exp]}] }
|
||||
while {$int > 0} { set int [expr {wide(1) << [incr exp]}] }
|
||||
return [expr {$int-1}]
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -5,7 +5,7 @@
|
||||
# "autoconf" program (constructs like "@foo@" will get replaced in the
|
||||
# actual Makefile.
|
||||
#
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.83 2001/09/10 00:33:09 mdejong Exp $
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.83.4.1 2001/10/17 09:28:16 dkf Exp $
|
||||
|
||||
VERSION = @TCL_VERSION@
|
||||
|
||||
@@ -1031,9 +1031,15 @@ strtod.o: $(COMPAT_DIR)/strtod.c
|
||||
strtol.o: $(COMPAT_DIR)/strtol.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtol.c
|
||||
|
||||
strtoll.o: $(COMPAT_DIR)/strtoll.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoll.c
|
||||
|
||||
strtoul.o: $(COMPAT_DIR)/strtoul.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoul.c
|
||||
|
||||
strtoull.o: $(COMPAT_DIR)/strtoull.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoull.c
|
||||
|
||||
tmpnam.o: $(COMPAT_DIR)/tmpnam.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/tmpnam.c
|
||||
|
||||
|
||||
Vendored
+1108
-1525
File diff suppressed because it is too large
Load Diff
+50
-29
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
|
||||
dnl generate the file "configure", which is run during Tcl installation
|
||||
dnl to configure the system for the local environment.
|
||||
AC_INIT(../generic/tcl.h)
|
||||
# RCS: @(#) $Id: configure.in,v 1.72 2001/08/12 21:17:43 mdejong Exp $
|
||||
# RCS: @(#) $Id: configure.in,v 1.72.6.2 2001/10/17 09:28:16 dkf Exp $
|
||||
|
||||
TCL_VERSION=8.4
|
||||
TCL_MAJOR_VERSION=8
|
||||
@@ -60,6 +60,12 @@ if test -n "$GCC"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_C_CROSS
|
||||
|
||||
SC_TCL_EARLY_FLAGS
|
||||
|
||||
SC_TCL_64BIT_FLAGS
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Supply substitutes for missing POSIX library procedures, or
|
||||
# set flags so Tcl uses alternate procedures.
|
||||
@@ -72,7 +78,7 @@ AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD)])
|
||||
|
||||
AC_REPLACE_FUNCS(opendir strstr)
|
||||
|
||||
AC_REPLACE_FUNCS(strtol tmpnam waitpid)
|
||||
AC_REPLACE_FUNCS(strtol tmpnam waitpid strtoll strtoull)
|
||||
AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR)])
|
||||
AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD)])
|
||||
AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3)])
|
||||
@@ -108,16 +114,23 @@ SC_SERIAL_PORT
|
||||
# special flag.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING([fd_set and sys/select])
|
||||
AC_TRY_COMPILE([#include <sys/types.h>],
|
||||
[fd_set readMask, writeMask;], tk_ok=yes, tk_ok=no)
|
||||
if test $tk_ok = no; then
|
||||
AC_HEADER_EGREP(fd_mask, sys/select.h, tk_ok=yes)
|
||||
if test $tk_ok = yes; then
|
||||
AC_MSG_CHECKING([for fd_set in sys/types])
|
||||
AC_CACHE_VAL(tcl_cv_type_fd_set,
|
||||
AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
|
||||
tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no))
|
||||
AC_MSG_RESULT($tcl_cv_type_fd_set)
|
||||
tk_ok=$tcl_cv_type_fd_set
|
||||
if test $tcl_cv_type_fd_set = no; then
|
||||
AC_MSG_CHECKING([for fd_mask in sys/select])
|
||||
AC_CACHE_VAL(tcl_cv_grep_fd_mask,
|
||||
AC_HEADER_EGREP(fd_mask, sys/select.h,
|
||||
tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing))
|
||||
AC_MSG_RESULT($tcl_cv_grep_fd_mask)
|
||||
if test $tcl_cv_grep_fd_mask = present; then
|
||||
AC_DEFINE(HAVE_SYS_SELECT_H)
|
||||
tk_ok=yes
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($tk_ok)
|
||||
if test $tk_ok = no; then
|
||||
AC_DEFINE(NO_FD_SET)
|
||||
fi
|
||||
@@ -254,14 +267,15 @@ AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H)])
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING([union wait])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
AC_CACHE_VAL(tcl_cv_union_wait,
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/wait.h>], [
|
||||
union wait x;
|
||||
WIFEXITED(x); /* Generates compiler error if WIFEXITED
|
||||
* uses an int. */
|
||||
], tcl_ok=yes, tcl_ok=no)
|
||||
AC_MSG_RESULT($tcl_ok)
|
||||
if test $tcl_ok = no; then
|
||||
], tcl_cv_union_wait=yes, tcl_cv_union_wait=no))
|
||||
AC_MSG_RESULT($tcl_cv_union_wait)
|
||||
if test $tcl_cv_union_wait = no; then
|
||||
AC_DEFINE(NO_UNION_WAIT)
|
||||
fi
|
||||
|
||||
@@ -271,13 +285,14 @@ fi
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING([matherr support])
|
||||
AC_TRY_COMPILE([#include <math.h>], [
|
||||
struct exception x;
|
||||
x.type = DOMAIN;
|
||||
x.type = SING;
|
||||
], tcl_ok=yes, tcl_ok=no)
|
||||
AC_MSG_RESULT($tcl_ok)
|
||||
if test $tcl_ok = yes; then
|
||||
AC_CACHE_VAL(tcl_cv_func_matherr,
|
||||
AC_TRY_COMPILE([#include <math.h>], [
|
||||
struct exception x;
|
||||
x.type = DOMAIN;
|
||||
x.type = SING;
|
||||
], tcl_cv_func_matherr=yes, tcl_cv_func_matherr=no))
|
||||
AC_MSG_RESULT($tcl_cv_func_matherr)
|
||||
if test $tcl_cv_func_matherr = yes; then
|
||||
AC_DEFINE(NEED_MATHERR)
|
||||
fi
|
||||
|
||||
@@ -314,10 +329,13 @@ AC_CHECK_FUNC(BSDgettimeofday,
|
||||
AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD)])
|
||||
])
|
||||
AC_MSG_CHECKING([for gettimeofday declaration])
|
||||
AC_EGREP_HEADER(gettimeofday, sys/time.h, AC_MSG_RESULT(present), [
|
||||
AC_MSG_RESULT(missing)
|
||||
AC_CACHE_VAL(tcl_cv_grep_gettimeofday,
|
||||
AC_EGREP_HEADER(gettimeofday, sys/time.h,
|
||||
tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing))
|
||||
AC_MSG_RESULT($tcl_cv_grep_gettimeofday)
|
||||
if test $tcl_cv_grep_gettimeofday = missing ; then
|
||||
AC_DEFINE(GETTOD_NOT_DECLARED)
|
||||
])
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# The following code checks to see whether it is possible to get
|
||||
@@ -327,12 +345,13 @@ AC_EGREP_HEADER(gettimeofday, sys/time.h, AC_MSG_RESULT(present), [
|
||||
|
||||
AC_C_CHAR_UNSIGNED
|
||||
AC_MSG_CHECKING([signed char declarations])
|
||||
AC_TRY_COMPILE(, [
|
||||
signed char *p;
|
||||
p = 0;
|
||||
], tcl_ok=yes, tcl_ok=no)
|
||||
AC_MSG_RESULT($tcl_ok)
|
||||
if test $tcl_ok = yes; then
|
||||
AC_CACHE_VAL(tcl_cv_char_signed,
|
||||
AC_TRY_COMPILE(, [
|
||||
signed char *p;
|
||||
p = 0;
|
||||
], tcl_cv_char_signed=yes, tcl_cv_char_signed=no))
|
||||
AC_MSG_RESULT($tcl_cv_char_signed)
|
||||
if test $tcl_cv_char_signed = yes; then
|
||||
AC_DEFINE(HAVE_SIGNED_CHAR)
|
||||
fi
|
||||
|
||||
@@ -541,4 +560,6 @@ AC_SUBST(TCL_BIN_DIR)
|
||||
AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
|
||||
AC_SUBST(TCL_VERSION)
|
||||
|
||||
AC_SUBST(TCL_HAS_LONGLONG)
|
||||
|
||||
AC_OUTPUT(Makefile tclConfig.sh)
|
||||
|
||||
@@ -484,6 +484,7 @@ if test -r FileSystem.3; then
|
||||
rm -f Tcl_FSNewNativePath.3
|
||||
rm -f Tcl_FSGetNativePath.3
|
||||
rm -f Tcl_FSFileSystemInfo.3
|
||||
rm -f Tcl_AllocStatBuf.3
|
||||
ln FileSystem.3 Tcl_FSRegister.3
|
||||
ln FileSystem.3 Tcl_FSUnregister.3
|
||||
ln FileSystem.3 Tcl_FSData.3
|
||||
@@ -521,6 +522,7 @@ if test -r FileSystem.3; then
|
||||
ln FileSystem.3 Tcl_FSNewNativePath.3
|
||||
ln FileSystem.3 Tcl_FSGetNativePath.3
|
||||
ln FileSystem.3 Tcl_FSFileSystemInfo.3
|
||||
ln FileSystem.3 Tcl_AllocStatBuf.3
|
||||
fi
|
||||
if test -r FindExec.3; then
|
||||
rm -f Tcl_FindExecutable.3
|
||||
|
||||
+174
-84
@@ -1316,14 +1316,15 @@ dnl AC_CHECK_TOOL(AR, ar, :)
|
||||
#
|
||||
# Determine which interface to use to talk to the serial port.
|
||||
# Note that #include lines must begin in leftmost column for
|
||||
# some compilers to recognize them as preprocessor directives.
|
||||
# some compilers to recognize them as preprocessor directives,
|
||||
# and some build environments have stdin not pointing at a
|
||||
# pseudo-terminal (usually /dev/null instead.)
|
||||
#
|
||||
# Arguments:
|
||||
# none
|
||||
#
|
||||
# Results:
|
||||
#
|
||||
# Defines only one of the following vars:
|
||||
# Defines only one of the following vars (if any):
|
||||
# USE_TERMIOS
|
||||
# USE_TERMIO
|
||||
# USE_SGTTY
|
||||
@@ -1332,12 +1333,10 @@ dnl AC_CHECK_TOOL(AR, ar, :)
|
||||
|
||||
AC_DEFUN(SC_SERIAL_PORT, [
|
||||
AC_MSG_CHECKING([termios vs. termio vs. sgtty])
|
||||
|
||||
AC_CACHE_VAL(tcl_cv_api_serial, [
|
||||
AC_TRY_RUN([
|
||||
#include <termios.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
struct termios t;
|
||||
if (tcgetattr(0, &t) == 0) {
|
||||
cfsetospeed(&t, 0);
|
||||
@@ -1345,32 +1344,23 @@ main()
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}], tk_ok=termios, tk_ok=no, tk_ok=no)
|
||||
|
||||
if test $tk_ok = termios; then
|
||||
AC_DEFINE(USE_TERMIOS)
|
||||
else
|
||||
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
|
||||
if test $tcl_cv_api_serial = no ; then
|
||||
AC_TRY_RUN([
|
||||
#include <termio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
struct termio t;
|
||||
if (ioctl(0, TCGETA, &t) == 0) {
|
||||
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}], tk_ok=termio, tk_ok=no, tk_ok=no)
|
||||
|
||||
if test $tk_ok = termio; then
|
||||
AC_DEFINE(USE_TERMIO)
|
||||
else
|
||||
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
|
||||
fi
|
||||
if test $tcl_cv_api_serial = no ; then
|
||||
AC_TRY_RUN([
|
||||
#include <sgtty.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
struct sgttyb t;
|
||||
if (ioctl(0, TIOCGETP, &t) == 0) {
|
||||
t.sg_ospeed = 0;
|
||||
@@ -1378,17 +1368,13 @@ main()
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}], tk_ok=sgtty, tk_ok=none, tk_ok=none)
|
||||
|
||||
if test $tk_ok = sgtty; then
|
||||
AC_DEFINE(USE_SGTTY)
|
||||
else
|
||||
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
|
||||
fi
|
||||
if test $tcl_cv_api_serial = no ; then
|
||||
AC_TRY_RUN([
|
||||
#include <termios.h>
|
||||
#include <errno.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
struct termios t;
|
||||
if (tcgetattr(0, &t) == 0
|
||||
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
|
||||
@@ -1397,17 +1383,13 @@ main()
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}], tk_ok=termios, tk_ok=no, tk_ok=no)
|
||||
|
||||
if test $tk_ok = termios; then
|
||||
AC_DEFINE(USE_TERMIOS)
|
||||
else
|
||||
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
|
||||
fi
|
||||
if test $tcl_cv_api_serial = no; then
|
||||
AC_TRY_RUN([
|
||||
#include <termio.h>
|
||||
#include <errno.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
struct termio t;
|
||||
if (ioctl(0, TCGETA, &t) == 0
|
||||
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
|
||||
@@ -1415,17 +1397,13 @@ main()
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}], tk_ok=termio, tk_ok=no, tk_ok=no)
|
||||
|
||||
if test $tk_ok = termio; then
|
||||
AC_DEFINE(USE_TERMIO)
|
||||
else
|
||||
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
|
||||
fi
|
||||
if test $tcl_cv_api_serial = no; then
|
||||
AC_TRY_RUN([
|
||||
#include <sgtty.h>
|
||||
#include <errno.h>
|
||||
|
||||
main()
|
||||
{
|
||||
main() {
|
||||
struct sgttyb t;
|
||||
if (ioctl(0, TIOCGETP, &t) == 0
|
||||
|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
|
||||
@@ -1434,17 +1412,14 @@ main()
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}], tk_ok=sgtty, tk_ok=none, tk_ok=none)
|
||||
|
||||
if test $tk_ok = sgtty; then
|
||||
AC_DEFINE(USE_SGTTY)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($tk_ok)
|
||||
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
|
||||
fi])
|
||||
case $tcl_cv_api_serial in
|
||||
termios) AC_DEFINE(USE_TERMIOS);;
|
||||
termio) AC_DEFINE(USE_TERMIO);;
|
||||
sgtty) AC_DEFINE(USE_SGTTY);;
|
||||
esac
|
||||
AC_MSG_RESULT($tcl_cv_api_serial)
|
||||
])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
@@ -1718,44 +1693,52 @@ AC_DEFUN(SC_TIME_HANDLER, [
|
||||
AC_CHECK_FUNCS(gmtime_r localtime_r)
|
||||
|
||||
AC_MSG_CHECKING([tm_tzadj in struct tm])
|
||||
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
|
||||
[AC_DEFINE(HAVE_TM_TZADJ)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
AC_CACHE_VAL(tcl_cv_member_tm_tzadj,
|
||||
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
|
||||
tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no))
|
||||
AC_MSG_RESULT($tcl_cv_member_tm_tzadj)
|
||||
if test $tcl_cv_member_tm_tzadj = yes ; then
|
||||
AC_DEFINE(HAVE_TM_TZADJ)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([tm_gmtoff in struct tm])
|
||||
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
|
||||
[AC_DEFINE(HAVE_TM_GMTOFF)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
AC_CACHE_VAL(tcl_cv_member_tm_gmtoff,
|
||||
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
|
||||
tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no))
|
||||
AC_MSG_RESULT($tcl_cv_member_tm_gmtoff)
|
||||
if test $tcl_cv_member_tm_gmtoff = yes ; then
|
||||
AC_DEFINE(HAVE_TM_GMTOFF)
|
||||
fi
|
||||
|
||||
#
|
||||
# Its important to include time.h in this check, as some systems
|
||||
# (like convex) have timezone functions, etc.
|
||||
#
|
||||
have_timezone=no
|
||||
AC_MSG_CHECKING([long timezone variable])
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
AC_CACHE_VAL(tcl_cv_var_timezone,
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[extern long timezone;
|
||||
timezone += 1;
|
||||
exit (0);],
|
||||
[have_timezone=yes
|
||||
tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no))
|
||||
AC_MSG_RESULT($tcl_cv_timezone_long)
|
||||
if test $tcl_cv_timezone_long = yes ; then
|
||||
AC_DEFINE(HAVE_TIMEZONE_VAR)
|
||||
else
|
||||
#
|
||||
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
|
||||
#
|
||||
AC_MSG_CHECKING([time_t timezone variable])
|
||||
AC_CACHE_VAL(tcl_cv_timezone_time,
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[extern time_t timezone;
|
||||
timezone += 1;
|
||||
exit (0);],
|
||||
tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no))
|
||||
AC_MSG_RESULT($tcl_cv_timezone_time)
|
||||
if test $tcl_cv_timezone_time = yes ; then
|
||||
AC_DEFINE(HAVE_TIMEZONE_VAR)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
#
|
||||
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
|
||||
#
|
||||
if test "$have_timezone" = no; then
|
||||
AC_MSG_CHECKING([time_t timezone variable])
|
||||
AC_TRY_COMPILE([#include <time.h>],
|
||||
[extern time_t timezone;
|
||||
timezone += 1;
|
||||
exit (0);],
|
||||
[AC_DEFINE(HAVE_TIMEZONE_VAR)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
fi
|
||||
fi
|
||||
|
||||
])
|
||||
@@ -1896,3 +1879,110 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [
|
||||
AC_SUBST(TCL_LIBS)
|
||||
AC_SUBST(MATH_LIBS)
|
||||
])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# SC_TCL_EARLY_FLAGS
|
||||
#
|
||||
# Check for what flags are needed to be passed so the correct OS
|
||||
# features are available.
|
||||
#
|
||||
# Arguments:
|
||||
# None
|
||||
#
|
||||
# Results:
|
||||
#
|
||||
# Might define the following vars:
|
||||
# _ISOC99_SOURCE
|
||||
# _LARGEFILE64_SOURCE
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN(SC_TCL_EARLY_FLAG,[
|
||||
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
|
||||
AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
|
||||
AC_TRY_COMPILE([[#define ]$1[ 1
|
||||
]$2], $3,
|
||||
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
|
||||
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
|
||||
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
|
||||
AC_DEFINE($1)
|
||||
tcl_flags="$tcl_flags $1"
|
||||
fi])
|
||||
|
||||
AC_DEFUN(SC_TCL_EARLY_FLAGS,[
|
||||
AC_MSG_CHECKING([for required early compiler flags])
|
||||
tcl_flags=""
|
||||
SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
|
||||
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
|
||||
SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
|
||||
[struct stat64 buf; int i = stat64("/", &buf);])
|
||||
if test "x${tcl_flags}" = "x" ; then
|
||||
AC_MSG_RESULT(none)
|
||||
else
|
||||
AC_MSG_RESULT(${tcl_flags})
|
||||
fi])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# SC_TCL_64BIT_FLAGS
|
||||
#
|
||||
# Check for what is defined in the way of 64-bit features.
|
||||
#
|
||||
# Arguments:
|
||||
# None
|
||||
#
|
||||
# Results:
|
||||
#
|
||||
# Might define the following vars:
|
||||
# TCL_WIDE_INT_IS_LONG
|
||||
# TCL_WIDE_INT_TYPE
|
||||
# HAVE_STRUCT_DIRENT64
|
||||
# HAVE_STRUCT_STAT64
|
||||
# HAVE_TYPE_OFF64_T
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN(SC_TCL_64BIT_FLAGS, [
|
||||
AC_MSG_CHECKING([for 64-bit integer type])
|
||||
AC_CACHE_VAL(tcl_cv_type_64bit,[
|
||||
AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
|
||||
tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none
|
||||
AC_TRY_RUN([#include <unistd.h>
|
||||
int main() {exit(!(sizeof(long long) > sizeof(long)));}
|
||||
], tcl_cv_type_64bit="long long"))])
|
||||
if test "${tcl_cv_type_64bit}" = none ; then
|
||||
AC_MSG_RESULT(using long)
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit})
|
||||
AC_MSG_RESULT(${tcl_cv_type_64bit})
|
||||
|
||||
# Now check for auxiliary declarations
|
||||
AC_MSG_CHECKING([for struct dirent64])
|
||||
AC_CACHE_VAL(tcl_cv_struct_dirent64,[
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/dirent.h>],[struct dirent64 p;],
|
||||
tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
|
||||
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_STRUCT_DIRENT64)
|
||||
fi
|
||||
AC_MSG_RESULT(${tcl_cv_struct_dirent64})
|
||||
|
||||
AC_MSG_CHECKING([for struct stat64])
|
||||
AC_CACHE_VAL(tcl_cv_struct_stat64,[
|
||||
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
|
||||
],
|
||||
tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
|
||||
if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_STRUCT_STAT64)
|
||||
fi
|
||||
AC_MSG_RESULT(${tcl_cv_struct_stat64})
|
||||
|
||||
AC_MSG_CHECKING([for off64_t])
|
||||
AC_CACHE_VAL(tcl_cv_type_off64_t,[
|
||||
AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
|
||||
],
|
||||
tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
|
||||
if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_TYPE_OFF64_T)
|
||||
fi
|
||||
AC_MSG_RESULT(${tcl_cv_type_off64_t})
|
||||
fi])
|
||||
|
||||
+9
-2
@@ -14,7 +14,7 @@
|
||||
* and Design Engineering (MADE) Initiative through ARPA contract
|
||||
* F33615-94-C-4400.
|
||||
*
|
||||
* RCS: @(#) $Id: tclLoadAout.c,v 1.6 2001/09/04 18:06:34 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclLoadAout.c,v 1.6.6.1 2001/09/27 10:21:32 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -263,7 +263,14 @@ TclpLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
|
||||
|
||||
(void) brk (startAddress + relocatedSize);
|
||||
|
||||
/* Seek to the start of the module's text */
|
||||
/*
|
||||
* Seek to the start of the module's text
|
||||
*
|
||||
* Note that this does not really work with large files (i.e. where
|
||||
* lseek64 exists and is different to lseek), but anyone trying to
|
||||
* dynamically load a binary that is larger than what can fit in
|
||||
* addressable memory is in trouble anyway...
|
||||
*/
|
||||
|
||||
#if defined(__mips) || defined(mips)
|
||||
status = lseek (relocatedFd,
|
||||
|
||||
+17
-16
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUnixChan.c,v 1.21 2001/08/30 08:53:15 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclUnixChan.c,v 1.21.6.5 2001/09/28 14:29:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h" /* Internal definitions for Tcl. */
|
||||
@@ -188,9 +188,9 @@ static int FileInputProc _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toRead, int *errorCode));
|
||||
static int FileOutputProc _ANSI_ARGS_((
|
||||
ClientData instanceData, char *buf, int toWrite,
|
||||
int *errorCode));
|
||||
static int FileSeekProc _ANSI_ARGS_((ClientData instanceData,
|
||||
long offset, int mode, int *errorCode));
|
||||
int *errorCode));
|
||||
static Tcl_WideInt FileSeekProc _ANSI_ARGS_((ClientData instanceData,
|
||||
Tcl_WideInt offset, int mode, int *errorCode));
|
||||
static void FileWatchProc _ANSI_ARGS_((ClientData instanceData,
|
||||
int mask));
|
||||
static void TcpAccept _ANSI_ARGS_((ClientData data, int mask));
|
||||
@@ -510,10 +510,10 @@ FileCloseProc(instanceData, interp)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
static Tcl_WideInt
|
||||
FileSeekProc(instanceData, offset, mode, errorCodePtr)
|
||||
ClientData instanceData; /* File state. */
|
||||
long offset; /* Offset to seek to. */
|
||||
Tcl_WideInt offset; /* Offset to seek to. */
|
||||
int mode; /* Relative to where
|
||||
* should we seek? Can be
|
||||
* one of SEEK_START,
|
||||
@@ -521,9 +521,9 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
|
||||
int *errorCodePtr; /* To store error code. */
|
||||
{
|
||||
FileState *fsPtr = (FileState *) instanceData;
|
||||
int newLoc;
|
||||
Tcl_WideInt newLoc;
|
||||
|
||||
newLoc = lseek(fsPtr->fd, (off_t) offset, mode);
|
||||
newLoc = Tcl_PlatformSeek(fsPtr->fd, (Tcl_SeekOffset) offset, mode);
|
||||
|
||||
*errorCodePtr = (newLoc == -1) ? errno : 0;
|
||||
return newLoc;
|
||||
@@ -1326,7 +1326,7 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
|
||||
if (native == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
fd = open(native, mode, permissions);
|
||||
fd = Tcl_PlatformOpen(native, mode, permissions);
|
||||
|
||||
if (fd < 0) {
|
||||
if (interp != (Tcl_Interp *) NULL) {
|
||||
@@ -1378,7 +1378,8 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions)
|
||||
(ClientData) fsPtr, channelPermissions);
|
||||
|
||||
if (seekFlag) {
|
||||
if (Tcl_Seek(fsPtr->channel, 0, SEEK_END) < 0) {
|
||||
if (Tcl_Seek(fsPtr->channel, (Tcl_WideInt)0,
|
||||
SEEK_END) < (Tcl_WideInt)0) {
|
||||
if (interp != (Tcl_Interp *) NULL) {
|
||||
Tcl_AppendResult(interp, "couldn't seek to end of file on \"",
|
||||
channelName, "\": ", Tcl_PosixError(interp), NULL);
|
||||
@@ -2497,8 +2498,8 @@ TclpGetDefaultStdChannel(type)
|
||||
|
||||
switch (type) {
|
||||
case TCL_STDIN:
|
||||
if ((lseek(0, (off_t) 0, SEEK_CUR) == -1) &&
|
||||
(errno == EBADF)) {
|
||||
if ((Tcl_PlatformSeek(0, (Tcl_SeekOffset) 0, SEEK_CUR)
|
||||
== (Tcl_SeekOffset)-1) && (errno == EBADF)) {
|
||||
return (Tcl_Channel) NULL;
|
||||
}
|
||||
fd = 0;
|
||||
@@ -2506,8 +2507,8 @@ TclpGetDefaultStdChannel(type)
|
||||
bufMode = "line";
|
||||
break;
|
||||
case TCL_STDOUT:
|
||||
if ((lseek(1, (off_t) 0, SEEK_CUR) == -1) &&
|
||||
(errno == EBADF)) {
|
||||
if ((Tcl_PlatformSeek(1, (Tcl_SeekOffset) 0, SEEK_CUR)
|
||||
== (Tcl_SeekOffset)-1) && (errno == EBADF)) {
|
||||
return (Tcl_Channel) NULL;
|
||||
}
|
||||
fd = 1;
|
||||
@@ -2515,8 +2516,8 @@ TclpGetDefaultStdChannel(type)
|
||||
bufMode = "line";
|
||||
break;
|
||||
case TCL_STDERR:
|
||||
if ((lseek(2, (off_t) 0, SEEK_CUR) == -1) &&
|
||||
(errno == EBADF)) {
|
||||
if ((Tcl_PlatformSeek(2, (Tcl_SeekOffset) 0, SEEK_CUR)
|
||||
== (Tcl_SeekOffset)-1) && (errno == EBADF)) {
|
||||
return (Tcl_Channel) NULL;
|
||||
}
|
||||
fd = 2;
|
||||
|
||||
+27
-27
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUnixFCmd.c,v 1.12 2001/09/04 18:06:34 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclUnixFCmd.c,v 1.12.6.7 2001/09/28 14:29:23 dkf Exp $
|
||||
*
|
||||
* Portions of this code were derived from NetBSD source code which has
|
||||
* the following copyright notice:
|
||||
@@ -97,7 +97,7 @@ static int GetModeFromPermString _ANSI_ARGS_((
|
||||
*/
|
||||
|
||||
typedef int (TraversalProc) _ANSI_ARGS_((Tcl_DString *srcPtr,
|
||||
Tcl_DString *dstPtr, CONST struct stat *statBufPtr, int type,
|
||||
Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr, int type,
|
||||
Tcl_DString *errorPtr));
|
||||
|
||||
/*
|
||||
@@ -128,9 +128,9 @@ CONST TclFileAttrProcs tclpFileAttrProcs[] = {
|
||||
*/
|
||||
|
||||
static int CopyFile _ANSI_ARGS_((CONST char *src,
|
||||
CONST char *dst, CONST struct stat *statBufPtr));
|
||||
CONST char *dst, CONST Tcl_StatBuf *statBufPtr));
|
||||
static int CopyFileAtts _ANSI_ARGS_((CONST char *src,
|
||||
CONST char *dst, CONST struct stat *statBufPtr));
|
||||
CONST char *dst, CONST Tcl_StatBuf *statBufPtr));
|
||||
static int DoCopyFile _ANSI_ARGS_((CONST char *srcPtr,
|
||||
CONST char *dstPtr));
|
||||
static int DoCreateDirectory _ANSI_ARGS_((CONST char *pathPtr));
|
||||
@@ -140,10 +140,10 @@ static int DoRemoveDirectory _ANSI_ARGS_((Tcl_DString *pathPtr,
|
||||
static int DoRenameFile _ANSI_ARGS_((CONST char *src,
|
||||
CONST char *dst));
|
||||
static int TraversalCopy _ANSI_ARGS_((Tcl_DString *srcPtr,
|
||||
Tcl_DString *dstPtr, CONST struct stat *statBufPtr,
|
||||
Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr,
|
||||
int type, Tcl_DString *errorPtr));
|
||||
static int TraversalDelete _ANSI_ARGS_((Tcl_DString *srcPtr,
|
||||
Tcl_DString *dstPtr, CONST struct stat *statBufPtr,
|
||||
Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr,
|
||||
int type, Tcl_DString *errorPtr));
|
||||
static int TraverseUnixTree _ANSI_ARGS_((
|
||||
TraversalProc *traversalProc,
|
||||
@@ -230,7 +230,7 @@ DoRenameFile(src, dst)
|
||||
if (errno == EINVAL) {
|
||||
char srcPath[MAXPATHLEN], dstPath[MAXPATHLEN];
|
||||
DIR *dirPtr;
|
||||
struct dirent *dirEntPtr;
|
||||
Tcl_DirEntry *dirEntPtr;
|
||||
|
||||
if ((realpath((char *) src, srcPath) != NULL) /* INTL: Native. */
|
||||
&& (realpath((char *) dst, dstPath) != NULL) /* INTL: Native. */
|
||||
@@ -238,7 +238,7 @@ DoRenameFile(src, dst)
|
||||
dirPtr = opendir(dst); /* INTL: Native. */
|
||||
if (dirPtr != NULL) {
|
||||
while (1) {
|
||||
dirEntPtr = readdir(dirPtr); /* INTL: Native. */
|
||||
dirEntPtr = Tcl_PlatformReaddir(dirPtr); /* INTL: Native. */
|
||||
if (dirEntPtr == NULL) {
|
||||
break;
|
||||
}
|
||||
@@ -317,13 +317,13 @@ DoCopyFile(src, dst)
|
||||
CONST char *src; /* Pathname of file to be copied (native). */
|
||||
CONST char *dst; /* Pathname of file to copy to (native). */
|
||||
{
|
||||
struct stat srcStatBuf, dstStatBuf;
|
||||
Tcl_StatBuf srcStatBuf, dstStatBuf;
|
||||
|
||||
/*
|
||||
* Have to do a stat() to determine the filetype.
|
||||
*/
|
||||
|
||||
if (lstat(src, &srcStatBuf) != 0) { /* INTL: Native. */
|
||||
if (Tcl_PlatformLStat(src, &srcStatBuf) != 0) { /* INTL: Native. */
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (S_ISDIR(srcStatBuf.st_mode)) {
|
||||
@@ -336,7 +336,7 @@ DoCopyFile(src, dst)
|
||||
* exists, so we remove it first
|
||||
*/
|
||||
|
||||
if (lstat(dst, &dstStatBuf) == 0) { /* INTL: Native. */
|
||||
if (Tcl_PlatformLStat(dst, &dstStatBuf) == 0) { /* INTL: Native. */
|
||||
if (S_ISDIR(dstStatBuf.st_mode)) {
|
||||
errno = EISDIR;
|
||||
return TCL_ERROR;
|
||||
@@ -406,7 +406,7 @@ CopyFile(src, dst, statBufPtr)
|
||||
CONST char *src; /* Pathname of file to copy (native). */
|
||||
CONST char *dst; /* Pathname of file to create/overwrite
|
||||
* (native). */
|
||||
CONST struct stat *statBufPtr;
|
||||
CONST Tcl_StatBuf *statBufPtr;
|
||||
/* Used to determine mode and blocksize. */
|
||||
{
|
||||
int srcFd;
|
||||
@@ -415,11 +415,11 @@ CopyFile(src, dst, statBufPtr)
|
||||
char *buffer; /* Data buffer for copy */
|
||||
size_t nread;
|
||||
|
||||
if ((srcFd = open(src, O_RDONLY, 0)) < 0) { /* INTL: Native. */
|
||||
if ((srcFd = Tcl_PlatformOpen(src,O_RDONLY,0)) < 0) { /* INTL: Native. */
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
dstFd = open(dst, O_CREAT | O_TRUNC | O_WRONLY, /* INTL: Native. */
|
||||
dstFd = Tcl_PlatformOpen(dst, O_CREAT|O_TRUNC|O_WRONLY,/* INTL: Native. */
|
||||
statBufPtr->st_mode);
|
||||
if (dstFd < 0) {
|
||||
close(srcFd);
|
||||
@@ -692,10 +692,10 @@ DoRemoveDirectory(pathPtr, recursive, errorPtr)
|
||||
|
||||
if (recursive != 0) {
|
||||
/* We should try to change permissions so this can be deleted */
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
int newPerm;
|
||||
|
||||
if (stat(path, &statBuf) == 0) {
|
||||
if (Tcl_PlatformStat(path, &statBuf) == 0) {
|
||||
oldPerm = (mode_t) (statBuf.st_mode & 0x00007FFF);
|
||||
}
|
||||
|
||||
@@ -768,11 +768,11 @@ TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr)
|
||||
* DString filled with UTF-8 name of file
|
||||
* causing error. */
|
||||
{
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
CONST char *source, *errfile;
|
||||
int result, sourceLen;
|
||||
int targetLen;
|
||||
struct dirent *dirEntPtr;
|
||||
Tcl_DirEntry *dirEntPtr;
|
||||
DIR *dirPtr;
|
||||
|
||||
errfile = NULL;
|
||||
@@ -780,7 +780,7 @@ TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr)
|
||||
targetLen = 0; /* lint. */
|
||||
|
||||
source = Tcl_DStringValue(sourcePtr);
|
||||
if (lstat(source, &statBuf) != 0) { /* INTL: Native. */
|
||||
if (Tcl_PlatformLStat(source, &statBuf) != 0) { /* INTL: Native. */
|
||||
errfile = source;
|
||||
goto end;
|
||||
}
|
||||
@@ -816,7 +816,7 @@ TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr)
|
||||
targetLen = Tcl_DStringLength(targetPtr);
|
||||
}
|
||||
|
||||
while ((dirEntPtr = readdir(dirPtr)) != NULL) { /* INTL: Native. */
|
||||
while ((dirEntPtr = Tcl_PlatformReaddir(dirPtr)) != NULL) { /* INTL: Native. */
|
||||
if ((strcmp(dirEntPtr->d_name, ".") == 0)
|
||||
|| (strcmp(dirEntPtr->d_name, "..") == 0)) {
|
||||
continue;
|
||||
@@ -898,7 +898,7 @@ static int
|
||||
TraversalCopy(srcPtr, dstPtr, statBufPtr, type, errorPtr)
|
||||
Tcl_DString *srcPtr; /* Source pathname to copy (native). */
|
||||
Tcl_DString *dstPtr; /* Destination pathname of copy (native). */
|
||||
CONST struct stat *statBufPtr;
|
||||
CONST Tcl_StatBuf *statBufPtr;
|
||||
/* Stat info for file specified by srcPtr. */
|
||||
int type; /* Reason for call - see TraverseUnixTree(). */
|
||||
Tcl_DString *errorPtr; /* If non-NULL, uninitialized or free
|
||||
@@ -963,7 +963,7 @@ static int
|
||||
TraversalDelete(srcPtr, ignore, statBufPtr, type, errorPtr)
|
||||
Tcl_DString *srcPtr; /* Source pathname (native). */
|
||||
Tcl_DString *ignore; /* Destination pathname (not used). */
|
||||
CONST struct stat *statBufPtr;
|
||||
CONST Tcl_StatBuf *statBufPtr;
|
||||
/* Stat info for file specified by srcPtr. */
|
||||
int type; /* Reason for call - see TraverseUnixTree(). */
|
||||
Tcl_DString *errorPtr; /* If non-NULL, uninitialized or free
|
||||
@@ -1017,7 +1017,7 @@ static int
|
||||
CopyFileAtts(src, dst, statBufPtr)
|
||||
CONST char *src; /* Path name of source file (native). */
|
||||
CONST char *dst; /* Path name of target file (native). */
|
||||
CONST struct stat *statBufPtr;
|
||||
CONST Tcl_StatBuf *statBufPtr;
|
||||
/* Stat info for source file */
|
||||
{
|
||||
struct utimbuf tval;
|
||||
@@ -1076,7 +1076,7 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr)
|
||||
Tcl_Obj *fileName; /* The name of the file (UTF-8). */
|
||||
Tcl_Obj **attributePtrPtr; /* A pointer to return the object with. */
|
||||
{
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
struct group *groupPtr;
|
||||
int result;
|
||||
|
||||
@@ -1128,7 +1128,7 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr)
|
||||
Tcl_Obj *fileName; /* The name of the file (UTF-8). */
|
||||
Tcl_Obj **attributePtrPtr; /* A pointer to return the object with. */
|
||||
{
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
struct passwd *pwPtr;
|
||||
int result;
|
||||
|
||||
@@ -1180,7 +1180,7 @@ GetPermissionsAttribute(interp, objIndex, fileName, attributePtrPtr)
|
||||
Tcl_Obj *fileName; /* The name of the file (UTF-8). */
|
||||
Tcl_Obj **attributePtrPtr; /* A pointer to return the object with. */
|
||||
{
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
char returnString[7];
|
||||
int result;
|
||||
|
||||
@@ -1358,7 +1358,7 @@ SetPermissionsAttribute(interp, objIndex, fileName, attributePtr)
|
||||
if (Tcl_GetLongFromObj(NULL, attributePtr, &mode) == TCL_OK) {
|
||||
newMode = (mode_t) (mode & 0x00007FFF);
|
||||
} else {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
char *modeStringPtr = Tcl_GetString(attributePtr);
|
||||
|
||||
/*
|
||||
|
||||
+16
-19
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUnixFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclUnixFile.c,v 1.12.6.6 2001/09/28 14:29:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -46,7 +46,7 @@ TclpFindExecutable(argv0)
|
||||
* (native). */
|
||||
{
|
||||
CONST char *name, *p;
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
int length;
|
||||
Tcl_DString buffer, nameString;
|
||||
|
||||
@@ -116,8 +116,8 @@ TclpFindExecutable(argv0)
|
||||
* strings directly.
|
||||
*/
|
||||
|
||||
if ((access(name, X_OK) == 0) /* INTL: Native. */
|
||||
&& (stat(name, &statBuf) == 0) /* INTL: Native. */
|
||||
if ((access(name, X_OK) == 0) /* INTL: Native. */
|
||||
&& (Tcl_PlatformStat(name, &statBuf) == 0) /* INTL: Native. */
|
||||
&& S_ISREG(statBuf.st_mode)) {
|
||||
goto gotName;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
char *native, *fname, *dirName;
|
||||
DIR *d;
|
||||
Tcl_DString ds;
|
||||
struct stat statBuf;
|
||||
Tcl_StatBuf statBuf;
|
||||
int matchHidden;
|
||||
int nativeDirLen;
|
||||
int result = TCL_OK;
|
||||
@@ -257,7 +257,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
|
||||
native = Tcl_UtfToExternalDString(NULL, dirName, -1, &ds);
|
||||
|
||||
if ((stat(native, &statBuf) != 0) /* INTL: UTF-8. */
|
||||
if ((Tcl_PlatformStat(native, &statBuf) != 0) /* INTL: UTF-8. */
|
||||
|| !S_ISDIR(statBuf.st_mode)) {
|
||||
Tcl_DStringFree(&dsOrig);
|
||||
Tcl_DStringFree(&ds);
|
||||
@@ -295,9 +295,9 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
while (1) {
|
||||
Tcl_DString utfDs;
|
||||
char *utf;
|
||||
struct dirent *entryPtr;
|
||||
Tcl_DirEntry *entryPtr;
|
||||
|
||||
entryPtr = readdir(d); /* INTL: Native. */
|
||||
entryPtr = Tcl_PlatformReaddir(d); /* INTL: Native. */
|
||||
if (entryPtr == NULL) {
|
||||
break;
|
||||
}
|
||||
@@ -331,7 +331,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
Tcl_DStringAppend(&dsOrig, utf, -1);
|
||||
fname = Tcl_DStringValue(&dsOrig);
|
||||
if (types != NULL) {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
char *nativeEntry;
|
||||
Tcl_DStringSetLength(&ds, nativeDirLen);
|
||||
Tcl_DStringAppend(&ds, entryPtr->d_name, -1);
|
||||
@@ -342,7 +342,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
*/
|
||||
|
||||
if (types->perm != 0) {
|
||||
if (stat(nativeEntry, &buf) != 0) {
|
||||
if (Tcl_PlatformStat(nativeEntry, &buf) != 0) {
|
||||
/*
|
||||
* Either the file has disappeared between the
|
||||
* 'readdir' call and the 'stat' call, or
|
||||
@@ -377,7 +377,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
if (typeOk && (types->type != 0)) {
|
||||
if (types->perm == 0) {
|
||||
/* We haven't yet done a stat on the file */
|
||||
if (stat(nativeEntry, &buf) != 0) {
|
||||
if (Tcl_PlatformStat(nativeEntry, &buf) != 0) {
|
||||
/* Posix error occurred */
|
||||
typeOk = 0;
|
||||
}
|
||||
@@ -407,7 +407,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
typeOk = 0;
|
||||
#ifdef S_ISLNK
|
||||
if (types->type & TCL_GLOB_TYPE_LINK) {
|
||||
if (lstat(nativeEntry, &buf) == 0) {
|
||||
if (Tcl_PlatformLStat(nativeEntry, &buf)==0) {
|
||||
if (S_ISLNK(buf.st_mode)) {
|
||||
typeOk = 1;
|
||||
}
|
||||
@@ -552,13 +552,13 @@ TclpObjChdir(pathPtr)
|
||||
int
|
||||
TclpObjLstat(pathPtr, bufPtr)
|
||||
Tcl_Obj *pathPtr; /* Path of file to stat */
|
||||
struct stat *bufPtr; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *bufPtr; /* Filled with results of stat call. */
|
||||
{
|
||||
char *path = Tcl_FSGetNativePath(pathPtr);
|
||||
if (path == NULL) {
|
||||
return -1;
|
||||
} else {
|
||||
return lstat(path, bufPtr);
|
||||
return Tcl_PlatformLStat(path, bufPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,13 +684,13 @@ TclpReadlink(path, linkPtr)
|
||||
int
|
||||
TclpObjStat(pathPtr, bufPtr)
|
||||
Tcl_Obj *pathPtr; /* Path of file to stat */
|
||||
struct stat *bufPtr; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *bufPtr; /* Filled with results of stat call. */
|
||||
{
|
||||
char *path = Tcl_FSGetNativePath(pathPtr);
|
||||
if (path == NULL) {
|
||||
return -1;
|
||||
} else {
|
||||
return stat(path, bufPtr);
|
||||
return Tcl_PlatformStat(path, bufPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,6 +734,3 @@ TclpObjLink(pathPtr, toPtr)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Copyright (c) 1999 by Scriptics Corporation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUnixInit.c,v 1.24 2001/08/27 02:14:08 dgp Exp $
|
||||
* RCS: @(#) $Id: tclUnixInit.c,v 1.24.6.3 2001/09/27 15:18:53 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUnixPipe.c,v 1.15 2001/09/04 18:06:35 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclUnixPipe.c,v 1.15.6.5 2001/09/28 14:29:23 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
@@ -140,7 +140,7 @@ TclpOpenFile(fname, mode)
|
||||
Tcl_DString ds;
|
||||
|
||||
native = Tcl_UtfToExternalDString(NULL, fname, -1, &ds);
|
||||
fd = open(native, mode, 0666); /* INTL: Native. */
|
||||
fd = Tcl_PlatformOpen(native, mode, 0666); /* INTL: Native. */
|
||||
Tcl_DStringFree(&ds);
|
||||
if (fd != -1) {
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
@@ -151,7 +151,7 @@ TclpOpenFile(fname, mode)
|
||||
*/
|
||||
|
||||
if (mode & O_WRONLY) {
|
||||
lseek(fd, (off_t) 0, SEEK_END);
|
||||
Tcl_PlatformSeek(fd, (Tcl_SeekOffset) 0, SEEK_END);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -214,7 +214,7 @@ TclpCreateTempFile(contents)
|
||||
return NULL;
|
||||
}
|
||||
Tcl_DStringFree(&dstring);
|
||||
lseek(fd, (off_t) 0, SEEK_SET);
|
||||
Tcl_PlatformSeek(fd, (Tcl_SeekOffset) 0, SEEK_SET);
|
||||
}
|
||||
return MakeFile(fd);
|
||||
}
|
||||
|
||||
+24
-1
@@ -19,7 +19,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclUnixPort.h,v 1.18 2001/08/30 08:53:15 vincentdarley Exp $
|
||||
* RCS: @(#) $Id: tclUnixPort.h,v 1.18.6.1 2001/10/17 09:28:17 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLUNIXPORT
|
||||
@@ -56,6 +56,29 @@
|
||||
# include <dirent.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STRUCT_DIRENT64
|
||||
typedef struct dirent64 Tcl_DirEntry;
|
||||
# define Tcl_PlatformReaddir readdir64
|
||||
#else
|
||||
typedef struct dirent Tcl_DirEntry;
|
||||
# define Tcl_PlatformReaddir readdir
|
||||
#endif
|
||||
#ifdef HAVE_TYPE_OFF64_T
|
||||
typedef off64_t Tcl_SeekOffset;
|
||||
# define Tcl_PlatformSeek lseek64
|
||||
# define Tcl_PlatformOpen open64
|
||||
#else
|
||||
typedef off_t Tcl_SeekOffset;
|
||||
# define Tcl_PlatformSeek lseek
|
||||
# define Tcl_PlatformOpen open
|
||||
#endif
|
||||
#ifdef HAVE_STRUCT_STAT64
|
||||
# define Tcl_PlatformStat stat64
|
||||
# define Tcl_PlatformLStat lstat64
|
||||
#else
|
||||
# define Tcl_PlatformStat stat
|
||||
# define Tcl_PlatformLStat lstat
|
||||
#endif
|
||||
#include <sys/file.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
# "autoconf" program (constructs like "@foo@" will get replaced in the
|
||||
# actual Makefile.
|
||||
#
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.54 2001/09/14 01:00:59 andreas_kupries Exp $
|
||||
# RCS: @(#) $Id: Makefile.in,v 1.54.2.1 2001/10/18 09:03:59 dkf Exp $
|
||||
|
||||
VERSION = @TCL_VERSION@
|
||||
|
||||
@@ -275,7 +275,7 @@ WIN_OBJS = \
|
||||
tclWinTime.$(OBJEXT)
|
||||
|
||||
COMPAT_OBJS = \
|
||||
strftime.$(OBJEXT)
|
||||
strftime.$(OBJEXT) strtoll.$(OBJEXT) strtoull.$(OBJEXT)
|
||||
|
||||
PIPE_OBJS = stub16.$(OBJEXT)
|
||||
|
||||
|
||||
@@ -175,6 +175,8 @@ TCLOBJS = \
|
||||
$(TMPDIR)\regfree.obj \
|
||||
$(TMPDIR)\regerror.obj \
|
||||
$(TMPDIR)\strftime.obj \
|
||||
$(TMPDIR)\strtoll.obj \
|
||||
$(TMPDIR)\strtoull.obj \
|
||||
$(TMPDIR)\tclAlloc.obj \
|
||||
$(TMPDIR)\tclAsync.obj \
|
||||
$(TMPDIR)\tclBasic.obj \
|
||||
|
||||
+3
-1
@@ -6,7 +6,7 @@
|
||||
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
# Copyright (c) 1998-2000 Ajuba Solutions.
|
||||
#
|
||||
# RCS: @(#) $Id: makefile.vc,v 1.65 2001/09/14 01:00:59 andreas_kupries Exp $
|
||||
# RCS: @(#) $Id: makefile.vc,v 1.65.2.1 2001/10/18 09:03:59 dkf Exp $
|
||||
|
||||
# Does not depend on the presence of any environment variables in
|
||||
# order to compile tcl; all needed information is derived from
|
||||
@@ -163,6 +163,8 @@ TCLOBJS = \
|
||||
$(TMPDIR)\regfree.obj \
|
||||
$(TMPDIR)\regerror.obj \
|
||||
$(TMPDIR)\strftime.obj \
|
||||
$(TMPDIR)\strtoll.obj \
|
||||
$(TMPDIR)\strtoull.obj \
|
||||
$(TMPDIR)\tclAlloc.obj \
|
||||
$(TMPDIR)\tclAsync.obj \
|
||||
$(TMPDIR)\tclBasic.obj \
|
||||
|
||||
+20
-16
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclWinChan.c,v 1.15 2001/09/07 17:08:50 andreas_kupries Exp $
|
||||
* RCS: @(#) $Id: tclWinChan.c,v 1.15.6.3 2001/10/19 12:51:48 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclWinInt.h"
|
||||
@@ -89,8 +89,8 @@ static int FileInputProc _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toRead, int *errorCode));
|
||||
static int FileOutputProc _ANSI_ARGS_((ClientData instanceData,
|
||||
char *buf, int toWrite, int *errorCode));
|
||||
static int FileSeekProc _ANSI_ARGS_((ClientData instanceData,
|
||||
long offset, int mode, int *errorCode));
|
||||
static Tcl_WideInt FileSeekProc _ANSI_ARGS_((ClientData instanceData,
|
||||
Tcl_WideInt offset, int mode, int *errorCode));
|
||||
static void FileSetupProc _ANSI_ARGS_((ClientData clientData,
|
||||
int flags));
|
||||
static void FileWatchProc _ANSI_ARGS_((ClientData instanceData,
|
||||
@@ -431,17 +431,16 @@ FileCloseProc(instanceData, interp)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
static Tcl_WideInt
|
||||
FileSeekProc(instanceData, offset, mode, errorCodePtr)
|
||||
ClientData instanceData; /* File state. */
|
||||
long offset; /* Offset to seek to. */
|
||||
int mode; /* Relative to where
|
||||
* should we seek? */
|
||||
int *errorCodePtr; /* To store error code. */
|
||||
ClientData instanceData; /* File state. */
|
||||
Tcl_WideInt offset; /* Offset to seek to. */
|
||||
int mode; /* Relative to where should we seek? */
|
||||
int *errorCodePtr; /* To store error code. */
|
||||
{
|
||||
FileInfo *infoPtr = (FileInfo *) instanceData;
|
||||
DWORD moveMethod;
|
||||
DWORD newPos;
|
||||
DWORD newPos, newPosHigh;
|
||||
|
||||
*errorCodePtr = 0;
|
||||
if (mode == SEEK_SET) {
|
||||
@@ -452,13 +451,18 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
|
||||
moveMethod = FILE_END;
|
||||
}
|
||||
|
||||
newPos = SetFilePointer(infoPtr->handle, offset, NULL, moveMethod);
|
||||
if (newPos == 0xFFFFFFFF) {
|
||||
TclWinConvertError(GetLastError());
|
||||
*errorCodePtr = errno;
|
||||
return -1;
|
||||
newPosHigh = (DWORD)(offset >> 32);
|
||||
newPos = SetFilePointer(infoPtr->handle, (LONG) offset, &newPosHigh,
|
||||
moveMethod);
|
||||
if (newPos == INVALID_SET_FILE_POINTER) {
|
||||
int winError = GetLastError();
|
||||
if (winError != NO_ERROR) {
|
||||
TclWinConvertError(winError);
|
||||
*errorCodePtr = errno;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return newPos;
|
||||
return ((Tcl_WideInt) newPos) | (((Tcl_WideInt) newPosHigh) << 32);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+8
-7
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclWinFile.c,v 1.15 2001/09/10 17:17:41 andreas_kupries Exp $
|
||||
* RCS: @(#) $Id: tclWinFile.c,v 1.15.4.2 2001/10/19 12:51:48 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclWinInt.h"
|
||||
@@ -31,7 +31,7 @@ typedef NET_API_STATUS NET_API_FUNCTION NETGETDCNAMEPROC
|
||||
(LPWSTR servername, LPWSTR domainname, LPBYTE *bufptr);
|
||||
|
||||
static int NativeAccess(TCHAR *path, int mode);
|
||||
static int NativeStat(TCHAR *path, struct stat *statPtr);
|
||||
static int NativeStat(TCHAR *path, Tcl_StatBuf *statPtr);
|
||||
static int NativeIsExec(TCHAR *path);
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
|
||||
typeOk = 0;
|
||||
}
|
||||
} else {
|
||||
struct stat buf;
|
||||
Tcl_StatBuf buf;
|
||||
|
||||
if (attr & FILE_ATTRIBUTE_HIDDEN) {
|
||||
/* If invisible */
|
||||
@@ -828,7 +828,7 @@ TclpGetCwd(interp, bufferPtr)
|
||||
int
|
||||
TclpObjStat(pathPtr, statPtr)
|
||||
Tcl_Obj *pathPtr; /* Path of file to stat */
|
||||
struct stat *statPtr; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *statPtr; /* Filled with results of stat call. */
|
||||
{
|
||||
Tcl_Obj *transPtr;
|
||||
/*
|
||||
@@ -879,7 +879,7 @@ TclpObjStat(pathPtr, statPtr)
|
||||
static int
|
||||
NativeStat(nativePath, statPtr)
|
||||
TCHAR *nativePath; /* Path of file to stat */
|
||||
struct stat *statPtr; /* Filled with results of stat call. */
|
||||
Tcl_StatBuf *statPtr; /* Filled with results of stat call. */
|
||||
{
|
||||
Tcl_DString ds;
|
||||
WIN32_FIND_DATAT data;
|
||||
@@ -980,7 +980,8 @@ NativeStat(nativePath, statPtr)
|
||||
statPtr->st_uid = 0;
|
||||
statPtr->st_gid = 0;
|
||||
statPtr->st_rdev = (dev_t) dev;
|
||||
statPtr->st_size = data.a.nFileSizeLow;
|
||||
statPtr->st_size = ((Tcl_WideInt)data.a.nFileSizeLow) |
|
||||
(((Tcl_WideInt)data.a.nFileSizeHigh) << 32);
|
||||
statPtr->st_atime = ToCTime(data.a.ftLastAccessTime);
|
||||
statPtr->st_mtime = ToCTime(data.a.ftLastWriteTime);
|
||||
statPtr->st_ctime = ToCTime(data.a.ftCreationTime);
|
||||
@@ -1143,7 +1144,7 @@ TclpObjAccess(pathPtr, mode)
|
||||
int
|
||||
TclpObjLstat(pathPtr, buf)
|
||||
Tcl_Obj *pathPtr;
|
||||
struct stat *buf;
|
||||
Tcl_StatBuf *buf;
|
||||
{
|
||||
return TclpObjStat(pathPtr,buf);
|
||||
}
|
||||
|
||||
+6
-2
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclWinMtherr.c,v 1.3 1999/04/16 00:48:09 stanton Exp $
|
||||
* RCS: @(#) $Id: tclWinMtherr.c,v 1.3.26.1 2001/10/22 14:53:22 dkf Exp $
|
||||
*/
|
||||
|
||||
#include "tclWinInt.h"
|
||||
@@ -43,7 +43,11 @@ _matherr(xPtr)
|
||||
if (!TclMathInProgress()) {
|
||||
return 0;
|
||||
}
|
||||
if ((xPtr->type == DOMAIN) || (xPtr->type == SING)) {
|
||||
if ((xPtr->type == DOMAIN)
|
||||
#ifdef __BORLANDC__
|
||||
|| (xPtr->type == TLOSS)
|
||||
#endif
|
||||
|| (xPtr->type == SING)) {
|
||||
errno = EDOM;
|
||||
} else {
|
||||
errno = ERANGE;
|
||||
|
||||
+12
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* RCS: @(#) $Id: tclWinPort.h,v 1.22 2001/09/20 18:33:55 hobbs Exp $
|
||||
* RCS: @(#) $Id: tclWinPort.h,v 1.22.2.2 2001/10/22 10:15:02 dkf Exp $
|
||||
*/
|
||||
|
||||
#ifndef _TCLWINPORT
|
||||
@@ -464,6 +464,17 @@ typedef int TclpMutex;
|
||||
#define TclpMutexUnlock(a)
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
#ifdef TCL_WIDE_INT_TYPE
|
||||
EXTERN Tcl_WideInt strtoll _ANSI_ARGS_((char *string, char **endPtr,
|
||||
int base));
|
||||
EXTERN Tcl_WideUInt strtoull _ANSI_ARGS_((char *string, char **endPtr,
|
||||
int base));
|
||||
#endif /* TCL_WIDE_INT_TYPE */
|
||||
|
||||
#ifndef INVALID_SET_FILE_POINTER
|
||||
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
|
||||
#endif
|
||||
|
||||
#include "tclPlatDecls.h"
|
||||
#include "tclIntPlatDecls.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user