Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch core-8-6-branch
Through [c7f8965af7]
Excluding Merge-Ins
This is equivalent to a diff from
eb8b79d49c
to c7f8965af7
|
2017-05-21
| | |
| 17:42 |
|
check-in: a871079e2e user: jan.nijtmans tags: core-8-6-branch
|
|
2017-05-19
| | |
| 14:23 |
|
check-in: f3376c975d user: aspect tags: trunk
|
| 14:21 |
|
check-in: c7f8965af7 user: aspect tags: core-8-6-branch
|
|
2017-05-18
| | |
| 13:25 |
|
check-in: 9bbee496de user: jan.nijtmans tags: core-8-6-branch
|
|
2017-02-28
| | |
| 13:39 |
|
check-in: 998812b7db user: limeboy tags: oo-copy-ns
|
|
2017-01-04
| | |
| 11:55 |
|
check-in: 13dc69ec99 user: jan.nijtmans tags: trunk
|
|
2017-01-02
| | |
| 14:31 |
|
check-in: b6fc234ef3 user: sebres tags: bug_b87ad7e914
|
|
2017-01-01
| | |
| 19:50 |
|
check-in: d8746f0cb8 user: jan.nijtmans tags: novem
|
| 19:49 |
|
check-in: eb8b79d49c user: jan.nijtmans tags: trunk
|
| 19:46 |
|
check-in: 07bc29650e user: jan.nijtmans tags: core-8-6-branch
|
| 19:10 |
|
check-in: 4b7084a579 user: jan.nijtmans tags: trunk
|
| | |
Changes to .fossil-settings/binary-glob.
1
2
3
|
1
2
3
4
5
6
7
8
9
|
+
+
+
+
+
+
|
compat/zlib/win32/zdll.lib
compat/zlib/win32/zlib1.dll
compat/zlib/win64/zdll.lib
compat/zlib/win64/zlib1.dll
compat/zlib/win64/libz.dll.a
compat/zlib/zlib.3.pdf
*.bmp
*.gif
*.png
|
| | | | | |
Added .fossil-settings/crlf-glob.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
compat/zlib/contrib/vstudio/readme.txt
compat/zlib/contrib/vstudio/*/zlib.rc
compat/zlib/win32/*.txt
compat/zlib/win64/*.txt
tools/tcl.hpj.in
tools/tcl.wse.in
win/buildall.vc.bat
win/coffbase.txt
win/makefile.vc
win/rules.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in
|
| | | | | | | | | | | | |
Changes to .fossil-settings/crnl-glob.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
+
+
+
+
+
-
|
compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
compat/zlib/contrib/vstudio/readme.txt
compat/zlib/contrib/vstudio/*/zlib.rc
compat/zlib/win32/*.txt
compat/zlib/win64/*.txt
tools/tcl.hpj.in
tools/tcl.wse.in
win/buildall.vc.bat
win/coffbase.txt
win/makefile.bc
win/makefile.vc
win/rules.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in
|
| | | | |
Changes to .fossil-settings/encoding-glob.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
|
-
|
tools/tcl.hpj.in
tools/tcl.wse.in
win/buildall.vc.bat
win/coffbase.txt
win/makefile.bc
win/makefile.vc
win/rules.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in
|
Changes to .fossil-settings/ignore-glob.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
+
+
|
*.a
*.dll
*.dylib
*.exe
*.exp
*.lib
*.o
*.obj
*.pdb
*.res
*.sl
*.so
*/Makefile
*/config.cache
*/config.log
*/config.status
*/tclConfig.sh
*/tclsh*
*/tcltest*
*/versions.vc
html
libtommath/bn.ilg
libtommath/bn.ind
libtommath/pretty.build
libtommath/tommath.src
libtommath/*.pdf
libtommath/*.pl
libtommath/*.sh
|
| ︙ | | |
34
35
36
37
38
39
40
41
42
|
36
37
38
39
40
41
42
43
44
45
46
|
+
+
|
libtommath/*.out
libtommath/*.tex
unix/autoMkindex.tcl
unix/dltest.marker
unix/tcl.pc
unix/tclIndex
unix/pkgs/*
win/Debug_VC*
win/Release_VC*
win/pkgs/*
win/tcl.hpj
|
Changes to .project.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tcl8.7</name>
<name>tcl8.6</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
|
| ︙ | | |
Changes to README.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
README: Tcl
This is the Tcl 8.7a0 source distribution.
This is the Tcl 8.6.6 source distribution.
http://sourceforge.net/projects/tcl/files/Tcl/
You can get any source release of Tcl from the URL above.
Contents
--------
1. Introduction
2. Documentation
|
| ︙ | | |
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
+
-
+
-
+
|
"license.terms" for complete information.
2. Documentation
----------------
Extensive documentation is available at our website.
The home page for this release, including new features, is
http://www.tcl.tk/software/tcltk/8.7.html
http://www.tcl.tk/software/tcltk/8.6.html
Detailed release notes can be found at the file distributions page
by clicking on the relevant version.
http://sourceforge.net/projects/tcl/files/Tcl/
Information about Tcl itself can be found at
http://www.tcl.tk/about/
There have been many Tcl books on the market. Many are mentioned in the Wiki:
http://wiki.tcl.tk/_/ref?N=25206
To view the complete set of reference manual entries for Tcl 8.7 online,
To view the complete set of reference manual entries for Tcl 8.6 online,
visit the URL:
http://www.tcl.tk/man/tcl8.7/
http://www.tcl.tk/man/tcl8.6/
2a. Unix Documentation
----------------------
The "doc" subdirectory in this release contains a complete set of
reference manual entries for Tcl. Files with extension ".1" are for
programs (for example, tclsh.1); files with extension ".3" are for C
|
| ︙ | | |
Changes to changes.
| ︙ | | |
8620
8621
8622
8623
8624
8625
8626
|
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
2016-02-03 (bug)[25842c] stream [zlib deflate] fails with 0 input (ade,fellows)
2016-02-04 (bug)[3d96b7][593baa][cf74de] crashes in OO teardown (porter,fellows)
2016-02-22 (bug)[9b4702] [info exists env(missing)] kills trace (nijtmans)
--- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tcl/ for details
2016-03-01 (bug)[803042] mem leak due to reference cycle (porter)
2016-03-08 (bug)[bbc304] reflected watch race condition (porter)
2016-03-17 (bug)[fadc99] compile-5.3 (rodriguez,porter)
2016-03-17 (enhancement)[1a25fd] compile [variable ${ns}::v] (porter)
2016-03-20 (bug)[1af8de] crash in compiled [string replace] (harder,fellows)
2016-03-21 (bug)[d30718] segv in notifier finalize (hirofumi,nijtmans)
2016-03-23 (enhancement)[7d0db7] parallel make (yarda,nijtmans)
2016-03-23 [f12535] enable test bindings customization (vogel,nijtmans)
2016-04-04 (bug)[47ac84] compiled [lreplace] fixes (aspect,ferrieux,fellows)
*** POTENTIAL INCOMPATIBILITY ***
2016-04-08 (bug)[866368] RE \w includes 'Punctuation Connector' (nijtmans)
2016-04-08 (bug)[2538f3] Win crash Tcl_OpenTcpServer() (griffin)
2016-04-10 [07d13d] Restore TclBlend support lost in 8.6.1 (buratti)
2016-05-13 (bug)[3154ea] Mem corruption in assembler exceptions (tkob,kenny)
2016-05-13 (bug) registry package support any Unicode env (nijtmans)
=> registry 1.3.2
2016-05-21 (bug)[f7d4e] [namespace delete] performance (fellows)
2016-06-02 (TIP 447) execution time verbosity option (cerutti)
=> tcltest 2.4.0
2016-06-16 (bug)[16828b] crash due to [vwait] trace undo fail (dah,porter)
2016-06-16 (enhancement)[4b61af] good [info frame] from more cases (beric)
2016-06-21 (bug)[c383eb] crash in [glob -path a] (oehlmann,porter)
2016-06-21 (update) Update Unicode data to 9.0 (nijtmans)
*** POTENTIAL INCOMPATIBILITY ***
2016-06-22 (bug)[16896d] Tcl_DString tolerate append to self. (dah,porter)
2016-06-23 (bug)[d55322] crash in [dict update] (yorick,fellows)
2016-06-27 (bug)[dd260a] crash in [chan configure -dictionary] (madden,aspect)
2016-07-02 (bug)[f961d7] usage message with parameters with spaces (porter)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-02 (enhancement)[09fabc] Sort order of -relateddir (lanam)
2016-07-07 (bug)[5d7ca0] Win: [file executable] for .cmd and .ps1 (nadkarni)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-08 (bug)[a47641] [file normalize] & Windows junctions (nadkarni)
2016-07-09 [ae61a6] [file] handling of Win hardcoded names (CON) (nadkarni)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-09 [3613671] [file owned] (more) useful on Win (nadkarni)
2016-07-09 (bug)[1493a4] [namespace upvar] use of resolvers (beric,fellows)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-10 (bug)[da340d] integer division in clock math (nadkarni)
2016-07-20 tzdata updated to Olson's tzdata2016f (venkat)
--- Released 8.6.6, July 27, 2016 --- http://core.tcl.tk/tcl/ for details
|
Changes to compat/opendir.c.
| ︙ | | |
102
103
104
105
106
107
108
109
110
|
102
103
104
105
106
107
108
109
110
|
-
+
|
void
closedir(
register DIR *dirp)
{
close(dirp->dd_fd);
dirp->dd_fd = -1;
dirp->dd_loc = 0;
ckfree(dirp);
ckfree((char *) dirp);
}
|
Changes to compat/waitpid.c.
| ︙ | | |
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
-
+
|
result = waitPtr->pid;
*statusPtr = *((int *) &waitPtr->status);
if (prevPtr == NULL) {
deadList = waitPtr->nextPtr;
} else {
prevPtr->nextPtr = waitPtr->nextPtr;
}
ckfree(waitPtr);
ckfree((char *) waitPtr);
return result;
}
/*
* Wait for any process to stop or exit. If it's an acceptable one then
* return it to the caller; otherwise store information about it in the
* list of exited processes and try again. On systems that have only wait
|
| ︙ | | |
Changes to compat/zlib/CMakeLists.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
set(VERSION "1.2.9")
set(VERSION "1.2.11")
option(ASM686 "Enable building i686 assembly implementation")
option(AMD64 "Enable building amd64 assembly implementation")
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
|
| ︙ | | |
Changes to compat/zlib/ChangeLog.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
+
+
+
+
+
+
+
+
+
+
+
|
ChangeLog file for zlib
Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input
Changes in 1.2.10 (2 Jan 2017)
- Avoid warnings on snprintf() return value
- Fix bug in deflate_stored() for zero-length input
- Fix bug in gzwrite.c that produced corrupt gzip files
- Remove files to be installed before copying them in Makefile.in
- Add warnings when compiling with assembler code
Changes in 1.2.9 (31 Dec 2016)
- Fix contrib/minizip to permit unzipping with desktop API [Zouzou]
- Improve contrib/blast to return unused bytes
- Assure that gzoffset() is correct when appending
- Improve compress() and uncompress() to support large lengths
- Fix bug in test/example.c where error code not saved
- Remedy Coverity warning [Randers-Pehrson]
|
| ︙ | | |
Changes to compat/zlib/Makefile.in.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
# Makefile for zlib
# Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
# ./configure; make test
# Normally configure builds both a static and a shared library.
# If you want to build just a static library, use: ./configure --static
|
| ︙ | | |
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
-
+
|
LDFLAGS=
TEST_LDFLAGS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.9
SHAREDLIBV=libz.so.1.2.11
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)
AR=ar
ARFLAGS=rc
RANLIB=ranlib
LDCONFIG=ldconfig
|
| ︙ | | |
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
+
+
+
+
+
|
install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
cp $(STATICLIB) $(DESTDIR)$(libdir)
chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
-@if test -n "$(SHAREDLIBV)"; then \
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
($(LDCONFIG) || true) >/dev/null 2>&1; \
fi
rm -f $(DESTDIR)$(man3dir)/zlib.3
cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
chmod 644 $(DESTDIR)$(man3dir)/zlib.3
rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
# The ranlib in install is needed on NeXTSTEP which checks file times
# ldconfig is for Linux
install: install-libs
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
uninstall:
cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
cd $(DESTDIR)$(libdir) && rm -f libz.a; \
if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
|
| ︙ | | |
Changes to compat/zlib/README.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.9 is a general purpose data compression library. All the code is
zlib 1.2.11 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
rfc1952 (gzip format).
All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
|
| ︙ | | |
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
-
+
|
PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
http://marknelson.us/1997/01/01/zlib-engine/ .
The changes made in version 1.2.9 are documented in the file ChangeLog.
The changes made in version 1.2.11 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
zlib is available in Java using the java.util.zip package, documented at
http://java.sun.com/developer/technicalArticles/Programming/compression/ .
A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
|
| ︙ | | |
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
-
+
|
The deflate format used by zlib was defined by Phil Katz. The deflate and
zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib; they
are too numerous to cite here.
Copyright notice:
(C) 1995-2016 Jean-loup Gailly and Mark Adler
(C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
|
| ︙ | | |
Changes to compat/zlib/contrib/delphi/ZLib.pas.
| ︙ | | |
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
-
+
|
InBytes = number of bytes in InBuf
Out: OutBuf = ptr to user-allocated buffer to contain decompressed data
BufSize = number of bytes in OutBuf }
procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer);
const
zlib_version = '1.2.9';
zlib_version = '1.2.11';
type
EZlibError = class(Exception);
ECompressionError = class(EZlibError);
EDecompressionError = class(EZlibError);
implementation
|
| ︙ | | |
Changes to compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs.
| ︙ | | |
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
-
+
|
public class InfoTests
{
#region Info tests
[Test]
public void Info_Version()
{
Info info = new Info();
Assert.AreEqual("1.2.9", Info.Version);
Assert.AreEqual("1.2.11", Info.Version);
Assert.AreEqual(32, info.SizeOfUInt);
Assert.AreEqual(32, info.SizeOfULong);
Assert.AreEqual(32, info.SizeOfPointer);
Assert.AreEqual(32, info.SizeOfOffset);
}
#endregion
}
|
| ︙ | | |
Changes to compat/zlib/contrib/infback9/inftree9.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
+
-
+
|
/* inftree9.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2016 Mark Adler
* Copyright (C) 1995-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftree9.h"
#define MAXBITS 15
const char inflate9_copyright[] =
" inflate9 1.2.9 Copyright 1995-2016 Mark Adler ";
" inflate9 1.2.11 Copyright 1995-2017 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
include such an acknowledgment, I would appreciate that you keep this
copyright string in the executable of your product.
*/
|
| ︙ | | |
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
-
+
|
static const unsigned short lbase[31] = { /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17,
19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
131, 163, 195, 227, 3, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
133, 133, 133, 133, 144, 192, 79};
133, 133, 133, 133, 144, 77, 202};
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};
static const unsigned short dext[32] = { /* Distance codes 0..31 extra */
128, 128, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132,
133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138,
|
| ︙ | | |
Changes to compat/zlib/contrib/minizip/configure.ac.
1
2
3
4
5
6
7
8
9
10
11
|
1
2
3
4
5
6
7
8
9
10
11
|
-
+
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([minizip], [1.2.9], [bugzilla.redhat.com])
AC_INIT([minizip], [1.2.11], [bugzilla.redhat.com])
AC_CONFIG_SRCDIR([minizip.c])
AM_INIT_AUTOMAKE([foreign])
LT_INIT
AC_MSG_CHECKING([whether to build example programs])
AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs]))
AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes])
|
| ︙ | | |
Changes to compat/zlib/contrib/pascal/zlibpas.pas.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
-
-
+
+
|
(* zlibpas -- Pascal interface to the zlib data compression library
*
* Copyright (C) 2003 Cosmin Truta.
* Derived from original sources by Bob Dellaca.
* For conditions of distribution and use, see copyright notice in readme.txt
*)
unit zlibpas;
interface
const
ZLIB_VERSION = '1.2.9';
ZLIB_VERNUM = $1290;
ZLIB_VERSION = '1.2.11';
ZLIB_VERNUM = $12a0;
type
alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
cdecl;
free_func = procedure(opaque, address: Pointer);
cdecl;
|
| ︙ | | |
Changes to compat/zlib/contrib/vstudio/readme.txt.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
Building instructions for the DLL versions of Zlib 1.2.9
Building instructions for the DLL versions of Zlib 1.2.11
========================================================
This directory contains projects that build zlib and minizip using
Microsoft Visual C++ 9.0/10.0.
You don't need to build these projects yourself. You can download the
binaries from:
|
| ︙ | | |
Changes to compat/zlib/contrib/vstudio/vc10/zlib.rc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
-
+
+
-
+
-
+
|
#include <windows.h>
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 2, 9, 0
PRODUCTVERSION 1, 2, 9, 0
FILEVERSION 1, 2, 11, 0
PRODUCTVERSION 1, 2, 11, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.2.9\0"
VALUE "FileVersion", "1.2.11\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2016 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
|
Changes to compat/zlib/contrib/vstudio/vc11/zlib.rc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
-
+
+
-
+
-
+
|
#include <windows.h>
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 2, 9, 0
PRODUCTVERSION 1, 2, 9, 0
FILEVERSION 1, 2, 11, 0
PRODUCTVERSION 1, 2, 11, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.2.9\0"
VALUE "FileVersion", "1.2.11\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2016 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
|
Changes to compat/zlib/contrib/vstudio/vc12/zlib.rc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
-
+
+
-
+
-
+
|
#include <windows.h>
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 2, 9, 0
PRODUCTVERSION 1, 2, 9, 0
FILEVERSION 1, 2, 11, 0
PRODUCTVERSION 1, 2, 11, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.2.8.1\0"
VALUE "FileVersion", "1.2.11\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
|
Deleted compat/zlib/contrib/vstudio/vc14/miniunz.vcxproj.user.
1
2
3
4
|
|
-
-
-
-
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
|
Deleted compat/zlib/contrib/vstudio/vc14/minizip.vcxproj.user.
1
2
3
4
|
|
-
-
-
-
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
|
Deleted compat/zlib/contrib/vstudio/vc14/testzlib.vcxproj.user.
1
2
3
4
|
|
-
-
-
-
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
|
Deleted compat/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj.user.
1
2
3
4
|
|
-
-
-
-
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
|
Changes to compat/zlib/contrib/vstudio/vc14/zlib.rc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
-
+
+
-
+
-
+
|
#include <windows.h>
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 2, 9, 0
PRODUCTVERSION 1, 2, 9, 0
FILEVERSION 1, 2, 11, 0
PRODUCTVERSION 1, 2, 11, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.2.8.1\0"
VALUE "FileVersion", "1.2.11\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
|
Deleted compat/zlib/contrib/vstudio/vc14/zlibstat.vcxproj.user.
1
2
3
4
|
|
-
-
-
-
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
|
Deleted compat/zlib/contrib/vstudio/vc14/zlibvc.vcxproj.user.
1
2
3
4
|
|
-
-
-
-
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
|
Changes to compat/zlib/contrib/vstudio/vc9/zlib.rc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
-
+
+
-
+
-
+
|
#include <windows.h>
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 2, 9, 0
PRODUCTVERSION 1, 2, 9, 0
FILEVERSION 1, 2, 11, 0
PRODUCTVERSION 1, 2, 11, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.2.9\0"
VALUE "FileVersion", "1.2.11\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2016 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
|
Changes to compat/zlib/deflate.c.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
/* deflate.c -- compress data using the deflation algorithm
* Copyright (C) 1995-2016 Jean-loup Gailly and Mark Adler
* Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/*
* ALGORITHM
*
* The "deflation" process depends on being able to identify portions
|
| ︙ | | |
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
-
+
|
*/
/* @(#) $Id$ */
#include "deflate.h"
const char deflate_copyright[] =
" deflate 1.2.9 Copyright 1995-2016 Jean-loup Gailly and Mark Adler ";
" deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
include such an acknowledgment, I would appreciate that you keep this
copyright string in the executable of your product.
*/
|
| ︙ | | |
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
+
|
local block_state deflate_rle OF((deflate_state *s, int flush));
local block_state deflate_huff OF((deflate_state *s, int flush));
local void lm_init OF((deflate_state *s));
local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm));
local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
#ifdef ASMV
# pragma message("Assembler code may have bugs -- use at your own risk")
void match_init OF((void)); /* asm code initialization */
uInt longest_match OF((deflate_state *s, IPos cur_match));
#else
local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif
#ifdef ZLIB_DEBUG
|
| ︙ | | |
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
|
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
|
-
+
+
|
if (level == Z_DEFAULT_COMPRESSION) level = 6;
#endif
if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
return Z_STREAM_ERROR;
}
func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func)) {
if ((strategy != s->strategy || func != configuration_table[level].func) &&
s->high_water) {
/* Flush the last buffer: */
int err = deflate(strm, Z_BLOCK);
if (err == Z_STREAM_ERROR)
return err;
if (strm->avail_out == 0)
return Z_BUF_ERROR;
}
|
| ︙ | | |
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
|
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
|
-
|
flush_pending(strm);
if (strm->avail_out == 0) {
s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
return Z_OK;
}
}
}
Assert(strm->avail_out > 0, "bug2");
if (flush != Z_FINISH) return Z_OK;
if (s->wrap <= 0) return Z_STREAM_END;
/* Write the trailer */
#ifdef GZIP
if (s->wrap == 2) {
|
| ︙ | | |
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
|
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
|
-
+
-
+
+
+
-
+
-
-
+
-
-
+
+
-
+
-
+
+
+
-
+
|
*/
unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size);
/* Copy as many min_block or larger stored blocks directly to next_out as
* possible. If flushing, copy the remaining available input to next_out as
* stored blocks, if there is enough space.
*/
unsigned len, left, have, last;
unsigned len, left, have, last = 0;
unsigned used = s->strm->avail_in;
for (;;) {
do {
/* Set len to the maximum size block that we can copy directly with the
* available input data and output space. Set left to how much of that
* would be copied from what's left in the window.
*/
len = MAX_STORED; /* maximum deflate stored block length */
have = (s->bi_valid + 42) >> 3; /* number of header bytes */
if (s->strm->avail_out < have) /* need room for header */
break;
/* maximum stored block length that will fit in avail_out: */
have = s->strm->avail_out > have ? s->strm->avail_out - have : 0;
have = s->strm->avail_out - have;
left = s->strstart - s->block_start; /* bytes left in window */
if (len > (ulg)left + s->strm->avail_in)
len = left + s->strm->avail_in; /* limit len to the input */
if (len > have)
len = have; /* limit len to the output */
if (left > len)
left = len; /* limit window pull to len */
/* If the stored block would be less than min_block in length, or if
* unable to copy all of the available input when flushing, then try
* copying to the window and the pending buffer instead. Also don't
* write an empty block when flushing -- deflate() does that.
*/
if (len < min_block && ((len == 0 && flush != Z_FINISH) ||
if (len < min_block && (len == 0 || flush == Z_NO_FLUSH ||
len - left != s->strm->avail_in))
flush == Z_NO_FLUSH ||
len != left + s->strm->avail_in))
break;
/* Make a dummy stored block in pending to get the header bytes,
* including any pending bits. This also updates the debugging counts.
*/
last = flush == Z_FINISH && len - left == s->strm->avail_in ? 1 : 0;
last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0;
_tr_stored_block(s, (char *)0, 0L, last);
/* Replace the lengths in the dummy stored block with len. */
s->pending_buf[s->pending - 4] = len;
s->pending_buf[s->pending - 3] = len >> 8;
s->pending_buf[s->pending - 2] = ~len;
s->pending_buf[s->pending - 1] = ~len >> 8;
/* Write the stored block header bytes. */
flush_pending(s->strm);
/* Update debugging counts for the data about to be copied. */
#ifdef ZLIB_DEBUG
/* Update debugging counts for the data about to be copied. */
s->compressed_len += len << 3;
s->bits_sent += len << 3;
#endif
/* Copy uncompressed bytes from the window to next_out. */
if (left) {
if (left > len)
left = len;
zmemcpy(s->strm->next_out, s->window + s->block_start, left);
s->strm->next_out += left;
s->strm->avail_out -= left;
s->strm->total_out += left;
s->block_start += left;
len -= left;
}
/* Copy uncompressed bytes directly from next_in to next_out, updating
* the check value.
*/
if (len) {
read_buf(s->strm, s->strm->next_out, len);
s->strm->next_out += len;
s->strm->avail_out -= len;
s->strm->total_out += len;
}
}
} while (last == 0);
/* Update the sliding window with the last s->w_size bytes of the copied
* data, or append all of the copied data to the existing window if less
* than s->w_size bytes were copied. Also update the number of bytes to
* insert in the hash tables, in the event that deflateParams() switches to
* a non-zero compression level.
*/
|
| ︙ | | |
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
|
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
|
+
+
+
+
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
+
|
}
zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);
s->strstart += used;
}
s->block_start = s->strstart;
s->insert += MIN(used, s->w_size - s->insert);
}
if (s->high_water < s->strstart)
s->high_water = s->strstart;
/* If the last block was written to next_out, then done. */
if (last)
return finish_done;
/* If flushing or finishing and all input has been consumed, then done. If
/* If flushing and all input has been consumed, then done. */
* the code above couldn't write a complete block to next_out, then the
* code following this won't be able to either.
*/
if (flush != Z_NO_FLUSH && s->strm->avail_in == 0 &&
(long)s->strstart == s->block_start)
return flush == Z_FINISH ? finish_done : block_done;
if (flush != Z_NO_FLUSH && flush != Z_FINISH &&
s->strm->avail_in == 0 && (long)s->strstart == s->block_start)
return block_done;
/* Fill the window with any remaining input. */
have = s->window_size - s->strstart - 1;
if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) {
/* Slide the window down. */
s->block_start -= s->w_size;
s->strstart -= s->w_size;
zmemcpy(s->window, s->window + s->w_size, s->strstart);
if (s->matches < 2)
s->matches++; /* add a pending slide_hash() */
have += s->w_size; /* more space now */
}
if (have > s->strm->avail_in)
have = s->strm->avail_in;
if (have) {
read_buf(s->strm, s->window + s->strstart, have);
s->strstart += have;
}
if (s->high_water < s->strstart)
s->high_water = s->strstart;
/* There was not enough avail_out to write a complete worthy or flushed
* stored block to next_out. Write a stored block to pending instead, if we
* have enough input for a worthy block, or if flushing and there is enough
* room for the remaining input as a stored block in the pending buffer.
*/
have = (s->bi_valid + 42) >> 3; /* number of header bytes */
/* maximum stored block length that will fit in pending: */
have = MIN(s->pending_buf_size - have, MAX_STORED);
min_block = MIN(have, s->w_size);
left = s->strstart - s->block_start;
if (left >= min_block ||
(left && flush != Z_NO_FLUSH && s->strm->avail_in == 0 &&
left <= have)) {
((left || flush == Z_FINISH) && flush != Z_NO_FLUSH &&
s->strm->avail_in == 0 && left <= have)) {
len = MIN(left, have);
last = flush == Z_FINISH && s->strm->avail_in == 0 &&
len == left ? 1 : 0;
_tr_stored_block(s, (charf *)s->window + s->block_start, len, last);
s->block_start += len;
flush_pending(s->strm);
if (last)
return finish_started;
}
/* We've done all we can with the available input and output. */
return need_more;
return last ? finish_started : need_more;
}
/* ===========================================================================
* Compress as much as possible from the input stream, return the current
* block state.
* This function does not perform lazy evaluation of matches and inserts
* new strings in the dictionary only for unmatched strings or for short
|
| ︙ | | |
Deleted compat/zlib/doc/algorithm.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
1. Compression algorithm (deflate)
The deflation algorithm used by gzip (also zip and zlib) is a variation of
LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
the input data. The second occurrence of a string is replaced by a
pointer to the previous string, in the form of a pair (distance,
length). Distances are limited to 32K bytes, and lengths are limited
to 258 bytes. When a string does not occur anywhere in the previous
32K bytes, it is emitted as a sequence of literal bytes. (In this
description, `string' must be taken as an arbitrary sequence of bytes,
and is not restricted to printable characters.)
Literals or match lengths are compressed with one Huffman tree, and
match distances are compressed with another tree. The trees are stored
in a compact form at the start of each block. The blocks can have any
size (except that the compressed data for one block must fit in
available memory). A block is terminated when deflate() determines that
it would be useful to start another block with fresh trees. (This is
somewhat similar to the behavior of LZW-based _compress_.)
Duplicated strings are found using a hash table. All input strings of
length 3 are inserted in the hash table. A hash index is computed for
the next 3 bytes. If the hash chain for this index is not empty, all
strings in the chain are compared with the current input string, and
the longest match is selected.
The hash chains are searched starting with the most recent strings, to
favor small distances and thus take advantage of the Huffman encoding.
The hash chains are singly linked. There are no deletions from the
hash chains, the algorithm simply discards matches that are too old.
To avoid a worst-case situation, very long hash chains are arbitrarily
truncated at a certain length, determined by a runtime option (level
parameter of deflateInit). So deflate() does not always find the longest
possible match but generally finds a match which is long enough.
deflate() also defers the selection of matches with a lazy evaluation
mechanism. After a match of length N has been found, deflate() searches for
a longer match at the next input byte. If a longer match is found, the
previous match is truncated to a length of one (thus producing a single
literal byte) and the process of lazy evaluation begins again. Otherwise,
the original match is kept, and the next match search is attempted only N
steps later.
The lazy match evaluation is also subject to a runtime parameter. If
the current match is long enough, deflate() reduces the search for a longer
match, thus speeding up the whole process. If compression ratio is more
important than speed, deflate() attempts a complete second search even if
the first match is already long enough.
The lazy match evaluation is not performed for the fastest compression
modes (level parameter 1 to 3). For these fast modes, new strings
are inserted in the hash table only when no match was found, or
when the match is not too long. This degrades the compression ratio
but saves time since there are both fewer insertions and fewer searches.
2. Decompression algorithm (inflate)
2.1 Introduction
The key question is how to represent a Huffman code (or any prefix code) so
that you can decode fast. The most important characteristic is that shorter
codes are much more common than longer codes, so pay attention to decoding the
short codes fast, and let the long codes take longer to decode.
inflate() sets up a first level table that covers some number of bits of
input less than the length of longest code. It gets that many bits from the
stream, and looks it up in the table. The table will tell if the next
code is that many bits or less and how many, and if it is, it will tell
the value, else it will point to the next level table for which inflate()
grabs more bits and tries to decode a longer code.
How many bits to make the first lookup is a tradeoff between the time it
takes to decode and the time it takes to build the table. If building the
table took no time (and if you had infinite memory), then there would only
be a first level table to cover all the way to the longest code. However,
building the table ends up taking a lot longer for more bits since short
codes are replicated many times in such a table. What inflate() does is
simply to make the number of bits in the first table a variable, and then
to set that variable for the maximum speed.
For inflate, which has 286 possible codes for the literal/length tree, the size
of the first table is nine bits. Also the distance trees have 30 possible
values, and the size of the first table is six bits. Note that for each of
those cases, the table ended up one bit longer than the ``average'' code
length, i.e. the code length of an approximately flat code which would be a
little more than eight bits for 286 symbols and a little less than five bits
for 30 symbols.
2.2 More details on the inflate table lookup
Ok, you want to know what this cleverly obfuscated inflate tree actually
looks like. You are correct that it's not a Huffman tree. It is simply a
lookup table for the first, let's say, nine bits of a Huffman symbol. The
symbol could be as short as one bit or as long as 15 bits. If a particular
symbol is shorter than nine bits, then that symbol's translation is duplicated
in all those entries that start with that symbol's bits. For example, if the
symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a
symbol is nine bits long, it appears in the table once.
If the symbol is longer than nine bits, then that entry in the table points
to another similar table for the remaining bits. Again, there are duplicated
entries as needed. The idea is that most of the time the symbol will be short
and there will only be one table look up. (That's whole idea behind data
compression in the first place.) For the less frequent long symbols, there
will be two lookups. If you had a compression method with really long
symbols, you could have as many levels of lookups as is efficient. For
inflate, two is enough.
So a table entry either points to another table (in which case nine bits in
the above example are gobbled), or it contains the translation for the symbol
and the number of bits to gobble. Then you start again with the next
ungobbled bit.
You may wonder: why not just have one lookup table for how ever many bits the
longest symbol is? The reason is that if you do that, you end up spending
more time filling in duplicate symbol entries than you do actually decoding.
At least for deflate's output that generates new trees every several 10's of
kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code
would take too long if you're only decoding several thousand symbols. At the
other extreme, you could make a new table for every bit in the code. In fact,
that's essentially a Huffman tree. But then you spend too much time
traversing the tree while decoding, even for short symbols.
So the number of bits for the first lookup table is a trade of the time to
fill out the table vs. the time spent looking at the second level and above of
the table.
Here is an example, scaled down:
The code being decoded, with 10 symbols, from 1 to 6 bits long:
A: 0
B: 10
C: 1100
D: 11010
E: 11011
F: 11100
G: 11101
H: 11110
I: 111110
J: 111111
Let's make the first table three bits long (eight entries):
000: A,1
001: A,1
010: A,1
011: A,1
100: B,2
101: B,2
110: -> table X (gobble 3 bits)
111: -> table Y (gobble 3 bits)
Each entry is what the bits decode as and how many bits that is, i.e. how
many bits to gobble. Or the entry points to another table, with the number of
bits to gobble implicit in the size of the table.
Table X is two bits long since the longest code starting with 110 is five bits
long:
00: C,1
01: C,1
10: D,2
11: E,2
Table Y is three bits long since the longest code starting with 111 is six
bits long:
000: F,2
001: F,2
010: G,2
011: G,2
100: H,2
101: H,2
110: I,3
111: J,3
So what we have here are three tables with a total of 20 entries that had to
be constructed. That's compared to 64 entries for a single table. Or
compared to 16 entries for a Huffman tree (six two entry tables and one four
entry table). Assuming that the code ideally represents the probability of
the symbols, it takes on the average 1.25 lookups per symbol. That's compared
to one lookup for the single table, or 1.66 lookups per symbol for the
Huffman tree.
There, I think that gives you a picture of what's going on. For inflate, the
meaning of a particular symbol is often more than just a letter. It can be a
byte (a "literal"), or it can be either a length or a distance which
indicates a base value and a number of bits to fetch after the code that is
added to the base value. Or it might be the special end-of-block code. The
data structures created in inftrees.c try to encode all that information
compactly in the tables.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
References:
[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data
Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
pp. 337-343.
``DEFLATE Compressed Data Format Specification'' available in
http://tools.ietf.org/html/rfc1951
|
Deleted compat/zlib/doc/rfc1950.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
Network Working Group P. Deutsch
Request for Comments: 1950 Aladdin Enterprises
Category: Informational J-L. Gailly
Info-ZIP
May 1996
ZLIB Compressed Data Format Specification version 3.3
Status of This Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
IESG Note:
The IESG takes no position on the validity of any Intellectual
Property Rights statements contained in this document.
Notices
Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly
Permission is granted to copy and distribute this document for any
purpose and without charge, including translations into other
languages and incorporation into compilations, provided that the
copyright notice and this notice are preserved, and that any
substantive changes or deletions from the original are clearly
marked.
A pointer to the latest version of this and related documentation in
HTML format can be found at the URL
<ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
Abstract
This specification defines a lossless compressed data format. The
data can be produced or consumed, even for an arbitrarily long
sequentially presented input data stream, using only an a priori
bounded amount of intermediate storage. The format presently uses
the DEFLATE compression method but can be easily extended to use
other compression methods. It can be implemented readily in a manner
not covered by patents. This specification also defines the ADLER-32
checksum (an extension and improvement of the Fletcher checksum),
used for detection of data corruption, and provides an algorithm for
computing it.
Deutsch & Gailly Informational [Page 1]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
Table of Contents
1. Introduction ................................................... 2
1.1. Purpose ................................................... 2
1.2. Intended audience ......................................... 3
1.3. Scope ..................................................... 3
1.4. Compliance ................................................ 3
1.5. Definitions of terms and conventions used ................ 3
1.6. Changes from previous versions ............................ 3
2. Detailed specification ......................................... 3
2.1. Overall conventions ....................................... 3
2.2. Data format ............................................... 4
2.3. Compliance ................................................ 7
3. References ..................................................... 7
4. Source code .................................................... 8
5. Security Considerations ........................................ 8
6. Acknowledgements ............................................... 8
7. Authors' Addresses ............................................. 8
8. Appendix: Rationale ............................................ 9
9. Appendix: Sample code ..........................................10
1. Introduction
1.1. Purpose
The purpose of this specification is to define a lossless
compressed data format that:
* Is independent of CPU type, operating system, file system,
and character set, and hence can be used for interchange;
* Can be produced or consumed, even for an arbitrarily long
sequentially presented input data stream, using only an a
priori bounded amount of intermediate storage, and hence can
be used in data communications or similar structures such as
Unix filters;
* Can use a number of different compression methods;
* Can be implemented readily in a manner not covered by
patents, and hence can be practiced freely.
The data format defined by this specification does not attempt to
allow random access to compressed data.
Deutsch & Gailly Informational [Page 2]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
1.2. Intended audience
This specification is intended for use by implementors of software
to compress data into zlib format and/or decompress data from zlib
format.
The text of the specification assumes a basic background in
programming at the level of bits and other primitive data
representations.
1.3. Scope
The specification specifies a compressed data format that can be
used for in-memory compression of a sequence of arbitrary bytes.
1.4. Compliance
Unless otherwise indicated below, a compliant decompressor must be
able to accept and decompress any data set that conforms to all
the specifications presented here; a compliant compressor must
produce data sets that conform to all the specifications presented
here.
1.5. Definitions of terms and conventions used
byte: 8 bits stored or transmitted as a unit (same as an octet).
(For this specification, a byte is exactly 8 bits, even on
machines which store a character on a number of bits different
from 8.) See below, for the numbering of bits within a byte.
1.6. Changes from previous versions
Version 3.1 was the first public release of this specification.
In version 3.2, some terminology was changed and the Adler-32
sample code was rewritten for clarity. In version 3.3, the
support for a preset dictionary was introduced, and the
specification was converted to RFC style.
2. Detailed specification
2.1. Overall conventions
In the diagrams below, a box like this:
+---+
| | <-- the vertical bars might be missing
+---+
Deutsch & Gailly Informational [Page 3]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
represents one byte; a box like this:
+==============+
| |
+==============+
represents a variable number of bytes.
Bytes stored within a computer do not have a "bit order", since
they are always treated as a unit. However, a byte considered as
an integer between 0 and 255 does have a most- and least-
significant bit, and since we write numbers with the most-
significant digit on the left, we also write bytes with the most-
significant bit on the left. In the diagrams below, we number the
bits of a byte so that bit 0 is the least-significant bit, i.e.,
the bits are numbered:
+--------+
|76543210|
+--------+
Within a computer, a number may occupy multiple bytes. All
multi-byte numbers in the format described here are stored with
the MOST-significant byte first (at the lower memory address).
For example, the decimal number 520 is stored as:
0 1
+--------+--------+
|00000010|00001000|
+--------+--------+
^ ^
| |
| + less significant byte = 8
+ more significant byte = 2 x 256
2.2. Data format
A zlib stream has the following structure:
0 1
+---+---+
|CMF|FLG| (more-->)
+---+---+
Deutsch & Gailly Informational [Page 4]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
(if FLG.FDICT set)
0 1 2 3
+---+---+---+---+
| DICTID | (more-->)
+---+---+---+---+
+=====================+---+---+---+---+
|...compressed data...| ADLER32 |
+=====================+---+---+---+---+
Any data which may appear after ADLER32 are not part of the zlib
stream.
CMF (Compression Method and flags)
This byte is divided into a 4-bit compression method and a 4-
bit information field depending on the compression method.
bits 0 to 3 CM Compression method
bits 4 to 7 CINFO Compression info
CM (Compression method)
This identifies the compression method used in the file. CM = 8
denotes the "deflate" compression method with a window size up
to 32K. This is the method used by gzip and PNG (see
references [1] and [2] in Chapter 3, below, for the reference
documents). CM = 15 is reserved. It might be used in a future
version of this specification to indicate the presence of an
extra field before the compressed data.
CINFO (Compression info)
For CM = 8, CINFO is the base-2 logarithm of the LZ77 window
size, minus eight (CINFO=7 indicates a 32K window size). Values
of CINFO above 7 are not allowed in this version of the
specification. CINFO is not defined in this specification for
CM not equal to 8.
FLG (FLaGs)
This flag byte is divided as follows:
bits 0 to 4 FCHECK (check bits for CMF and FLG)
bit 5 FDICT (preset dictionary)
bits 6 to 7 FLEVEL (compression level)
The FCHECK value must be such that CMF and FLG, when viewed as
a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG),
is a multiple of 31.
Deutsch & Gailly Informational [Page 5]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
FDICT (Preset dictionary)
If FDICT is set, a DICT dictionary identifier is present
immediately after the FLG byte. The dictionary is a sequence of
bytes which are initially fed to the compressor without
producing any compressed output. DICT is the Adler-32 checksum
of this sequence of bytes (see the definition of ADLER32
below). The decompressor can use this identifier to determine
which dictionary has been used by the compressor.
FLEVEL (Compression level)
These flags are available for use by specific compression
methods. The "deflate" method (CM = 8) sets these flags as
follows:
0 - compressor used fastest algorithm
1 - compressor used fast algorithm
2 - compressor used default algorithm
3 - compressor used maximum compression, slowest algorithm
The information in FLEVEL is not needed for decompression; it
is there to indicate if recompression might be worthwhile.
compressed data
For compression method 8, the compressed data is stored in the
deflate compressed data format as described in the document
"DEFLATE Compressed Data Format Specification" by L. Peter
Deutsch. (See reference [3] in Chapter 3, below)
Other compressed data formats are not specified in this version
of the zlib specification.
ADLER32 (Adler-32 checksum)
This contains a checksum value of the uncompressed data
(excluding any dictionary data) computed according to Adler-32
algorithm. This algorithm is a 32-bit extension and improvement
of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073
standard. See references [4] and [5] in Chapter 3, below)
Adler-32 is composed of two sums accumulated per byte: s1 is
the sum of all bytes, s2 is the sum of all s1 values. Both sums
are done modulo 65521. s1 is initialized to 1, s2 to zero. The
Adler-32 checksum is stored as s2*65536 + s1 in most-
significant-byte first (network) order.
Deutsch & Gailly Informational [Page 6]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
2.3. Compliance
A compliant compressor must produce streams with correct CMF, FLG
and ADLER32, but need not support preset dictionaries. When the
zlib data format is used as part of another standard data format,
the compressor may use only preset dictionaries that are specified
by this other data format. If this other format does not use the
preset dictionary feature, the compressor must not set the FDICT
flag.
A compliant decompressor must check CMF, FLG, and ADLER32, and
provide an error indication if any of these have incorrect values.
A compliant decompressor must give an error indication if CM is
not one of the values defined in this specification (only the
value 8 is permitted in this version), since another value could
indicate the presence of new features that would cause subsequent
data to be interpreted incorrectly. A compliant decompressor must
give an error indication if FDICT is set and DICTID is not the
identifier of a known preset dictionary. A decompressor may
ignore FLEVEL and still be compliant. When the zlib data format
is being used as a part of another standard format, a compliant
decompressor must support all the preset dictionaries specified by
the other format. When the other format does not use the preset
dictionary feature, a compliant decompressor must reject any
stream in which the FDICT flag is set.
3. References
[1] Deutsch, L.P.,"GZIP Compressed Data Format Specification",
available in ftp://ftp.uu.net/pub/archiving/zip/doc/
[2] Thomas Boutell, "PNG (Portable Network Graphics) specification",
available in ftp://ftp.uu.net/graphics/png/documents/
[3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification",
available in ftp://ftp.uu.net/pub/archiving/zip/doc/
[4] Fletcher, J. G., "An Arithmetic Checksum for Serial
Transmissions," IEEE Transactions on Communications, Vol. COM-30,
No. 1, January 1982, pp. 247-252.
[5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms,"
November, 1993, pp. 144, 145. (Available from
gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073.
Deutsch & Gailly Informational [Page 7]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
4. Source code
Source code for a C language implementation of a "zlib" compliant
library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/.
5. Security Considerations
A decoder that fails to check the ADLER32 checksum value may be
subject to undetected data corruption.
6. Acknowledgements
Trademarks cited in this document are the property of their
respective owners.
Jean-Loup Gailly and Mark Adler designed the zlib format and wrote
the related software described in this specification. Glenn
Randers-Pehrson converted this document to RFC and HTML format.
7. Authors' Addresses
L. Peter Deutsch
Aladdin Enterprises
203 Santa Margarita Ave.
Menlo Park, CA 94025
Phone: (415) 322-0103 (AM only)
FAX: (415) 322-1734
EMail: <ghost@aladdin.com>
Jean-Loup Gailly
EMail: <gzip@prep.ai.mit.edu>
Questions about the technical content of this specification can be
sent by email to
Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
Mark Adler <madler@alumni.caltech.edu>
Editorial comments on this specification can be sent by email to
L. Peter Deutsch <ghost@aladdin.com> and
Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
Deutsch & Gailly Informational [Page 8]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
8. Appendix: Rationale
8.1. Preset dictionaries
A preset dictionary is specially useful to compress short input
sequences. The compressor can take advantage of the dictionary
context to encode the input in a more compact manner. The
decompressor can be initialized with the appropriate context by
virtually decompressing a compressed version of the dictionary
without producing any output. However for certain compression
algorithms such as the deflate algorithm this operation can be
achieved without actually performing any decompression.
The compressor and the decompressor must use exactly the same
dictionary. The dictionary may be fixed or may be chosen among a
certain number of predefined dictionaries, according to the kind
of input data. The decompressor can determine which dictionary has
been chosen by the compressor by checking the dictionary
identifier. This document does not specify the contents of
predefined dictionaries, since the optimal dictionaries are
application specific. Standard data formats using this feature of
the zlib specification must precisely define the allowed
dictionaries.
8.2. The Adler-32 algorithm
The Adler-32 algorithm is much faster than the CRC32 algorithm yet
still provides an extremely low probability of undetected errors.
The modulo on unsigned long accumulators can be delayed for 5552
bytes, so the modulo operation time is negligible. If the bytes
are a, b, c, the second sum is 3a + 2b + c + 3, and so is position
and order sensitive, unlike the first sum, which is just a
checksum. That 65521 is prime is important to avoid a possible
large class of two-byte errors that leave the check unchanged.
(The Fletcher checksum uses 255, which is not prime and which also
makes the Fletcher check insensitive to single byte changes 0 <->
255.)
The sum s1 is initialized to 1 instead of zero to make the length
of the sequence part of s2, so that the length does not have to be
checked separately. (Any sequence of zeroes has a Fletcher
checksum of zero.)
Deutsch & Gailly Informational [Page 9]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
9. Appendix: Sample code
The following C code computes the Adler-32 checksum of a data buffer.
It is written for clarity, not for speed. The sample code is in the
ANSI C programming language. Non C users may find it easier to read
with these hints:
& Bitwise AND operator.
>> Bitwise right shift operator. When applied to an
unsigned quantity, as here, right shift inserts zero bit(s)
at the left.
<< Bitwise left shift operator. Left shift inserts zero
bit(s) at the right.
++ "n++" increments the variable n.
% modulo operator: a % b is the remainder of a divided by b.
#define BASE 65521 /* largest prime smaller than 65536 */
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1]
and return the updated checksum. The Adler-32 checksum should be
initialized to 1.
Usage example:
unsigned long adler = 1L;
while (read_buffer(buffer, length) != EOF) {
adler = update_adler32(adler, buffer, length);
}
if (adler != original_adler) error();
*/
unsigned long update_adler32(unsigned long adler,
unsigned char *buf, int len)
{
unsigned long s1 = adler & 0xffff;
unsigned long s2 = (adler >> 16) & 0xffff;
int n;
for (n = 0; n < len; n++) {
s1 = (s1 + buf[n]) % BASE;
s2 = (s2 + s1) % BASE;
}
return (s2 << 16) + s1;
}
/* Return the adler32 of the bytes buf[0..len-1] */
Deutsch & Gailly Informational [Page 10]
RFC 1950 ZLIB Compressed Data Format Specification May 1996
unsigned long adler32(unsigned char *buf, int len)
{
return update_adler32(1L, buf, len);
}
Deutsch & Gailly Informational [Page 11]
|
Deleted compat/zlib/doc/rfc1951.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
|
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
Network Working Group P. Deutsch
Request for Comments: 1951 Aladdin Enterprises
Category: Informational May 1996
DEFLATE Compressed Data Format Specification version 1.3
Status of This Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
IESG Note:
The IESG takes no position on the validity of any Intellectual
Property Rights statements contained in this document.
Notices
Copyright (c) 1996 L. Peter Deutsch
Permission is granted to copy and distribute this document for any
purpose and without charge, including translations into other
languages and incorporation into compilations, provided that the
copyright notice and this notice are preserved, and that any
substantive changes or deletions from the original are clearly
marked.
A pointer to the latest version of this and related documentation in
HTML format can be found at the URL
<ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
Abstract
This specification defines a lossless compressed data format that
compresses data using a combination of the LZ77 algorithm and Huffman
coding, with efficiency comparable to the best currently available
general-purpose compression methods. The data can be produced or
consumed, even for an arbitrarily long sequentially presented input
data stream, using only an a priori bounded amount of intermediate
storage. The format can be implemented readily in a manner not
covered by patents.
Deutsch Informational [Page 1]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
Table of Contents
1. Introduction ................................................... 2
1.1. Purpose ................................................... 2
1.2. Intended audience ......................................... 3
1.3. Scope ..................................................... 3
1.4. Compliance ................................................ 3
1.5. Definitions of terms and conventions used ................ 3
1.6. Changes from previous versions ............................ 4
2. Compressed representation overview ............................. 4
3. Detailed specification ......................................... 5
3.1. Overall conventions ....................................... 5
3.1.1. Packing into bytes .................................. 5
3.2. Compressed block format ................................... 6
3.2.1. Synopsis of prefix and Huffman coding ............... 6
3.2.2. Use of Huffman coding in the "deflate" format ....... 7
3.2.3. Details of block format ............................. 9
3.2.4. Non-compressed blocks (BTYPE=00) ................... 11
3.2.5. Compressed blocks (length and distance codes) ...... 11
3.2.6. Compression with fixed Huffman codes (BTYPE=01) .... 12
3.2.7. Compression with dynamic Huffman codes (BTYPE=10) .. 13
3.3. Compliance ............................................... 14
4. Compression algorithm details ................................. 14
5. References .................................................... 16
6. Security Considerations ....................................... 16
7. Source code ................................................... 16
8. Acknowledgements .............................................. 16
9. Author's Address .............................................. 17
1. Introduction
1.1. Purpose
The purpose of this specification is to define a lossless
compressed data format that:
* Is independent of CPU type, operating system, file system,
and character set, and hence can be used for interchange;
* Can be produced or consumed, even for an arbitrarily long
sequentially presented input data stream, using only an a
priori bounded amount of intermediate storage, and hence
can be used in data communications or similar structures
such as Unix filters;
* Compresses data with efficiency comparable to the best
currently available general-purpose compression methods,
and in particular considerably better than the "compress"
program;
* Can be implemented readily in a manner not covered by
patents, and hence can be practiced freely;
Deutsch Informational [Page 2]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
* Is compatible with the file format produced by the current
widely used gzip utility, in that conforming decompressors
will be able to read data produced by the existing gzip
compressor.
The data format defined by this specification does not attempt to:
* Allow random access to compressed data;
* Compress specialized data (e.g., raster graphics) as well
as the best currently available specialized algorithms.
A simple counting argument shows that no lossless compression
algorithm can compress every possible input data set. For the
format defined here, the worst case expansion is 5 bytes per 32K-
byte block, i.e., a size increase of 0.015% for large data sets.
English text usually compresses by a factor of 2.5 to 3;
executable files usually compress somewhat less; graphical data
such as raster images may compress much more.
1.2. Intended audience
This specification is intended for use by implementors of software
to compress data into "deflate" format and/or decompress data from
"deflate" format.
The text of the specification assumes a basic background in
programming at the level of bits and other primitive data
representations. Familiarity with the technique of Huffman coding
is helpful but not required.
1.3. Scope
The specification specifies a method for representing a sequence
of bytes as a (usually shorter) sequence of bits, and a method for
packing the latter bit sequence into bytes.
1.4. Compliance
Unless otherwise indicated below, a compliant decompressor must be
able to accept and decompress any data set that conforms to all
the specifications presented here; a compliant compressor must
produce data sets that conform to all the specifications presented
here.
1.5. Definitions of terms and conventions used
Byte: 8 bits stored or transmitted as a unit (same as an octet).
For this specification, a byte is exactly 8 bits, even on machines
Deutsch Informational [Page 3]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
which store a character on a number of bits different from eight.
See below, for the numbering of bits within a byte.
String: a sequence of arbitrary bytes.
1.6. Changes from previous versions
There have been no technical changes to the deflate format since
version 1.1 of this specification. In version 1.2, some
terminology was changed. Version 1.3 is a conversion of the
specification to RFC style.
2. Compressed representation overview
A compressed data set consists of a series of blocks, corresponding
to successive blocks of input data. The block sizes are arbitrary,
except that non-compressible blocks are limited to 65,535 bytes.
Each block is compressed using a combination of the LZ77 algorithm
and Huffman coding. The Huffman trees for each block are independent
of those for previous or subsequent blocks; the LZ77 algorithm may
use a reference to a duplicated string occurring in a previous block,
up to 32K input bytes before.
Each block consists of two parts: a pair of Huffman code trees that
describe the representation of the compressed data part, and a
compressed data part. (The Huffman trees themselves are compressed
using Huffman encoding.) The compressed data consists of a series of
elements of two types: literal bytes (of strings that have not been
detected as duplicated within the previous 32K input bytes), and
pointers to duplicated strings, where a pointer is represented as a
pair <length, backward distance>. The representation used in the
"deflate" format limits distances to 32K bytes and lengths to 258
bytes, but does not limit the size of a block, except for
uncompressible blocks, which are limited as noted above.
Each type of value (literals, distances, and lengths) in the
compressed data is represented using a Huffman code, using one code
tree for literals and lengths and a separate code tree for distances.
The code trees for each block appear in a compact form just before
the compressed data for that block.
Deutsch Informational [Page 4]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
3. Detailed specification
3.1. Overall conventions In the diagrams below, a box like this:
+---+
| | <-- the vertical bars might be missing
+---+
represents one byte; a box like this:
+==============+
| |
+==============+
represents a variable number of bytes.
Bytes stored within a computer do not have a "bit order", since
they are always treated as a unit. However, a byte considered as
an integer between 0 and 255 does have a most- and least-
significant bit, and since we write numbers with the most-
significant digit on the left, we also write bytes with the most-
significant bit on the left. In the diagrams below, we number the
bits of a byte so that bit 0 is the least-significant bit, i.e.,
the bits are numbered:
+--------+
|76543210|
+--------+
Within a computer, a number may occupy multiple bytes. All
multi-byte numbers in the format described here are stored with
the least-significant byte first (at the lower memory address).
For example, the decimal number 520 is stored as:
0 1
+--------+--------+
|00001000|00000010|
+--------+--------+
^ ^
| |
| + more significant byte = 2 x 256
+ less significant byte = 8
3.1.1. Packing into bytes
This document does not address the issue of the order in which
bits of a byte are transmitted on a bit-sequential medium,
since the final data format described here is byte- rather than
Deutsch Informational [Page 5]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
bit-oriented. However, we describe the compressed block format
in below, as a sequence of data elements of various bit
lengths, not a sequence of bytes. We must therefore specify
how to pack these data elements into bytes to form the final
compressed byte sequence:
* Data elements are packed into bytes in order of
increasing bit number within the byte, i.e., starting
with the least-significant bit of the byte.
* Data elements other than Huffman codes are packed
starting with the least-significant bit of the data
element.
* Huffman codes are packed starting with the most-
significant bit of the code.
In other words, if one were to print out the compressed data as
a sequence of bytes, starting with the first byte at the
*right* margin and proceeding to the *left*, with the most-
significant bit of each byte on the left as usual, one would be
able to parse the result from right to left, with fixed-width
elements in the correct MSB-to-LSB order and Huffman codes in
bit-reversed order (i.e., with the first bit of the code in the
relative LSB position).
3.2. Compressed block format
3.2.1. Synopsis of prefix and Huffman coding
Prefix coding represents symbols from an a priori known
alphabet by bit sequences (codes), one code for each symbol, in
a manner such that different symbols may be represented by bit
sequences of different lengths, but a parser can always parse
an encoded string unambiguously symbol-by-symbol.
We define a prefix code in terms of a binary tree in which the
two edges descending from each non-leaf node are labeled 0 and
1 and in which the leaf nodes correspond one-for-one with (are
labeled with) the symbols of the alphabet; then the code for a
symbol is the sequence of 0's and 1's on the edges leading from
the root to the leaf labeled with that symbol. For example:
Deutsch Informational [Page 6]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
/\ Symbol Code
0 1 ------ ----
/ \ A 00
/\ B B 1
0 1 C 011
/ \ D 010
A /\
0 1
/ \
D C
A parser can decode the next symbol from an encoded input
stream by walking down the tree from the root, at each step
choosing the edge corresponding to the next input bit.
Given an alphabet with known symbol frequencies, the Huffman
algorithm allows the construction of an optimal prefix code
(one which represents strings with those symbol frequencies
using the fewest bits of any possible prefix codes for that
alphabet). Such a code is called a Huffman code. (See
reference [1] in Chapter 5, references for additional
information on Huffman codes.)
Note that in the "deflate" format, the Huffman codes for the
various alphabets must not exceed certain maximum code lengths.
This constraint complicates the algorithm for computing code
lengths from symbol frequencies. Again, see Chapter 5,
references for details.
3.2.2. Use of Huffman coding in the "deflate" format
The Huffman codes used for each alphabet in the "deflate"
format have two additional rules:
* All codes of a given bit length have lexicographically
consecutive values, in the same order as the symbols
they represent;
* Shorter codes lexicographically precede longer codes.
Deutsch Informational [Page 7]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
We could recode the example above to follow this rule as
follows, assuming that the order of the alphabet is ABCD:
Symbol Code
------ ----
A 10
B 0
C 110
D 111
I.e., 0 precedes 10 which precedes 11x, and 110 and 111 are
lexicographically consecutive.
Given this rule, we can define the Huffman code for an alphabet
just by giving the bit lengths of the codes for each symbol of
the alphabet in order; this is sufficient to determine the
actual codes. In our example, the code is completely defined
by the sequence of bit lengths (2, 1, 3, 3). The following
algorithm generates the codes as integers, intended to be read
from most- to least-significant bit. The code lengths are
initially in tree[I].Len; the codes are produced in
tree[I].Code.
1) Count the number of codes for each code length. Let
bl_count[N] be the number of codes of length N, N >= 1.
2) Find the numerical value of the smallest code for each
code length:
code = 0;
bl_count[0] = 0;
for (bits = 1; bits <= MAX_BITS; bits++) {
code = (code + bl_count[bits-1]) << 1;
next_code[bits] = code;
}
3) Assign numerical values to all codes, using consecutive
values for all codes of the same length with the base
values determined at step 2. Codes that are never used
(which have a bit length of zero) must not be assigned a
value.
for (n = 0; n <= max_code; n++) {
len = tree[n].Len;
if (len != 0) {
tree[n].Code = next_code[len];
next_code[len]++;
}
Deutsch Informational [Page 8]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
}
Example:
Consider the alphabet ABCDEFGH, with bit lengths (3, 3, 3, 3,
3, 2, 4, 4). After step 1, we have:
N bl_count[N]
- -----------
2 1
3 5
4 2
Step 2 computes the following next_code values:
N next_code[N]
- ------------
1 0
2 0
3 2
4 14
Step 3 produces the following code values:
Symbol Length Code
------ ------ ----
A 3 010
B 3 011
C 3 100
D 3 101
E 3 110
F 2 00
G 4 1110
H 4 1111
3.2.3. Details of block format
Each block of compressed data begins with 3 header bits
containing the following data:
first bit BFINAL
next 2 bits BTYPE
Note that the header bits do not necessarily begin on a byte
boundary, since a block does not necessarily occupy an integral
number of bytes.
Deutsch Informational [Page 9]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
BFINAL is set if and only if this is the last block of the data
set.
BTYPE specifies how the data are compressed, as follows:
00 - no compression
01 - compressed with fixed Huffman codes
10 - compressed with dynamic Huffman codes
11 - reserved (error)
The only difference between the two compressed cases is how the
Huffman codes for the literal/length and distance alphabets are
defined.
In all cases, the decoding algorithm for the actual data is as
follows:
do
read block header from input stream.
if stored with no compression
skip any remaining bits in current partially
processed byte
read LEN and NLEN (see next section)
copy LEN bytes of data to output
otherwise
if compressed with dynamic Huffman codes
read representation of code trees (see
subsection below)
loop (until end of block code recognized)
decode literal/length value from input stream
if value < 256
copy value (literal byte) to output stream
otherwise
if value = end of block (256)
break from loop
otherwise (value = 257..285)
decode distance from input stream
move backwards distance bytes in the output
stream, and copy length bytes from this
position to the output stream.
end loop
while not last block
Note that a duplicated string reference may refer to a string
in a previous block; i.e., the backward distance may cross one
or more block boundaries. However a distance cannot refer past
the beginning of the output stream. (An application using a
Deutsch Informational [Page 10]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
preset dictionary might discard part of the output stream; a
distance can refer to that part of the output stream anyway)
Note also that the referenced string may overlap the current
position; for example, if the last 2 bytes decoded have values
X and Y, a string reference with <length = 5, distance = 2>
adds X,Y,X,Y,X to the output stream.
We now specify each compression method in turn.
3.2.4. Non-compressed blocks (BTYPE=00)
Any bits of input up to the next byte boundary are ignored.
The rest of the block consists of the following information:
0 1 2 3 4...
+---+---+---+---+================================+
| LEN | NLEN |... LEN bytes of literal data...|
+---+---+---+---+================================+
LEN is the number of data bytes in the block. NLEN is the
one's complement of LEN.
3.2.5. Compressed blocks (length and distance codes)
As noted above, encoded data blocks in the "deflate" format
consist of sequences of symbols drawn from three conceptually
distinct alphabets: either literal bytes, from the alphabet of
byte values (0..255), or <length, backward distance> pairs,
where the length is drawn from (3..258) and the distance is
drawn from (1..32,768). In fact, the literal and length
alphabets are merged into a single alphabet (0..285), where
values 0..255 represent literal bytes, the value 256 indicates
end-of-block, and values 257..285 represent length codes
(possibly in conjunction with extra bits following the symbol
code) as follows:
Deutsch Informational [Page 11]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
Extra Extra Extra
Code Bits Length(s) Code Bits Lengths Code Bits Length(s)
---- ---- ------ ---- ---- ------- ---- ---- -------
257 0 3 267 1 15,16 277 4 67-82
258 0 4 268 1 17,18 278 4 83-98
259 0 5 269 2 19-22 279 4 99-114
260 0 6 270 2 23-26 280 4 115-130
261 0 7 271 2 27-30 281 5 131-162
262 0 8 272 2 31-34 282 5 163-194
263 0 9 273 3 35-42 283 5 195-226
264 0 10 274 3 43-50 284 5 227-257
265 1 11,12 275 3 51-58 285 0 258
266 1 13,14 276 3 59-66
The extra bits should be interpreted as a machine integer
stored with the most-significant bit first, e.g., bits 1110
represent the value 14.
Extra Extra Extra
Code Bits Dist Code Bits Dist Code Bits Distance
---- ---- ---- ---- ---- ------ ---- ---- --------
0 0 1 10 4 33-48 20 9 1025-1536
1 0 2 11 4 49-64 21 9 1537-2048
2 0 3 12 5 65-96 22 10 2049-3072
3 0 4 13 5 97-128 23 10 3073-4096
4 1 5,6 14 6 129-192 24 11 4097-6144
5 1 7,8 15 6 193-256 25 11 6145-8192
6 2 9-12 16 7 257-384 26 12 8193-12288
7 2 13-16 17 7 385-512 27 12 12289-16384
8 3 17-24 18 8 513-768 28 13 16385-24576
9 3 25-32 19 8 769-1024 29 13 24577-32768
3.2.6. Compression with fixed Huffman codes (BTYPE=01)
The Huffman codes for the two alphabets are fixed, and are not
represented explicitly in the data. The Huffman code lengths
for the literal/length alphabet are:
Lit Value Bits Codes
--------- ---- -----
0 - 143 8 00110000 through
10111111
144 - 255 9 110010000 through
111111111
256 - 279 7 0000000 through
0010111
280 - 287 8 11000000 through
11000111
Deutsch Informational [Page 12]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
The code lengths are sufficient to generate the actual codes,
as described above; we show the codes in the table for added
clarity. Literal/length values 286-287 will never actually
occur in the compressed data, but participate in the code
construction.
Distance codes 0-31 are represented by (fixed-length) 5-bit
codes, with possible additional bits as shown in the table
shown in Paragraph 3.2.5, above. Note that distance codes 30-
31 will never actually occur in the compressed data.
3.2.7. Compression with dynamic Huffman codes (BTYPE=10)
The Huffman codes for the two alphabets appear in the block
immediately after the header bits and before the actual
compressed data, first the literal/length code and then the
distance code. Each code is defined by a sequence of code
lengths, as discussed in Paragraph 3.2.2, above. For even
greater compactness, the code length sequences themselves are
compressed using a Huffman code. The alphabet for code lengths
is as follows:
0 - 15: Represent code lengths of 0 - 15
16: Copy the previous code length 3 - 6 times.
The next 2 bits indicate repeat length
(0 = 3, ... , 3 = 6)
Example: Codes 8, 16 (+2 bits 11),
16 (+2 bits 10) will expand to
12 code lengths of 8 (1 + 6 + 5)
17: Repeat a code length of 0 for 3 - 10 times.
(3 bits of length)
18: Repeat a code length of 0 for 11 - 138 times
(7 bits of length)
A code length of 0 indicates that the corresponding symbol in
the literal/length or distance alphabet will not occur in the
block, and should not participate in the Huffman code
construction algorithm given earlier. If only one distance
code is used, it is encoded using one bit, not zero bits; in
this case there is a single code length of one, with one unused
code. One distance code of zero bits means that there are no
distance codes used at all (the data is all literals).
We can now define the format of the block:
5 Bits: HLIT, # of Literal/Length codes - 257 (257 - 286)
5 Bits: HDIST, # of Distance codes - 1 (1 - 32)
4 Bits: HCLEN, # of Code Length codes - 4 (4 - 19)
Deutsch Informational [Page 13]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
(HCLEN + 4) x 3 bits: code lengths for the code length
alphabet given just above, in the order: 16, 17, 18,
0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
These code lengths are interpreted as 3-bit integers
(0-7); as above, a code length of 0 means the
corresponding symbol (literal/length or distance code
length) is not used.
HLIT + 257 code lengths for the literal/length alphabet,
encoded using the code length Huffman code
HDIST + 1 code lengths for the distance alphabet,
encoded using the code length Huffman code
The actual compressed data of the block,
encoded using the literal/length and distance Huffman
codes
The literal/length symbol 256 (end of data),
encoded using the literal/length Huffman code
The code length repeat codes can cross from HLIT + 257 to the
HDIST + 1 code lengths. In other words, all code lengths form
a single sequence of HLIT + HDIST + 258 values.
3.3. Compliance
A compressor may limit further the ranges of values specified in
the previous section and still be compliant; for example, it may
limit the range of backward pointers to some value smaller than
32K. Similarly, a compressor may limit the size of blocks so that
a compressible block fits in memory.
A compliant decompressor must accept the full range of possible
values defined in the previous section, and must accept blocks of
arbitrary size.
4. Compression algorithm details
While it is the intent of this document to define the "deflate"
compressed data format without reference to any particular
compression algorithm, the format is related to the compressed
formats produced by LZ77 (Lempel-Ziv 1977, see reference [2] below);
since many variations of LZ77 are patented, it is strongly
recommended that the implementor of a compressor follow the general
algorithm presented here, which is known not to be patented per se.
The material in this section is not part of the definition of the
Deutsch Informational [Page 14]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
specification per se, and a compressor need not follow it in order to
be compliant.
The compressor terminates a block when it determines that starting a
new block with fresh trees would be useful, or when the block size
fills up the compressor's block buffer.
The compressor uses a chained hash table to find duplicated strings,
using a hash function that operates on 3-byte sequences. At any
given point during compression, let XYZ be the next 3 input bytes to
be examined (not necessarily all different, of course). First, the
compressor examines the hash chain for XYZ. If the chain is empty,
the compressor simply writes out X as a literal byte and advances one
byte in the input. If the hash chain is not empty, indicating that
the sequence XYZ (or, if we are unlucky, some other 3 bytes with the
same hash function value) has occurred recently, the compressor
compares all strings on the XYZ hash chain with the actual input data
sequence starting at the current point, and selects the longest
match.
The compressor searches the hash chains starting with the most recent
strings, to favor small distances and thus take advantage of the
Huffman encoding. The hash chains are singly linked. There are no
deletions from the hash chains; the algorithm simply discards matches
that are too old. To avoid a worst-case situation, very long hash
chains are arbitrarily truncated at a certain length, determined by a
run-time parameter.
To improve overall compression, the compressor optionally defers the
selection of matches ("lazy matching"): after a match of length N has
been found, the compressor searches for a longer match starting at
the next input byte. If it finds a longer match, it truncates the
previous match to a length of one (thus producing a single literal
byte) and then emits the longer match. Otherwise, it emits the
original match, and, as described above, advances N bytes before
continuing.
Run-time parameters also control this "lazy match" procedure. If
compression ratio is most important, the compressor attempts a
complete second search regardless of the length of the first match.
In the normal case, if the current match is "long enough", the
compressor reduces the search for a longer match, thus speeding up
the process. If speed is most important, the compressor inserts new
strings in the hash table only when no match was found, or when the
match is not "too long". This degrades the compression ratio but
saves time since there are both fewer insertions and fewer searches.
Deutsch Informational [Page 15]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
5. References
[1] Huffman, D. A., "A Method for the Construction of Minimum
Redundancy Codes", Proceedings of the Institute of Radio
Engineers, September 1952, Volume 40, Number 9, pp. 1098-1101.
[2] Ziv J., Lempel A., "A Universal Algorithm for Sequential Data
Compression", IEEE Transactions on Information Theory, Vol. 23,
No. 3, pp. 337-343.
[3] Gailly, J.-L., and Adler, M., ZLIB documentation and sources,
available in ftp://ftp.uu.net/pub/archiving/zip/doc/
[4] Gailly, J.-L., and Adler, M., GZIP documentation and sources,
available as gzip-*.tar in ftp://prep.ai.mit.edu/pub/gnu/
[5] Schwartz, E. S., and Kallick, B. "Generating a canonical prefix
encoding." Comm. ACM, 7,3 (Mar. 1964), pp. 166-169.
[6] Hirschberg and Lelewer, "Efficient decoding of prefix codes,"
Comm. ACM, 33,4, April 1990, pp. 449-459.
6. Security Considerations
Any data compression method involves the reduction of redundancy in
the data. Consequently, any corruption of the data is likely to have
severe effects and be difficult to correct. Uncompressed text, on
the other hand, will probably still be readable despite the presence
of some corrupted bytes.
It is recommended that systems using this data format provide some
means of validating the integrity of the compressed data. See
reference [3], for example.
7. Source code
Source code for a C language implementation of a "deflate" compliant
compressor and decompressor is available within the zlib package at
ftp://ftp.uu.net/pub/archiving/zip/zlib/.
8. Acknowledgements
Trademarks cited in this document are the property of their
respective owners.
Phil Katz designed the deflate format. Jean-Loup Gailly and Mark
Adler wrote the related software described in this specification.
Glenn Randers-Pehrson converted this document to RFC and HTML format.
Deutsch Informational [Page 16]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
9. Author's Address
L. Peter Deutsch
Aladdin Enterprises
203 Santa Margarita Ave.
Menlo Park, CA 94025
Phone: (415) 322-0103 (AM only)
FAX: (415) 322-1734
EMail: <ghost@aladdin.com>
Questions about the technical content of this specification can be
sent by email to:
Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
Mark Adler <madler@alumni.caltech.edu>
Editorial comments on this specification can be sent by email to:
L. Peter Deutsch <ghost@aladdin.com> and
Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
Deutsch Informational [Page 17]
|
Deleted compat/zlib/doc/rfc1952.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
|
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
Network Working Group P. Deutsch
Request for Comments: 1952 Aladdin Enterprises
Category: Informational May 1996
GZIP file format specification version 4.3
Status of This Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
IESG Note:
The IESG takes no position on the validity of any Intellectual
Property Rights statements contained in this document.
Notices
Copyright (c) 1996 L. Peter Deutsch
Permission is granted to copy and distribute this document for any
purpose and without charge, including translations into other
languages and incorporation into compilations, provided that the
copyright notice and this notice are preserved, and that any
substantive changes or deletions from the original are clearly
marked.
A pointer to the latest version of this and related documentation in
HTML format can be found at the URL
<ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
Abstract
This specification defines a lossless compressed data format that is
compatible with the widely used GZIP utility. The format includes a
cyclic redundancy check value for detecting data corruption. The
format presently uses the DEFLATE method of compression but can be
easily extended to use other compression methods. The format can be
implemented readily in a manner not covered by patents.
Deutsch Informational [Page 1]
RFC 1952 GZIP File Format Specification May 1996
Table of Contents
1. Introduction ................................................... 2
1.1. Purpose ................................................... 2
1.2. Intended audience ......................................... 3
1.3. Scope ..................................................... 3
1.4. Compliance ................................................ 3
1.5. Definitions of terms and conventions used ................. 3
1.6. Changes from previous versions ............................ 3
2. Detailed specification ......................................... 4
2.1. Overall conventions ....................................... 4
2.2. File format ............................................... 5
2.3. Member format ............................................. 5
2.3.1. Member header and trailer ........................... 6
2.3.1.1. Extra field ................................... 8
2.3.1.2. Compliance .................................... 9
3. References .................................................. 9
4. Security Considerations .................................... 10
5. Acknowledgements ........................................... 10
6. Author's Address ........................................... 10
7. Appendix: Jean-Loup Gailly's gzip utility .................. 11
8. Appendix: Sample CRC Code .................................. 11
1. Introduction
1.1. Purpose
The purpose of this specification is to define a lossless
compressed data format that:
* Is independent of CPU type, operating system, file system,
and character set, and hence can be used for interchange;
* Can compress or decompress a data stream (as opposed to a
randomly accessible file) to produce another data stream,
using only an a priori bounded amount of intermediate
storage, and hence can be used in data communications or
similar structures such as Unix filters;
* Compresses data with efficiency comparable to the best
currently available general-purpose compression methods,
and in particular considerably better than the "compress"
program;
* Can be implemented readily in a manner not covered by
patents, and hence can be practiced freely;
* Is compatible with the file format produced by the current
widely used gzip utility, in that conforming decompressors
will be able to read data produced by the existing gzip
compressor.
Deutsch Informational [Page 2]
RFC 1952 GZIP File Format Specification May 1996
The data format defined by this specification does not attempt to:
* Provide random access to compressed data;
* Compress specialized data (e.g., raster graphics) as well as
the best currently available specialized algorithms.
1.2. Intended audience
This specification is intended for use by implementors of software
to compress data into gzip format and/or decompress data from gzip
format.
The text of the specification assumes a basic background in
programming at the level of bits and other primitive data
representations.
1.3. Scope
The specification specifies a compression method and a file format
(the latter assuming only that a file can store a sequence of
arbitrary bytes). It does not specify any particular interface to
a file system or anything about character sets or encodings
(except for file names and comments, which are optional).
1.4. Compliance
Unless otherwise indicated below, a compliant decompressor must be
able to accept and decompress any file that conforms to all the
specifications presented here; a compliant compressor must produce
files that conform to all the specifications presented here. The
material in the appendices is not part of the specification per se
and is not relevant to compliance.
1.5. Definitions of terms and conventions used
byte: 8 bits stored or transmitted as a unit (same as an octet).
(For this specification, a byte is exactly 8 bits, even on
machines which store a character on a number of bits different
from 8.) See below for the numbering of bits within a byte.
1.6. Changes from previous versions
There have been no technical changes to the gzip format since
version 4.1 of this specification. In version 4.2, some
terminology was changed, and the sample CRC code was rewritten for
clarity and to eliminate the requirement for the caller to do pre-
and post-conditioning. Version 4.3 is a conversion of the
specification to RFC style.
Deutsch Informational [Page 3]
RFC 1952 GZIP File Format Specification May 1996
2. Detailed specification
2.1. Overall conventions
In the diagrams below, a box like this:
+---+
| | <-- the vertical bars might be missing
+---+
represents one byte; a box like this:
+==============+
| |
+==============+
represents a variable number of bytes.
Bytes stored within a computer do not have a "bit order", since
they are always treated as a unit. However, a byte considered as
an integer between 0 and 255 does have a most- and least-
significant bit, and since we write numbers with the most-
significant digit on the left, we also write bytes with the most-
significant bit on the left. In the diagrams below, we number the
bits of a byte so that bit 0 is the least-significant bit, i.e.,
the bits are numbered:
+--------+
|76543210|
+--------+
This document does not address the issue of the order in which
bits of a byte are transmitted on a bit-sequential medium, since
the data format described here is byte- rather than bit-oriented.
Within a computer, a number may occupy multiple bytes. All
multi-byte numbers in the format described here are stored with
the least-significant byte first (at the lower memory address).
For example, the decimal number 520 is stored as:
0 1
+--------+--------+
|00001000|00000010|
+--------+--------+
^ ^
| |
| + more significant byte = 2 x 256
+ less significant byte = 8
Deutsch Informational [Page 4]
RFC 1952 GZIP File Format Specification May 1996
2.2. File format
A gzip file consists of a series of "members" (compressed data
sets). The format of each member is specified in the following
section. The members simply appear one after another in the file,
with no additional information before, between, or after them.
2.3. Member format
Each member has the following structure:
+---+---+---+---+---+---+---+---+---+---+
|ID1|ID2|CM |FLG| MTIME |XFL|OS | (more-->)
+---+---+---+---+---+---+---+---+---+---+
(if FLG.FEXTRA set)
+---+---+=================================+
| XLEN |...XLEN bytes of "extra field"...| (more-->)
+---+---+=================================+
(if FLG.FNAME set)
+=========================================+
|...original file name, zero-terminated...| (more-->)
+=========================================+
(if FLG.FCOMMENT set)
+===================================+
|...file comment, zero-terminated...| (more-->)
+===================================+
(if FLG.FHCRC set)
+---+---+
| CRC16 |
+---+---+
+=======================+
|...compressed blocks...| (more-->)
+=======================+
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| CRC32 | ISIZE |
+---+---+---+---+---+---+---+---+
Deutsch Informational [Page 5]
RFC 1952 GZIP File Format Specification May 1996
2.3.1. Member header and trailer
ID1 (IDentification 1)
ID2 (IDentification 2)
These have the fixed values ID1 = 31 (0x1f, \037), ID2 = 139
(0x8b, \213), to identify the file as being in gzip format.
CM (Compression Method)
This identifies the compression method used in the file. CM
= 0-7 are reserved. CM = 8 denotes the "deflate"
compression method, which is the one customarily used by
gzip and which is documented elsewhere.
FLG (FLaGs)
This flag byte is divided into individual bits as follows:
bit 0 FTEXT
bit 1 FHCRC
bit 2 FEXTRA
bit 3 FNAME
bit 4 FCOMMENT
bit 5 reserved
bit 6 reserved
bit 7 reserved
If FTEXT is set, the file is probably ASCII text. This is
an optional indication, which the compressor may set by
checking a small amount of the input data to see whether any
non-ASCII characters are present. In case of doubt, FTEXT
is cleared, indicating binary data. For systems which have
different file formats for ascii text and binary data, the
decompressor can use FTEXT to choose the appropriate format.
We deliberately do not specify the algorithm used to set
this bit, since a compressor always has the option of
leaving it cleared and a decompressor always has the option
of ignoring it and letting some other program handle issues
of data conversion.
If FHCRC is set, a CRC16 for the gzip header is present,
immediately before the compressed data. The CRC16 consists
of the two least significant bytes of the CRC32 for all
bytes of the gzip header up to and not including the CRC16.
[The FHCRC bit was never set by versions of gzip up to
1.2.4, even though it was documented with a different
meaning in gzip 1.2.4.]
If FEXTRA is set, optional extra fields are present, as
described in a following section.
Deutsch Informational [Page 6]
RFC 1952 GZIP File Format Specification May 1996
If FNAME is set, an original file name is present,
terminated by a zero byte. The name must consist of ISO
8859-1 (LATIN-1) characters; on operating systems using
EBCDIC or any other character set for file names, the name
must be translated to the ISO LATIN-1 character set. This
is the original name of the file being compressed, with any
directory components removed, and, if the file being
compressed is on a file system with case insensitive names,
forced to lower case. There is no original file name if the
data was compressed from a source other than a named file;
for example, if the source was stdin on a Unix system, there
is no file name.
If FCOMMENT is set, a zero-terminated file comment is
present. This comment is not interpreted; it is only
intended for human consumption. The comment must consist of
ISO 8859-1 (LATIN-1) characters. Line breaks should be
denoted by a single line feed character (10 decimal).
Reserved FLG bits must be zero.
MTIME (Modification TIME)
This gives the most recent modification time of the original
file being compressed. The time is in Unix format, i.e.,
seconds since 00:00:00 GMT, Jan. 1, 1970. (Note that this
may cause problems for MS-DOS and other systems that use
local rather than Universal time.) If the compressed data
did not come from a file, MTIME is set to the time at which
compression started. MTIME = 0 means no time stamp is
available.
XFL (eXtra FLags)
These flags are available for use by specific compression
methods. The "deflate" method (CM = 8) sets these flags as
follows:
XFL = 2 - compressor used maximum compression,
slowest algorithm
XFL = 4 - compressor used fastest algorithm
OS (Operating System)
This identifies the type of file system on which compression
took place. This may be useful in determining end-of-line
convention for text files. The currently defined values are
as follows:
Deutsch Informational [Page 7]
RFC 1952 GZIP File Format Specification May 1996
0 - FAT filesystem (MS-DOS, OS/2, NT/Win32)
1 - Amiga
2 - VMS (or OpenVMS)
3 - Unix
4 - VM/CMS
5 - Atari TOS
6 - HPFS filesystem (OS/2, NT)
7 - Macintosh
8 - Z-System
9 - CP/M
10 - TOPS-20
11 - NTFS filesystem (NT)
12 - QDOS
13 - Acorn RISCOS
255 - unknown
XLEN (eXtra LENgth)
If FLG.FEXTRA is set, this gives the length of the optional
extra field. See below for details.
CRC32 (CRC-32)
This contains a Cyclic Redundancy Check value of the
uncompressed data computed according to CRC-32 algorithm
used in the ISO 3309 standard and in section 8.1.1.6.2 of
ITU-T recommendation V.42. (See http://www.iso.ch for
ordering ISO documents. See gopher://info.itu.ch for an
online version of ITU-T V.42.)
ISIZE (Input SIZE)
This contains the size of the original (uncompressed) input
data modulo 2^32.
2.3.1.1. Extra field
If the FLG.FEXTRA bit is set, an "extra field" is present in
the header, with total length XLEN bytes. It consists of a
series of subfields, each of the form:
+---+---+---+---+==================================+
|SI1|SI2| LEN |... LEN bytes of subfield data ...|
+---+---+---+---+==================================+
SI1 and SI2 provide a subfield ID, typically two ASCII letters
with some mnemonic value. Jean-Loup Gailly
<gzip@prep.ai.mit.edu> is maintaining a registry of subfield
IDs; please send him any subfield ID you wish to use. Subfield
IDs with SI2 = 0 are reserved for future use. The following
IDs are currently defined:
Deutsch Informational [Page 8]
RFC 1952 GZIP File Format Specification May 1996
SI1 SI2 Data
---------- ---------- ----
0x41 ('A') 0x70 ('P') Apollo file type information
LEN gives the length of the subfield data, excluding the 4
initial bytes.
2.3.1.2. Compliance
A compliant compressor must produce files with correct ID1,
ID2, CM, CRC32, and ISIZE, but may set all the other fields in
the fixed-length part of the header to default values (255 for
OS, 0 for all others). The compressor must set all reserved
bits to zero.
A compliant decompressor must check ID1, ID2, and CM, and
provide an error indication if any of these have incorrect
values. It must examine FEXTRA/XLEN, FNAME, FCOMMENT and FHCRC
at least so it can skip over the optional fields if they are
present. It need not examine any other part of the header or
trailer; in particular, a decompressor may ignore FTEXT and OS
and always produce binary output, and still be compliant. A
compliant decompressor must give an error indication if any
reserved bit is non-zero, since such a bit could indicate the
presence of a new field that would cause subsequent data to be
interpreted incorrectly.
3. References
[1] "Information Processing - 8-bit single-byte coded graphic
character sets - Part 1: Latin alphabet No.1" (ISO 8859-1:1987).
The ISO 8859-1 (Latin-1) character set is a superset of 7-bit
ASCII. Files defining this character set are available as
iso_8859-1.* in ftp://ftp.uu.net/graphics/png/documents/
[2] ISO 3309
[3] ITU-T recommendation V.42
[4] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification",
available in ftp://ftp.uu.net/pub/archiving/zip/doc/
[5] Gailly, J.-L., GZIP documentation, available as gzip-*.tar in
ftp://prep.ai.mit.edu/pub/gnu/
[6] Sarwate, D.V., "Computation of Cyclic Redundancy Checks via Table
Look-Up", Communications of the ACM, 31(8), pp.1008-1013.
Deutsch Informational [Page 9]
RFC 1952 GZIP File Format Specification May 1996
[7] Schwaderer, W.D., "CRC Calculation", April 85 PC Tech Journal,
pp.118-133.
[8] ftp://ftp.adelaide.edu.au/pub/rocksoft/papers/crc_v3.txt,
describing the CRC concept.
4. Security Considerations
Any data compression method involves the reduction of redundancy in
the data. Consequently, any corruption of the data is likely to have
severe effects and be difficult to correct. Uncompressed text, on
the other hand, will probably still be readable despite the presence
of some corrupted bytes.
It is recommended that systems using this data format provide some
means of validating the integrity of the compressed data, such as by
setting and checking the CRC-32 check value.
5. Acknowledgements
Trademarks cited in this document are the property of their
respective owners.
Jean-Loup Gailly designed the gzip format and wrote, with Mark Adler,
the related software described in this specification. Glenn
Randers-Pehrson converted this document to RFC and HTML format.
6. Author's Address
L. Peter Deutsch
Aladdin Enterprises
203 Santa Margarita Ave.
Menlo Park, CA 94025
Phone: (415) 322-0103 (AM only)
FAX: (415) 322-1734
EMail: <ghost@aladdin.com>
Questions about the technical content of this specification can be
sent by email to:
Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
Mark Adler <madler@alumni.caltech.edu>
Editorial comments on this specification can be sent by email to:
L. Peter Deutsch <ghost@aladdin.com> and
Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
Deutsch Informational [Page 10]
RFC 1952 GZIP File Format Specification May 1996
7. Appendix: Jean-Loup Gailly's gzip utility
The most widely used implementation of gzip compression, and the
original documentation on which this specification is based, were
created by Jean-Loup Gailly <gzip@prep.ai.mit.edu>. Since this
implementation is a de facto standard, we mention some more of its
features here. Again, the material in this section is not part of
the specification per se, and implementations need not follow it to
be compliant.
When compressing or decompressing a file, gzip preserves the
protection, ownership, and modification time attributes on the local
file system, since there is no provision for representing protection
attributes in the gzip file format itself. Since the file format
includes a modification time, the gzip decompressor provides a
command line switch that assigns the modification time from the file,
rather than the local modification time of the compressed input, to
the decompressed output.
8. Appendix: Sample CRC Code
The following sample code represents a practical implementation of
the CRC (Cyclic Redundancy Check). (See also ISO 3309 and ITU-T V.42
for a formal specification.)
The sample code is in the ANSI C programming language. Non C users
may find it easier to read with these hints:
& Bitwise AND operator.
^ Bitwise exclusive-OR operator.
>> Bitwise right shift operator. When applied to an
unsigned quantity, as here, right shift inserts zero
bit(s) at the left.
! Logical NOT operator.
++ "n++" increments the variable n.
0xNNN 0x introduces a hexadecimal (base 16) constant.
Suffix L indicates a long value (at least 32 bits).
/* Table of CRCs of all 8-bit messages. */
unsigned long crc_table[256];
/* Flag: has the table been computed? Initially false. */
int crc_table_computed = 0;
/* Make the table for a fast CRC. */
void make_crc_table(void)
{
unsigned long c;
Deutsch Informational [Page 11]
RFC 1952 GZIP File Format Specification May 1996
int n, k;
for (n = 0; n < 256; n++) {
c = (unsigned long) n;
for (k = 0; k < 8; k++) {
if (c & 1) {
c = 0xedb88320L ^ (c >> 1);
} else {
c = c >> 1;
}
}
crc_table[n] = c;
}
crc_table_computed = 1;
}
/*
Update a running crc with the bytes buf[0..len-1] and return
the updated crc. The crc should be initialized to zero. Pre- and
post-conditioning (one's complement) is performed within this
function so it shouldn't be done by the caller. Usage example:
unsigned long crc = 0L;
while (read_buffer(buffer, length) != EOF) {
crc = update_crc(crc, buffer, length);
}
if (crc != original_crc) error();
*/
unsigned long update_crc(unsigned long crc,
unsigned char *buf, int len)
{
unsigned long c = crc ^ 0xffffffffL;
int n;
if (!crc_table_computed)
make_crc_table();
for (n = 0; n < len; n++) {
c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
}
return c ^ 0xffffffffL;
}
/* Return the CRC of the bytes buf[0..len-1]. */
unsigned long crc(unsigned char *buf, int len)
{
return update_crc(0L, buf, len);
}
Deutsch Informational [Page 12]
|
Deleted compat/zlib/doc/txtvsbin.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
A Fast Method for Identifying Plain Text Files
==============================================
Introduction
------------
Given a file coming from an unknown source, it is sometimes desirable
to find out whether the format of that file is plain text. Although
this may appear like a simple task, a fully accurate detection of the
file type requires heavy-duty semantic analysis on the file contents.
It is, however, possible to obtain satisfactory results by employing
various heuristics.
Previous versions of PKZip and other zip-compatible compression tools
were using a crude detection scheme: if more than 80% (4/5) of the bytes
found in a certain buffer are within the range [7..127], the file is
labeled as plain text, otherwise it is labeled as binary. A prominent
limitation of this scheme is the restriction to Latin-based alphabets.
Other alphabets, like Greek, Cyrillic or Asian, make extensive use of
the bytes within the range [128..255], and texts using these alphabets
are most often misidentified by this scheme; in other words, the rate
of false negatives is sometimes too high, which means that the recall
is low. Another weakness of this scheme is a reduced precision, due to
the false positives that may occur when binary files containing large
amounts of textual characters are misidentified as plain text.
In this article we propose a new, simple detection scheme that features
a much increased precision and a near-100% recall. This scheme is
designed to work on ASCII, Unicode and other ASCII-derived alphabets,
and it handles single-byte encodings (ISO-8859, MacRoman, KOI8, etc.)
and variable-sized encodings (ISO-2022, UTF-8, etc.). Wider encodings
(UCS-2/UTF-16 and UCS-4/UTF-32) are not handled, however.
The Algorithm
-------------
The algorithm works by dividing the set of bytecodes [0..255] into three
categories:
- The white list of textual bytecodes:
9 (TAB), 10 (LF), 13 (CR), 32 (SPACE) to 255.
- The gray list of tolerated bytecodes:
7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB), 27 (ESC).
- The black list of undesired, non-textual bytecodes:
0 (NUL) to 6, 14 to 31.
If a file contains at least one byte that belongs to the white list and
no byte that belongs to the black list, then the file is categorized as
plain text; otherwise, it is categorized as binary. (The boundary case,
when the file is empty, automatically falls into the latter category.)
Rationale
---------
The idea behind this algorithm relies on two observations.
The first observation is that, although the full range of 7-bit codes
[0..127] is properly specified by the ASCII standard, most control
characters in the range [0..31] are not used in practice. The only
widely-used, almost universally-portable control codes are 9 (TAB),
10 (LF) and 13 (CR). There are a few more control codes that are
recognized on a reduced range of platforms and text viewers/editors:
7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB) and 27 (ESC); but these
codes are rarely (if ever) used alone, without being accompanied by
some printable text. Even the newer, portable text formats such as
XML avoid using control characters outside the list mentioned here.
The second observation is that most of the binary files tend to contain
control characters, especially 0 (NUL). Even though the older text
detection schemes observe the presence of non-ASCII codes from the range
[128..255], the precision rarely has to suffer if this upper range is
labeled as textual, because the files that are genuinely binary tend to
contain both control characters and codes from the upper range. On the
other hand, the upper range needs to be labeled as textual, because it
is used by virtually all ASCII extensions. In particular, this range is
used for encoding non-Latin scripts.
Since there is no counting involved, other than simply observing the
presence or the absence of some byte values, the algorithm produces
consistent results, regardless what alphabet encoding is being used.
(If counting were involved, it could be possible to obtain different
results on a text encoded, say, using ISO-8859-16 versus UTF-8.)
There is an extra category of plain text files that are "polluted" with
one or more black-listed codes, either by mistake or by peculiar design
considerations. In such cases, a scheme that tolerates a small fraction
of black-listed codes would provide an increased recall (i.e. more true
positives). This, however, incurs a reduced precision overall, since
false positives are more likely to appear in binary files that contain
large chunks of textual data. Furthermore, "polluted" plain text should
be regarded as binary by general-purpose text detection schemes, because
general-purpose text processing algorithms might not be applicable.
Under this premise, it is safe to say that our detection method provides
a near-100% recall.
Experiments have been run on many files coming from various platforms
and applications. We tried plain text files, system logs, source code,
formatted office documents, compiled object code, etc. The results
confirm the optimistic assumptions about the capabilities of this
algorithm.
--
Cosmin Truta
Last updated: 2006-May-28
|
Changes to compat/zlib/gzlib.c.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
/* gzlib.c -- zlib functions common to reading and writing gzip files
* Copyright (C) 2004, 2010, 2011, 2012, 2013, 2016 Mark Adler
* Copyright (C) 2004-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__)
# define LSEEK _lseeki64
|
| ︙ | | |
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
-
+
|
if (len)
wcstombs(state->path, path, len + 1);
else
*(state->path) = 0;
else
#endif
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(state->path, len + 1, "%s", (const char *)path);
(void)snprintf(state->path, len + 1, "%s", (const char *)path);
#else
strcpy(state->path, path);
#endif
/* compute the flags for open() */
oflag =
#ifdef O_LARGEFILE
|
| ︙ | | |
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
-
+
|
{
char *path; /* identifier for error messages */
gzFile gz;
if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
return NULL;
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
(void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
#else
sprintf(path, "<fd:%d>", fd); /* for debugging */
#endif
gz = gz_open(path, fd, mode);
free(path);
return gz;
}
|
| ︙ | | |
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
-
-
+
+
|
/* construct error message with path */
if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
NULL) {
state->err = Z_MEM_ERROR;
return;
}
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
"%s%s%s", state->path, ": ", msg);
(void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
"%s%s%s", state->path, ": ", msg);
#else
strcpy(state->msg, state->path);
strcat(state->msg, ": ");
strcat(state->msg, msg);
#endif
}
|
| ︙ | | |
Changes to compat/zlib/gzwrite.c.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
/* gzwrite.c -- zlib functions for writing gzip files
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler
* Copyright (C) 2004-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
/* Local functions */
local int gz_init OF((gz_statep));
|
| ︙ | | |
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
+
|
return -1;
}
state->x.next += writ;
}
if (strm->avail_out == 0) {
strm->avail_out = state->size;
strm->next_out = state->out;
state->x.next = state->out;
}
}
/* compress */
have = strm->avail_out;
ret = deflate(strm, flush);
if (ret == Z_STREAM_ERROR) {
|
| ︙ | | |
Changes to compat/zlib/inffast.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
-
+
-
+
+
+
|
/* inffast.c -- fast decoding
* Copyright (C) 1995-2008, 2010, 2013, 2016 Mark Adler
* Copyright (C) 1995-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
#ifndef ASMINF
#ifdef ASMINF
# pragma message("Assembler code may have bugs -- use at your own risk")
#else
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
|
| ︙ | | |
Changes to compat/zlib/inftrees.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
+
-
+
|
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2016 Mark Adler
* Copyright (C) 1995-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftrees.h"
#define MAXBITS 15
const char inflate_copyright[] =
" inflate 1.2.9 Copyright 1995-2016 Mark Adler ";
" inflate 1.2.11 Copyright 1995-2017 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
include such an acknowledgment, I would appreciate that you keep this
copyright string in the executable of your product.
*/
|
| ︙ | | |
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
-
+
|
unsigned short count[MAXBITS+1]; /* number of codes of each length */
unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
static const unsigned short lbase[31] = { /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 192, 79};
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577, 0, 0};
static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
|
| ︙ | | |
Changes to compat/zlib/os400/README400.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
ZLIB version 1.2.9 for OS/400 installation instructions
ZLIB version 1.2.11 for OS/400 installation instructions
1) Download and unpack the zlib tarball to some IFS directory.
(i.e.: /path/to/the/zlib/ifs/source/directory)
If the installed IFS command suppors gzip format, this is straightforward,
else you have to unpack first to some directory on a system supporting it,
then move the whole directory to the IFS via the network (via SMB or FTP).
|
| ︙ | | |
Changes to compat/zlib/os400/make.sh.
| ︙ | | |
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
-
+
|
# Create and compile the identification source file.
echo '#pragma comment(user, "ZLIB version '"${VERSION}"'")' > os400.c
echo '#pragma comment(user, __DATE__)' >> os400.c
echo '#pragma comment(user, __TIME__)' >> os400.c
echo '#pragma comment(copyright, "Copyright (C) 1995-2016 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c
echo '#pragma comment(copyright, "Copyright (C) 1995-2017 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c
make_module OS400 os400.c
LINK= # No need to rebuild service program yet.
MODULES=
# Get source list.
|
| ︙ | | |
Changes to compat/zlib/os400/zlib.inc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
+
-
-
+
+
-
+
|
* ZLIB.INC - Interface to the general purpose compression library
*
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
* Version 1.2.9
* Version 1.2.11
*
*
* WARNING:
* Procedures inflateInit(), inflateInit2(), deflateInit(),
* deflateInit2() and inflateBackInit() need to be called with
* two additional arguments:
* the package version string and the stream control structure.
* size. This is needed because RPG lacks some macro feature.
* Call these procedures as:
* inflateInit(...: ZLIB_VERSION: %size(z_stream))
*
/if not defined(ZLIB_H_)
/define ZLIB_H_
*
**************************************************************************
* Constants
**************************************************************************
*
* Versioning information.
*
D ZLIB_VERSION C '1.2.9'
D ZLIB_VERNUM C X'1290'
D ZLIB_VERSION C '1.2.11'
D ZLIB_VERNUM C X'12a0'
D ZLIB_VER_MAJOR C 1
D ZLIB_VER_MINOR C 2
D ZLIB_VER_REVISION...
D C 9
D C 11
D ZLIB_VER_SUBREVISION...
D C 0
*
* Other equates.
*
D Z_NO_FLUSH C 0
D Z_PARTIAL_FLUSH...
|
| ︙ | | |
Changes to compat/zlib/qnx/package.qpg.
| ︙ | | |
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
-
-
-
-
+
+
+
+
|
<QPG:EmailAddress></QPG:EmailAddress>
</QPG:Responsible>
<QPG:Values>
<QPG:Files>
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../libz.so.1.2.9" install="/opt/lib/" user="root:bin" permission="644"/>
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.9"/>
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.9"/>
<QPG:Add file="../libz.so.1.2.9" install="/opt/lib/" component="slib"/>
<QPG:Add file="../libz.so.1.2.11" install="/opt/lib/" user="root:bin" permission="644"/>
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.11"/>
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.11"/>
<QPG:Add file="../libz.so.1.2.11" install="/opt/lib/" component="slib"/>
</QPG:Files>
<QPG:PackageFilter>
<QPM:PackageManifest>
<QPM:PackageDescription>
<QPM:PackageType>Library</QPM:PackageType>
<QPM:PackageReleaseNotes></QPM:PackageReleaseNotes>
|
| ︙ | | |
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
+
|
<QPM:ProductDescriptionShort>A massively spiffy yet delicately unobtrusive compression library.</QPM:ProductDescriptionShort>
<QPM:ProductDescriptionLong>zlib is designed to be a free, general-purpose, legally unencumbered, lossless data compression library for use on virtually any computer hardware and operating system.</QPM:ProductDescriptionLong>
<QPM:ProductDescriptionURL>http://www.gzip.org/zlib</QPM:ProductDescriptionURL>
<QPM:ProductDescriptionEmbedURL></QPM:ProductDescriptionEmbedURL>
</QPM:ProductDescription>
<QPM:ReleaseDescription>
<QPM:ReleaseVersion>1.2.9</QPM:ReleaseVersion>
<QPM:ReleaseVersion>1.2.11</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
<QPM:ReleaseNoteMajor></QPM:ReleaseNoteMajor>
<QPM:ExcludeCountries>
<QPM:Country></QPM:Country>
</QPM:ExcludeCountries>
|
| ︙ | | |
Changes to compat/zlib/treebuild.xml.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
<?xml version="1.0" ?>
<package name="zlib" version="1.2.9">
<library name="zlib" dlversion="1.2.9" dlname="z">
<package name="zlib" version="1.2.11">
<library name="zlib" dlversion="1.2.11" dlname="z">
<property name="description"> zip compression library </property>
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
<!-- fixme: not implemented yet -->
<property name="compiler/c/inline" value="yes" />
<include-file name="zlib.h" scope="public" mode="644" />
|
| ︙ | | |
Changes to compat/zlib/trees.c.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
/* trees.c -- output deflated data using Huffman coding
* Copyright (C) 1995-2016 Jean-loup Gailly
* Copyright (C) 1995-2017 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/*
* ALGORITHM
*
|
| ︙ | | |
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
|
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
|
-
+
|
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
#endif
bi_flush(s);
}
/* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static
* trees or store, and output the encoded block to the zip file.
* trees or store, and write out the encoded block.
*/
void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
int last; /* one if this is the last block for a file */
{
|
| ︙ | | |
Changes to compat/zlib/win32/Makefile.msc.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
# Makefile for zlib using Microsoft (Visual) C
# zlib is copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler
# zlib is copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
#
# Usage:
# nmake -f win32/Makefile.msc (standard build)
# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
# nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \
# OBJA="inffas32.obj match686.obj" (use ASM code, x86)
# nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." \
|
| ︙ | | |
Changes to compat/zlib/win32/README-WIN32.txt.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.9 is a general purpose data compression library. All the code is
zlib 1.2.11 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
and rfc1952.txt (gzip format).
All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). Two compiled
|
| ︙ | | |
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
+
|
PLEASE read DLL_FAQ.txt, and the the zlib FAQ http://zlib.net/zlib_faq.html
before asking for help.
Manifest:
The package zlib-1.2.9-win32-x86.zip will contain the following files:
The package zlib-1.2.11-win32-x86.zip will contain the following files:
README-WIN32.txt This document
ChangeLog Changes since previous zlib packages
DLL_FAQ.txt Frequently asked questions about zlib1.dll
zlib.3.pdf Documentation of this library in Adobe Acrobat format
example.exe A statically-bound example (using zlib.lib, not the dll)
|
| ︙ | | |
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
-
+
|
zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib; they
are too numerous to cite here.
Copyright notice:
(C) 1995-2012 Jean-loup Gailly and Mark Adler
(C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
|
| ︙ | | |
Changes to compat/zlib/win32/README.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
-
+
-
+
-
+
-
+
|
What's here
===========
The official ZLIB1.DLL
Source
======
zlib version 1.2.8
zlib version 1.2.11
available at http://www.gzip.org/zlib/
Specification and rationale
===========================
See the accompanying DLL_FAQ.txt
Usage
=====
See the accompanying USAGE.txt
Build info
==========
Contributed by Jan Nijtmans.
Compiler:
i686-w64-mingw32-gcc (GCC) 4.5.3
i686-w64-mingw32-gcc (GCC) 5.4.0
Library:
mingw64-i686-runtime/headers: 3.0b_svn5747-1
mingw64-i686-runtime/headers: 5.0.0
Build commands:
i686-w64-mingw32-gcc -c -DASMV contrib/asm686/match.S
i686-w64-mingw32-gcc -c -DASMINF -I. -O3 contrib/inflate86/inffas86.c
make -f win32/Makefile.gcc PREFIX=i686-w64-mingw32- LOC="-mms-bitfields -DASMV -DASMINF" OBJA="inffas86.o match.o"
Finally, from VS commandline (VS2005 or higher):
lib -machine:X86 -name:zlib1.dll -def:zlib.def -out:zdll.lib
Copyright notice
================
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
|
| ︙ | | |
Changes to compat/zlib/win32/USAGE.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
+
+
+
-
+
+
+
+
+
+
-
+
|
Installing ZLIB1.DLL
====================
Copy ZLIB1.DLL to the SYSTEM or the SYSTEM32 directory.
If you want to install the 32-bit dll on a 64-bit
machine, use the SysWOW64 directory instead.
Using ZLIB1.DLL with Microsoft Visual C++
=========================================
1. Install the supplied header files "zlib.h" and "zconf.h"
into a directory found in the INCLUDE path list.
2. Install the supplied library file "zdll.lib" into a
directory found in the LIB path list.
3. Add "zdll.lib" to your project.
Using ZLIB1.DLL with gcc/MinGW
==============================
1. Install the supplied header files "zlib.h" and "zconf.h"
into the INCLUDE directory.
2. Copy the supplied library file "zdll.lib" to "libzdll.a":
2. (32-bit): Copy the supplied library file "zdll.lib" to "libzdll.a":
cp lib/zdll.lib lib/libzdll.a
OR
2'. (64-bit): Copy the supplied library file "libz.dll.a" to "libzdll.a":
cp lib/libz.dll.a lib/libzdll.a
OR
2' Build the import library from the supplied "zlib.def":
2'' Build the import library from the supplied "zlib.def":
dlltool -D zlib1.dll -d lib/zlib.def -l lib/libzdll.a
3. Install "libzdll.a" into the LIB directory.
4. Add "libzdll.a" to your project, or use the -lzdll option.
|
| ︙ | | |
Changes to compat/zlib/win32/VisualC.txt.
1
2
3
|
1
2
3
|
-
+
|
To build zlib using the Microsoft Visual C++ environment,
use the appropriate project from the projects/ directory.
use the appropriate project from the contrib/vstudio/ directory.
|
Changes to compat/zlib/win32/zdll.lib.
cannot compute difference between binary files
Changes to compat/zlib/win32/zlib1.dll.
cannot compute difference between binary files
Changes to compat/zlib/win32/zlib1.rc.
| ︙ | | |
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-
+
|
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression library\0"
VALUE "FileVersion", ZLIB_VERSION "\0"
VALUE "InternalName", "zlib1.dll\0"
VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
VALUE "OriginalFilename", "zlib1.dll\0"
VALUE "ProductName", "zlib\0"
VALUE "ProductVersion", ZLIB_VERSION "\0"
VALUE "Comments", "For more information visit http://www.zlib.net/\0"
END
END
BLOCK "VarFileInfo"
|
| ︙ | | |
Changes to compat/zlib/win64/libz.dll.a.
cannot compute difference between binary files
Changes to compat/zlib/win64/zdll.lib.
cannot compute difference between binary files
Changes to compat/zlib/win64/zlib1.dll.
cannot compute difference between binary files
Changes to compat/zlib/zlib.3.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
.TH ZLIB 3 "31 Dec 2016"
.TH ZLIB 3 "15 Jan 2017"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
[see
.I zlib.h
for full description]
.SH DESCRIPTION
|
| ︙ | | |
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
-
+
-
+
|
.IP
http://zlib.net/zlib_faq.html
.LP
before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS AND LICENSE
Version 1.2.9
Version 1.2.11
.LP
Copyright (C) 1995-2016 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
.LP
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
.LP
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
|
| ︙ | | |
Changes to compat/zlib/zlib.3.pdf.
cannot compute difference between binary files
Changes to compat/zlib/zlib.h.
1
2
3
4
5
6
7
8
9
10
11
|
1
2
3
4
5
6
7
8
9
10
11
|
-
+
-
+
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.9, December 31st, 2016
version 1.2.11, January 15th, 2017
Copyright (C) 1995-2016 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
|
| ︙ | | |
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
-
-
+
+
-
+
|
#include "zconf.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ZLIB_VERSION "1.2.9"
#define ZLIB_VERNUM 0x1290
#define ZLIB_VERSION "1.2.11"
#define ZLIB_VERNUM 0x12b0
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 9
#define ZLIB_VER_REVISION 11
#define ZLIB_VER_SUBREVISION 0
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed data.
This version of the library supports only one compression method (deflation)
but other algorithms will be added later and will have the same stream
|
| ︙ | | |
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
|
-
-
-
-
+
+
+
+
+
|
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
the caller. In the current version of inflate, the provide input is not
read or consumed. Any memory allocation will be deferred to the first call
of inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them
to use default allocation functions.
the caller. In the current version of inflate, the provided input is not
read or consumed. The allocation of a sliding window will be deferred to
the first call of inflate (if the decompression does not complete on the
first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
them to use default allocation functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller, or Z_STREAM_ERROR if the parameters are
invalid, such as a null pointer to the structure. msg is set to null if
there is no error message. inflateInit does not perform any decompression.
Actual decompression will be done by inflate(). So next_in, and avail_in,
|
| ︙ | | |
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
|
-
+
|
forced to flush.
The detailed semantics are as follows. inflate performs one or both of the
following actions:
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), then next_in and avail_on are updated
enough room in the output buffer), then next_in and avail_in are updated
accordingly, and processing will resume at this point for the next call of
inflate().
- Generate more output starting at next_out and update next_out and avail_out
accordingly. inflate() provides as much output as possible, until there is
no more input data or no more space in the output buffer (see below about
the flush parameter).
|
| ︙ | | |
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
|
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
+
-
-
-
-
+
+
+
+
|
int strategy));
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2(). This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the
strategy is changed, and if any input has been consumed in a previous
strategy is changed, then the input available so far is compressed with the
old level and strategy using deflate(strm, Z_BLOCK). There are three
approaches for the compression levels 0, 1..3, and 4..9 respectively. The
new level and strategy will take effect at the next call of deflate().
deflate() call, then the input available so far is compressed with the old
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not
take effect. In this case, deflateParams() can be called again with the
same parameters and more output space to try again.
In order to assure a change in the parameters on the first try, the
|
| ︙ | | |
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
|
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
|
-
+
-
+
|
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
of the destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer. compress() is equivalent to compress2() with a level
compressed data. compress() is equivalent to compress2() with a level
parameter of Z_DEFAULT_COMPRESSION.
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
*/
ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level));
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compressed data.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
|
| ︙ | | |
Changes to compat/zlib/zutil.c.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
+
|
/* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2005, 2010, 2011, 2012, 2016 Jean-loup Gailly
* Copyright (C) 1995-2017 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
#ifndef Z_SOLO
|
| ︙ | | |
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
-
+
|
# endif
# endif
#endif
return flags;
}
#ifdef ZLIB_DEBUG
#include <stdlib.h>
# ifndef verbose
# define verbose 0
# endif
int ZLIB_INTERNAL z_verbose = verbose;
void ZLIB_INTERNAL z_error (m)
char *m;
|
| ︙ | | |
Changes to doc/AddErrInfo.3.
| ︙ | | |
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
-
+
|
\fBTcl_SetVar2Ex\fR).
.PP
A typical usage for \fBTcl_GetReturnOptions\fR is to
retrieve the stack trace when script evaluation returns
\fBTCL_ERROR\fR, like so:
.PP
.CS
int code = Tcl_EvalEx(interp, script, -1, 0);
int code = Tcl_Eval(interp, script);
if (code == TCL_ERROR) {
Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code);
Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1);
Tcl_Obj *stackTrace;
Tcl_IncrRefCount(key);
Tcl_DictObjGet(NULL, options, key, &stackTrace);
Tcl_DecrRefCount(key);
|
| ︙ | | |
Changes to doc/CallDel.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interpreter is deleted
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/CmdCmplt.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CommandComplete \- Check for unmatched braces in a Tcl command
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Concat.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Concat \- concatenate a collection of strings
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/CrtFileHdlr.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1990-1994 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CreateFileHandler, Tcl_DeleteFileHandler \- associate procedure callbacks with files or devices (Unix only)
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/CrtInterp.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CreateInterp, Tcl_DeleteInterp, Tcl_InterpActive, Tcl_InterpDeleted \- create and delete Tcl command interpreters
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/CrtTimerHdlr.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CreateTimerHandler, Tcl_DeleteTimerHandler \- call a procedure at a given time
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/DetachPids.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_DetachPids, Tcl_ReapDetachedProcs, Tcl_WaitPid \- manage child processes in background
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/DictObj.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2003 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DictObj 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_NewDictObj, Tcl_DictObjPut, Tcl_DictObjGet, Tcl_DictObjRemove, Tcl_DictObjSize, Tcl_DictObjFirst, Tcl_DictObjNext, Tcl_DictObjDone, Tcl_DictObjPutKeyList, Tcl_DictObjRemoveKeyList \- manipulate Tcl values as dictionaries
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/DoWhenIdle.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pending events
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Environment.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1997-1998 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_PutEnv 3 "7.5" Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_PutEnv \- procedures to manipulate the environment
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Eval.3.
| ︙ | | |
201
202
203
204
205
206
207
208
209
210
211
|
201
202
203
204
205
206
207
208
209
210
211
|
-
+
|
about to be returned from the topmost \fBTcl_EvalObjEx\fR
invocation for \fIinterp\fR,
it converts the return code to \fBTCL_ERROR\fR
and sets \fIinterp\fR's result to an error message indicating that
the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was
invoked in an inappropriate place.
This means that top-level applications should never see a return code
from \fBTcl_EvalObjEx\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR.
from \fBTcl_EvalObjEx\fR other than \fBTCL_OK\fR or \fBTCL_ERROR\fR.
.SH KEYWORDS
execute, file, global, result, script, value
|
Changes to doc/ExprLongObj.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj, Tcl_ExprObj \- evaluate an expression
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/FindExec.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of the binary file containing the application
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/GetCwd.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1998-1999 Scriptics Corporation
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_GetCwd, Tcl_Chdir \- manipulate the current working directory
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/GetIndex.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_GetIndexFromObj, Tcl_GetIndexFromObjStruct \- lookup string in table of keywords
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/GetInt.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_GetInt, Tcl_GetDouble, Tcl_GetBoolean \- convert from string to integer, double, or boolean
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/GetOpnFl.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_GetOpenFile \- Return a FILE* for a channel registered in the given interpreter (Unix only)
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/GetTime.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2001 by Kevin B. Kenny <kennykb@acm.org>.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetTime 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_GetTime, Tcl_SetTimeProc, Tcl_QueryTimeProc \- get date and time
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Hash.3.
| ︙ | | |
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
-
+
|
custom set of allocation routines might depend on, in order to avoid any
circular dependency.
.PP
The \fIhashKeyProc\fR member contains the address of a function called to
calculate a hash value for the key.
.PP
.CS
typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR(
typedef unsigned int \fBTcl_HashKeyProc\fR(
Tcl_HashTable *\fItablePtr\fR,
void *\fIkeyPtr\fR);
.CE
.PP
If this is NULL then \fIkeyPtr\fR is used and
\fBTCL_HASH_KEY_RANDOMIZE_HASH\fR is assumed.
.PP
|
| ︙ | | |
Changes to doc/Init.3.
1
2
3
4
5
6
7
8
9
10
11
|
1
2
3
4
5
6
7
8
9
10
11
|
-
+
|
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Init \- find and source initialization script
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/InitStubs.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
+
-
+
-
+
-
+
|
'\"
'\" Copyright (c) 1998-1999 Scriptics Corporation
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_InitStubs 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_InitStubs \- initialize the Tcl stubs mechanism
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
const char *
\fBTcl_InitStubs\fR(\fIinterp, version, exact\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Tcl interpreter handle.
.AP "const char" *version in
A version string consisting of one or more decimal numbers
separated by dots.
.AP int exact in
1 means that only the particular version specified by
Non-zero means that only the particular version specified by
\fIversion\fR is acceptable.
0 means that versions newer than \fIversion\fR are also
Zero means that versions newer than \fIversion\fR are also
acceptable as long as they have the same major version number
as \fIversion\fR. Other bits have no effect.
as \fIversion\fR.
.BE
.SH INTRODUCTION
.PP
The Tcl stubs mechanism defines a way to dynamically bind
extensions to a particular Tcl implementation at run time.
This provides two significant benefits to Tcl users:
.IP 1) 5
|
| ︙ | | |
Changes to doc/IntObj.3.
| ︙ | | |
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
-
+
|
with which values might be exchanged. The C integral types for which Tcl
provides value exchange routines are \fBint\fR, \fBlong int\fR,
\fBTcl_WideInt\fR, and \fBmp_int\fR. The \fBint\fR and \fBlong int\fR types
are provided by the C language standard. The \fBTcl_WideInt\fR type is a
typedef defined to be whatever signed integral type covers at least the
64-bit integer range (-9223372036854775808 to 9223372036854775807). Depending
on the platform and the C compiler, the actual type might be
\fBlong int\fR, \fBlong long int\fR, \fBint64\fR, or something else.
\fBlong int\fR, \fBlong long int\fR, \fB__int64\fR, or something else.
The \fBmp_int\fR type is a multiple-precision integer type defined
by the LibTomMath multiple-precision integer library.
.PP
The \fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, \fBTcl_NewWideIntObj\fR,
and \fBTcl_NewBignumObj\fR routines each create and return a new
Tcl value initialized to the integral value of the argument. The
returned Tcl value is unshared.
|
| ︙ | | |
Changes to doc/Limit.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2004 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_LimitCheck 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_LimitAddHandler, Tcl_LimitCheck, Tcl_LimitExceeded, Tcl_LimitGetCommands, Tcl_LimitGetGranularity, Tcl_LimitGetTime, Tcl_LimitReady, Tcl_LimitRemoveHandler, Tcl_LimitSetCommands, Tcl_LimitSetGranularity, Tcl_LimitSetTime, Tcl_LimitTypeEnabled, Tcl_LimitTypeExceeded, Tcl_LimitTypeReset, Tcl_LimitTypeSet \- manage and check resource limits on interpreters
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/LinkVar.3.
| ︙ | | |
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+
+
+
|
\fBTCL_LINK_READ_ONLY\fR:
.TP
\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_GetIntFromObj\fR; attempts to write
non-integer values into \fIvarName\fR will be rejected with
Tcl errors.
Tcl errors. Incomplete integer representations (like the empty
string, '+', '-' or the hex/octal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_UINT\fR
The C variable is of type \fBunsigned int\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
platform's defined range for the \fBunsigned int\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors.
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_CHAR\fR
The C variable is of type \fBchar\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
\fBchar\fR datatype; attempts to write non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors.
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_UCHAR\fR
The C variable is of type \fBunsigned char\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
platform's defined range for the \fBunsigned char\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors.
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_SHORT\fR
The C variable is of type \fBshort\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
\fBshort\fR datatype; attempts to write non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors.
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_USHORT\fR
The C variable is of type \fBunsigned short\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
platform's defined range for the \fBunsigned short\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors.
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_LONG\fR
The C variable is of type \fBlong\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetLongFromObj\fR; attempts to write
non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors.
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_ULONG\fR
The C variable is of type \fBunsigned long\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
platform's defined range for the \fBunsigned long\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors.
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
prefix) are accepted as if they are valid too.
.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_GetDoubleFromObj\fR; attempts to write
non-real values into \fIvarName\fR will be rejected with
Tcl errors.
Tcl errors. Incomplete integer or real representations (like the
empty string, '.', '+', '-' or the hex/octal/binary prefix) are
accepted as if they are valid too.
.TP
\fBTCL_LINK_FLOAT\fR
The C variable is of type \fBfloat\fR.
Any value written into the Tcl variable must have a proper real
form acceptable to \fBTcl_GetDoubleFromObj\fR and must be within the
range acceptable for a \fBfloat\fR; attempts to
write non-real values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors.
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
or real representations (like the empty string, '.', '+', '-' or
the hex/octal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_WIDE_INT\fR
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.
Tcl errors. Incomplete integer representations (like the empty
string, '+', '-' or the hex/octal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_WIDE_UINT\fR
The C variable is of type \fBTcl_WideUInt\fR (which is an unsigned
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 unsigned
integer form acceptable to \fBTcl_GetWideIntFromObj\fR (it will be
cast to unsigned);
.\" FIXME! Use bignums instead.
attempts to write non-integer values into \fIvarName\fR will be
rejected with Tcl errors.
rejected with Tcl errors. Incomplete integer representations (like
the empty string, '+', '-' or the hex/octal/binary prefix) are accepted
as if they are valid too.
.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
.QW 0 ;
otherwise it will read from Tcl as
.QW 1 .
|
| ︙ | | |
Changes to doc/Load.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 2009-2010 Kevin B. Kenny
'\" Copyright (c) 2010 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Load 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_LoadFile, Tcl_FindSymbol \- platform-independent dynamic library loading
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Namespace.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
-
+
-
+
|
'\"
'\" Copyright (c) 2003 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" Note that some of these functions do not seem to belong, but they
'\" were all introduced with the same TIP (#139)
'\"
'\"
.TH Tcl_Namespace 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_AppendExportList, Tcl_CreateNamespace, Tcl_DeleteNamespace, Tcl_Export, Tcl_FindCommand, Tcl_FindNamespace, Tcl_ForgetImport, Tcl_GetCurrentNamespace, Tcl_GetGlobalNamespace, Tcl_GetNamespaceUnknownHandler, Tcl_Import, Tcl_SetNamespaceUnknownHandler \- manipulate namespaces
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/OpenTcp.3.
| ︙ | | |
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
-
+
|
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
argument to \fBTcl_OpenTcpServer\fR, \fIchannel\fR will be the handle
for the new channel, \fIhostName\fR points to a string containing
the name of the client host making the connection, and \fIport\fR
will contain the client's port number.
The new channel
is opened for both input and output.
is opened for both input and output.
If \fIproc\fR raises an error, the connection is closed automatically.
\fIProc\fR has no return value, but if it wishes to reject the
connection it can close \fIchannel\fR.
.PP
\fBTcl_OpenTcpServer\fR normally returns a pointer to a channel
representing the server socket.
If an error occurs, \fBTcl_OpenTcpServer\fR returns NULL and
|
| ︙ | | |
Changes to doc/ParseArgs.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2008 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_ParseArgsObjv 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_ParseArgsObjv \- parse arguments according to a tabular description
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Preserve.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it is being used
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/PrintDbl.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_PrintDouble \- Convert floating value to string
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/RecEvalObj.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_RecordAndEvalObj \- save command on history list before evaluating
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/RecordEval.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_RecordAndEval \- save command on history list before evaluating
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/SetErrno.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SetErrno, Tcl_GetErrno, Tcl_ErrnoId, Tcl_ErrnoMsg \- manipulate errno to store and retrieve error codes
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/SetRecLmt.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SetRecursionLimit \- set maximum allowable nesting depth in interpreter
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Signal.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2001 ActiveState Tool Corp.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SignalId, Tcl_SignalMsg \- Convert signal codes
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/Sleep.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Sleep \- delay execution for a given number of milliseconds
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/SplitList.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SplitList 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SplitList, Tcl_Merge, Tcl_ScanElement, Tcl_ConvertElement, Tcl_ScanCountedElement, Tcl_ConvertCountedElement \- manipulate Tcl lists
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/SplitPath.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SplitPath, Tcl_JoinPath, Tcl_GetPathType \- manipulate platform-dependent file paths
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/StaticPkg.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_StaticPackage \- make a statically linked package available via the 'load' command
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/StdChannels.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2001 by ActiveState Corporation
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "Standard Channels" 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_StandardChannels \- How the Tcl library deals with the standard channels
.BE
|
| ︙ | | |
Changes to doc/StrMatch.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_StringMatch 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_StringMatch, Tcl_StringCaseMatch \- test whether a string matches a pattern
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/SubstObj.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2001 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SubstObj 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SubstObj \- perform substitutions on Tcl values
.SH SYNOPSIS
.nf
|
| ︙ | | |
Changes to doc/TCL_MEM_DEBUG.3.
1
2
3
4
5
6
7
8
9
10
11
12
|
1
2
3
4
5
6
7
8
9
10
11
12
|
-
+
-
+
|
'\"
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH TCL_MEM_DEBUG 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
TCL_MEM_DEBUG \- Compile-time flag to enable Tcl memory debugging
.BE
.SH DESCRIPTION
|
| ︙ | | |
Changes to doc/TclZlib.3.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2008 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH TclZlib 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_ZlibAdler32, Tcl_ZlibCRC32, Tcl_ZlibDeflate, Tcl_ZlibInflate, Tcl_ZlibStreamChecksum, Tcl_ZlibStreamClose, Tcl_ZlibStreamEof, Tcl_ZlibStreamGet, Tcl_ZlibStreamGetCommandName, Tcl_ZlibStreamInit, Tcl_ZlibStreamPut \- compression and decompression functions
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/break.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993-1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH break n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
break \- Abort looping command
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/case.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH case n 7.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
case \- Evaluate one of several scripts, depending on a given value
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/cd.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH cd n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
cd \- Change working directory
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/clock.n.
| ︙ | | |
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
-
-
-
+
+
+
+
|
exactly 86400 seconds. Tcl responds to leap seconds by speeding or
slowing its clock by a tiny fraction for some minutes until it is
back in sync with UTC; its data model does not represent minutes that
have 59 or 61 seconds.
.TP
\fIunit\fR
One of the words, \fBseconds\fR, \fBminutes\fR, \fBhours\fR,
\fBdays\fR, \fBweekdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR.
Used in conjunction with \fIcount\fR to identify an interval of time,
for example, \fI3 seconds\fR or \fI1 year\fR.
\fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or
any unique prefix of such a word. Used in conjunction with \fIcount\fR
to identify an interval of time, for example, \fI3 seconds\fR or
\fI1 year\fR.
.SS "OPTIONS"
.TP
\fB\-base\fR time
Specifies that any relative times present in a \fBclock scan\fR command
are to be given relative to \fItime\fR. \fItime\fR must be expressed as
a count of nominal seconds from the epoch time of 1 January 1970, 00:00 UTC.
.TP
|
| ︙ | | |
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
-
+
+
|
.PP
The \fBclock add\fR command performs clock arithmetic on a value
(expressed as nominal seconds from the epoch time of 1 January 1970, 00:00 UTC)
given as its first argument. The remaining arguments (other than the
possible \fB\-timezone\fR, \fB\-locale\fR and \fB\-gmt\fR options)
are integers and keywords in alternation, where the keywords are chosen
from \fBseconds\fR, \fBminutes\fR, \fBhours\fR,
\fBdays\fR, \fBweekdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR.
\fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or
any unique prefix of such a word.
.PP
Addition of seconds, minutes and hours is fairly straightforward;
the given time increment (times sixty for minutes, or 3600 for hours)
is simply added to the \fItimeVal\fR given
to the \fBclock add\fR command. The result is interpreted as
a nominal number of seconds from the Epoch.
.PP
|
| ︙ | | |
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
-
+
-
|
.CE
.PP
Adding and subtracting days and weeks is accomplished by converting
the given time to a calendar day and time of day in the appropriate
time zone and locale. The requisite number of days (weeks are converted
to days by multiplying by seven) is added to the calendar day, and
the date and time are then converted back to a count of seconds from
the epoch time. The \fBweekdays\fR keyword is similar to \fBdays\fR,
the epoch time.
with the only difference that weekends - Saturdays and Sundays - are skipped.
.PP
Adding and subtracting a given number of days across the point that
the time changes at the start or end of summer time (Daylight Saving Time)
results in the \fIsame local time\fR on the day in question. For
instance, the following code sets the value of \fBx\fR to \fB05:00:00\fR.
.PP
.CS
|
| ︙ | | |
Changes to doc/close.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH close n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
close \- Close an open channel
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/concat.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH concat n 8.3 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
concat \- Join lists together
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/continue.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993-1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH continue n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
continue \- Skip to the next iteration of a loop
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/coroutine.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2009 Donal K. Fellows.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH coroutine n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
coroutine, yield, yieldto \- Create and produce values from coroutines
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/eof.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH eof n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
eof \- Check for end of file condition on channel
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/eval.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH eval n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
eval \- Evaluate a Tcl script
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/exit.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH exit n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
exit \- End the application
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/expr.n.
| ︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
|
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
+
+
-
+
-
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
+
+
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
+
+
+
-
+
+
-
+
+
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
+
+
+
-
+
+
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
+
+
+
+
-
-
+
+
+
-
-
-
+
+
+
-
+
-
-
-
-
+
+
+
+
+
-
+
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
-
-
-
+
+
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
|
.SH NAME
expr \- Evaluate an expression
.SH SYNOPSIS
\fBexpr \fIarg \fR?\fIarg arg ...\fR?
.BE
.SH DESCRIPTION
.PP
Concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates
that expression, returning its value.
The operators permitted in an expression include a subset of
Concatenates \fIarg\fRs (adding separator spaces between them),
evaluates the result as a Tcl expression, and returns the value.
The operators permitted in Tcl expressions include a subset of
the operators permitted in C expressions. For those operators
common to both Tcl and C, Tcl applies the same meaning and precedence
as the corresponding C operators.
The value of an expression is often a numeric result, either an integer or a
floating-point value, but may also be a non-numeric value.
Expressions almost always yield numeric results
(integer or floating-point values).
For example, the expression
.PP
.CS
\fBexpr\fR 8.2 + 6
.CE
.PP
evaluates to 14.2.
Expressions differ from C expressions in the way that
operands are specified. Expressions also support
non-numeric operands, string comparisons, and some
Tcl expressions differ from C expressions in the way that
operands are specified. Also, Tcl expressions support
non-numeric operands and string comparisons, as well as some
additional operators not found in C.
.PP
When an expression evaluates to an integer, the value is the decimal form of
the integer, and when an expression evaluates to a floating-point number, the
value is the form produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command.
.SS OPERANDS
.PP
An expression consists of a combination of operands, operators, parentheses and
commas, possibly with whitespace between any of these elements, which is
ignored.
An integer operand may be specified in decimal, binary
(the first two characters are \fB0b\fR), octal
(the first two characters are \fB0o\fR), or hexadecimal
(the first two characters are \fB0x\fR) form. For
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
interpreted as an octal integer even if the second character is not \fBo\fR.
A floating-point number may be specified in any of several
common decimal formats, and may use the decimal point \fB.\fR,
\fBe\fR or \fBE\fR for scientific notation, and
the sign characters \fB+\fR and \fB\-\fR. The
following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
The strings \fBInf\fR
and \fBNaN\fR, in any combination of case, are also recognized as floating point
values. An operand that doesn't have a numeric interpretation must be quoted
with either braces or with double quotes.
A Tcl expression consists of a combination of operands, operators,
parentheses and commas.
White space may be used between the operands and operators and
parentheses (or commas); it is ignored by the expression's instructions.
Where possible, operands are interpreted as integer values.
Integer values may be specified in decimal (the normal case), in binary
(if the first two characters of the operand are \fB0b\fR), in octal
(if the first two characters of the operand are \fB0o\fR), or in hexadecimal
(if the first two characters of the operand are \fB0x\fR). For
compatibility with older Tcl releases, an octal integer value is also
indicated simply when the first character of the operand is \fB0\fR,
whether or not the second character is also \fBo\fR.
If an operand does not have one of the integer formats given
above, then it is treated as a floating-point number if that is
possible. Floating-point numbers may be specified in any of several
common formats making use of the decimal digits, the decimal point \fB.\fR,
the characters \fBe\fR or \fBE\fR indicating scientific notation, and
the sign characters \fB+\fR or \fB\-\fR. For example, all of the
following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
Also recognized as floating point values are the strings \fBInf\fR
and \fBNaN\fR making use of any case for each character.
If no numeric interpretation is possible (note that all literal
operands that are not numeric or boolean must be quoted with either
braces or with double quotes), then an operand is left as a string
(and only a limited set of operators may be applied to it).
.PP
An operand may be specified in any of the following ways:
Operands may be specified in any of the following ways:
.IP [1]
As a numeric value, either integer or floating-point.
.IP [2]
As a boolean value, using any form understood by \fBstring is\fR
\fBboolean\fR.
.IP [3]
As a variable, using standard \fB$\fR notation.
The value of the variable is then the value of the operand.
As a Tcl variable, using standard \fB$\fR notation.
The variable's value will be used as the operand.
.IP [4]
As a string enclosed in double-quotes.
Backslash, variable, and command substitution are performed as described in
\fBTcl\fR.
The expression parser will perform backslash, variable, and
command substitutions on the information between the quotes,
and use the resulting value as the operand
.IP [5]
As a string enclosed in braces.
The characters between the open brace and matching close brace
The operand is treated as a braced value as described in \fBTcl\fR.
will be used as the operand without any substitutions.
.IP [6]
As a Tcl command enclosed in brackets.
Command substitution is performed as described in \fBTcl\fR.
The command will be executed and its result will be used as
the operand.
.IP [7]
As a mathematical function such as \fBsin($x)\fR, whose arguments have any of the above
forms for operands. See \fBMATH FUNCTIONS\fR below for
As a mathematical function whose arguments have any of the above
forms for operands, such as \fBsin($x)\fR. See \fBMATH FUNCTIONS\fR below for
a discussion of how mathematical functions are handled.
.PP
Because \fBexpr\fR parses and performs substitutions on values that have
already been parsed and substituted by \fBTcl\fR, it is usually best to enclose
expressions in braces to avoid the first round of substitutions by
Where the above substitutions occur (e.g. inside quoted strings), they
are performed by the expression's instructions.
However, the command parser may already have performed one round of
substitution before the expression processor was called.
As discussed below, it is usually best to enclose expressions
in braces to prevent the command parser from performing substitutions
\fBTcl\fR.
on the contents.
.PP
Below are some examples of simple expressions where the value of \fBa\fR is 3
and the value of \fBb\fR is 6. The command on the left side of each line
produces the value on the right side.
For some examples of simple expressions, suppose the variable
\fBa\fR has the value 3 and
the variable \fBb\fR has the value 6.
Then the command on the left side of each of the lines below
will produce the value on the right side of the line:
.PP
.CS
.ta 6c
\fBexpr\fR 3.1 + $a \fI6.1\fR
\fBexpr\fR 2 + "$a.$b" \fI5.6\fR
\fBexpr\fR 4*[llength "6 2"] \fI8\fR
\fBexpr\fR {{word one} < "word $a"} \fI0\fR
.CE
.SS OPERATORS
.PP
For operators having both a numeric mode and a string mode, the numeric mode is
chosen when all operands have a numeric interpretation. The integer
interpretation of an operand is preferred over the floating-point
interpretation. To ensure string operations on arbitrary values it is generally a
good idea to use \fBeq\fR, \fBne\fR, or the \fBstring\fR command instead of
more versatile operators such as \fB==\fR.
.PP
Unless otherwise specified, operators accept non-numeric operands. The value
of a boolean operation is 1 if true, 0 otherwise. See also \fBstring is\fR
\fBboolean\fR. The valid operators, most of which are also available as
commands in the \fBtcl::mathop\fR namespace (see \fBmathop\fR(n)), are listed
below, grouped in decreasing order of precedence:
The valid operators (most of which are also available as commands in
the \fBtcl::mathop\fR namespace; see the \fBmathop\fR(n) manual page
for details) are listed below, grouped in decreasing order of precedence:
.TP 20
\fB\-\0\0+\0\0~\0\0!\fR
.
Unary minus, unary plus, bit-wise NOT, logical NOT. These operators
may only be applied to numeric operands, and bit-wise NOT may only be
applied to integers.
Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operators
may be applied to string operands, and bit-wise NOT may be
applied only to integers.
.TP 20
\fB**\fR
.
Exponentiation. Valid for numeric operands.
Exponentiation. Valid for any numeric operands.
.TP 20
\fB*\0\0/\0\0%\fR
.
Multiply, divide, remainder. None of these operators may be
Multiply and divide, which are valid for numeric operands, and remainder, which
is valid for integers. The remainder, an absolute value smaller than the
absolute value of the divisor, has the same sign as the divisor.
applied to string operands, and remainder may be applied only
to integers.
The remainder will always have the same sign as the divisor and
an absolute value smaller than the absolute value of the divisor.
.RS
.PP
When applied to integers, division and remainder can be
considered to partition the number line into a sequence of
adjacent non-overlapping pieces, where each piece is the size of the divisor;
the quotient identifies which piece the dividend lies within, and the
remainder identifies where within that piece the dividend lies. A
When applied to integers, the division and remainder operators can be
considered to partition the number line into a sequence of equal-sized
adjacent non-overlapping pieces where each piece is the size of the divisor;
the division result identifies which piece the divisor lay within, and the
remainder result identifies where within that piece the divisor lay. A
consequence of this is that the result of
.QW "-57 \fB/\fR 10"
is always -6, and the result of
.QW "-57 \fB%\fR 10"
is always 3.
.RE
.TP 20
\fB+\0\0\-\fR
.
Add and subtract. Valid for numeric operands.
Add and subtract. Valid for any numeric operands.
.TP 20
\fB<<\0\0>>\fR
.
Left and right shift. Valid for integers.
Left and right shift. Valid for integer operands only.
A right shift always propagates the sign bit.
.TP 20
\fB<\0\0>\0\0<=\0\0>=\fR
.
Boolean less than, greater than, less than or equal, and greater than or equal.
Boolean less, greater, less than or equal, and greater than or equal.
Each operator produces 1 if the condition is true, 0 otherwise.
These operators may be applied to strings as well as numeric operands,
in which case string comparison is used.
.TP 20
\fB==\0\0!=\fR
.
Boolean equal and not equal.
Boolean equal and not equal. Each operator produces a zero/one result.
Valid for all operand types.
.TP 20
\fBeq\0\0ne\fR
.
Boolean string equal and string not equal.
Boolean string equal and string not equal. Each operator produces a
zero/one result. The operand types are interpreted only as strings.
.TP 20
\fBin\0\0ni\fR
.
List containment and negated list containment. The first argument is
interpreted as a string, the second as a list. \fBin\fR tests for membership
in the list, and \fBni\fR is the inverse.
List containment and negated list containment. Each operator produces
a zero/one result and treats its first argument as a string and its
second argument as a Tcl list. The \fBin\fR operator indicates
whether the first argument is a member of the second argument list;
the \fBni\fR operator inverts the sense of the result.
.TP 20
\fB&\fR
.
Bit-wise AND. Valid for integer operands.
Bit-wise AND. Valid for integer operands only.
.TP 20
\fB^\fR
.
Bit-wise exclusive OR. Valid for integer operands.
Bit-wise exclusive OR. Valid for integer operands only.
.TP 20
\fB|\fR
.
Bit-wise OR. Valid for integer operands.
Bit-wise OR. Valid for integer operands only.
.TP 20
\fB&&\fR
.
Logical AND. If both operands are true, the result is 1, or 0 otherwise.
Logical AND. Produces a 1 result if both operands are non-zero,
0 otherwise.
Valid for boolean and numeric (integers or floating-point) operands only.
.TP 20
\fB||\fR
.
Logical OR. If both operands are false, the result is 0, or 1 otherwise.
Logical OR. Produces a 0 result if both operands are zero, 1 otherwise.
Valid for boolean and numeric (integers or floating-point) operands only.
.TP 20
\fIx\fB?\fIy\fB:\fIz\fR
.
If-then-else, as in C. If \fIx\fR is false , the result is the value of
\fIy\fR. Otherwise the result is the value of \fIz\fR.
If-then-else, as in C. If \fIx\fR
evaluates to non-zero, then the result is the value of \fIy\fR.
Otherwise the result is the value of \fIz\fR.
The \fIx\fR operand must have a boolean or numeric value.
.PP
See the C manual for more details on the results
produced by each operator.
The exponentiation operator promotes types in the same way that the multiply
and divide operators do, and the result is is the same as the result of
\fBpow\fR.
Exponentiation groups right-to-left within a precedence level. Other binary
operators group left-to-right. For example, the value of
The exponentiation operator promotes types like the multiply and
divide operators, and produces a result that is the same as the output
of the \fBpow\fR function (after any type conversions.)
All of the binary operators but exponentiation group left-to-right
within the same precedence level; exponentiation groups right-to-left. For example, the command
.PP
.CS
\fBexpr\fR {4*2 < 7}
.CE
.PP
is 0, while the value of
returns 0, while
.PP
.CS
\fBexpr\fR {2**3**2}
.CE
.PP
is 512.
returns 512.
.PP
As in C, \fB&&\fR, \fB||\fR, and \fB?:\fR feature
The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have
.QW "lazy evaluation" ,
which means that operands are not evaluated if they are
not needed to determine the outcome. For example, in
just as in C, which means that operands are not evaluated if they are
not needed to determine the outcome. For example, in the command
.PP
.CS
\fBexpr\fR {$v ? [a] : [b]}
.CE
.PP
only one of \fB[a]\fR or \fB[b]\fR is evaluated,
depending on the value of \fB$v\fR. This is not true of the normal Tcl parser,
only one of
.QW \fB[a]\fR
or
.QW \fB[b]\fR
will actually be evaluated,
depending on the value of \fB$v\fR. Note, however, that this is
so it is normally recommended to enclose the arguments to \fBexpr\fR in braces.
Without braces, as in
\fBexpr\fR $v ? [a] : [b]
both \fB[a]\fR and \fB[b]\fR are evaluated before \fBexpr\fR is even called.
only true if the entire expression is enclosed in braces; otherwise
the Tcl parser will evaluate both
.QW \fB[a]\fR
and
.QW \fB[b]\fR
.PP
For more details on the results
before invoking the \fBexpr\fR command.
produced by each operator, see the documentation for C.
.SS "MATH FUNCTIONS"
.PP
When the expression parser encounters a mathematical function
A mathematical function such as \fBsin($x)\fR is replaced with a call to an ordinary
Tcl command in the \fBtcl::mathfunc\fR namespace. The evaluation
of an expression such as
such as \fBsin($x)\fR, it replaces it with a call to an ordinary
Tcl function in the \fBtcl::mathfunc\fR namespace. The processing
of an expression such as:
.PP
.CS
\fBexpr\fR {sin($x+$y)}
.CE
.PP
is the same in every way as the evaluation of
is the same in every way as the processing of:
.PP
.CS
\fBexpr\fR {[tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]]}
.CE
.PP
which in turn is the same as the evaluation of
which in turn is the same as the processing of:
.PP
.CS
tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]
.CE
.PP
\fBtcl::mathfunc::sin\fR is resolved as described in
\fBNAMESPACE RESOLUTION\fR in the \fBnamespace\fR(n) documentation. Given the
default value of \fBnamespace path\fR, \fB[namespace
current]::tcl::mathfunc::sin\fR or \fB::tcl::mathfunc::sin\fR are the typical
resolutions.
The executor will search for \fBtcl::mathfunc::sin\fR using the usual
rules for resolving functions in namespaces. Either
\fB::tcl::mathfunc::sin\fR or \fB[namespace
current]::tcl::mathfunc::sin\fR will satisfy the request, and others
may as well (depending on the current \fBnamespace path\fR setting).
.PP
As in C, a mathematical function may accept multiple arguments separated by commas. Thus,
Some mathematical functions have several arguments, separated by commas like in C. Thus:
.PP
.CS
\fBexpr\fR {hypot($x,$y)}
.CE
.PP
becomes
ends up as
.PP
.CS
tcl::mathfunc::hypot $x $y
.CE
.PP
See the \fBmathfunc\fR(n) documentation for the math functions that are
See the \fBmathfunc\fR(n) manual page for the math functions that are
available by default.
.SS "TYPES, OVERFLOW, AND PRECISION"
.PP
When needed to guarantee exact performance, internal computations involving
integers use the LibTomMath multiple precision integer library. In Tcl releases
prior to 8.5, integer calculations were performed using one of the C types
All internal computations involving integers are done calling on the
LibTomMath multiple precision integer library as required so that all
integer calculations are performed exactly. Note that in Tcl releases
prior to 8.5, integer calculations were performed with one of the C types
\fIlong int\fR or \fITcl_WideInt\fR, causing implicit range truncation
in those calculations where values overflowed the range of those types.
Any code that relied on these implicit truncations should instead call
\fBint()\fR or \fBwide()\fR, which do truncate.
Any code that relied on these implicit truncations will need to explicitly
add \fBint()\fR or \fBwide()\fR function calls to expressions at the points
where such truncation is required to take place.
.PP
Internal floating-point computations are
performed using the \fIdouble\fR C type.
When converting a string to floating-point value, exponent overflow is
All internal computations involving floating-point are
done with the C type \fIdouble\fR.
When converting a string to floating-point, exponent overflow is
detected and results in the \fIdouble\fR value of \fBInf\fR or
\fB\-Inf\fR as appropriate. Floating-point overflow and underflow
are detected to the degree supported by the hardware, which is generally
fairly reliable.
pretty reliable.
.PP
Conversion among internal representations for integer, floating-point, and
string operands is done automatically as needed. For arithmetic computations,
integers are used until some floating-point number is introduced, after which
floating-point values are used. For example,
Conversion among internal representations for integer, floating-point,
and string operands is done automatically as needed.
For arithmetic computations, integers are used until some
floating-point number is introduced, after which floating-point is used.
For example,
.PP
.CS
\fBexpr\fR {5 / 4}
.CE
.PP
returns 1, while
.PP
.CS
\fBexpr\fR {5 / 4.0}
\fBexpr\fR {5 / ( [string length "abcd"] + 0.0 )}
.CE
.PP
both return 1.25.
A floating-point result can be distinguished from an integer result by the
Floating-point values are always returned with a
presence of either
.QW \fB.\fR
or
or an
.QW \fBe\fR
.PP
. For example,
so that they will not look like integer values. For example,
.PP
.CS
\fBexpr\fR {20.0/5.0}
.CE
.PP
returns \fB4.0\fR, not \fB4\fR.
.SS "STRING OPERATIONS"
.PP
String values may be used as operands of the comparison operators,
although the expression evaluator tries to do comparisons as integer
or floating-point when it can,
i.e., when all arguments to the operator allow numeric interpretations,
except in the case of the \fBeq\fR and \fBne\fR operators.
If one of the operands of a comparison is a string and the other
has a numeric value, a canonical string representation of the numeric
operand value is generated to compare with the string operand.
Canonical string representation for integer values is a decimal string
format. Canonical string representation for floating-point values
is that produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command. For example, the commands
.PP
.CS
\fBexpr\fR {"0x03" > "2"}
\fBexpr\fR {"0y" > "0x12"}
.CE
.PP
both return 1. The first comparison is done using integer
comparison, and the second is done using string comparison.
Because of Tcl's tendency to treat values as numbers whenever
possible, it is not generally a good idea to use operators like \fB==\fR
when you really want string comparison and the values of the
operands could be arbitrary; it is better in these cases to use
the \fBeq\fR or \fBne\fR operators, or the \fBstring\fR command instead.
.SH "PERFORMANCE CONSIDERATIONS"
.PP
Where an expression contains syntax that Tcl would otherwise perform
Enclose expressions in braces for the best speed and the smallest
substitutions on, enclosing an expression in braces or otherwise quoting it
so that it's a static value allows the Tcl compiler to generate bytecode for
the expression, resulting in better speed and smaller storage requirements.
This also avoids issues that can arise if Tcl is allowed to perform
storage requirements.
This allows the Tcl bytecode compiler to generate the best code.
substitution on the value before \fBexpr\fR is called.
.PP
In the following example, the value of the expression is 11 because the Tcl parser first
substitutes \fB$b\fR and \fBexpr\fR then substitutes \fB$a\fR. Enclosing the
As mentioned above, expressions are substituted twice:
once by the Tcl parser and once by the \fBexpr\fR command.
expression in braces would result in a syntax error.
For example, the commands
.PP
.CS
set a 3
set b {$a + 2}
\fBexpr\fR $b*4
.CE
.PP
When an expression is generated at runtime, like the one above is, the bytcode
compiler must ensure that new code is generated each time the expression
return 11, not a multiple of 4.
This is because the Tcl parser will first substitute \fB$a + 2\fR for
the variable \fBb\fR,
is evaluated. This is the most costly kind of expression from a performance
perspective. In such cases, consider directly using the commands described in
the \fBmathfunc\fR(n) or \fBmathop\fR(n) documentation instead of \fBexpr\fR.
Most expressions are not formed at runtime, but are literal strings or contain
substitutions that don't introduce other substitutions. To allow the bytecode
compiler to work with an expression as a string literal at compilation time,
ensure that it contains no substitutions or that it is enclosed in braces or
otherwise quoted to prevent Tcl from performing substitutions, allowing
\fBexpr\fR to perform them instead.
then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR.
.PP
Most expressions do not require a second round of substitutions.
Either they are enclosed in braces or, if not,
their variable and command substitutions yield numbers or strings
that do not themselves require substitutions.
However, because a few unbraced expressions
need two rounds of substitutions,
the bytecode compiler must emit
additional instructions to handle this situation.
The most expensive code is required for
unbraced expressions that contain command substitutions.
These expressions must be implemented by generating new code
each time the expression is executed.
When the expression is unbraced to allow the substitution of a function or
operator, consider using the commands documented in the \fBmathfunc\fR(n) or
\fBmathop\fR(n) manual pages directly instead.
.SH EXAMPLES
.PP
A numeric comparison whose result is 1:
.CS
\fBexpr\fR {"0x03" > "2"}
.CE
.PP
A string comparison whose result is 1:
.CS
\fBexpr\fR {"0y" > "0x12"}
.CE
.PP
Define a procedure that computes an
.QW interesting
mathematical function:
.PP
.CS
proc tcl::mathfunc::calc {x y} {
|
| ︙ | | |
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
|
-
-
+
+
|
Print a message describing the relationship of two string values to
each other:
.PP
.CS
puts "a and b are [\fBexpr\fR {$a eq $b ? {equal} : {different}}]"
.CE
.PP
Set a variable indicating whether an environment variable is defined and has
value of true:
Set a variable to whether an environment variable is both defined at
all and also set to a true boolean value:
.PP
.CS
set isTrue [\fBexpr\fR {
[info exists ::env(SOME_ENV_VAR)] &&
[string is true -strict $::env(SOME_ENV_VAR)]
}]
.CE
|
| ︙ | | |
Changes to doc/fblocked.n.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
'\"
'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH fblocked n 7.5 Tcl "Tcl Built-In Commands"
.BS
|
| ︙ | | |
Changes to doc/file.n.
| ︙ | | |
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
-
+
|
returns
.QW \fB/\0\0foo\0\0./~bar\0\0baz\fR
to ensure that later commands
that use the third component do not attempt to perform tilde
substitution.
.RE
.TP
\fBfile stat \fIname varName\fR
\fBfile stat \fIname varName\fR
.
Invokes the \fBstat\fR kernel call on \fIname\fR, and uses the variable
given by \fIvarName\fR to hold information returned from the kernel call.
\fIVarName\fR is treated as an array variable, and the following elements
of that variable are set: \fBatime\fR, \fBctime\fR, \fBdev\fR, \fBgid\fR,
\fBino\fR, \fBmode\fR, \fBmtime\fR, \fBnlink\fR, \fBsize\fR, \fBtype\fR,
\fBuid\fR. Each element except \fBtype\fR is a decimal string with the
|
| ︙ | | |
Changes to doc/flush.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH flush n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
flush \- Flush buffered output for a channel
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/foreach.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH foreach n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
foreach \- Iterate over all elements in one or more lists
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/gets.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH gets n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
gets \- Read a line from a channel
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/history.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH history n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
history \- Manipulate the history list
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/if.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH if n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
if \- Execute scripts conditionally
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/incr.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH incr n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
incr \- Increment the value of a variable
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/info.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\" Copyright (c) 1993-1997 Bell Labs Innovations for Lucent Technologies
'\" Copyright (c) 1998-2000 Ajuba Solutions
'\" Copyright (c) 2007-2012 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH info n 8.4 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
info \- Return information about the state of the Tcl interpreter
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/interp.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
+
|
'\"
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2004 Donal K. Fellows
'\" Copyright (c) 2006-2008 Joe Mistachkin.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH interp n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
interp \- Create and manipulate Tcl interpreters
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/join.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH join n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
join \- Create a string by joining together list elements
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/lappend.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lappend n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lappend \- Append list elements onto a variable
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/lassign.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer & Mark Diekhans
'\" Copyright (c) 2004 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lassign n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lassign \- Assign list elements to variables
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/list.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH list n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
list \- Create a list
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/load.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH load n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
load \- Load machine code and initialize new commands
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/lrepeat.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2003 by Simon Geard. All rights reserved.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lrepeat n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lrepeat \- Build a list by repeating elements
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/lreverse.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2006 by Donal K. Fellows. All rights reserved.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH lreverse n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lreverse \- Reverse the order of a list
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/lsort.n.
| ︙ | | |
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
-
+
+
|
\fB\-dictionary\fR
.
Use dictionary-style comparison. This is the same as \fB\-ascii\fR
except (a) case is ignored except as a tie-breaker and (b) if two
strings contain embedded numbers, the numbers compare as integers,
not characters. For example, in \fB\-dictionary\fR mode, \fBbigBoy\fR
sorts between \fBbigbang\fR and \fBbigboy\fR, and \fBx10y\fR
sorts between \fBx9y\fR and \fBx11y\fR.
sorts between \fBx9y\fR and \fBx11y\fR. Overrides the \fB\-nocase\fR
option.
.TP
\fB\-integer\fR
.
Convert list elements to integers and use integer comparison.
.TP
\fB\-real\fR
.
|
| ︙ | | |
Changes to doc/namespace.n.
| ︙ | | |
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
-
+
|
\fBnamespace upvar\fR returns an empty string.
.TP
\fBnamespace unknown\fR ?\fIscript\fR?
.
Sets or returns the unknown command handler for the current namespace.
The handler is invoked when a command called from within the namespace
cannot be found in the current namespace, the namespace's path nor in
the global namespace.
the global namespace.
The \fIscript\fR argument, if given, should be a well
formed list representing a command name and optional arguments. When
the handler is invoked, the full invocation line will be appended to the
script and the result evaluated in the context of the namespace. The
default handler for all namespaces is \fB::unknown\fR. If no argument
is given, it returns the handler for the current namespace.
.TP
|
| ︙ | | |
Changes to doc/next.n.
| ︙ | | |
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
-
+
|
.PP
.CS
per-object method, args = 1 2 3
before chaining from subclass, args = x 1 2 3 y
in the superclass, args = a x 1 2 3 y b
in the superclass, args = pureSynthesis
after chaining from subclass
before chaining from subclass, args =
before chaining from subclass, args =
in the superclass, args = a b
in the superclass, args = pureSynthesis
after chaining from subclass
.CE
.PP
This example demonstrates how to build a simple cache class that applies
memoization to all the method calls of the objects it is mixed into, and shows
|
| ︙ | | |
Changes to doc/package.n.
| ︙ | | |
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
|
-
-
+
+
|
.QW latest .
.PP
When passed any other value as an argument, raise an invalid argument
error.
.PP
When an interpreter is created, its initial selection mode value is set to
.QW stable
unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR is set
(to any value) or the Tcl package itself is unstable. Otherwise
unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR
is set. If that environment variable is defined (with any value) then
the initial (and permanent) selection mode value is set to
.QW latest .
.RE
.SH "VERSION NUMBERS"
.PP
Version numbers consist of one or more decimal numbers separated
by dots, such as 2 or 1.162 or 3.1.13.1.
|
| ︙ | | |
Changes to doc/packagens.n.
1
2
3
4
5
6
7
8
9
10
11
|
1
2
3
4
5
6
7
8
9
10
11
|
-
+
|
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH pkg::create n 8.3 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
pkg::create \- Construct an appropriate 'package ifneeded' command for a given package specification
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/pid.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH pid n 7.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
pid \- Retrieve process identifiers
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/platform.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2006 ActiveState Software Inc
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "platform" n 1.0.4 platform "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
platform \- System identification support code and utilities
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/platform_shell.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2006-2008 ActiveState Software Inc
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "platform::shell" n 1.1.4 platform::shell "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
platform::shell \- System identification support code and utilities
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/prefix.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2008 Peter Spjuth <pspjuth@users.sourceforge.net>
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH prefix n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tcl::prefix \- facilities for prefix matching
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/puts.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH puts n 7.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
puts \- Write to a channel
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/pwd.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH pwd n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
pwd \- Return the absolute path of the current working directory
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/refchan.n.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
'\"
'\"
'\" Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH refchan n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
|
| ︙ | | |
Changes to doc/registry.n.
| ︙ | | |
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
-
+
|
.
The registry value contains arbitrary binary data with no defined
type. The data is represented exactly in Tcl, including any embedded
nulls.
.TP
\fBsz\fR
.
The registry value contains a null-terminated string. The data is
The registry value contains a null-terminated string. The data is
represented in Tcl as a string.
.TP
\fBexpand_sz\fR
.
The registry value contains a null-terminated string that contains
unexpanded references to environment variables in the normal Windows
style (for example,
|
| ︙ | | |
Changes to doc/rename.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH rename n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
rename \- Rename or delete a command
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/seek.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH seek n 8.1 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
seek \- Change the access position for an open channel
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/source.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2000 Scriptics Corporation.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH source n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
source \- Evaluate a file or resource as a Tcl script
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/split.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH split n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
split \- Split a string into a proper Tcl list
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/switch.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH switch n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
switch \- Evaluate one of several scripts, depending on a given value
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/tailcall.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH tailcall n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tailcall \- Replace the current procedure with another command
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/tclsh.1.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH tclsh 1 "" Tcl "Tcl Applications"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tclsh \- Simple shell containing Tcl interpreter
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/tell.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
-
+
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH tell n 8.1 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tell \- Return current access position for an open channel
.SH SYNOPSIS
\fBtell \fIchannelId\fR
.BE
.SH DESCRIPTION
.PP
Returns an integer giving the current access position in
Returns an integer string giving the current access position in
\fIchannelId\fR. This value returned is a byte offset that can be passed to
\fBseek\fR in order to set the channel to a particular position. Note
that this value is in terms of bytes, not characters like \fBread\fR.
The value returned is -1 for channels that do not support
seeking.
.PP
\fIChannelId\fR must be an identifier for an open channel such as a
|
| ︙ | | |
Changes to doc/throw.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2008 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH throw n 8.6 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
throw \- Generate a machine-readable error
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/time.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH time n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
time \- Time the execution of a script
.SH SYNOPSIS
|
| ︙ | | |
Changes to doc/tm.n.
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
'\"
'\" Copyright (c) 2004-2010 Andreas Kupries <andreas_kupries@users.sourceforge.net>
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH tm n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tm \- Facilities for locating and loading of Tcl Modules
.SH SYNOPSIS
|
| ︙ | | |
Changes to generic/regc_lex.c.
| ︙ | | |
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
-
+
|
if (!(v->cflags®_ADVF)) {
RETV(PLAIN, c);
}
NOTE(REG_UNONPOSIX);
if (ATEOS()) {
FAILW(REG_EESCAPE);
}
(void)lexescape(v);
(DISCARD)lexescape(v);
switch (v->nexttype) { /* not all escapes okay here */
case PLAIN:
return 1;
break;
case CCLASS:
switch (v->nextvalue) {
case 'd':
|
| ︙ | | |
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
-
+
|
if (!(v->cflags®_ADVF)) {/* only AREs have non-trivial escapes */
if (iscalnum(*v->now)) {
NOTE(REG_UBSALNUM);
NOTE(REG_UUNSPEC);
}
RETV(PLAIN, *v->now++);
}
(void)lexescape(v);
(DISCARD)lexescape(v);
if (ISERR()) {
FAILW(REG_EESCAPE);
}
if (v->nexttype == CCLASS) {/* fudge at lexical level */
switch (v->nextvalue) {
case 'd': lexnest(v, backd, ENDOF(backd)); break;
case 'D': lexnest(v, backD, ENDOF(backD)); break;
|
| ︙ | | |
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
|
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
|
-
+
|
NOTE(REG_UNONPOSIX);
}
}
/*
- newline - return the chr for a newline
* This helps confine use of CHR to this source file.
^ static chr newline(void);
^ static chr newline(NOPARMS);
*/
static chr
newline(void)
{
return CHR('\n');
}
|
| ︙ | | |
Changes to generic/regc_locale.c.
| ︙ | | |
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
|
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
|
-
+
|
^ static int cmp(const chr *, const chr *, size_t);
*/
static int /* 0 for equal, nonzero for unequal */
cmp(
const chr *x, const chr *y, /* strings to compare */
size_t len) /* exact length of comparison */
{
return memcmp((void*)(x), (void*)(y), len*sizeof(chr));
return memcmp(VS(x), VS(y), len*sizeof(chr));
}
/*
- casecmp - case-independent chr-substring compare
* REG_ICASE backrefs need this. It should preferably be efficient.
* Note that it does not need to report anything except equal/unequal.
* Note also that the length is exact, and the comparison should not
|
| ︙ | | |
Changes to generic/regc_nfa.c.
| ︙ | | |
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
|
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
|
-
+
|
assert(oldState->nins == 0);
assert(oldState->ins == NULL);
}
/*
- copyins - copy in arcs of a state to another state
^ static void copyins(struct nfa *, struct state *, struct state *, int);
^ static VOID copyins(struct nfa *, struct state *, struct state *, int);
*/
static void
copyins(
struct nfa *nfa,
struct state *oldState,
struct state *newState)
{
|
| ︙ | | |
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
|
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
|
-
+
|
assert(oldState->nouts == 0);
assert(oldState->outs == NULL);
}
/*
- copyouts - copy out arcs of a state to another state
^ static void copyouts(struct nfa *, struct state *, struct state *, int);
^ static VOID copyouts(struct nfa *, struct state *, struct state *, int);
*/
static void
copyouts(
struct nfa *nfa,
struct state *oldState,
struct state *newState)
{
|
| ︙ | | |
Changes to generic/regcomp.c.
| ︙ | | |
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
-
+
|
static void lexnest(struct vars *, const chr *, const chr *);
static void lexword(struct vars *);
static int next(struct vars *);
static int lexescape(struct vars *);
static int lexdigits(struct vars *, int, int, int);
static int brenext(struct vars *, pchr);
static void skip(struct vars *);
static chr newline(void);
static chr newline(NOPARMS);
static chr chrnamed(struct vars *, const chr *, const chr *, pchr);
/* === regc_color.c === */
static void initcm(struct vars *, struct colormap *);
static void freecm(struct colormap *);
static void cmtreefree(struct colormap *, union tree *, int);
static color setcolor(struct colormap *, pchr, pcolor);
static color maxcolor(struct colormap *);
|
| ︙ | | |
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
-
+
-
+
|
v->lacons = NULL;
v->nlacons = 0;
v->spaceused = 0;
re->re_magic = REMAGIC;
re->re_info = 0; /* bits get set during parse */
re->re_csize = sizeof(chr);
re->re_guts = NULL;
re->re_fns = (void*)(&functions);
re->re_fns = VS(&functions);
/*
* More complex setup, malloced things.
*/
re->re_guts = (void*)(MALLOC(sizeof(struct guts)));
re->re_guts = VS(MALLOC(sizeof(struct guts)));
if (re->re_guts == NULL) {
return freev(v, REG_ESPACE);
}
g = (struct guts *) re->re_guts;
g->tree = NULL;
initcm(v, &g->cmap);
v->cm = &g->cmap;
|
| ︙ | | |
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
-
+
|
fprintf(debug, "\n\n\n========= SEARCH ==========\n");
}
/*
* Can sacrifice main NFA now, so use it as work area.
*/
(void) optimize(v->nfa, debug);
(DISCARD) optimize(v->nfa, debug);
CNOERR();
makesearch(v, v->nfa);
CNOERR();
compact(v->nfa, &g->search);
CNOERR();
/*
|
| ︙ | | |
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
|
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
|
-
+
-
+
|
struct vars *v,
struct subre *t,
FILE *f) /* for debug output */
{
assert(t != NULL && t->begin != NULL);
if (t->left != NULL) {
(void) nfatree(v, t->left, f);
(DISCARD) nfatree(v, t->left, f);
}
if (t->right != NULL) {
(void) nfatree(v, t->right, f);
(DISCARD) nfatree(v, t->right, f);
}
return nfanode(v, t, f);
}
/*
- nfanode - do one NFA for nfatree
|
| ︙ | | |
Changes to generic/regcustom.h.
| ︙ | | |
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
+
-
-
-
+
+
+
|
#include "regex.h"
/*
* Overrides for regguts.h definitions, if any.
*/
#define FUNCPTR(name, args) (*name)args
#define MALLOC(n) (void*)(attemptckalloc(n))
#define FREE(p) ckfree((void*)(p))
#define REALLOC(p,n) (void*)(attemptckrealloc((void*)(p),n))
#define MALLOC(n) VS(attemptckalloc(n))
#define FREE(p) ckfree(VS(p))
#define REALLOC(p,n) VS(attemptckrealloc(VS(p),n))
/*
* Do not insert extras between the "begin" and "end" lines - this chunk is
* automatically extracted to be fitted into regex.h.
*/
/* --- begin --- */
|
| ︙ | | |
Changes to generic/regexec.c.
| ︙ | | |
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
-
+
|
};
struct sset { /* state set */
unsigned *states; /* pointer to bitvector */
unsigned hash; /* hash of bitvector */
#define HASH(bv, nw) (((nw) == 1) ? *(bv) : hash(bv, nw))
#define HIT(h,bv,ss,nw) ((ss)->hash == (h) && ((nw) == 1 || \
memcmp((void*)(bv), (void*)((ss)->states), (nw)*sizeof(unsigned)) == 0))
memcmp(VS(bv), VS((ss)->states), (nw)*sizeof(unsigned)) == 0))
int flags;
#define STARTER 01 /* the initial state set */
#define POSTSTATE 02 /* includes the goal state */
#define LOCKED 04 /* locked in cache */
#define NOPROGRESS 010 /* zero-progress state set */
struct arcp ins; /* chain of inarcs pointing here */
chr *lastseen; /* last entered on arrival here */
|
| ︙ | | |
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
|
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
|
-
+
|
/*
* Copy (portion of) match vector over if necessary.
*/
if (st == REG_OKAY && v->pmatch != pmatch && nmatch > 0) {
zapallsubs(pmatch, nmatch);
n = (nmatch < v->nmatch) ? nmatch : v->nmatch;
memcpy((void*)(pmatch), (void*)(v->pmatch), n*sizeof(regmatch_t));
memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t));
}
/*
* Clean up.
*/
if (v->pmatch != pmatch && v->pmatch != mat) {
|
| ︙ | | |
Changes to generic/regguts.h.
| ︙ | | |
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
|
#ifndef REG_DEBUG
#ifndef NDEBUG
#define NDEBUG /* no assertions */
#endif
#endif /* !REG_DEBUG */
#include <assert.h>
#endif
/* voids */
#ifndef VOID
#define VOID void /* for function return values */
#endif
#ifndef DISCARD
#define DISCARD void /* for throwing values away */
#endif
#ifndef PVOID
#define PVOID void * /* generic pointer */
#endif
#ifndef VS
#define VS(x) ((void*)(x)) /* cast something to generic ptr */
#endif
#ifndef NOPARMS
#define NOPARMS void /* for empty parm lists */
#endif
/* function-pointer declarator */
#ifndef FUNCPTR
#if __STDC__ >= 1
#define FUNCPTR(name, args) (*name)args
#else
#define FUNCPTR(name, args) (*name)()
#endif
#endif
/* memory allocation */
#ifndef MALLOC
#define MALLOC(n) malloc(n)
#endif
#ifndef REALLOC
#define REALLOC(p, n) realloc(p, n)
#define REALLOC(p, n) realloc(VS(p), n)
#endif
#ifndef FREE
#define FREE(p) free(p)
#define FREE(p) free(VS(p))
#endif
/* want size of a char in bits, and max value in bounded quantifiers */
#ifndef _POSIX2_RE_DUP_MAX
#define _POSIX2_RE_DUP_MAX 255 /* normally from <limits.h> */
#endif
|
| ︙ | | |
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
|
-
+
-
+
|
/*
* table of function pointers for generic manipulation functions. A regex_t's
* re_fns points to one of these.
*/
struct fns {
void (*free) (regex_t *);
void FUNCPTR(free, (regex_t *));
};
/*
* the insides of a regex_t, hidden behind a void *
*/
struct guts {
int magic;
#define GUTSMAGIC 0xfed9
int cflags; /* copy of compile flags */
long info; /* copy of re_info */
size_t nsub; /* copy of re_nsub */
struct subre *tree;
struct cnfa search; /* for fast preliminary search */
int ntree; /* number of subre's, plus one */
struct colormap cmap;
int (*compare) (const chr *, const chr *, size_t);
int FUNCPTR(compare, (const chr *, const chr *, size_t));
struct subre *lacons; /* lookahead-constraint vector */
int nlacons; /* size of lacons */
};
/*
* Magic for allocating a variable workspace. This default version is
* stack-hungry.
|
| ︙ | | |
Changes to generic/tcl.h.
| ︙ | | |
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
+
+
-
-
-
-
+
+
+
-
-
+
+
|
#define TCL_FINAL_RELEASE 2
/*
* When version numbers change here, must also go into the following files and
* update the version numbers:
*
* library/init.tcl (1 LOC patch)
* unix/configure.ac (2 LOC Major, 2 LOC minor, 1 LOC patch)
* win/configure.ac (as above)
* unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
* win/configure.in (as above)
* win/tcl.m4 (not patchlevel)
* win/makefile.bc (not patchlevel) 2 LOC
* README (sections 0 and 2, with and without separator)
* macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC
* macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC
* macosx/Tcl.xcode/project.pbxproj (not patchlevel) 2 LOC
* macosx/Tcl.xcode/default.pbxuser (not patchlevel) 1 LOC
* macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC
* win/README (not patchlevel) (sections 0 and 2)
* unix/tcl.spec (1 LOC patch)
* tools/tcl.hpj.in (not patchlevel, for windows installer)
*/
#define TCL_MAJOR_VERSION 8
#define TCL_MINOR_VERSION 7
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
#define TCL_RELEASE_SERIAL 0
#define TCL_MINOR_VERSION 6
#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
#define TCL_RELEASE_SERIAL 6
#define TCL_VERSION "8.7"
#define TCL_PATCH_LEVEL "8.7a0"
#define TCL_VERSION "8.6"
#define TCL_PATCH_LEVEL "8.6.6"
/*
*----------------------------------------------------------------------------
* The following definitions set up the proper options for Windows compilers.
* We use this method because there is no autoconf equivalent.
*/
|
| ︙ | | |
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
-
-
-
|
# define TCL_VARARGS(type, name) (type name, ...)
# define TCL_VARARGS_DEF(type, name) (type name, ...)
# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
#endif
#if defined(__GNUC__) && (__GNUC__ > 2)
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
# define TCL_NORETURN __attribute__ ((noreturn))
# define TCL_NOINLINE __attribute__ ((noinline))
# if defined(BUILD_tcl) || defined(BUILD_tk)
# define TCL_NORETURN1 __attribute__ ((noreturn))
# else
# define TCL_NORETURN1 /* nothing */
# endif
#else
# define TCL_FORMAT_PRINTF(a,b)
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
# define TCL_NORETURN _declspec(noreturn)
# define TCL_NOINLINE __declspec(noinline)
# else
# define TCL_NORETURN /* nothing */
# define TCL_NOINLINE /* nothing */
# endif
# define TCL_NORETURN1 /* nothing */
#endif
/*
* Allow a part of Tcl's API to be explicitly marked as deprecated.
*
|
| ︙ | | |
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
-
-
+
+
|
/*
* Define Tcl_WideInt to be a type that is (at least) 64-bits wide, and define
* Tcl_WideUInt to be the unsigned variant of that type (assuming that where
* we have one, we can have the other.)
*
* Also defines the following macros:
* TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a real
* 64-bit system.)
* TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on a
* LP64 system such as modern Solaris or Linux ... not including Win64)
* Tcl_WideAsLong - forgetful converter from wideInt to long.
* Tcl_LongAsWide - sign-extending converter from long to wideInt.
* Tcl_WideAsDouble - converter from wideInt to double.
* Tcl_DoubleAsWide - converter from double to wideInt.
*
* The following invariant should hold for any long value 'longVal':
* longVal == Tcl_WideAsLong(Tcl_LongAsWide(longVal))
|
| ︙ | | |
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
|
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
|
-
-
+
+
-
+
-
+
-
-
+
|
const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
* corresponds to the type of the object's
* internal rep. NULL indicates the object has
* no internal rep (has no type). */
union { /* The internal representation: */
long longValue; /* - an long integer value. */
double doubleValue; /* - a double-precision floating value. */
void *otherValuePtr; /* - another, type-specific value, not used
* internally any more. */
void *otherValuePtr; /* - another, type-specific value,
not used internally any more. */
Tcl_WideInt wideValue; /* - a long long value. */
struct { /* - internal rep as two pointers.
* Many uses in Tcl, including a bignum's
* the main use of which is a bignum's
* tightly packed fields, where the alloc,
* used and signum flags are packed into
* ptr2 with everything else hung off
* ptr2 with everything else hung off ptr1. */
* ptr1. */
void *ptr1;
void *ptr2;
} twoPtrValue;
struct { /* - internal rep as a pointer and a long,
* not used internally any more. */
not used internally any more. */
void *ptr;
unsigned long value;
} ptrAndLongRep;
} internalRep;
} Tcl_Obj;
/*
|
| ︙ | | |
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
|
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
|
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#define TCL_LINK_READ_ONLY 0x80
/*
*----------------------------------------------------------------------------
* Forward declarations of Tcl_HashTable and related types.
*/
#ifndef TCL_HASH_TYPE
# define TCL_HASH_TYPE unsigned
#endif
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
typedef struct Tcl_HashTable Tcl_HashTable;
typedef struct Tcl_HashEntry Tcl_HashEntry;
typedef TCL_HASH_TYPE (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
typedef unsigned (Tcl_HashKeyProc) (Tcl_HashTable *tablePtr, void *keyPtr);
typedef int (Tcl_CompareHashKeysProc) (void *keyPtr, Tcl_HashEntry *hPtr);
typedef Tcl_HashEntry * (Tcl_AllocHashEntryProc) (Tcl_HashTable *tablePtr,
void *keyPtr);
typedef void (Tcl_FreeHashEntryProc) (Tcl_HashEntry *hPtr);
/*
* This flag controls whether the hash table stores the hash of a key, or
* recalculates it. There should be no reason for turning this flag off as it
* is completely binary and source compatible unless you directly access the
* bucketPtr member of the Tcl_HashTableEntry structure. This member has been
* removed and the space used to store the hash value.
*/
#ifndef TCL_HASH_KEY_STORE_HASH
# define TCL_HASH_KEY_STORE_HASH 1
#endif
/*
* Structure definition for an entry in a hash table. No-one outside Tcl
* should access any of these fields directly; use the macros defined below.
*/
struct Tcl_HashEntry {
Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
* or NULL for end of chain. */
Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
#if TCL_HASH_KEY_STORE_HASH
void *hash; /* Hash value, stored as pointer to ensure
* that the offsets of the fields in this
* structure are not changed. */
#else
Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to first
* entry in this entry's chain: used for
* deleting the entry. */
#endif
ClientData clientData; /* Application stores something here with
* Tcl_SetHashValue. */
union { /* Key has one of these forms: */
char *oneWordValue; /* One-word value for key. */
Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
int words[1]; /* Multiple integer words for key. The actual
* size will be as large as necessary for this
|
| ︙ | | |
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
|
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
|
+
+
+
-
+
+
+
+
+
-
+
-
-
-
-
-
-
+
-
+
+
+
+
|
typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
int result);
/*
*----------------------------------------------------------------------------
* The following constant is used to test for older versions of Tcl in the
* stubs tables.
*
* Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different
* value since the stubs tables don't match.
*/
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
/*
* The following function is required to be defined in all stubs aware
* extensions. The function is actually implemented in the stub library, not
* the main Tcl library, although there is a trivial implementation in the
* main library in case an extension is statically linked into an application.
*/
const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
int exact, int magic);
int exact);
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
const char *version, int epoch, int revision);
/*
* When not using stubs, make it a macro.
*/
#ifdef USE_TCL_STUBS
#ifndef USE_TCL_STUBS
#define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
TCL_STUB_MAGIC)
#else
#define Tcl_InitStubs(interp, version, exact) \
Tcl_PkgInitStubsCheck(interp, version, \
Tcl_PkgInitStubsCheck(interp, version, exact)
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16))
#endif
/*
* TODO - tommath stubs export goes here!
*/
/*
* Public functions that are not accessible via the stubs table.
* Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
*/
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
|
| ︙ | | |
Changes to generic/tclAlloc.c.
| ︙ | | |
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
-
+
|
/*
* We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait
* until Tcl uses config.h properly.
*/
#if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__BORLANDC__)
typedef size_t caddr_t;
typedef unsigned long caddr_t;
#endif
/*
* The overhead on a block is at least 8 bytes. When free, this space contains
* a pointer to the next free block, and the bottom two bits must be zero.
* When in use, the first byte is set to MAGIC, and the second byte is the
* size index. The remaining bytes are for alignment. If range checking is
|
| ︙ | | |
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
-
+
|
struct {
unsigned char magic0; /* magic number */
unsigned char index; /* bucket # */
unsigned char unused; /* unused */
unsigned char magic1; /* other magic number */
#ifndef NDEBUG
unsigned short rmagic; /* range magic number */
size_t size; /* actual block size */
unsigned long size; /* actual block size */
unsigned short unused2; /* padding to 8-byte align */
#endif
} ovu;
#define overMagic0 ovu.magic0
#define overMagic1 ovu.magic1
#define bucketIndex ovu.index
#define rangeCheckMagic ovu.rmagic
|
| ︙ | | |
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
-
+
-
+
|
#ifdef MSTATS
/*
* numMallocs[i] is the difference between the number of mallocs and frees for
* a given block size.
*/
static size_t numMallocs[NBUCKETS+1];
static unsigned int numMallocs[NBUCKETS+1];
#endif
#if !defined(NDEBUG)
#define ASSERT(p) if (!(p)) Tcl_Panic(# p)
#define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p)
#else
#define ASSERT(p)
#define RANGE_ASSERT(p)
#endif
/*
* Prototypes for functions used only in this file.
*/
static void MoreCore(size_t bucket);
static void MoreCore(int bucket);
/*
*-------------------------------------------------------------------------
*
* TclInitAlloc --
*
* Initialize the memory system.
|
| ︙ | | |
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
-
+
|
*/
char *
TclpAlloc(
unsigned int numBytes) /* Number of bytes to allocate. */
{
register union overhead *overPtr;
register size_t bucket;
register long bucket;
register unsigned amount;
struct block *bigBlockPtr = NULL;
if (!allocInit) {
/*
* We have to make the "self initializing" because Tcl_Alloc may be
* used before any other part of Tcl. E.g., see main() for tclsh!
|
| ︙ | | |
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
-
+
-
-
-
+
+
+
-
+
-
+
|
* Attempts to get more memory from the system.
*
*----------------------------------------------------------------------
*/
static void
MoreCore(
size_t bucket) /* What bucket to allocate to. */
int bucket) /* What bucket to allocat to. */
{
register union overhead *overPtr;
register size_t size; /* size of desired block */
size_t amount; /* amount to allocate */
size_t numBlocks; /* how many blocks we get */
register long size; /* size of desired block */
long amount; /* amount to allocate */
int numBlocks; /* how many blocks we get */
struct block *blockPtr;
/*
* sbrk_size <= 0 only for big, FLUFFY, requests (about 2^30 bytes on a
* VAX, I think) or for a negative arg.
*/
size = ((size_t)1) << (bucket + 3);
size = 1 << (bucket + 3);
ASSERT(size > 0);
amount = MAXMALLOC;
numBlocks = amount / size;
ASSERT(numBlocks*size == amount);
blockPtr = (struct block *) TclpSysAlloc(
blockPtr = (struct block *) TclpSysAlloc((unsigned)
(sizeof(struct block) + amount), 1);
/* no more room! */
if (blockPtr == NULL) {
return;
}
blockPtr->nextPtr = blockList;
blockList = blockPtr;
|
| ︙ | | |
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
|
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
|
-
+
|
*----------------------------------------------------------------------
*/
void
TclpFree(
char *oldPtr) /* Pointer to memory to free. */
{
register size_t size;
register long size;
register union overhead *overPtr;
struct block *bigBlockPtr;
if (oldPtr == NULL) {
return;
}
|
| ︙ | | |
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
-
+
|
char *oldPtr, /* Pointer to alloced block. */
unsigned int numBytes) /* New size of memory. */
{
int i;
union overhead *overPtr;
struct block *bigBlockPtr;
int expensive;
size_t maxSize;
unsigned long maxSize;
if (oldPtr == NULL) {
return TclpAlloc(numBytes);
}
Tcl_MutexLock(allocMutexPtr);
|
| ︙ | | |
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
|
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
|
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
|
*/
#ifdef MSTATS
void
mstats(
char *s) /* Where to write info. */
{
register unsigned int i, j;
register int i, j;
register union overhead *overPtr;
size_t totalFree = 0, totalUsed = 0;
int totalFree = 0, totalUsed = 0;
Tcl_MutexLock(allocMutexPtr);
fprintf(stderr, "Memory allocation statistics %s\nTclpFree:\t", s);
for (i = 0; i < NBUCKETS; i++) {
for (j=0, overPtr=nextf[i]; overPtr; overPtr=overPtr->next, j++) {
fprintf(stderr, " %u", j);
fprintf(stderr, " %d", j);
}
totalFree += ((size_t)j) * (1 << (i + 3));
totalFree += j * (1 << (i + 3));
}
fprintf(stderr, "\nused:\t");
for (i = 0; i < NBUCKETS; i++) {
fprintf(stderr, " %" TCL_LL_MODIFIER "d", (Tcl_WideInt)numMallocs[i]);
fprintf(stderr, " %d", numMallocs[i]);
totalUsed += numMallocs[i] * (1 << (i + 3));
}
fprintf(stderr, "\n\tTotal small in use: %" TCL_LL_MODIFIER "d, total free: %" TCL_LL_MODIFIER "d\n",
(Tcl_WideInt)totalUsed, (Tcl_WideInt)totalFree);
fprintf(stderr, "\n\tNumber of big (>%d) blocks in use: %" TCL_LL_MODIFIER "d\n",
MAXMALLOC, (Tcl_WideInt)numMallocs[NBUCKETS]);
fprintf(stderr, "\n\tTotal small in use: %d, total free: %d\n",
totalUsed, totalFree);
fprintf(stderr, "\n\tNumber of big (>%d) blocks in use: %d\n",
MAXMALLOC, numMallocs[NBUCKETS]);
Tcl_MutexUnlock(allocMutexPtr);
}
#endif
#else /* !USE_TCLALLOC */
|
| ︙ | | |
Changes to generic/tclAssembly.c.
| ︙ | | |
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
+
+
|
typedef enum TalInstType {
ASSEM_1BYTE, /* Fixed arity, 1-byte instruction */
ASSEM_BEGIN_CATCH, /* Begin catch: one 4-byte jump offset to be
* converted to appropriate exception
* ranges */
ASSEM_BOOL, /* One Boolean operand */
ASSEM_BOOL_LVT4, /* One Boolean, one 4-byte LVT ref. */
ASSEM_CLOCK_READ, /* 1-byte unsigned-integer case number, in the
* range 0-3 */
ASSEM_CONCAT1, /* 1-byte unsigned-integer operand count, must
* be strictly positive, consumes N, produces
* 1 */
ASSEM_DICT_GET, /* 'dict get' and related - consumes N+1
* operands, produces 1, N > 0 */
ASSEM_DICT_SET, /* specifies key count and LVT index, consumes
* N+1 operands, produces 1, N > 0 */
|
| ︙ | | |
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
|
+
|
{"arrayMakeStk", ASSEM_1BYTE, INST_ARRAY_MAKE_STK, 1, 0},
{"beginCatch", ASSEM_BEGIN_CATCH,
INST_BEGIN_CATCH4, 0, 0},
{"bitand", ASSEM_1BYTE, INST_BITAND, 2, 1},
{"bitnot", ASSEM_1BYTE, INST_BITNOT, 1, 1},
{"bitor", ASSEM_1BYTE, INST_BITOR, 2, 1},
{"bitxor", ASSEM_1BYTE, INST_BITXOR, 2, 1},
{"clockRead", ASSEM_CLOCK_READ, INST_CLOCK_READ, 0, 1},
{"concat", ASSEM_CONCAT1, INST_STR_CONCAT1, INT_MIN,1},
{"concatStk", ASSEM_LIST, INST_CONCAT_STK, INT_MIN,1},
{"coroName", ASSEM_1BYTE, INST_COROUTINE_NAME, 0, 1},
{"currentNamespace",ASSEM_1BYTE, INST_NS_CURRENT, 0, 1},
{"dictAppend", ASSEM_LVT4, INST_DICT_APPEND, 2, 1},
{"dictExists", ASSEM_DICT_GET, INST_DICT_EXISTS, INT_MIN,1},
{"dictExpand", ASSEM_1BYTE, INST_DICT_EXPAND, 3, 1},
|
| ︙ | | |
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
|
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
|
-
+
|
return codePtr;
}
/*
* Not valid, so free it and regenerate.
*/
TclFreeIntRep(objPtr);
FreeAssembleCodeInternalRep(objPtr);
}
/*
* Set up the compilation environment, and assemble the code.
*/
source = TclGetStringFromObj(objPtr, &sourceLen);
|
| ︙ | | |
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
|
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
|
-
+
+
+
|
/*
* Add a "done" instruction as the last instruction and change the object
* into a ByteCode object. Ownership of the literal objects and aux data
* items is given to the ByteCode object.
*/
TclEmitOpcode(INST_DONE, &compEnv);
codePtr = TclInitByteCodeObj(objPtr, &assembleCodeType, &compEnv);
TclInitByteCodeObj(objPtr, &compEnv);
objPtr->typePtr = &assembleCodeType;
TclFreeCompileEnv(&compEnv);
/*
* Record the local variable context to which the bytecode pertains
*/
codePtr = objPtr->internalRep.twoPtrValue.ptr1;
if (iPtr->varFramePtr->localCachePtr) {
codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr;
codePtr->localCachePtr->refCount++;
}
/*
* Report on what the assembler did.
|
| ︙ | | |
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
|
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
|
-
-
+
+
|
if (parsePtr->numWords != 2) {
Tcl_WrongNumArgs(interp, 1, &instNameObj, "value");
goto cleanup;
}
if (GetNextOperand(assemEnvPtr, &tokenPtr, &operand1Obj) != TCL_OK) {
goto cleanup;
}
operand1 = TclGetStringFromObj(operand1Obj, &operand1Len);
litIndex = TclRegisterLiteral(envPtr, operand1, operand1Len, 0);
operand1 = Tcl_GetStringFromObj(operand1Obj, &operand1Len);
litIndex = TclRegisterNewLiteral(envPtr, operand1, operand1Len);
BBEmitInst1or4(assemEnvPtr, tblIdx, litIndex, 0);
break;
case ASSEM_1BYTE:
if (parsePtr->numWords != 1) {
Tcl_WrongNumArgs(interp, 1, &instNameObj, "");
goto cleanup;
|
| ︙ | | |
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
|
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
localVar = FindLocalVar(assemEnvPtr, &tokenPtr);
if (localVar < 0) {
goto cleanup;
}
BBEmitInstInt1(assemEnvPtr, tblIdx, opnd, 0);
TclEmitInt4(localVar, envPtr);
break;
case ASSEM_CLOCK_READ:
if (parsePtr->numWords != 2) {
Tcl_WrongNumArgs(interp, 1, &instNameObj, "imm8");
goto cleanup;
}
if (GetIntegerOperand(assemEnvPtr, &tokenPtr, &opnd) != TCL_OK) {
goto cleanup;
}
if (opnd < 0 || opnd > 3) {
Tcl_SetObjResult(interp,
Tcl_NewStringObj("operand must be [0..3]", -1));
Tcl_SetErrorCode(interp, "TCL", "ASSEM", "OPERAND<0,>3", NULL);
goto cleanup;
}
BBEmitInstInt1(assemEnvPtr, tblIdx, opnd, opnd);
break;
case ASSEM_CONCAT1:
if (parsePtr->numWords != 2) {
Tcl_WrongNumArgs(interp, 1, &instNameObj, "imm8");
goto cleanup;
}
if (GetIntegerOperand(assemEnvPtr, &tokenPtr, &opnd) != TCL_OK
|
| ︙ | | |
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
|
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
|
-
-
+
+
|
if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
CompileEmbeddedScript(assemEnvPtr, tokenPtr+1,
TalInstructionTable+tblIdx);
} else if (GetNextOperand(assemEnvPtr, &tokenPtr,
&operand1Obj) != TCL_OK) {
goto cleanup;
} else {
operand1 = TclGetStringFromObj(operand1Obj, &operand1Len);
litIndex = TclRegisterLiteral(envPtr, operand1, operand1Len, 0);
operand1 = Tcl_GetStringFromObj(operand1Obj, &operand1Len);
litIndex = TclRegisterNewLiteral(envPtr, operand1, operand1Len);
/*
* Assumes that PUSH is the first slot!
*/
BBEmitInst1or4(assemEnvPtr, 0, litIndex, 0);
BBEmitOpcode(assemEnvPtr, tblIdx, 0);
|
| ︙ | | |
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
|
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
|
-
+
|
goto cleanup;
}
/*
* Add the (label_name, address) pair to the hash table.
*/
if (DefineLabel(assemEnvPtr, TclGetString(operand1Obj)) != TCL_OK) {
if (DefineLabel(assemEnvPtr, Tcl_GetString(operand1Obj)) != TCL_OK) {
goto cleanup;
}
break;
case ASSEM_LINDEX_MULTI:
if (parsePtr->numWords != 2) {
Tcl_WrongNumArgs(interp, 1, &instNameObj, "count");
|
| ︙ | | |
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
|
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
|
-
+
|
}
BBEmitInstInt4(assemEnvPtr, tblIdx, opnd, 0);
TclEmitInt4(localVar, envPtr);
break;
default:
Tcl_Panic("Instruction \"%s\" could not be found, can't happen\n",
TclGetString(instNameObj));
Tcl_GetString(instNameObj));
}
status = TCL_OK;
cleanup:
Tcl_DecrRefCount(instNameObj);
if (operand1Obj) {
Tcl_DecrRefCount(operand1Obj);
|
| ︙ | | |
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
|
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
|
-
-
-
+
+
+
-
+
|
/*
* Fill the keys and labels into the table.
*/
DEBUG_PRINT("jump table {\n");
for (i = 0; i < objc; i+=2) {
DEBUG_PRINT(" %s -> %s\n", TclGetString(objv[i]),
TclGetString(objv[i+1]));
hashEntry = Tcl_CreateHashEntry(jtHashPtr, TclGetString(objv[i]),
DEBUG_PRINT(" %s -> %s\n", Tcl_GetString(objv[i]),
Tcl_GetString(objv[i+1]));
hashEntry = Tcl_CreateHashEntry(jtHashPtr, Tcl_GetString(objv[i]),
&isNew);
if (!isNew) {
if (assemEnvPtr->flags & TCL_EVAL_DIRECT) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"duplicate entry in jump table for \"%s\"",
TclGetString(objv[i])));
Tcl_GetString(objv[i])));
Tcl_SetErrorCode(interp, "TCL", "ASSEM", "DUPJUMPTABLEENTRY");
DeleteMirrorJumpTable(jtPtr);
return TCL_ERROR;
}
}
Tcl_SetHashValue(hashEntry, objv[i+1]);
Tcl_IncrRefCount(objv[i+1]);
|
| ︙ | | |
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
|
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
|
-
+
|
const char* varNameStr;
int varNameLen;
int localVar; /* Index of the variable in the LVT */
if (GetNextOperand(assemEnvPtr, tokenPtrPtr, &varNameObj) != TCL_OK) {
return -1;
}
varNameStr = TclGetStringFromObj(varNameObj, &varNameLen);
varNameStr = Tcl_GetStringFromObj(varNameObj, &varNameLen);
if (CheckNamespaceQualifiers(interp, varNameStr, varNameLen)) {
Tcl_DecrRefCount(varNameObj);
return -1;
}
localVar = TclFindCompiledLocal(varNameStr, varNameLen, 1, envPtr);
Tcl_DecrRefCount(varNameObj);
if (localVar == -1) {
|
| ︙ | | |
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
|
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
|
-
+
|
* If the basic block references a label (and hence performs a
* jump), find the location of the label. Report an error if the
* label is missing.
*/
if (bbPtr->jumpTarget != NULL) {
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(bbPtr->jumpTarget));
Tcl_GetString(bbPtr->jumpTarget));
if (entry == NULL) {
ReportUndefinedLabel(assemEnvPtr, bbPtr,
bbPtr->jumpTarget);
return TCL_ERROR;
}
/*
|
| ︙ | | |
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
|
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
|
-
+
-
+
|
DEBUG_PRINT("check jump table labels %p {\n", bbPtr);
for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search);
symEntryPtr != NULL;
symEntryPtr = Tcl_NextHashEntry(&search)) {
symbolObj = Tcl_GetHashValue(symEntryPtr);
valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(symbolObj));
Tcl_GetString(symbolObj));
DEBUG_PRINT(" %s -> %s (%d)\n",
(char*) Tcl_GetHashKey(symHash, symEntryPtr),
TclGetString(symbolObj), (valEntryPtr != NULL));
Tcl_GetString(symbolObj), (valEntryPtr != NULL));
if (valEntryPtr == NULL) {
ReportUndefinedLabel(assemEnvPtr, bbPtr, symbolObj);
return TCL_ERROR;
}
}
DEBUG_PRINT("}\n");
return TCL_OK;
|
| ︙ | | |
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
|
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
|
-
+
-
+
|
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
/* Tcl interpreter */
if (assemEnvPtr->flags & TCL_EVAL_DIRECT) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"undefined label \"%s\"", TclGetString(jumpTarget)));
"undefined label \"%s\"", Tcl_GetString(jumpTarget)));
Tcl_SetErrorCode(interp, "TCL", "ASSEM", "NOLABEL",
TclGetString(jumpTarget), NULL);
Tcl_GetString(jumpTarget), NULL);
Tcl_SetErrorLine(interp, bbPtr->jumpLine);
}
}
/*
*-----------------------------------------------------------------------------
*
|
| ︙ | | |
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
|
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
|
-
+
|
* target */
for (bbPtr = assemEnvPtr->head_bb;
bbPtr != NULL;
bbPtr = bbPtr->successor1) {
if (bbPtr->jumpTarget != NULL) {
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(bbPtr->jumpTarget));
Tcl_GetString(bbPtr->jumpTarget));
jumpTarget = Tcl_GetHashValue(entry);
fromOffset = bbPtr->jumpOffset;
targetOffset = jumpTarget->startOffset;
if (bbPtr->flags & BB_JUMP1) {
TclStoreInt1AtPtr(targetOffset - fromOffset,
envPtr->codeStart + fromOffset + 1);
} else {
|
| ︙ | | |
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
|
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
|
-
+
-
+
-
+
|
*/
DEBUG_PRINT("resolve jump table {\n");
for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search);
symEntryPtr != NULL;
symEntryPtr = Tcl_NextHashEntry(&search)) {
symbolObj = Tcl_GetHashValue(symEntryPtr);
DEBUG_PRINT(" symbol %s\n", TclGetString(symbolObj));
DEBUG_PRINT(" symbol %s\n", Tcl_GetString(symbolObj));
valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(symbolObj));
Tcl_GetString(symbolObj));
jumpTargetBBPtr = Tcl_GetHashValue(valEntryPtr);
realJumpEntryPtr = Tcl_CreateHashEntry(realJumpHashPtr,
Tcl_GetHashKey(symHash, symEntryPtr), &junk);
DEBUG_PRINT(" %s -> %s -> bb %p (pc %d) hash entry %p\n",
(char*) Tcl_GetHashKey(symHash, symEntryPtr),
TclGetString(symbolObj), jumpTargetBBPtr,
Tcl_GetString(symbolObj), jumpTargetBBPtr,
jumpTargetBBPtr->startOffset, realJumpEntryPtr);
Tcl_SetHashValue(realJumpEntryPtr,
INT2PTR(jumpTargetBBPtr->startOffset - bbPtr->jumpOffset));
}
DEBUG_PRINT("}\n");
}
|
| ︙ | | |
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
|
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
|
-
+
-
+
|
if (blockPtr->flags & BB_FALLTHRU) {
result = StackCheckBasicBlock(assemEnvPtr, blockPtr->successor1,
blockPtr, stackDepth);
}
if (result == TCL_OK && blockPtr->jumpTarget != NULL) {
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(blockPtr->jumpTarget));
Tcl_GetString(blockPtr->jumpTarget));
jumpTarget = Tcl_GetHashValue(entry);
result = StackCheckBasicBlock(assemEnvPtr, jumpTarget, blockPtr,
stackDepth);
}
/*
* All blocks referenced in a jump table are successors.
*/
if (blockPtr->flags & BB_JUMPTABLE) {
for (jtEntry = Tcl_FirstHashEntry(&blockPtr->jtPtr->hashTable,
&jtSearch);
result == TCL_OK && jtEntry != NULL;
jtEntry = Tcl_NextHashEntry(&jtSearch)) {
targetLabel = Tcl_GetHashValue(jtEntry);
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(targetLabel));
Tcl_GetString(targetLabel));
jumpTarget = Tcl_GetHashValue(entry);
result = StackCheckBasicBlock(assemEnvPtr, jumpTarget,
blockPtr, stackDepth);
}
}
return result;
|
| ︙ | | |
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
|
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
|
-
+
|
depth = curr_bb->finalStackDepth + curr_bb->initialStackDepth;
if (depth == 0) {
/*
* Emit a 'push' of the empty literal.
*/
litIndex = TclRegisterLiteral(envPtr, "", 0, 0);
litIndex = TclRegisterNewLiteral(envPtr, "", 0);
/*
* Assumes that 'push' is at slot 0 in TalInstructionTable.
*/
BBEmitInst1or4(assemEnvPtr, 0, litIndex, 0);
++depth;
|
| ︙ | | |
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
|
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
|
-
+
-
+
|
result = TCL_OK;
if (bbPtr->flags & BB_FALLTHRU) {
result = ProcessCatchesInBasicBlock(assemEnvPtr, bbPtr->successor1,
fallThruEnclosing, fallThruState, catchDepth);
}
if (result == TCL_OK && bbPtr->jumpTarget != NULL) {
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(bbPtr->jumpTarget));
Tcl_GetString(bbPtr->jumpTarget));
jumpTarget = Tcl_GetHashValue(entry);
result = ProcessCatchesInBasicBlock(assemEnvPtr, jumpTarget,
jumpEnclosing, jumpState, catchDepth);
}
/*
* All blocks referenced in a jump table are successors.
*/
if (bbPtr->flags & BB_JUMPTABLE) {
for (jtEntry = Tcl_FirstHashEntry(&bbPtr->jtPtr->hashTable,&jtSearch);
result == TCL_OK && jtEntry != NULL;
jtEntry = Tcl_NextHashEntry(&jtSearch)) {
targetLabel = Tcl_GetHashValue(jtEntry);
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(targetLabel));
Tcl_GetString(targetLabel));
jumpTarget = Tcl_GetHashValue(entry);
result = ProcessCatchesInBasicBlock(assemEnvPtr, jumpTarget,
jumpEnclosing, jumpState, catchDepth);
}
}
return result;
|
| ︙ | | |
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
|
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
|
-
+
|
range = envPtr->exceptArrayPtr + catchIndices[catchDepth];
range->nestingLevel = envPtr->exceptDepth + catchDepth;
envPtr->maxExceptDepth =
TclMax(range->nestingLevel + 1, envPtr->maxExceptDepth);
range->codeOffset = bbPtr->startOffset;
entryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(catch->jumpTarget));
Tcl_GetString(catch->jumpTarget));
if (entryPtr == NULL) {
Tcl_Panic("undefined label in tclAssembly.c:"
"BuildExceptionRanges, can't happen");
}
errorExit = Tcl_GetHashValue(entryPtr);
range->catchOffset = errorExit->startOffset;
|
| ︙ | | |
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
|
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
|
+
+
-
+
+
+
|
static void
FreeAssembleCodeInternalRep(
Tcl_Obj *objPtr)
{
ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
codePtr->refCount--;
if (codePtr->refCount <= 0) {
TclReleaseByteCode(codePtr);
TclCleanupByteCode(codePtr);
}
objPtr->typePtr = NULL;
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclBasic.c.
| ︙ | | |
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
|
261
262
263
264
265
266
267
268
269
270
271
272
273
274
|
-
|
* Commands in the OS-interface. Note that many of these are unsafe.
*/
{"after", Tcl_AfterObjCmd, NULL, NULL, CMD_IS_SAFE},
{"cd", Tcl_CdObjCmd, NULL, NULL, 0},
{"close", Tcl_CloseObjCmd, NULL, NULL, CMD_IS_SAFE},
{"eof", Tcl_EofObjCmd, NULL, NULL, CMD_IS_SAFE},
{"encoding", Tcl_EncodingObjCmd, NULL, NULL, 0},
{"exec", Tcl_ExecObjCmd, NULL, NULL, 0},
{"exit", Tcl_ExitObjCmd, NULL, NULL, 0},
{"fblocked", Tcl_FblockedObjCmd, NULL, NULL, CMD_IS_SAFE},
{"fconfigure", Tcl_FconfigureObjCmd, NULL, NULL, 0},
{"fcopy", Tcl_FcopyObjCmd, NULL, NULL, CMD_IS_SAFE},
{"fileevent", Tcl_FileEventObjCmd, NULL, NULL, CMD_IS_SAFE},
{"flush", Tcl_FlushObjCmd, NULL, NULL, CMD_IS_SAFE},
|
| ︙ | | |
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
|
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
|
-
-
+
-
+
-
+
|
iPtr->appendAvl = 0;
iPtr->appendUsed = 0;
Tcl_InitHashTable(&iPtr->packageTable, TCL_STRING_KEYS);
iPtr->packageUnknown = NULL;
/* TIP #268 */
#if (TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE)
if (getenv("TCL_PKG_PREFER_LATEST") == NULL) {
iPtr->packagePrefer = PKG_PREFER_STABLE;
} else
} else {
#endif
iPtr->packagePrefer = PKG_PREFER_LATEST;
}
iPtr->cmdCount = 0;
TclInitLiteralTable(&iPtr->literalTable);
iPtr->compileEpoch = 1;
iPtr->compileEpoch = 0;
iPtr->compiledProcPtr = NULL;
iPtr->resolverPtr = NULL;
iPtr->evalFlags = 0;
iPtr->scriptFile = NULL;
iPtr->flags = 0;
iPtr->tracePtr = NULL;
iPtr->tracesForbiddingInline = 0;
|
| ︙ | | |
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
|
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
|
-
-
-
-
+
+
+
+
+
|
cmdPtr->tracePtr = NULL;
cmdPtr->nreProc = cmdInfoPtr->nreProc;
Tcl_SetHashValue(hPtr, cmdPtr);
}
}
/*
* Create the "array", "binary", "chan", "dict", "file", "info",
* "namespace" and "string" ensembles. Note that all these commands (and
* their subcommands that are not present in the global namespace) are
* wholly safe *except* for "file".
* Create the "array", "binary", "chan", "clock", "dict", "encoding",
* "file", "info", "namespace" and "string" ensembles. Note that all these
* commands (and their subcommands that are not present in the global
* namespace) are wholly safe *except* for "clock", "encoding" and "file".
*/
TclInitArrayCmd(interp);
TclInitBinaryCmd(interp);
TclInitChanCmd(interp);
TclInitDictCmd(interp);
TclInitEncodingCmd(interp);
TclInitFileCmd(interp);
TclInitInfoCmd(interp);
TclInitNamespaceCmd(interp);
TclInitStringCmd(interp);
TclInitPrefixCmd(interp);
/*
|
| ︙ | | |
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
|
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
|
-
-
+
+
|
Tcl_SetVar2Ex(interp, "tcl_platform", "pointerSize",
Tcl_NewLongObj((long) sizeof(void *)), TCL_GLOBAL_ONLY);
/*
* Set up other variables such as tcl_version and tcl_library
*/
Tcl_SetVar2(interp, "tcl_patchLevel", NULL, TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tcl_version", NULL, TCL_VERSION, TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "tcl_patchLevel", TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "tcl_version", TCL_VERSION, TCL_GLOBAL_ONLY);
Tcl_TraceVar2(interp, "tcl_precision", NULL,
TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
TclPrecTraceProc, NULL);
TclpSetVariables(interp);
#ifdef TCL_THREADS
/*
|
| ︙ | | |
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
|
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
|
-
+
-
+
-
+
|
* Register Tcl's version number.
* TIP #268: Full patchlevel instead of just major.minor
*/
Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs);
if (TclTommath_Init(interp) != TCL_OK) {
Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp)));
}
if (TclOOInit(interp) != TCL_OK) {
Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp)));
}
/*
* Only build in zlib support if we've successfully detected a library to
* compile and link against.
*/
#ifdef HAVE_ZLIB
if (TclZlibInit(interp) != TCL_OK) {
Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp)));
}
#endif
TOP_CB(iPtr) = NULL;
return interp;
}
|
| ︙ | | |
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
|
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
|
+
|
return TCL_ERROR;
}
for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
if (!(cmdInfoPtr->flags & CMD_IS_SAFE)) {
Tcl_HideCommand(interp, cmdInfoPtr->name, cmdInfoPtr->name);
}
}
TclMakeEncodingCommandSafe(interp); /* Ugh! */
TclMakeFileCommandSafe(interp); /* Ugh! */
return TCL_OK;
}
/*
*--------------------------------------------------------------
*
|
| ︙ | | |
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
|
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
|
-
+
|
* are no arguments, so this table has to be empty.
*/
Tcl_Panic("Argument location tracking table not empty");
}
Tcl_DeleteHashTable(iPtr->lineLAPtr);
ckfree(iPtr->lineLAPtr);
ckfree((char *) iPtr->lineLAPtr);
iPtr->lineLAPtr = NULL;
if (iPtr->lineLABCPtr->numEntries && !TclInExit()) {
/*
* When the interp goes away we have nothing on the stack, so there
* are no arguments, so this table has to be empty.
*/
|
| ︙ | | |
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
|
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
|
-
+
|
{
Command *cmdPtr = clientData;
int i, result;
const char **argv =
TclStackAlloc(interp, (unsigned)(objc + 1) * sizeof(char *));
for (i = 0; i < objc; i++) {
argv[i] = TclGetString(objv[i]);
argv[i] = Tcl_GetString(objv[i]);
}
argv[objc] = 0;
/*
* Invoke the command's string-based Tcl_CmdProc.
*/
|
| ︙ | | |
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
|
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
|
-
+
|
Tcl_DStringInit(&newFullName);
Tcl_DStringAppend(&newFullName, newNsPtr->fullName, -1);
if (newNsPtr != iPtr->globalNsPtr) {
TclDStringAppendLiteral(&newFullName, "::");
}
Tcl_DStringAppend(&newFullName, newTail, -1);
cmdPtr->refCount++;
CallCommandTraces(iPtr, cmdPtr, TclGetString(oldFullName),
CallCommandTraces(iPtr, cmdPtr, Tcl_GetString(oldFullName),
Tcl_DStringValue(&newFullName), TCL_TRACE_RENAME);
Tcl_DStringFree(&newFullName);
/*
* The new command name is okay, so remove the command from its current
* namespace. This is like deleting the command, so bump the cmdEpoch to
* invalidate any cached references to the command.
|
| ︙ | | |
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
|
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
|
+
+
+
+
+
+
+
|
Tcl_Command cmd) /* Token for command to delete. */
{
Interp *iPtr = (Interp *) interp;
Command *cmdPtr = (Command *) cmd;
ImportRef *refPtr, *nextRefPtr;
Tcl_Command importCmd;
/*
* Bump the command epoch counter. This will invalidate all cached
* references that point to this command.
*/
cmdPtr->cmdEpoch++;
/*
* The code here is tricky. We can't delete the hash table entry before
* invoking the deletion callback because there are cases where the
* deletion callback needs to invoke the command (e.g. object systems such
* as OTcl). However, this means that the callback could try to delete or
* rename the command. The deleted flag allows us to detect these cases
* and skip nested deletes.
|
| ︙ | | |
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
|
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
|
-
-
-
-
-
-
-
-
|
* three times, everything goes up in smoke. [Bug 1220058]
*/
if (cmdPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(cmdPtr->hPtr);
cmdPtr->hPtr = NULL;
}
/*
* Bump the command epoch counter. This will invalidate all cached
* references that point to this command.
*/
cmdPtr->cmdEpoch++;
return 0;
}
/*
* We must delete this command, even though both traces and delete procs
* may try to avoid this (renaming the command etc). Also traces and
* delete procs may try to delete the command themsevles. This flag
|
| ︙ | | |
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
|
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
|
-
-
-
-
-
-
-
|
* cmdPtr->hptr, and make sure that no-one else has already deleted the
* hash entry.
*/
if (cmdPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(cmdPtr->hPtr);
cmdPtr->hPtr = NULL;
/*
* Bump the command epoch counter. This will invalidate all cached
* references that point to this command.
*/
cmdPtr->cmdEpoch++;
}
/*
* A number of tests for particular kinds of commands are done by checking
* whether the objProc field holds a known value. Set the field to NULL so
* that such tests won't have false positives when applied to deleted
* commands.
|
| ︙ | | |
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
|
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
|
+
-
+
|
*/
void
TclCleanupCommand(
register Command *cmdPtr) /* Points to the Command structure to
* be freed. */
{
cmdPtr->refCount--;
if (cmdPtr->refCount-- <= 1) {
if (cmdPtr->refCount <= 0) {
ckfree(cmdPtr);
}
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
|
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
|
-
+
|
/*
* We have a non-numeric argument.
*/
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"argument to math function didn't have numeric value",
-1));
TclCheckBadOctal(interp, TclGetString(valuePtr));
TclCheckBadOctal(interp, Tcl_GetString(valuePtr));
ckfree(args);
return TCL_ERROR;
}
/*
* Copy the object's numeric value to the argument record, converting
* it if necessary.
|
| ︙ | | |
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
|
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
|
-
+
|
/*
* Setup errorCode variables so that we can differentiate between
* being canceled and unwound.
*/
if (iPtr->asyncCancelMsg != NULL) {
message = TclGetStringFromObj(iPtr->asyncCancelMsg, &length);
message = Tcl_GetStringFromObj(iPtr->asyncCancelMsg, &length);
} else {
length = 0;
}
if (iPtr->flags & TCL_CANCEL_UNWIND) {
id = "IUNWIND";
if (length == 0) {
|
| ︙ | | |
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
|
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
|
-
+
|
* cancellation request. Currently, clientData is ignored. If the
* TCL_CANCEL_UNWIND flags bit is set, the script in progress is not
* allowed to catch the script cancellation because the evaluation stack
* for the interp is completely unwound.
*/
if (resultObjPtr != NULL) {
result = TclGetStringFromObj(resultObjPtr, &cancelInfo->length);
result = Tcl_GetStringFromObj(resultObjPtr, &cancelInfo->length);
cancelInfo->result = ckrealloc(cancelInfo->result,cancelInfo->length);
memcpy(cancelInfo->result, result, (size_t) cancelInfo->length);
TclDecrRefCount(resultObjPtr); /* Discard their result object. */
} else {
cancelInfo->result = NULL;
cancelInfo->length = 0;
}
|
| ︙ | | |
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
|
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
|
-
+
|
/*
* If there was an error, a command string will be needed for the
* error log: get it out of the itemPtr. The details depend on the
* type.
*/
listPtr = Tcl_NewListObj(objc, objv);
cmdString = TclGetStringFromObj(listPtr, &cmdLen);
cmdString = Tcl_GetStringFromObj(listPtr, &cmdLen);
Tcl_LogCommandInfo(interp, cmdString, cmdString, cmdLen);
Tcl_DecrRefCount(listPtr);
}
iPtr->flags &= ~ERR_ALREADY_LOGGED;
return result;
}
|
| ︙ | | |
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
|
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
|
-
+
|
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
Command *cmdPtr = *cmdPtrPtr;
int newEpoch, cmdEpoch = cmdPtr->cmdEpoch;
int length, traceCode = TCL_OK;
const char *command = TclGetStringFromObj(commandPtr, &length);
const char *command = Tcl_GetStringFromObj(commandPtr, &length);
/*
* Call trace functions.
* Execute any command or execution traces. Note that we bump up the
* command's reference count for the duration of the calling of the
* traces so that the structure doesn't go away underneath our feet.
*/
|
| ︙ | | |
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
|
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
|
-
+
|
Interp *iPtr = (Interp *) interp;
int traceCode = TCL_OK;
int objc = PTR2INT(data[0]);
Tcl_Obj *commandPtr = data[1];
Command *cmdPtr = data[2];
Tcl_Obj **objv = data[3];
int length;
const char *command = TclGetStringFromObj(commandPtr, &length);
const char *command = Tcl_GetStringFromObj(commandPtr, &length);
if (!(cmdPtr->flags & CMD_IS_DELETED)) {
if (cmdPtr->flags & CMD_HAS_EXEC_TRACES){
traceCode = TclCheckExecutionTraces(interp, command, length,
cmdPtr, result, TCL_TRACE_LEAVE_EXEC, objc, objv);
}
if (iPtr->tracePtr != NULL && traceCode == TCL_OK) {
|
| ︙ | | |
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
|
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
|
+
-
+
|
Tcl_FindHashEntry(iPtr->lineLAPtr, (char *) objv[i]);
if (!hPtr) {
continue;
}
cfwPtr = Tcl_GetHashValue(hPtr);
cfwPtr->refCount--;
if (cfwPtr->refCount-- > 1) {
if (cfwPtr->refCount > 0) {
continue;
}
ckfree(cfwPtr);
Tcl_DeleteHashEntry(hPtr);
}
}
|
| ︙ | | |
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
|
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
|
-
+
|
assert(invoker == NULL);
iPtr->scriptCLLocPtr = TclContinuationsGet(objPtr);
Tcl_IncrRefCount(objPtr);
script = TclGetStringFromObj(objPtr, &numSrcBytes);
script = Tcl_GetStringFromObj(objPtr, &numSrcBytes);
result = Tcl_EvalEx(interp, script, numSrcBytes, flags);
TclDecrRefCount(objPtr);
iPtr->scriptCLLocPtr = saveCLLocPtr;
return result;
}
|
| ︙ | | |
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
|
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
|
-
+
|
}
if ((result != TCL_OK) && (result != TCL_ERROR) && !allowExceptions) {
const char *script;
int numSrcBytes;
ProcessUnexpectedResult(interp, result);
result = TCL_ERROR;
script = TclGetStringFromObj(objPtr, &numSrcBytes);
script = Tcl_GetStringFromObj(objPtr, &numSrcBytes);
Tcl_LogCommandInfo(interp, script, script, numSrcBytes);
}
/*
* We are returning to level 0, so should call TclResetCancellation.
* Let us just unset the flags inline.
*/
|
| ︙ | | |
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
|
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
|
-
+
|
string = va_arg(argList, char *);
if (string == NULL) {
break;
}
Tcl_DStringAppend(&buf, string, -1);
}
result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
result = Tcl_Eval(interp, Tcl_DStringValue(&buf));
Tcl_DStringFree(&buf);
return result;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
|
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
|
-
+
|
{
register Interp *iPtr = (Interp *) interp;
int result;
CallFrame *savedVarFramePtr;
savedVarFramePtr = iPtr->varFramePtr;
iPtr->varFramePtr = iPtr->rootFramePtr;
result = Tcl_EvalEx(interp, command, -1, 0);
result = Tcl_Eval(interp, command);
iPtr->varFramePtr = savedVarFramePtr;
return result;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
|
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
|
-
+
|
static void
MathFuncWrongNumArgs(
Tcl_Interp *interp, /* Tcl interpreter */
int expected, /* Formal parameter count. */
int found, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
const char *name = TclGetString(objv[0]);
const char *name = Tcl_GetString(objv[0]);
const char *tail = name + strlen(name);
while (tail > name+1) {
tail--;
if (*tail == ':' && tail[-1] == ':') {
name = tail+1;
break;
|
| ︙ | | |
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
|
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TclNREvalList --
*
* Callback to invoke command as list, used in order to delayed
* processing of canonical list command in sane environment.
*
*----------------------------------------------------------------------
*/
static int
TclNREvalList(
ClientData data[],
Tcl_Interp *interp,
int result)
{
int objc;
Tcl_Obj **objv;
Tcl_Obj *listPtr = data[0];
Tcl_IncrRefCount(listPtr);
TclMarkTailcall(interp);
TclNRAddCallback(interp, TclNRReleaseValues, listPtr, NULL, NULL,NULL);
TclListObjGetElements(NULL, listPtr, &objc, &objv);
return TclNREvalObjv(interp, objc, objv, 0, NULL);
}
/*
*----------------------------------------------------------------------
*
* NRCoroInjectObjCmd --
*
* Implementation of [::tcl::unsupported::inject] command.
*
*----------------------------------------------------------------------
*/
|
| ︙ | | |
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
|
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
|
-
+
+
-
+
|
/*
* Add the callback to the coro's execEnv, so that it is the first thing
* to happen when the coro is resumed.
*/
iPtr->execEnvPtr = corPtr->eePtr;
TclNREvalObjEx(interp, Tcl_NewListObj(objc-2, objv+2), 0, NULL, INT_MIN);
TclNRAddCallback(interp, TclNREvalList, Tcl_NewListObj(objc-2, objv+2),
NULL, NULL, NULL);
iPtr->execEnvPtr = savedEEPtr;
return TCL_OK;
}
int
TclNRInterpCoroutine(
ClientData clientData,
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
CoroutineData *corPtr = clientData;
if (!COR_IS_SUSPENDED(corPtr)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"coroutine \"%s\" is already running",
TclGetString(objv[0])));
Tcl_GetString(objv[0])));
Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "BUSY", NULL);
return TCL_ERROR;
}
/*
* Parse all the arguments to work out what to feed as the result of the
* [yield]. TRICKY POINT: objc==0 happens here! It occurs when a coroutine
|
| ︙ | | |
Changes to generic/tclBinary.c.
| ︙ | | |
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
-
-
-
+
-
-
+
-
-
-
-
-
-
+
-
-
-
-
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
|
{ "hex", BinaryDecodeHex, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0 },
{ "uuencode", BinaryDecodeUu, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0 },
{ "base64", BinaryDecode64, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
};
/*
* The following object types represent an array of bytes. The intent is
* The following object type represents an array of bytes. An array of bytes
* to allow arbitrary binary data to pass through Tcl as a Tcl value
* without loss or damage. Such values are useful for things like
* encoded strings or Tk images to name just two.
* is not equivalent to an internationalized string. Conceptually, a string is
*
* It's strange to have two Tcl_ObjTypes in place for this task when
* one would do, so a bit of detail and history how we got to this point
* and where we might go from here.
*
* A bytearray is an ordered sequence of bytes. Each byte is an integer
* value in the range [0-255]. To be a Tcl value type, we need a way to
* encode each value in the value set as a Tcl string. The simplest
* encoding is to represent each byte value as the same codepoint value.
* A bytearray of N bytes is encoded into a Tcl string of N characters
* where the codepoint of each character is the value of corresponding byte.
* an array of 16-bit quantities organized as a sequence of properly formed
* UTF-8 characters, while a ByteArray is an array of 8-bit quantities.
* This approach creates a one-to-one map between all bytearray values
* and a subset of Tcl string values.
*
* When converting a Tcl string value to the bytearray internal rep, the
* question arises what to do with strings outside that subset? That is,
* those Tcl strings containing at least one codepoint greater than 255?
* The obviously correct answer is to raise an error! That string value
* does not represent any valid bytearray value. Full Stop. The
* setFromAnyProc signature has a completion code return value for just
* this reason, to reject invalid inputs.
*
* Unfortunately this was not the path taken by the authors of the
* original tclByteArrayType. They chose to accept all Tcl string values
* Accessor functions are provided to convert a ByteArray to a String or a
* as acceptable string encodings of the bytearray values that result
* from masking away the high bits of any codepoint value at all. This
* meant that every bytearray value had multiple accepted string
* representations.
*
* The implications of this choice are truly ugly. When a Tcl value has
* a string representation, we are required to accept that as the true
* String to a ByteArray. Two or more consecutive bytes in an array of bytes
* may look like a single UTF-8 character if the array is casually treated as
* a string. But obtaining the String from a ByteArray is guaranteed to
* value. Bytearray values that possess a string representation cannot
* be processed as bytearrays because we cannot know which true value
* that bytearray represents. The consequence is that we drag around
* produced properly formed UTF-8 sequences so that there is a one-to-one map
* an internal rep that we cannot make any use of. This painful price
* is extracted at any point after a string rep happens to be generated
* between bytes and characters.
* for the value. This happens even when the troublesome codepoints
* outside the byte range never show up. This happens rather routinely
* in normal Tcl operations unless we burden the script writer with the
* cognitive burden of avoiding it. The price is also paid by callers
* of the C interface. The routine
*
* unsigned char *Tcl_GetByteArrayFromObj(objPtr, lenPtr)
* Converting a ByteArray to a String proceeds by casting each byte in the
*
* has a guarantee to always return a non-NULL value, but that value
* points to a byte sequence that cannot be used by the caller to
* process the Tcl value absent some sideband testing that objPtr
* array to a 16-bit quantity, treating that number as a Unicode character,
* and storing the UTF-8 version of that Unicode character in the String. For
* ByteArrays consisting entirely of values 1..127, the corresponding String
* is "pure". Tcl offers no public interface to perform this test,
* so callers either break encapsulation or are unavoidably buggy. Tcl
* has defined a public interface that cannot be used correctly. The
* Tcl source code itself suffers the same problem, and has been buggy,
* representation is the same as the ByteArray representation.
* but progressively less so as more and more portions of the code have
* been retrofitted with the required "purity testing". The set of values
* able to pass the purity test can be increased via the introduction of
* a "canonical" flag marker, but the only way the broken interface itself
* can be discarded is to start over and define the Tcl_ObjType properly.
* Bytearrays should simply be usable as bytearrays without a kabuki
* dance of testing.
*
* The Tcl_ObjType "properByteArrayType" is (nearly) a correct
* implementation of bytearrays. Any Tcl value with the type
* properByteArrayType can have its bytearray value fetched and
* Converting a String to a ByteArray proceeds by getting the Unicode
* representation of each character in the String, casting it to a byte by
* truncating the upper 8 bits, and then storing the byte in the ByteArray.
* used with confidence that acting on that value is equivalent to
* acting on the true Tcl string value. This still implies a side
* testing burden -- past mistakes will not let us avoid that
* immediately, but it is at least a conventional test of type, and
* can be implemented entirely by examining the objPtr fields, with
* no need to query the intrep, as a canonical flag would require.
*
* Until Tcl_GetByteArrayFromObj() and Tcl_SetByteArrayLength() can
* Converting from ByteArray to String and back to ByteArray is not lossy, but
* be revised to admit the possibility of returning NULL when the true
* value is not a valid bytearray, we need a mechanism to retain
* compatibility with the deployed callers of the broken interface.
* That's what the retained "tclByteArrayType" provides. In those
* converting an arbitrary String to a ByteArray may be.
* unusual circumstances where we convert an invalid bytearray value
* to a bytearray type, it is to this legacy type. Essentially any
* time this legacy type gets used, it's a signal of a bug being ignored.
* A TIP should be drafted to remove this connection to the broken past
* so that Tcl 9 will no longer have any trace of it. Prescribing a
* migration path will be the key element of that work. The internal
* changes now in place are the limit of what can be done short of
* interface repair. They provide a great expansion of the histories
* over which bytearray values can be useful in the meanwhile.
*/
static const Tcl_ObjType properByteArrayType = {
"bytearray",
FreeByteArrayInternalRep,
DupByteArrayInternalRep,
UpdateStringOfByteArray,
NULL
};
const Tcl_ObjType tclByteArrayType = {
"bytearray",
FreeByteArrayInternalRep,
DupByteArrayInternalRep,
NULL,
UpdateStringOfByteArray,
SetByteArrayFromAny
};
/*
* The following structure is the internal rep for a ByteArray object. Keeps
* track of how much memory has been used and how much has been allocated for
* the byte array to enable growing and shrinking of the ByteArray object with
|
| ︙ | | |
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
-
-
-
-
-
-
|
#define BYTEARRAY_SIZE(len) \
((unsigned) (TclOffset(ByteArray, bytes) + (len)))
#define GET_BYTEARRAY(objPtr) \
((ByteArray *) (objPtr)->internalRep.twoPtrValue.ptr1)
#define SET_BYTEARRAY(objPtr, baPtr) \
(objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (baPtr)
int
TclIsPureByteArray(
Tcl_Obj * objPtr)
{
return (objPtr->typePtr == &properByteArrayType);
}
/*
*----------------------------------------------------------------------
*
* Tcl_NewByteArrayObj --
*
* This procedure is creates a new ByteArray object and initializes it
|
| ︙ | | |
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
-
+
|
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
if ((bytes != NULL) && (length > 0)) {
memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
}
objPtr->typePtr = &properByteArrayType;
objPtr->typePtr = &tclByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
}
/*
*----------------------------------------------------------------------
*
* Tcl_GetByteArrayFromObj --
|
| ︙ | | |
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
-
-
+
|
Tcl_GetByteArrayFromObj(
Tcl_Obj *objPtr, /* The ByteArray object. */
int *lengthPtr) /* If non-NULL, filled with length of the
* array of bytes in the ByteArray object. */
{
ByteArray *baPtr;
if ((objPtr->typePtr != &properByteArrayType)
&& (objPtr->typePtr != &tclByteArrayType)) {
if (objPtr->typePtr != &tclByteArrayType) {
SetByteArrayFromAny(NULL, objPtr);
}
baPtr = GET_BYTEARRAY(objPtr);
if (lengthPtr != NULL) {
*lengthPtr = baPtr->used;
}
|
| ︙ | | |
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
|
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
|
-
-
+
|
int length) /* New length for internal byte array. */
{
ByteArray *byteArrayPtr;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength");
}
if ((objPtr->typePtr != &properByteArrayType)
&& (objPtr->typePtr != &tclByteArrayType)) {
if (objPtr->typePtr != &tclByteArrayType) {
SetByteArrayFromAny(NULL, objPtr);
}
byteArrayPtr = GET_BYTEARRAY(objPtr);
if (length > byteArrayPtr->allocated) {
byteArrayPtr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(length));
byteArrayPtr->allocated = length;
|
| ︙ | | |
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
-
+
-
-
-
-
-
+
-
-
-
-
+
-
-
+
-
-
-
+
+
+
-
-
-
+
+
-
-
+
+
-
-
-
+
+
+
+
|
*/
static int
SetByteArrayFromAny(
Tcl_Interp *interp, /* Not used. */
Tcl_Obj *objPtr) /* The object to convert to type ByteArray. */
{
size_t length;
int length;
int improper = 0;
const char *src, *srcEnd;
unsigned char *dst;
ByteArray *byteArrayPtr;
Tcl_UniChar ch;
if (objPtr->typePtr == &properByteArrayType) {
return TCL_OK;
}
if (objPtr->typePtr == &tclByteArrayType) {
if (objPtr->typePtr != &tclByteArrayType) {
return TCL_OK;
}
src = TclGetString(objPtr);
src = TclGetStringFromObj(objPtr, &length);
length = objPtr->length;
srcEnd = src + length;
srcEnd = src + length;
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += Tcl_UtfToUniChar(src, &ch);
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += Tcl_UtfToUniChar(src, &ch);
improper = improper || (ch > 255);
*dst++ = UCHAR(ch);
}
*dst++ = UCHAR(ch);
}
byteArrayPtr->used = dst - byteArrayPtr->bytes;
byteArrayPtr->allocated = length;
byteArrayPtr->used = dst - byteArrayPtr->bytes;
byteArrayPtr->allocated = length;
TclFreeIntRep(objPtr);
objPtr->typePtr = improper ? &tclByteArrayType : &properByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
TclFreeIntRep(objPtr);
objPtr->typePtr = &tclByteArrayType;
SET_BYTEARRAY(objPtr, byteArrayPtr);
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* FreeByteArrayInternalRep --
|
| ︙ | | |
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
|
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
|
-
+
|
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
copyArrayPtr->used = length;
copyArrayPtr->allocated = length;
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, (size_t) length);
SET_BYTEARRAY(copyPtr, copyArrayPtr);
copyPtr->typePtr = srcPtr->typePtr;
copyPtr->typePtr = &tclByteArrayType;
}
/*
*----------------------------------------------------------------------
*
* UpdateStringOfByteArray --
*
|
| ︙ | | |
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
|
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
|
-
-
+
|
Tcl_Panic("%s must be called with definite number of bytes to append",
"TclAppendBytesToByteArray");
}
if (len == 0) {
/* Append zero bytes is a no-op. */
return;
}
if ((objPtr->typePtr != &properByteArrayType)
&& (objPtr->typePtr != &tclByteArrayType)) {
if (objPtr->typePtr != &tclByteArrayType) {
SetByteArrayFromAny(NULL, objPtr);
}
byteArrayPtr = GET_BYTEARRAY(objPtr);
if (len > INT_MAX - byteArrayPtr->used) {
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
}
|
| ︙ | | |
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
|
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
|
+
+
+
-
+
+
+
+
+
+
|
(*formatPtr)++;
*flagsPtr |= BINARY_UNSIGNED;
}
if (**formatPtr == '*') {
(*formatPtr)++;
*countPtr = BINARY_ALL;
} else if (isdigit(UCHAR(**formatPtr))) { /* INTL: digit */
unsigned long int count;
errno = 0;
*countPtr = strtoul(*formatPtr, (char **) formatPtr, 10);
count = strtoul(*formatPtr, (char **) formatPtr, 10);
if (errno || (count > (unsigned long) INT_MAX)) {
*countPtr = INT_MAX;
} else {
*countPtr = (int) count;
}
} else {
*countPtr = BINARY_NOCOUNT;
}
return 1;
}
/*
|
| ︙ | | |
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
|
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
|
-
+
|
"line length out of range", -1));
Tcl_SetErrorCode(interp, "TCL", "BINARY", "ENCODE",
"LINE_LENGTH", NULL);
return TCL_ERROR;
}
break;
case OPT_WRAPCHAR:
wrapchar = TclGetStringFromObj(objv[i+1], &wrapcharlen);
wrapchar = Tcl_GetStringFromObj(objv[i+1], &wrapcharlen);
if (wrapcharlen == 0) {
maxlen = 0;
}
break;
}
}
|
| ︙ | | |
Changes to generic/tclCkalloc.c.
| ︙ | | |
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
-
+
-
+
-
+
-
+
|
/*
* One of the following structures is allocated each time the
* "memory tag" command is invoked, to hold the current tag.
*/
typedef struct MemTag {
size_t refCount; /* Number of mem_headers referencing this
int refCount; /* Number of mem_headers referencing this
* tag. */
char string[1]; /* Actual size of string will be as large as
* needed for actual tag. This must be the
* last field in the structure. */
} MemTag;
#define TAG_SIZE(bytesInString) ((TclOffset(MemTag, string) + 1) + bytesInString)
#define TAG_SIZE(bytesInString) ((unsigned) ((TclOffset(MemTag, string) + 1) + bytesInString))
static MemTag *curTagPtr = NULL;/* Tag to use in all future mem_headers (set
* by "memory tag" command). */
/*
* One of the following structures is allocated just before each dynamically
* allocated chunk of memory, both to record information about the chunk and
* to help detect chunk under-runs.
*/
#define LOW_GUARD_SIZE (8 + (32 - (sizeof(size_t) + sizeof(int)))%8)
#define LOW_GUARD_SIZE (8 + (32 - (sizeof(long) + sizeof(int)))%8)
struct mem_header {
struct mem_header *flink;
struct mem_header *blink;
MemTag *tagPtr; /* Tag from "memory tag" command; may be
* NULL. */
const char *file;
size_t length;
long length;
int line;
unsigned char low_guard[LOW_GUARD_SIZE];
/* Aligns body on 8-byte boundary, plus
* provides at least 8 additional guard bytes
* to detect underruns. */
char body[1]; /* First byte of client's space. Actual size
* of this field will be larger than one. */
|
| ︙ | | |
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
-
-
+
+
-
+
-
-
+
+
-
-
+
+
|
byte &= 0xff;
fprintf(stderr, "low guard byte %d is 0x%x \t%c\n", (int)idx, byte,
(isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
}
}
if (guard_failed) {
TclDumpMemoryInfo((ClientData) stderr, 0);
fprintf(stderr, "low guard failed at %p, %s %d\n",
memHeaderP->body, file, line);
fprintf(stderr, "low guard failed at %lx, %s %d\n",
(long unsigned) memHeaderP->body, file, line);
fflush(stderr); /* In case name pointer is bad. */
fprintf(stderr, "%" TCL_LL_MODIFIER "d bytes allocated at (%s %d)\n", (Tcl_WideInt) memHeaderP->length,
fprintf(stderr, "%ld bytes allocated at (%s %d)\n", memHeaderP->length,
memHeaderP->file, memHeaderP->line);
Tcl_Panic("Memory validation failure");
}
hiPtr = (unsigned char *)memHeaderP->body + memHeaderP->length;
for (idx = 0; idx < HIGH_GUARD_SIZE; idx++) {
byte = *(hiPtr + idx);
if (byte != GUARD_VALUE) {
guard_failed = TRUE;
fflush(stdout);
byte &= 0xff;
fprintf(stderr, "hi guard byte %d is 0x%x \t%c\n", (int)idx, byte,
(isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
}
}
if (guard_failed) {
TclDumpMemoryInfo((ClientData) stderr, 0);
fprintf(stderr, "high guard failed at %p, %s %d\n",
memHeaderP->body, file, line);
fprintf(stderr, "high guard failed at %lx, %s %d\n",
(long unsigned) memHeaderP->body, file, line);
fflush(stderr); /* In case name pointer is bad. */
fprintf(stderr, "%" TCL_LL_MODIFIER "d bytes allocated at (%s %d)\n",
(Tcl_WideInt)memHeaderP->length, memHeaderP->file,
fprintf(stderr, "%ld bytes allocated at (%s %d)\n",
memHeaderP->length, memHeaderP->file,
memHeaderP->line);
Tcl_Panic("Memory validation failure");
}
if (nukeGuards) {
memset(memHeaderP->low_guard, 0, LOW_GUARD_SIZE);
memset(hiPtr, 0, HIGH_GUARD_SIZE);
|
| ︙ | | |
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
-
-
-
-
+
+
+
+
|
return TCL_ERROR;
}
}
Tcl_MutexLock(ckallocMutexPtr);
for (memScanP = allocHead; memScanP != NULL; memScanP = memScanP->flink) {
address = &memScanP->body[0];
fprintf(fileP, "%8" TCL_LL_MODIFIER "x - %8" TCL_LL_MODIFIER "x %7" TCL_LL_MODIFIER "d @ %s %d %s",
(Tcl_WideInt)(size_t)address,
(Tcl_WideInt)((size_t)address + memScanP->length - 1),
(Tcl_WideInt)memScanP->length, memScanP->file, memScanP->line,
fprintf(fileP, "%8lx - %8lx %7ld @ %s %d %s",
(long unsigned) address,
(long unsigned) address + memScanP->length - 1,
memScanP->length, memScanP->file, memScanP->line,
(memScanP->tagPtr == NULL) ? "" : memScanP->tagPtr->string);
(void) fputc('\n', fileP);
}
Tcl_MutexUnlock(ckallocMutexPtr);
if (fileP != stderr) {
fclose(fileP);
|
| ︙ | | |
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
-
-
+
+
|
total_mallocs);
fflush(stderr);
alloc_tracing = TRUE;
trace_on_at_malloc = 0;
}
if (alloc_tracing) {
fprintf(stderr,"ckalloc %p %u %s %d\n",
result->body, size, file, line);
fprintf(stderr,"ckalloc %lx %u %s %d\n",
(long unsigned int) result->body, size, file, line);
}
if (break_on_malloc && (total_mallocs >= break_on_malloc)) {
break_on_malloc = 0;
(void) fflush(stdout);
Tcl_Panic("reached malloc break limit (%d)", total_mallocs);
}
|
| ︙ | | |
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
-
-
+
+
|
total_mallocs);
fflush(stderr);
alloc_tracing = TRUE;
trace_on_at_malloc = 0;
}
if (alloc_tracing) {
fprintf(stderr,"ckalloc %p %u %s %d\n",
result->body, size, file, line);
fprintf(stderr,"ckalloc %lx %u %s %d\n",
(long unsigned int) result->body, size, file, line);
}
if (break_on_malloc && (total_mallocs >= break_on_malloc)) {
break_on_malloc = 0;
(void) fflush(stdout);
Tcl_Panic("reached malloc break limit (%d)", total_mallocs);
}
|
| ︙ | | |
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
|
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
|
-
-
+
+
-
+
-
+
+
|
* such as Crays (will subtract only bytes, even though BODY_OFFSET is in
* words on these machines).
*/
memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
if (alloc_tracing) {
fprintf(stderr, "ckfree %p %" TCL_LL_MODIFIER "d %s %d\n",
memp->body, (Tcl_WideInt) memp->length, file, line);
fprintf(stderr, "ckfree %lx %ld %s %d\n",
(long unsigned int) memp->body, memp->length, file, line);
}
if (validate_memory) {
Tcl_ValidateAllMemory(file, line);
}
Tcl_MutexLock(ckallocMutexPtr);
ValidateMemory(memp, file, line, TRUE);
if (init_malloced_bodies) {
memset(ptr, GUARD_VALUE, memp->length);
memset(ptr, GUARD_VALUE, (size_t) memp->length);
}
total_frees++;
current_malloc_packets--;
current_bytes_malloced -= memp->length;
if (memp->tagPtr != NULL) {
if ((memp->tagPtr->refCount-- <= 1) && (curTagPtr != memp->tagPtr)) {
memp->tagPtr->refCount--;
if ((memp->tagPtr->refCount == 0) && (curTagPtr != memp->tagPtr)) {
TclpFree((char *) memp->tagPtr);
}
}
/*
* Delink from allocated list
*/
|
| ︙ | | |
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
|
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
|
-
+
-
+
-
+
-
+
|
Tcl_DbCkrealloc(
char *ptr,
unsigned int size,
const char *file,
int line)
{
char *newPtr;
size_t copySize;
unsigned int copySize;
struct mem_header *memp;
if (ptr == NULL) {
return Tcl_DbCkalloc(size, file, line);
}
/*
* See comment from Tcl_DbCkfree before you change the following line.
*/
memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
copySize = size;
if (copySize > memp->length) {
if (copySize > (unsigned int) memp->length) {
copySize = memp->length;
}
newPtr = Tcl_DbCkalloc(size, file, line);
memcpy(newPtr, ptr, (size_t) copySize);
Tcl_DbCkfree(ptr, file, line);
return newPtr;
}
char *
Tcl_AttemptDbCkrealloc(
char *ptr,
unsigned int size,
const char *file,
int line)
{
char *newPtr;
size_t copySize;
unsigned int copySize;
struct mem_header *memp;
if (ptr == NULL) {
return Tcl_AttemptDbCkalloc(size, file, line);
}
/*
* See comment from Tcl_DbCkfree before you change the following line.
*/
memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
copySize = size;
if (copySize > memp->length) {
if (copySize > (unsigned int) memp->length) {
copySize = memp->length;
}
newPtr = Tcl_AttemptDbCkalloc(size, file, line);
if (newPtr == NULL) {
return NULL;
}
memcpy(newPtr, ptr, (size_t) copySize);
|
| ︙ | | |
Changes to generic/tclClock.c.
| ︙ | | |
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
-
+
|
};
/*
* Structure containing the client data for [clock]
*/
typedef struct ClockClientData {
size_t refCount; /* Number of live references. */
int refCount; /* Number of live references. */
Tcl_Obj **literals; /* Pool of object literals. */
} ClockClientData;
/*
* Structure containing the fields used in [clock format] and [clock scan]
*/
|
| ︙ | | |
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
-
-
-
-
|
* the end of the table. */
Tcl_ObjCmdProc *objCmdProc; /* Function that implements the command. This
* will always have the ClockClientData sent
* to it, but may well ignore this data. */
};
static const struct ClockCommand clockCommands[] = {
{ "clicks", ClockClicksObjCmd },
{ "getenv", ClockGetenvObjCmd },
{ "microseconds", ClockMicrosecondsObjCmd },
{ "milliseconds", ClockMillisecondsObjCmd },
{ "seconds", ClockSecondsObjCmd },
{ "Oldscan", TclClockOldscanObjCmd },
{ "ConvertLocalToUTC", ClockConvertlocaltoutcObjCmd },
{ "GetDateFields", ClockGetdatefieldsObjCmd },
{ "GetJulianDayFromEraYearMonthDay",
ClockGetjuliandayfromerayearmonthdayObjCmd },
{ "GetJulianDayFromEraYearWeekDay",
ClockGetjuliandayfromerayearweekdayObjCmd },
|
| ︙ | | |
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
+
+
+
+
+
+
+
+
+
+
+
+
+
|
const struct ClockCommand *clockCmdPtr;
char cmdName[50]; /* Buffer large enough to hold the string
*::tcl::clock::GetJulianDayFromEraYearMonthDay
* plus a terminating NUL. */
ClockClientData *data;
int i;
/* Structure of the 'clock' ensemble */
static const EnsembleImplMap clockImplMap[] = {
{"add", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0},
{"clicks", ClockClicksObjCmd, TclCompileClockClicksCmd, NULL, NULL, 0},
{"format", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL, 0},
{"microseconds", ClockMicrosecondsObjCmd, TclCompileClockReadingCmd, NULL, INT2PTR(1), 0},
{"milliseconds", ClockMillisecondsObjCmd, TclCompileClockReadingCmd, NULL, INT2PTR(2), 0},
{"scan", NULL, TclCompileBasicMin1ArgCmd, NULL, NULL , 0},
{"seconds", ClockSecondsObjCmd, TclCompileClockReadingCmd, NULL, INT2PTR(3), 0},
{NULL, NULL, NULL, NULL, NULL, 0}
};
/*
* Safe interps get [::clock] as alias to a master, so do not need their
* own copies of the support routines.
*/
if (Tcl_IsSafe(interp)) {
return;
|
| ︙ | | |
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
|
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
+
+
+
+
+
|
for (i = 0; i < LIT__END; ++i) {
data->literals[i] = Tcl_NewStringObj(literals[i], -1);
Tcl_IncrRefCount(data->literals[i]);
}
/*
* Install the commands.
* TODO - Let Tcl_MakeEnsemble do this?
*/
#define TCL_CLOCK_PREFIX_LEN 14 /* == strlen("::tcl::clock::") */
memcpy(cmdName, "::tcl::clock::", TCL_CLOCK_PREFIX_LEN);
for (clockCmdPtr=clockCommands ; clockCmdPtr->name!=NULL ; clockCmdPtr++) {
strcpy(cmdName + TCL_CLOCK_PREFIX_LEN, clockCmdPtr->name);
data->refCount++;
Tcl_CreateObjCommand(interp, cmdName, clockCmdPtr->objCmdProc, data,
ClockDeleteCmdProc);
}
/* Make the clock ensemble */
TclMakeEnsemble(interp, "clock", clockImplMap);
}
/*
*----------------------------------------------------------------------
*
* ClockConvertlocaltoutcObjCmd --
*
|
| ︙ | | |
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
|
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
|
+
-
+
|
static void
ClockDeleteCmdProc(
ClientData clientData) /* Opaque pointer to the client data */
{
ClockClientData *data = clientData;
int i;
data->refCount--;
if (data->refCount-- <= 1) {
if (data->refCount == 0) {
for (i = 0; i < LIT__END; ++i) {
Tcl_DecrRefCount(data->literals[i]);
}
ckfree(data->literals);
ckfree(data);
}
}
|
| ︙ | | |
Changes to generic/tclCmdAH.c.
| ︙ | | |
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Prototypes for local procedures defined in this file:
*/
static int CheckAccess(Tcl_Interp *interp, Tcl_Obj *pathPtr,
int mode);
static int BadEncodingSubcommand(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int EncodingConvertfromObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int EncodingConverttoObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int EncodingDirsObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int EncodingNamesObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int EncodingSystemObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static inline int ForeachAssignments(Tcl_Interp *interp,
struct ForeachState *statePtr);
static inline void ForeachCleanup(Tcl_Interp *interp,
struct ForeachState *statePtr);
static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr,
Tcl_FSStatProc *statProc, Tcl_StatBuf *statPtr);
|
| ︙ | | |
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
|
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
|
+
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
case ENC_CONVERTTO:
return EncodingConverttoObjCmd(dummy, interp, objc, objv);
case ENC_CONVERTFROM: {
case ENC_CONVERTFROM:
Tcl_Obj *data;
Tcl_DString ds;
Tcl_Encoding encoding;
int length;
const char *stringPtr;
return EncodingConvertfromObjCmd(dummy, interp, objc, objv);
if (objc == 3) {
encoding = Tcl_GetEncoding(interp, NULL);
data = objv[2];
} else if (objc == 4) {
if (Tcl_GetEncodingFromObj(interp, objv[2], &encoding) != TCL_OK) {
return TCL_ERROR;
}
data = objv[3];
} else {
Tcl_WrongNumArgs(interp, 2, objv, "?encoding? data");
return TCL_ERROR;
}
if ((enum options) index == ENC_CONVERTFROM) {
/*
* Treat the string as binary data.
*/
stringPtr = (char *) Tcl_GetByteArrayFromObj(data, &length);
Tcl_ExternalToUtfDString(encoding, stringPtr, length, &ds);
/*
* Note that we cannot use Tcl_DStringResult here because it will
* truncate the string at the first null byte.
*/
Tcl_SetObjResult(interp, TclDStringToObj(&ds));
} else {
/*
* Store the result as binary data.
*/
stringPtr = TclGetStringFromObj(data, &length);
Tcl_UtfToExternalDString(encoding, stringPtr, length, &ds);
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(
(unsigned char *) Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds)));
Tcl_DStringFree(&ds);
}
Tcl_FreeEncoding(encoding);
break;
}
case ENC_DIRS:
return EncodingDirsObjCmd(dummy, interp, objc, objv);
case ENC_NAMES:
if (objc > 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
}
Tcl_GetEncodingNames(interp);
return EncodingNamesObjCmd(dummy, interp, objc, objv);
break;
case ENC_SYSTEM:
return EncodingSystemObjCmd(dummy, interp, objc, objv);
}
return TCL_OK;
}
/*
*-----------------------------------------------------------------------------
*
* TclInitEncodingCmd --
*
* This function creates the 'encoding' ensemble.
*
* Results:
* Returns the Tcl_Command so created.
*
* Side effects:
* The ensemble is initialized.
*
* This command is hidden in a safe interpreter.
*/
Tcl_Command
TclInitEncodingCmd(
Tcl_Interp* interp) /* Tcl interpreter */
{
static const EnsembleImplMap encodingImplMap[] = {
{"convertfrom", EncodingConvertfromObjCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0},
{"convertto", EncodingConverttoObjCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0},
{"dirs", EncodingDirsObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"names", EncodingNamesObjCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"system", EncodingSystemObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{NULL, NULL, NULL, NULL, NULL, 0}
};
return TclMakeEnsemble(interp, "encoding", encodingImplMap);
}
/*
*-----------------------------------------------------------------------------
*
* TclMakeEncodingCommandSafe --
*
* This function hides the unsafe 'dirs' and 'system' subcommands of
* the "encoding" Tcl command ensemble. It must be called only from
* TclHideUnsafeCommands.
*
* Results:
* A standard Tcl result
*
* Side effects:
* Adds commands to the table of hidden commands.
*
*-----------------------------------------------------------------------------
*/
int
TclMakeEncodingCommandSafe(
Tcl_Interp* interp) /* Tcl interpreter */
{
static const struct {
const char *cmdName;
int unsafe;
} unsafeInfo[] = {
{"convertfrom", 0},
{"convertto", 0},
{"dirs", 1},
{"names", 0},
{"system", 0},
{NULL, 0}
};
int i;
Tcl_DString oldBuf, newBuf;
Tcl_DStringInit(&oldBuf);
TclDStringAppendLiteral(&oldBuf, "::tcl::encoding::");
Tcl_DStringInit(&newBuf);
TclDStringAppendLiteral(&newBuf, "tcl:encoding:");
for (i=0 ; unsafeInfo[i].cmdName != NULL ; i++) {
if (unsafeInfo[i].unsafe) {
const char *oldName, *newName;
Tcl_DStringSetLength(&oldBuf, 17);
oldName = Tcl_DStringAppend(&oldBuf, unsafeInfo[i].cmdName, -1);
Tcl_DStringSetLength(&newBuf, 13);
newName = Tcl_DStringAppend(&newBuf, unsafeInfo[i].cmdName, -1);
if (TclRenameCommand(interp, oldName, "___tmp") != TCL_OK
|| Tcl_HideCommand(interp, "___tmp", newName) != TCL_OK) {
Tcl_Panic("problem making 'encoding %s' safe: %s",
unsafeInfo[i].cmdName,
Tcl_GetString(Tcl_GetObjResult(interp)));
}
Tcl_CreateObjCommand(interp, oldName, BadEncodingSubcommand,
(ClientData) unsafeInfo[i].cmdName, NULL);
}
}
Tcl_DStringFree(&oldBuf);
Tcl_DStringFree(&newBuf);
/*
* Ugh. The [encoding] command is now actually safe, but it is assumed by
* scripts that it is not, which messes up security policies.
*/
if (Tcl_HideCommand(interp, "encoding", "encoding") != TCL_OK) {
Tcl_Panic("problem making 'encoding' safe: %s",
Tcl_GetString(Tcl_GetObjResult(interp)));
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* BadEncodingSubcommand --
*
* Command used to act as a backstop implementation when subcommands of
* "encoding" are unsafe (the real implementations of the subcommands are
* hidden). The clientData is always the full official subcommand name.
*
* Results:
* A standard Tcl result (always a TCL_ERROR).
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
BadEncodingSubcommand(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
const char *subcommandName = (const char *) clientData;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"not allowed to invoke subcommand %s of encoding", subcommandName));
Tcl_SetErrorCode(interp, "TCL", "SAFE", "SUBCOMMAND", NULL);
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* EncodingConvertfromObjCmd --
*
* This command converts a byte array in an external encoding into a
* Tcl string
*
* Results:
* A standard Tcl result.
*
*----------------------------------------------------------------------
*/
int
EncodingConvertfromObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *data; /* Byte array to convert */
Tcl_DString ds; /* Buffer to hold the string */
Tcl_Encoding encoding; /* Encoding to use */
int length; /* Length of the byte array being converted */
const char *bytesPtr; /* Pointer to the first byte of the array */
if (objc > 3) {
Tcl_WrongNumArgs(interp, 2, objv, "?encoding?");
if (objc == 2) {
encoding = Tcl_GetEncoding(interp, NULL);
data = objv[1];
} else if (objc == 3) {
if (Tcl_GetEncodingFromObj(interp, objv[1], &encoding) != TCL_OK) {
return TCL_ERROR;
}
data = objv[2];
} else {
Tcl_WrongNumArgs(interp, 1, objv, "?encoding? data");
return TCL_ERROR;
}
/*
* Convert the string into a byte array in 'ds'
*/
bytesPtr = (char *) Tcl_GetByteArrayFromObj(data, &length);
Tcl_ExternalToUtfDString(encoding, bytesPtr, length, &ds);
/*
* Note that we cannot use Tcl_DStringResult here because it will
* truncate the string at the first null byte.
*/
Tcl_SetObjResult(interp, TclDStringToObj(&ds));
/*
* We're done with the encoding
*/
Tcl_FreeEncoding(encoding);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* EncodingConverttoObjCmd --
*
* This command converts a Tcl string into a byte array that
* encodes the string according to some encoding.
*
* Results:
* A standard Tcl result.
*
*----------------------------------------------------------------------
*/
int
EncodingConverttoObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *data; /* String to convert */
Tcl_DString ds; /* Buffer to hold the byte array */
Tcl_Encoding encoding; /* Encoding to use */
int length; /* Length of the string being converted */
const char *stringPtr; /* Pointer to the first byte of the string */
/* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */
if (objc == 2) {
encoding = Tcl_GetEncoding(interp, NULL);
data = objv[1];
} else if (objc == 3) {
if (Tcl_GetEncodingFromObj(interp, objv[1], &encoding) != TCL_OK) {
return TCL_ERROR;
}
if (objc == 2) {
data = objv[2];
Tcl_SetObjResult(interp, Tcl_NewStringObj(
Tcl_GetEncodingName(NULL), -1));
} else {
return Tcl_SetSystemEncoding(interp, TclGetString(objv[2]));
}
break;
}
} else {
Tcl_WrongNumArgs(interp, 1, objv, "?encoding? data");
return TCL_ERROR;
}
/*
* Convert the string to a byte array in 'ds'
*/
stringPtr = TclGetStringFromObj(data, &length);
Tcl_UtfToExternalDString(encoding, stringPtr, length, &ds);
Tcl_SetObjResult(interp,
Tcl_NewByteArrayObj((unsigned char*) Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds)));
Tcl_DStringFree(&ds);
/*
* We're done with the encoding
*/
Tcl_FreeEncoding(encoding);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* EncodingDirsObjCmd --
*
|
| ︙ | | |
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
|
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
|
-
-
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *dirListObj;
if (objc > 3) {
Tcl_WrongNumArgs(interp, 2, objv, "?dirList?");
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?dirList?");
return TCL_ERROR;
}
if (objc == 2) {
if (objc == 1) {
Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath());
return TCL_OK;
}
dirListObj = objv[2];
dirListObj = objv[1];
if (Tcl_SetEncodingSearchPath(dirListObj) == TCL_ERROR) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected directory list but got \"%s\"",
TclGetString(dirListObj)));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "ENCODING", "BADPATH",
NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, dirListObj);
return TCL_OK;
}
/*
*-----------------------------------------------------------------------------
*
* EncodingNamesObjCmd --
*
* This command returns a list of the available encoding names
*
* Results:
* Returns a standard Tcl result
*
*-----------------------------------------------------------------------------
*/
int
EncodingNamesObjCmd(ClientData dummy, /* Unused */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
Tcl_GetEncodingNames(interp);
return TCL_OK;
}
/*
*-----------------------------------------------------------------------------
*
* EncodingSystemObjCmd --
*
* This command retrieves or changes the system encoding
*
* Results:
* Returns a standard Tcl result
*
* Side effects:
* May change the system encoding.
*
*-----------------------------------------------------------------------------
*/
int
EncodingSystemObjCmd(ClientData dummy, /* Unused */
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Number of command line args */
Tcl_Obj* const objv[]) /* Vector of command line args */
{
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?encoding?");
return TCL_ERROR;
}
if (objc == 1) {
Tcl_SetObjResult(interp,
Tcl_NewStringObj(Tcl_GetEncodingName(NULL), -1));
} else {
return Tcl_SetSystemEncoding(interp, TclGetString(objv[1]));
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* Tcl_ErrorObjCmd --
*
* This procedure is invoked to process the "error" Tcl command. See the
|
| ︙ | | |
Changes to generic/tclCmdIL.c.
| ︙ | | |
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
|
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
|
-
+
|
const char *libDirName;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
libDirName = Tcl_GetVar2(interp, "tcl_library", NULL, TCL_GLOBAL_ONLY);
libDirName = Tcl_GetVar(interp, "tcl_library", TCL_GLOBAL_ONLY);
if (libDirName != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(libDirName, -1));
return TCL_OK;
}
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"no library has been specified for Tcl", -1));
|
| ︙ | | |
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
|
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
|
-
+
|
const char *patchlevel;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
patchlevel = Tcl_GetVar2(interp, "tcl_patchLevel", NULL,
patchlevel = Tcl_GetVar(interp, "tcl_patchLevel",
(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG));
if (patchlevel != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(patchlevel, -1));
return TCL_OK;
}
return TCL_ERROR;
}
|
| ︙ | | |
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
|
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
|
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
|
int
Tcl_JoinObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
int listLen;
Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
int listLen, i;
Tcl_Obj *resObjPtr, *joinObjPtr, **elemPtrs;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?");
return TCL_ERROR;
}
/*
* Make sure the list argument is a list object and get its length and a
* pointer to its array of element pointers.
*/
if (TclListObjGetElements(interp, objv[1], &listLen,
&elemPtrs) != TCL_OK) {
return TCL_ERROR;
}
if (listLen == 0) {
/* No elements to join; default empty result is correct. */
return TCL_OK;
}
if (listLen == 1) {
/* One element; return it */
Tcl_SetObjResult(interp, elemPtrs[0]);
return TCL_OK;
}
joinObjPtr = (objc == 2) ? Tcl_NewStringObj(" ", 1) : objv[2];
Tcl_IncrRefCount(joinObjPtr);
if (Tcl_GetCharLength(joinObjPtr) == 0) {
TclStringCatObjv(interp, /* inPlace */ 0, listLen, elemPtrs,
&resObjPtr);
} else {
int i;
resObjPtr = Tcl_NewObj();
for (i = 0; i < listLen; i++) {
if (i > 0) {
resObjPtr = Tcl_NewObj();
for (i = 0; i < listLen; i++) {
if (i > 0) {
/*
* NOTE: This code is relying on Tcl_AppendObjToObj() **NOT**
* to shimmer joinObjPtr. If it did, then the case where
* objv[1] and objv[2] are the same value would not be safe.
* Accessing elemPtrs would crash.
*/
/*
* NOTE: This code is relying on Tcl_AppendObjToObj() **NOT**
* to shimmer joinObjPtr. If it did, then the case where
* objv[1] and objv[2] are the same value would not be safe.
* Accessing elemPtrs would crash.
*/
Tcl_AppendObjToObj(resObjPtr, joinObjPtr);
}
Tcl_AppendObjToObj(resObjPtr, elemPtrs[i]);
}
Tcl_AppendObjToObj(resObjPtr, joinObjPtr);
}
Tcl_AppendObjToObj(resObjPtr, elemPtrs[i]);
}
}
Tcl_DecrRefCount(joinObjPtr);
if (resObjPtr) {
Tcl_SetObjResult(interp, resObjPtr);
return TCL_OK;
Tcl_SetObjResult(interp, resObjPtr);
return TCL_OK;
}
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* Tcl_LassignObjCmd --
*
|
| ︙ | | |
Changes to generic/tclCmdMZ.c.
| ︙ | | |
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
-
+
|
numMatchesSaved, eflags);
if (match < 0) {
return TCL_ERROR;
}
if (match == 0) {
/*
* We want to set the value of the interpreter result only when
* We want to set the value of the intepreter result only when
* this is the first time through the loop.
*/
if (all <= 1) {
/*
* If inlining, the interpreter's object result remains an
* empty list, otherwise set it to an integer object w/ value
|
| ︙ | | |
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
|
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
|
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
|
static int
StringFirstCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_UniChar *needleStr, *haystackStr;
int start = 0;
int match, start, needleLen, haystackLen;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
"needleString haystackString ?startIndex?");
return TCL_ERROR;
}
/*
* We are searching haystackStr for the sequence needleStr.
*/
match = -1;
start = 0;
haystackLen = -1;
needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen);
haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen);
if (objc == 4) {
int size = Tcl_GetCharLength(objv[2]);
/*
* If a startIndex is specified, we will need to fast forward to that
* point in the string before we think about a match.
*/
if (TCL_OK != TclGetIntForIndexM(interp, objv[3], size - 1, &start)) {
if (TclGetIntForIndexM(interp, objv[3], haystackLen-1,
&start) != TCL_OK){
return TCL_ERROR;
}
/*
* Reread to prevent shimmering problems.
*/
needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen);
haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen);
if (start >= haystackLen) {
goto str_first_done;
} else if (start > 0) {
haystackStr += start;
haystackLen -= start;
if (start < 0) {
} else if (start < 0) {
/*
* Invalid start index mapped to string start; Bug #423581
*/
start = 0;
}
}
if (start >= size) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
return TCL_OK;
}
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(TclStringFind(objv[1],
/*
* If the length of the needle is more than the length of the haystack, it
* cannot be contained in there so we can avoid searching. [Bug 2960021]
*/
if (needleLen > 0 && needleLen <= haystackLen) {
register Tcl_UniChar *p, *end;
end = haystackStr + haystackLen - needleLen + 1;
for (p = haystackStr; p < end; p++) {
/*
* Scan forward to find the first character.
*/
if ((*p == *needleStr) && (TclUniCharNcmp(needleStr, p,
(unsigned long) needleLen) == 0)) {
match = p - haystackStr;
break;
}
}
}
/*
* Compute the character index of the matching string by counting the
* number of characters before the match.
*/
if ((match != -1) && (objc == 4)) {
match += start;
}
str_first_done:
Tcl_SetObjResult(interp, Tcl_NewIntObj(match));
objv[2], start)));
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* StringLastCmd --
|
| ︙ | | |
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
|
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
|
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
|
static int
StringLastCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_UniChar *needleStr, *haystackStr, *p;
int last = INT_MAX - 1;
int match, start, needleLen, haystackLen;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 1, objv,
"needleString haystackString ?lastIndex?");
"needleString haystackString ?startIndex?");
return TCL_ERROR;
}
/*
* We are searching haystackString for the sequence needleString.
*/
match = -1;
start = 0;
haystackLen = -1;
needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen);
haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen);
if (objc == 4) {
int size = Tcl_GetCharLength(objv[2]);
/*
* If a startIndex is specified, we will need to restrict the string
* range to that char index in the string
*/
if (TCL_OK != TclGetIntForIndexM(interp, objv[3], size - 1, &last)) {
if (TclGetIntForIndexM(interp, objv[3], haystackLen-1,
&start) != TCL_OK){
return TCL_ERROR;
}
/*
* Reread to prevent shimmering problems.
*/
if (last < 0) {
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
return TCL_OK;
}
if (last >= size) {
last = size - 1;
}
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(TclStringLast(objv[1],
needleStr = Tcl_GetUnicodeFromObj(objv[1], &needleLen);
haystackStr = Tcl_GetUnicodeFromObj(objv[2], &haystackLen);
if (start < 0) {
goto str_last_done;
} else if (start < haystackLen) {
p = haystackStr + start + 1 - needleLen;
} else {
p = haystackStr + haystackLen - needleLen;
}
} else {
p = haystackStr + haystackLen - needleLen;
}
/*
* If the length of the needle is more than the length of the haystack, it
* cannot be contained in there so we can avoid searching. [Bug 2960021]
*/
if (needleLen > 0 && needleLen <= haystackLen) {
for (; p >= haystackStr; p--) {
/*
* Scan backwards to find the first character.
*/
if ((*p == *needleStr) && !memcmp(needleStr, p,
sizeof(Tcl_UniChar) * (size_t)needleLen)) {
match = p - haystackStr;
break;
}
}
}
str_last_done:
Tcl_SetObjResult(interp, Tcl_NewIntObj(match));
objv[2], last)));
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* StringIndexCmd --
|
| ︙ | | |
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
|
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
|
-
+
|
string, NULL);
return TCL_ERROR;
}
}
/*
* This test is tricky, but has to be that way or you get other strange
* inconsistencies (see test string-10.20.1 for illustration why!)
* inconsistencies (see test string-10.20 for illustration why!)
*/
if (objv[objc-2]->typePtr == &tclDictType && objv[objc-2]->bytes == NULL){
int i, done;
Tcl_DictSearch search;
/*
|
| ︙ | | |
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
|
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
|
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
static int
StringReptCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *string1;
char *string2;
int count;
int count, index, length1, length2;
Tcl_Obj *resultPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "string count");
return TCL_ERROR;
}
if (TclGetIntFromObj(interp, objv[2], &count) != TCL_OK) {
return TCL_ERROR;
}
/*
* Check for cases that allow us to skip copying stuff.
*/
if (count == 1) {
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
goto done;
} else if (count < 1) {
goto done;
}
string1 = TclGetStringFromObj(objv[1], &length1);
if (length1 <= 0) {
goto done;
}
/*
* Only build up a string that has data. Instead of building it up with
* repeated appends, we just allocate the necessary space once and copy
* the string value in.
*
* We have to worry about overflow [Bugs 714106, 2561746].
* At this point we know 1 <= length1 <= INT_MAX and 2 <= count <= INT_MAX.
* We need to keep 2 <= length2 <= INT_MAX.
*/
if (count > INT_MAX/length1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"result exceeds max size for a Tcl value (%d bytes)",
INT_MAX));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_OK;
return TCL_ERROR;
}
length2 = length1 * count;
/*
* Include space for the NUL.
*/
if (TCL_OK != TclStringRepeat(interp, objv[1], count, &resultPtr)) {
string2 = attemptckalloc((unsigned) length2 + 1);
if (string2 == NULL) {
/*
* Alloc failed. Note that in this case we try to do an error message
* since this is a case that's most likely when the alloc is large and
* that's easy to do with this API. Note that if we fail allocating a
* short string, this will likely keel over too (and fatally).
*/
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"string size overflow, out of memory allocating %u bytes",
length2 + 1));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
}
for (index = 0; index < count; index++) {
memcpy(string2 + (length1 * index), string1, (size_t) length1);
}
string2[length2] = '\0';
/*
* We have to directly assign this instead of using Tcl_SetStringObj (and
* indirectly TclInitStringRep) because that makes another copy of the
* data.
*/
TclNewObj(resultPtr);
resultPtr->bytes = string2;
resultPtr->length = length2;
Tcl_SetObjResult(interp, resultPtr);
done:
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* StringRplcCmd --
|
| ︙ | | |
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
|
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
|
-
+
+
+
+
-
+
-
-
-
+
+
+
-
-
+
-
-
+
-
-
+
|
static int
StringCatCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int code;
int i;
Tcl_Obj *objResultPtr;
if (objc < 2) {
/*
* If there are no args, the result is an empty object.
* Just leave the preset empty interp result.
*/
return TCL_OK;
}
if (objc == 2) {
/*
* Other trivial case, single arg, just return it.
*/
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
}
objResultPtr = objv[1];
if (Tcl_IsShared(objResultPtr)) {
objResultPtr = Tcl_DuplicateObj(objResultPtr);
}
code = TclStringCatObjv(interp, /* inPlace */ 1, objc-1, objv+1,
&objResultPtr);
for(i = 2;i < objc;i++) {
Tcl_AppendObjToObj(objResultPtr, objv[i]);
}
if (code == TCL_OK) {
Tcl_SetObjResult(interp, objResultPtr);
Tcl_SetObjResult(interp, objResultPtr);
return TCL_OK;
}
return code;
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* StringBytesCmd --
*
|
| ︙ | | |
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
|
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
|
-
+
|
commonHandler:
if (Tcl_ListObjLength(interp, objv[i+2], &dummy) != TCL_OK) {
Tcl_DecrRefCount(handlersObj);
return TCL_ERROR;
}
info[0] = objv[i]; /* type */
TclNewLongObj(info[1], code); /* returnCode */
TclNewIntObj(info[1], code); /* returnCode */
if (info[2] == NULL) { /* errorCodePrefix */
TclNewObj(info[2]);
}
info[3] = objv[i+2]; /* bindVariables */
info[4] = objv[i+3]; /* script */
bodyShared = !strcmp(TclGetString(objv[i+3]), "-");
|
| ︙ | | |
Changes to generic/tclCompCmds.c.
| ︙ | | |
729
730
731
732
733
734
735
736
737
738
739
740
741
742
|
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
Emit14Inst( INST_STORE_SCALAR, resultIndex, envPtr);
}
TclEmitOpcode( INST_POP, envPtr);
TclCheckStackDepth(depth+1, envPtr);
return TCL_OK;
}
/*----------------------------------------------------------------------
*
* TclCompileClockClicksCmd --
*
* Procedure called to compile the "tcl::clock::clicks" command.
*
* Results:
* Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
* evaluation to run time.
*
* Side effects:
* Instructions are added to envPtr to execute the "clock clicks"
* command at runtime.
*
*----------------------------------------------------------------------
*/
int
TclCompileClockClicksCmd(
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token* tokenPtr;
switch (parsePtr->numWords) {
case 1:
/*
* No args
*/
TclEmitInstInt1(INST_CLOCK_READ, 0, envPtr);
break;
case 2:
/*
* -milliseconds or -microseconds
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD
|| tokenPtr[1].size < 4
|| tokenPtr[1].size > 13) {
return TCL_ERROR;
} else if (!strncmp(tokenPtr[1].start, "-microseconds",
tokenPtr[1].size)) {
TclEmitInstInt1(INST_CLOCK_READ, 1, envPtr);
break;
} else if (!strncmp(tokenPtr[1].start, "-milliseconds",
tokenPtr[1].size)) {
TclEmitInstInt1(INST_CLOCK_READ, 2, envPtr);
break;
} else {
return TCL_ERROR;
}
default:
return TCL_ERROR;
}
return TCL_OK;
}
/*----------------------------------------------------------------------
*
* TclCompileClockReadingCmd --
*
* Procedure called to compile the "tcl::clock::microseconds",
* "tcl::clock::milliseconds" and "tcl::clock::seconds" commands.
*
* Results:
* Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
* evaluation to run time.
*
* Side effects:
* Instructions are added to envPtr to execute the "clock clicks"
* command at runtime.
*
* Client data is 1 for microseconds, 2 for milliseconds, 3 for seconds.
*----------------------------------------------------------------------
*/
int
TclCompileClockReadingCmd(
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
if (parsePtr->numWords != 1) {
return TCL_ERROR;
}
TclEmitInstInt1(INST_CLOCK_READ, PTR2INT(cmdPtr->objClientData), envPtr);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TclCompileConcatCmd --
*
* Procedure called to compile the "concat" command.
|
| ︙ | | |
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
|
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
|
-
+
|
Tcl_Obj **objs;
const char *bytes;
int len;
Tcl_ListObjGetElements(NULL, listObj, &len, &objs);
objPtr = Tcl_ConcatObj(len, objs);
Tcl_DecrRefCount(listObj);
bytes = TclGetStringFromObj(objPtr, &len);
bytes = Tcl_GetStringFromObj(objPtr, &len);
PushLiteral(envPtr, bytes, len);
Tcl_DecrRefCount(objPtr);
return TCL_OK;
}
/*
* General case: runtime concat.
|
| ︙ | | |
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
|
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
|
-
+
|
Tcl_DecrRefCount(valueObj);
}
/*
* We did! Excellent. The "verifyDict" is to do type forcing.
*/
bytes = TclGetStringFromObj(dictObj, &len);
bytes = Tcl_GetStringFromObj(dictObj, &len);
PushLiteral(envPtr, bytes, len);
TclEmitOpcode( INST_DUP, envPtr);
TclEmitOpcode( INST_DICT_VERIFY, envPtr);
Tcl_DecrRefCount(dictObj);
return TCL_OK;
/*
|
| ︙ | | |
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
|
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
|
-
+
|
for (j = 0; j < numVars; j++) {
Tcl_Obj *varNameObj;
const char *bytes;
int numBytes, varIndex;
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
bytes = TclGetStringFromObj(varNameObj, &numBytes);
bytes = Tcl_GetStringFromObj(varNameObj, &numBytes);
varIndex = LocalScalar(bytes, numBytes, envPtr);
if (varIndex < 0) {
code = TCL_ERROR;
goto done;
}
varListPtr->varIndexes[j] = varIndex;
}
|
| ︙ | | |
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
|
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
|
-
+
|
}
/*
* Not an error, always a constant result, so just push the result as a
* literal. Job done.
*/
bytes = TclGetStringFromObj(tmpObj, &len);
bytes = Tcl_GetStringFromObj(tmpObj, &len);
PushLiteral(envPtr, bytes, len);
Tcl_DecrRefCount(tmpObj);
return TCL_OK;
checkForStringConcatCase:
/*
* See if we can generate a sequence of things to concatenate. This
|
| ︙ | | |
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
|
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
|
-
+
|
* being built. */
for (bytes = start ; *bytes ; bytes++) {
if (*bytes == '%') {
Tcl_AppendToObj(tmpObj, start, bytes - start);
if (*++bytes == '%') {
Tcl_AppendToObj(tmpObj, "%", 1);
} else {
char *b = TclGetStringFromObj(tmpObj, &len);
char *b = Tcl_GetStringFromObj(tmpObj, &len);
/*
* If there is a non-empty literal from the format string,
* push it and reset.
*/
if (len > 0) {
|
| ︙ | | |
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
|
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
|
-
+
|
}
/*
* Handle the case of a trailing literal.
*/
Tcl_AppendToObj(tmpObj, start, bytes - start);
bytes = TclGetStringFromObj(tmpObj, &len);
bytes = Tcl_GetStringFromObj(tmpObj, &len);
if (len > 0) {
PushLiteral(envPtr, bytes, len);
i++;
}
Tcl_DecrRefCount(tmpObj);
Tcl_DecrRefCount(formatObj);
|
| ︙ | | |
Changes to generic/tclCompCmdsGR.c.
| ︙ | | |
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
|
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
|
-
+
|
}
/*
* Next, higher-level checks. Is the RE a very simple glob? Is the
* replacement "simple"?
*/
bytes = TclGetStringFromObj(patternObj, &len);
bytes = Tcl_GetStringFromObj(patternObj, &len);
if (TclReToGlob(NULL, bytes, len, &pattern, &exact, &quantified)
!= TCL_OK || exact || quantified) {
goto done;
}
bytes = Tcl_DStringValue(&pattern);
if (*bytes++ != '*') {
goto done;
|
| ︙ | | |
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
|
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
|
-
+
|
/*
* Proved the simplicity constraints! Time to issue the code.
*/
result = TCL_OK;
bytes = Tcl_DStringValue(&pattern) + 1;
PushLiteral(envPtr, bytes, len);
bytes = TclGetStringFromObj(replacementObj, &len);
bytes = Tcl_GetStringFromObj(replacementObj, &len);
PushLiteral(envPtr, bytes, len);
CompileWord(envPtr, stringTokenPtr, interp, parsePtr->numWords-2);
TclEmitOpcode( INST_STR_MAP, envPtr);
done:
Tcl_DStringFree(&pattern);
if (patternObj) {
|
| ︙ | | |
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
|
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
|
-
+
|
CompileEnv *envPtr)
{
Tcl_Obj *msg = Tcl_GetObjResult(interp);
int numBytes;
const char *bytes = TclGetStringFromObj(msg, &numBytes);
TclErrorStackResetIf(interp, bytes, numBytes);
TclEmitPush(TclRegisterLiteral(envPtr, bytes, numBytes, 0), envPtr);
TclEmitPush(TclRegisterNewLiteral(envPtr, bytes, numBytes), envPtr);
CompileReturnInternal(envPtr, INST_SYNTAX, TCL_ERROR, 0,
TclNoErrorStack(interp, Tcl_GetReturnOptions(interp, TCL_ERROR)));
Tcl_ResetResult(interp);
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
Changes to generic/tclCompCmdsSZ.c.
| ︙ | | |
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
-
+
-
+
|
} else {
folded = obj;
}
} else {
Tcl_DecrRefCount(obj);
if (folded) {
int len;
const char *bytes = TclGetStringFromObj(folded, &len);
const char *bytes = Tcl_GetStringFromObj(folded, &len);
PushLiteral(envPtr, bytes, len);
Tcl_DecrRefCount(folded);
folded = NULL;
numArgs ++;
}
CompileWord(envPtr, wordTokenPtr, interp, i);
numArgs ++;
if (numArgs >= 254) { /* 254 to take care of the possible +1 of "folded" above */
TclEmitInstInt1(INST_STR_CONCAT1, numArgs, envPtr);
numArgs = 1; /* concat pushes 1 obj, the result */
}
}
wordTokenPtr = TokenAfter(wordTokenPtr);
}
if (folded) {
int len;
const char *bytes = TclGetStringFromObj(folded, &len);
const char *bytes = Tcl_GetStringFromObj(folded, &len);
PushLiteral(envPtr, bytes, len);
Tcl_DecrRefCount(folded);
folded = NULL;
numArgs ++;
}
if (numArgs > 1) {
|
| ︙ | | |
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
|
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
|
-
+
-
+
|
/*
* Now issue the opcodes. Note that in the case that we know that the
* first word is an empty word, we don't issue the map at all. That is the
* correct semantics for mapping.
*/
bytes = TclGetStringFromObj(objv[0], &len);
bytes = Tcl_GetStringFromObj(objv[0], &len);
if (len == 0) {
CompileWord(envPtr, stringTokenPtr, interp, 2);
} else {
PushLiteral(envPtr, bytes, len);
bytes = TclGetStringFromObj(objv[1], &len);
bytes = Tcl_GetStringFromObj(objv[1], &len);
PushLiteral(envPtr, bytes, len);
CompileWord(envPtr, stringTokenPtr, interp, 2);
OP(STR_MAP);
}
Tcl_DecrRefCount(mapObj);
return TCL_OK;
}
|
| ︙ | | |
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
|
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
|
-
-
+
+
-
+
|
int length, literal, catchRange, breakJump;
char buf[TCL_UTF_MAX];
JumpFixup startFixup, okFixup, returnFixup, breakFixup;
JumpFixup continueFixup, otherFixup, endFixup;
switch (tokenPtr->type) {
case TCL_TOKEN_TEXT:
literal = TclRegisterLiteral(envPtr,
tokenPtr->start, tokenPtr->size, 0);
literal = TclRegisterNewLiteral(envPtr,
tokenPtr->start, tokenPtr->size);
TclEmitPush(literal, envPtr);
TclAdvanceLines(&bline, tokenPtr->start,
tokenPtr->start + tokenPtr->size);
count++;
continue;
case TCL_TOKEN_BS:
length = TclParseBackslash(tokenPtr->start, tokenPtr->size,
NULL, buf);
literal = TclRegisterLiteral(envPtr, buf, length, 0);
literal = TclRegisterNewLiteral(envPtr, buf, length);
TclEmitPush(literal, envPtr);
count++;
continue;
case TCL_TOKEN_VARIABLE:
/*
* Check for simple variable access; see if we can only generate
* TCL_OK or TCL_ERROR from the substituted variable read; if so,
|
| ︙ | | |
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
|
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
|
-
-
-
-
+
+
+
+
|
TclAdvanceContinuations(&bline, &clNext, bytes - envPtr->source);
numBytes -= (bytes - prevBytes);
numWords++;
}
if (numWords % 2) {
abort:
ckfree(bodyToken);
ckfree(bodyTokenArray);
ckfree(bodyLines);
ckfree(bodyContLines);
ckfree((char *) bodyToken);
ckfree((char *) bodyTokenArray);
ckfree((char *) bodyLines);
ckfree((char *) bodyContLines);
return TCL_ERROR;
}
} else if (numWords % 2 || numWords == 0) {
/*
* Odd number of words (>1) available, or no words at all available.
* Both are error cases, so punt and let the interpreted-version
* generate the error message. Note that the second case probably
|
| ︙ | | |
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
|
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
|
-
+
-
+
|
if (Tcl_ListObjGetElements(NULL, tmpObj, &objc, &objv) != TCL_OK
|| (objc > 2)) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
}
if (objc > 0) {
int len;
const char *varname = TclGetStringFromObj(objv[0], &len);
const char *varname = Tcl_GetStringFromObj(objv[0], &len);
resultVarIndices[i] = LocalScalar(varname, len, envPtr);
if (resultVarIndices[i] < 0) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
}
} else {
resultVarIndices[i] = -1;
}
if (objc == 2) {
int len;
const char *varname = TclGetStringFromObj(objv[1], &len);
const char *varname = Tcl_GetStringFromObj(objv[1], &len);
optionVarIndices[i] = LocalScalar(varname, len, envPtr);
if (optionVarIndices[i] < 0) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
}
} else {
|
| ︙ | | |
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
|
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
|
-
+
|
*/
LOAD( optionsVar);
PUSH( "-errorcode");
OP4( DICT_GET, 1);
TclAdjustStackDepth(-1, envPtr);
OP44( LIST_RANGE_IMM, 0, len-1);
p = TclGetStringFromObj(matchClauses[i], &len);
p = Tcl_GetStringFromObj(matchClauses[i], &len);
PushLiteral(envPtr, p, len);
OP( STR_EQ);
JUMP4( JUMP_FALSE, notECJumpSource);
} else {
notECJumpSource = -1; /* LINT */
}
OP( POP);
|
| ︙ | | |
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
|
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
|
-
+
|
*/
LOAD( optionsVar);
PUSH( "-errorcode");
OP4( DICT_GET, 1);
TclAdjustStackDepth(-1, envPtr);
OP44( LIST_RANGE_IMM, 0, len-1);
p = TclGetStringFromObj(matchClauses[i], &len);
p = Tcl_GetStringFromObj(matchClauses[i], &len);
PushLiteral(envPtr, p, len);
OP( STR_EQ);
JUMP4( JUMP_FALSE, notECJumpSource);
} else {
notECJumpSource = -1; /* LINT */
}
OP( POP);
|
| ︙ | | |
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
|
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
|
-
+
|
}
return TCL_ERROR;
}
if (varCount == 0) {
const char *bytes;
int len;
bytes = TclGetStringFromObj(leadingWord, &len);
bytes = Tcl_GetStringFromObj(leadingWord, &len);
if (i == 1 && len == 11 && !strncmp("-nocomplain", bytes, 11)) {
flags = 0;
haveFlags++;
} else if (i == (2 - flags) && len == 2 && !strncmp("--", bytes, 2)) {
haveFlags++;
} else {
varCount++;
|
| ︙ | | |
Changes to generic/tclCompExpr.c.
| ︙ | | |
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
|
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
|
+
+
-
+
+
-
+
|
OpNode *nodes,
int index,
Tcl_Obj *const **litObjvPtr)
{
CompileEnv *envPtr;
ByteCode *byteCodePtr;
int code;
Tcl_Obj *byteCodeObj = Tcl_NewObj();
NRE_callback *rootPtr = TOP_CB(interp);
/*
* Note we are compiling an expression with literal arguments. This means
* there can be no [info frame] calls when we execute the resulting
* bytecode, so there's no need to tend to TIP 280 issues.
*/
envPtr = TclStackAlloc(interp, sizeof(CompileEnv));
TclInitCompileEnv(interp, envPtr, NULL, 0, NULL, 0);
CompileExprTree(interp, nodes, index, litObjvPtr, NULL, NULL, envPtr,
0 /* optimize */);
TclEmitOpcode(INST_DONE, envPtr);
Tcl_IncrRefCount(byteCodeObj);
byteCodePtr = TclInitByteCode(envPtr);
TclInitByteCodeObj(byteCodeObj, envPtr);
TclFreeCompileEnv(envPtr);
TclStackFree(interp, envPtr);
byteCodePtr = byteCodeObj->internalRep.twoPtrValue.ptr1;
TclNRExecuteByteCode(interp, byteCodePtr);
code = TclNRRunCallbacks(interp, TCL_OK, rootPtr);
TclReleaseByteCode(byteCodePtr);
Tcl_DecrRefCount(byteCodeObj);
return code;
}
/*
*----------------------------------------------------------------------
*
* CompileExprTree --
|
| ︙ | | |
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
|
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
|
-
+
-
+
|
int length;
Tcl_DStringInit(&cmdName);
TclDStringAppendLiteral(&cmdName, "tcl::mathfunc::");
p = TclGetStringFromObj(*funcObjv, &length);
funcObjv++;
Tcl_DStringAppend(&cmdName, p, length);
TclEmitPush(TclRegisterLiteral(envPtr,
TclEmitPush(TclRegisterNewCmdLiteral(envPtr,
Tcl_DStringValue(&cmdName),
Tcl_DStringLength(&cmdName), LITERAL_CMD_NAME), envPtr);
Tcl_DStringLength(&cmdName)), envPtr);
Tcl_DStringFree(&cmdName);
/*
* Start a count of the number of words in this function
* command invocation. In case there's already a count in
* progress (nested functions), save it in our unused "left"
* field for restoring later.
|
| ︙ | | |
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
|
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
|
-
-
+
+
-
-
+
+
|
break;
case AND:
case OR:
CLANG_ASSERT(jumpPtr);
pc1 = CurrentOffset(envPtr);
TclEmitInstInt1((nodePtr->lexeme == AND) ? INST_JUMP_FALSE1
: INST_JUMP_TRUE1, 0, envPtr);
TclEmitPush(TclRegisterLiteral(envPtr,
(nodePtr->lexeme == AND) ? "1" : "0", 1, 0), envPtr);
TclEmitPush(TclRegisterNewLiteral(envPtr,
(nodePtr->lexeme == AND) ? "1" : "0", 1), envPtr);
pc2 = CurrentOffset(envPtr);
TclEmitInstInt1(INST_JUMP1, 0, envPtr);
TclAdjustStackDepth(-1, envPtr);
TclStoreInt1AtPtr(CurrentOffset(envPtr) - pc1,
envPtr->codeStart + pc1 + 1);
if (TclFixupForwardJumpToHere(envPtr, &jumpPtr->jump, 127)) {
pc2 += 3;
}
TclEmitPush(TclRegisterLiteral(envPtr,
(nodePtr->lexeme == AND) ? "0" : "1", 1, 0), envPtr);
TclEmitPush(TclRegisterNewLiteral(envPtr,
(nodePtr->lexeme == AND) ? "0" : "1", 1), envPtr);
TclStoreInt1AtPtr(CurrentOffset(envPtr) - pc2,
envPtr->codeStart + pc2 + 1);
convert = 0;
freePtr = jumpPtr;
jumpPtr = jumpPtr->next;
TclStackFree(interp, freePtr);
break;
|
| ︙ | | |
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
|
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
|
-
+
|
case OT_LITERAL: {
Tcl_Obj *const *litObjv = *litObjvPtr;
Tcl_Obj *literal = *litObjv;
if (optimize) {
int length;
const char *bytes = TclGetStringFromObj(literal, &length);
int index = TclRegisterLiteral(envPtr, bytes, length, 0);
int index = TclRegisterNewLiteral(envPtr, bytes, length);
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
/*
* Would like to do this:
*
* lePtr->objPtr = literal;
|
| ︙ | | |
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
|
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
|
-
-
+
+
|
* Don't generate a string rep, but if we have one
* already, then use it to share via the literal table.
*/
if (objPtr->bytes) {
Tcl_Obj *tableValue;
index = TclRegisterLiteral(envPtr, objPtr->bytes,
objPtr->length, 0);
index = TclRegisterNewLiteral(envPtr, objPtr->bytes,
objPtr->length);
tableValue = TclFetchLiteral(envPtr, index);
if ((tableValue->typePtr == NULL) &&
(objPtr->typePtr != NULL)) {
/*
* Same intrep surgery as for OT_LITERAL.
*/
|
| ︙ | | |
Changes to generic/tclCompile.c.
| ︙ | | |
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
|
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
|
+
+
+
+
+
-
-
|
* Stack: ... elem list => ... listVarContents */
{"lappendListArrayStk", 1, -2, 0, {OPERAND_NONE}},
/* Lappend list to array element.
* Stack: ... arrayName elem list => ... listVarContents */
{"lappendListStk", 1, -1, 0, {OPERAND_NONE}},
/* Lappend list to general variable.
* Stack: ... varName list => ... listVarContents */
{"clockRead", 2, +1, 1, {OPERAND_UINT1}},
/* Read clock out to the stack. Operand is which clock to read
* 0=clicks, 1=microseconds, 2=milliseconds, 3=seconds.
* Stack: ... => ... time */
{NULL, 0, 0, 0, {OPERAND_NONE}}
};
/*
* Prototypes for procedures defined later in this file:
*/
static void CleanupByteCode(ByteCode *codePtr);
static ByteCode * CompileSubstObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
int flags);
static void DupByteCodeInternalRep(Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr);
static unsigned char * EncodeCmdLocMap(CompileEnv *envPtr,
ByteCode *codePtr, unsigned char *startPtr);
static void EnterCmdExtentData(CompileEnv *envPtr,
int cmdNumber, int numSrcBytes, int numCodeBytes);
static void EnterCmdStartData(CompileEnv *envPtr,
int cmdNumber, int srcOffset, int codeOffset);
static void FreeByteCodeInternalRep(Tcl_Obj *objPtr);
static void FreeSubstCodeInternalRep(Tcl_Obj *objPtr);
static int GetCmdLocEncodingSize(CompileEnv *envPtr);
static int IsCompactibleCompileEnv(Tcl_Interp *interp,
CompileEnv *envPtr);
static void PreventCycle(Tcl_Obj *objPtr, CompileEnv *envPtr);
#ifdef TCL_COMPILE_STATS
static void RecordByteCodeStats(ByteCode *codePtr);
#endif /* TCL_COMPILE_STATS */
static int SetByteCodeFromAny(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static void StartExpanding(CompileEnv *envPtr);
|
| ︙ | | |
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
|
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
|
-
-
+
-
+
-
|
Tcl_Obj *objPtr, /* The object to make a ByteCode object. */
CompileHookProc *hookProc, /* Procedure to invoke after compilation. */
ClientData clientData) /* Hook procedure private data. */
{
Interp *iPtr = (Interp *) interp;
CompileEnv compEnv; /* Compilation environment structure allocated
* in frame. */
size_t length;
int result = TCL_OK;
int length, result = TCL_OK;
const char *stringPtr;
Proc *procPtr = iPtr->compiledProcPtr;
ContLineLoc *clLocPtr;
#ifdef TCL_COMPILE_DEBUG
if (!traceInitialized) {
if (Tcl_LinkVar(interp, "tcl_traceCompile",
(char *) &tclTraceCompile, TCL_LINK_INT) != TCL_OK) {
Tcl_Panic("SetByteCodeFromAny: unable to create link for tcl_traceCompile variable");
}
traceInitialized = 1;
}
#endif
stringPtr = TclGetString(objPtr);
stringPtr = TclGetStringFromObj(objPtr, &length);
length = objPtr->length;
/*
* TIP #280: Pick up the CmdFrame in which the BC compiler was invoked and
* use to initialize the tracking in the compiler. This information was
* stored by TclCompEvalObj and ProcCompileProc.
*/
|
| ︙ | | |
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
|
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
|
-
+
|
*/
#ifdef TCL_COMPILE_DEBUG
TclVerifyLocalLiteralTable(&compEnv);
#endif /*TCL_COMPILE_DEBUG*/
if (result == TCL_OK) {
(void) TclInitByteCodeObj(objPtr, &tclByteCodeType, &compEnv);
TclInitByteCodeObj(objPtr, &compEnv);
#ifdef TCL_COMPILE_DEBUG
if (tclTraceCompile >= 2) {
TclPrintByteCodeObj(interp, objPtr);
fflush(stdout);
}
#endif /* TCL_COMPILE_DEBUG */
}
|
| ︙ | | |
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
|
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
|
+
+
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
|
static void
FreeByteCodeInternalRep(
register Tcl_Obj *objPtr) /* Object whose internal rep to free. */
{
register ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->typePtr = NULL;
if (codePtr->refCount-- <= 1) {
TclReleaseByteCode(codePtr);
TclCleanupByteCode(codePtr);
}
}
/*
*----------------------------------------------------------------------
*
* TclReleaseByteCode --
* TclCleanupByteCode --
*
* This procedure does all the real work of freeing up a bytecode
* object's ByteCode structure. It's called only when the structure's
* reference count becomes zero.
*
* Results:
* None.
*
* Side effects:
* Frees objPtr's bytecode internal representation and sets its type NULL
* Also releases its literals and frees its auxiliary data items.
*
*----------------------------------------------------------------------
*/
void
TclPreserveByteCode(
register ByteCode *codePtr)
{
codePtr->refCount++;
}
void
TclReleaseByteCode(
register ByteCode *codePtr)
{
if (codePtr->refCount-- > 1) {
return;
}
/* Just dropped to refcount==0. Clean up. */
CleanupByteCode(codePtr);
}
static void
CleanupByteCode(
TclCleanupByteCode(
register ByteCode *codePtr) /* Points to the ByteCode to free. */
{
Tcl_Interp *interp = (Tcl_Interp *) *codePtr->interpHandle;
Interp *iPtr = (Interp *) interp;
int numLitObjects = codePtr->numLitObjects;
int numAuxDataItems = codePtr->numAuxDataItems;
register Tcl_Obj **objArrayPtr, *objPtr;
|
| ︙ | | |
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
|
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
|
+
+
|
* CompileSubstObj --
*
* Compile a Tcl value into ByteCode implementing its substitution, as
* governed by flags.
*
* Results:
* A (ByteCode *) is returned pointing to the resulting ByteCode.
* The caller must manage its refCount and arrange for a call to
* TclCleanupByteCode() when the last reference disappears.
*
* Side effects:
* The Tcl_ObjType of objPtr is changed to the "substcode" type, and the
* ByteCode and governing flags value are kept in the internal rep for
* faster operations the next time CompileSubstObj is called on the same
* value.
*
|
| ︙ | | |
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
|
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
|
-
+
-
+
-
+
+
+
|
if (flags != PTR2INT(objPtr->internalRep.twoPtrValue.ptr2)
|| ((Interp *) *codePtr->interpHandle != iPtr)
|| (codePtr->compileEpoch != iPtr->compileEpoch)
|| (codePtr->nsPtr != nsPtr)
|| (codePtr->nsEpoch != nsPtr->resolverEpoch)
|| (codePtr->localCachePtr !=
iPtr->varFramePtr->localCachePtr)) {
TclFreeIntRep(objPtr);
FreeSubstCodeInternalRep(objPtr);
}
}
if (objPtr->typePtr != &substCodeType) {
CompileEnv compEnv;
int numBytes;
const char *bytes = TclGetStringFromObj(objPtr, &numBytes);
const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes);
/* TODO: Check for more TIP 280 */
TclInitCompileEnv(interp, &compEnv, bytes, numBytes, NULL, 0);
TclSubstCompile(interp, bytes, numBytes, flags, 1, &compEnv);
TclEmitOpcode(INST_DONE, &compEnv);
codePtr = TclInitByteCodeObj(objPtr, &substCodeType, &compEnv);
TclInitByteCodeObj(objPtr, &compEnv);
objPtr->typePtr = &substCodeType;
TclFreeCompileEnv(&compEnv);
codePtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->internalRep.twoPtrValue.ptr1 = codePtr;
objPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(flags);
if (iPtr->varFramePtr->localCachePtr) {
codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr;
codePtr->localCachePtr->refCount++;
}
#ifdef TCL_COMPILE_DEBUG
|
| ︙ | | |
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
|
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
|
+
+
-
+
+
-
+
-
+
-
+
|
static void
FreeSubstCodeInternalRep(
register Tcl_Obj *objPtr) /* Object whose internal rep to free. */
{
register ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->typePtr = NULL;
if (codePtr->refCount-- <= 1) {
TclReleaseByteCode(codePtr);
TclCleanupByteCode(codePtr);
}
}
static void
ReleaseCmdWordData(
ExtCmdLoc *eclPtr)
{
int i;
if (eclPtr->type == TCL_LOCATION_SOURCE) {
Tcl_DecrRefCount(eclPtr->path);
}
for (i=0 ; i<eclPtr->nuloc ; i++) {
ckfree(eclPtr->loc[i].line);
ckfree((char *) eclPtr->loc[i].line);
}
if (eclPtr->loc != NULL) {
ckfree(eclPtr->loc);
ckfree((char *) eclPtr->loc);
}
ckfree(eclPtr);
ckfree((char *) eclPtr);
}
/*
*----------------------------------------------------------------------
*
* TclInitCompileEnv --
*
|
| ︙ | | |
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
|
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
|
-
-
+
+
|
int cmdLitIdx, extraLiteralFlags = LITERAL_CMD_NAME;
cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj);
if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) {
extraLiteralFlags |= LITERAL_UNSHARED;
}
bytes = TclGetStringFromObj(cmdObj, &numBytes);
cmdLitIdx = TclRegisterLiteral(envPtr, bytes, numBytes, extraLiteralFlags);
bytes = Tcl_GetStringFromObj(cmdObj, &numBytes);
cmdLitIdx = TclRegisterLiteral(envPtr, (char *)bytes, numBytes, extraLiteralFlags);
if (cmdPtr) {
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr);
}
TclEmitPush(cmdLitIdx, envPtr);
}
|
| ︙ | | |
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
|
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
|
-
-
+
+
|
SetLineInformation(wordIdx);
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
CompileTokens(envPtr, tokenPtr, interp);
continue;
}
objIdx = TclRegisterLiteral(envPtr,
tokenPtr[1].start, tokenPtr[1].size, 0);
objIdx = TclRegisterNewLiteral(envPtr,
tokenPtr[1].start, tokenPtr[1].size);
if (envPtr->clNext) {
TclContinuationsEnterDerived(TclFetchLiteral(envPtr, objIdx),
tokenPtr[1].start - envPtr->source, envPtr->clNext);
}
TclEmitPush(objIdx, envPtr);
}
|
| ︙ | | |
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
|
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
|
-
-
+
+
|
if (tokenPtr->type == TCL_TOKEN_EXPAND_WORD) {
TclEmitInstInt4(INST_EXPAND_STKTOP,
envPtr->currStackDepth, envPtr);
}
continue;
}
objIdx = TclRegisterLiteral(envPtr,
tokenPtr[1].start, tokenPtr[1].size, 0);
objIdx = TclRegisterNewLiteral(envPtr,
tokenPtr[1].start, tokenPtr[1].size);
if (envPtr->clNext) {
TclContinuationsEnterDerived(TclFetchLiteral(envPtr, objIdx),
tokenPtr[1].start - envPtr->source, envPtr->clNext);
}
TclEmitPush(objIdx, envPtr);
}
|
| ︙ | | |
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
|
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
|
-
-
-
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
|
* "ownership" (i.e., the pointers to) the Tcl objects and aux data items
* will be handed over to the new ByteCode structure from the CompileEnv
* structure.
*
*----------------------------------------------------------------------
*/
static void
PreventCycle(
Tcl_Obj *objPtr,
void
TclInitByteCodeObj(
Tcl_Obj *objPtr, /* Points object that should be initialized,
CompileEnv *envPtr)
{
int i;
* and whose string rep contains the source
for (i = 0; i < envPtr->literalArrayNext; i++) {
if (objPtr == TclFetchLiteral(envPtr, i)) {
/*
* Prevent circular reference where the bytecode intrep of
* a value contains a literal which is that same value.
* If this is allowed to happen, refcount decrements may not
* reach zero, and memory may leak. Bugs 467523, 3357771
*
* NOTE: [Bugs 3392070, 3389764] We make a copy based completely
* on the string value, and do not call Tcl_DuplicateObj() so we
* can be sure we do not have any lingering cycles hiding in
* the intrep.
*/
int numBytes;
const char *bytes = TclGetStringFromObj(objPtr, &numBytes);
Tcl_Obj *copyPtr = Tcl_NewStringObj(bytes, numBytes);
* code. */
Tcl_IncrRefCount(copyPtr);
TclReleaseLiteral((Tcl_Interp *)envPtr->iPtr, objPtr);
envPtr->literalArrayPtr[i].objPtr = copyPtr;
}
}
}
ByteCode *
TclInitByteCode(
register CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
register ByteCode *codePtr;
size_t codeBytes, objArrayBytes, exceptArrayBytes, cmdLocBytes;
size_t auxDataArrayBytes, structureSize;
register unsigned char *p;
|
| ︙ | | |
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
|
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
|
-
+
-
|
p = ckalloc(structureSize);
codePtr = (ByteCode *) p;
codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
codePtr->compileEpoch = iPtr->compileEpoch;
codePtr->nsPtr = namespacePtr;
codePtr->nsEpoch = namespacePtr->resolverEpoch;
codePtr->refCount = 0;
codePtr->refCount = 1;
TclPreserveByteCode(codePtr);
if (namespacePtr->compiledVarResProc || iPtr->resolverPtr) {
codePtr->flags = TCL_BYTECODE_RESOLVE_VARS;
} else {
codePtr->flags = 0;
}
codePtr->source = envPtr->source;
codePtr->procPtr = envPtr->procPtr;
|
| ︙ | | |
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
|
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
|
p += sizeof(ByteCode);
codePtr->codeStart = p;
memcpy(p, envPtr->codeStart, (size_t) codeBytes);
p += TCL_ALIGN(codeBytes); /* align object array */
codePtr->objArrayPtr = (Tcl_Obj **) p;
for (i = 0; i < numLitObjects; i++) {
Tcl_Obj *fetched = TclFetchLiteral(envPtr, i);
if (objPtr == fetched) {
/*
* Prevent circular reference where the bytecode intrep of
* a value contains a literal which is that same value.
* If this is allowed to happen, refcount decrements may not
* reach zero, and memory may leak. Bugs 467523, 3357771
*
* NOTE: [Bugs 3392070, 3389764] We make a copy based completely
* on the string value, and do not call Tcl_DuplicateObj() so we
* can be sure we do not have any lingering cycles hiding in
* the intrep.
*/
int numBytes;
const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes);
codePtr->objArrayPtr[i] = Tcl_NewStringObj(bytes, numBytes);
Tcl_IncrRefCount(codePtr->objArrayPtr[i]);
TclReleaseLiteral((Tcl_Interp *)iPtr, objPtr);
} else {
codePtr->objArrayPtr[i] = TclFetchLiteral(envPtr, i);
codePtr->objArrayPtr[i] = fetched;
}
}
p += TCL_ALIGN(objArrayBytes); /* align exception range array */
if (exceptArrayBytes > 0) {
codePtr->exceptArrayPtr = (ExceptionRange *) p;
memcpy(p, envPtr->exceptArrayPtr, (size_t) exceptArrayBytes);
} else {
|
| ︙ | | |
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
|
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
|
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
codePtr->structureSize = structureSize
- (sizeof(size_t) + sizeof(Tcl_Time));
Tcl_GetTime(&codePtr->createTime);
RecordByteCodeStats(codePtr);
#endif /* TCL_COMPILE_STATS */
/*
* Free the old internal rep then convert the object to a bytecode object
* by making its internal rep point to the just compiled ByteCode.
*/
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = codePtr;
objPtr->typePtr = &tclByteCodeType;
/*
* TIP #280. Associate the extended per-word line information with the
* byte code object (internal rep), for use with the bc compiler.
*/
Tcl_SetHashValue(Tcl_CreateHashEntry(iPtr->lineBCPtr, codePtr,
&isNew), envPtr->extCmdMapPtr);
envPtr->extCmdMapPtr = NULL;
/* We've used up the CompileEnv. Mark as uninitialized. */
envPtr->iPtr = NULL;
codePtr->localCachePtr = NULL;
return codePtr;
}
ByteCode *
TclInitByteCodeObj(
Tcl_Obj *objPtr, /* Points object that should be initialized,
* and whose string rep contains the source
* code. */
const Tcl_ObjType *typePtr,
register CompileEnv *envPtr)/* Points to the CompileEnv structure from
* which to create a ByteCode structure. */
{
ByteCode *codePtr;
PreventCycle(objPtr, envPtr);
codePtr = TclInitByteCode(envPtr);
/*
* Free the old internal rep then convert the object to a bytecode object
* by making its internal rep point to the just compiled ByteCode.
*/
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = codePtr;
objPtr->typePtr = typePtr;
return codePtr;
}
/*
*----------------------------------------------------------------------
*
* TclFindCompiledLocal --
*
|
| ︙ | | |
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
|
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
|
-
+
-
|
if (!cachePtr || !name) {
return -1;
}
varNamePtr = &cachePtr->varName0;
for (i=0; i < cachePtr->numVars; varNamePtr++, i++) {
if (*varNamePtr) {
localName = TclGetString(*varNamePtr);
localName = Tcl_GetStringFromObj(*varNamePtr, &len);
len = (*varNamePtr)->length;
if ((len == nameBytes) && !strncmp(name, localName, len)) {
return i;
}
}
}
return -1;
}
|
| ︙ | | |
Changes to generic/tclCompile.h.
| ︙ | | |
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
|
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
|
-
+
|
typedef struct ByteCode {
TclHandle interpHandle; /* Handle for interpreter containing the
* compiled code. Commands and their compile
* procs are specific to an interpreter so the
* code emitted will depend on the
* interpreter. */
unsigned int compileEpoch; /* Value of iPtr->compileEpoch when this
int compileEpoch; /* Value of iPtr->compileEpoch when this
* ByteCode was compiled. Used to invalidate
* code when, e.g., commands with compile
* procs are redefined. */
Namespace *nsPtr; /* Namespace context in which this code was
* compiled. If the code is executed if a
* different namespace, it must be
* recompiled. */
|
| ︙ | | |
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
+
+
-
+
|
#define INST_STR_CLASS 184
#define INST_LAPPEND_LIST 185
#define INST_LAPPEND_LIST_ARRAY 186
#define INST_LAPPEND_LIST_ARRAY_STK 187
#define INST_LAPPEND_LIST_STK 188
#define INST_CLOCK_READ 189
/* The last opcode */
#define LAST_INST_OPCODE 188
#define LAST_INST_OPCODE 189
/*
* Table describing the Tcl bytecode instructions: their name (for displaying
* code), total number of code bytes required (including operand bytes), and a
* description of the type of each operand. These operand types include signed
* and unsigned integers of length one and four bytes. The unsigned integers
* are used for indexes or for, e.g., the count of objects to push in a "push"
|
| ︙ | | |
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
|
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
|
+
|
* not used outside:
*----------------------------------------------------------------
*/
MODULE_SCOPE int TclAttemptCompileProc(Tcl_Interp *interp,
Tcl_Parse *parsePtr, int depth, Command *cmdPtr,
CompileEnv *envPtr);
MODULE_SCOPE void TclCleanupByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclCleanupStackForBreakContinue(CompileEnv *envPtr,
ExceptionAux *auxPtr);
MODULE_SCOPE void TclCompileCmdWord(Tcl_Interp *interp,
Tcl_Token *tokenPtr, int count,
CompileEnv *envPtr);
MODULE_SCOPE void TclCompileExpr(Tcl_Interp *interp, const char *script,
int numBytes, CompileEnv *envPtr, int optimize);
|
| ︙ | | |
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
|
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
|
-
+
|
MODULE_SCOPE void TclCompileVarSubst(Tcl_Interp *interp,
Tcl_Token *tokenPtr, CompileEnv *envPtr);
MODULE_SCOPE int TclCreateAuxData(ClientData clientData,
const AuxDataType *typePtr, CompileEnv *envPtr);
MODULE_SCOPE int TclCreateExceptRange(ExceptionRangeType type,
CompileEnv *envPtr);
MODULE_SCOPE ExecEnv * TclCreateExecEnv(Tcl_Interp *interp, int size);
MODULE_SCOPE Tcl_Obj * TclCreateLiteral(Interp *iPtr, const char *bytes,
MODULE_SCOPE Tcl_Obj * TclCreateLiteral(Interp *iPtr, char *bytes,
int length, unsigned int hash, int *newPtr,
Namespace *nsPtr, int flags,
LiteralEntry **globalPtrPtr);
MODULE_SCOPE void TclDeleteExecEnv(ExecEnv *eePtr);
MODULE_SCOPE void TclDeleteLiteralTable(Tcl_Interp *interp,
LiteralTable *tablePtr);
MODULE_SCOPE void TclEmitForwardJump(CompileEnv *envPtr,
|
| ︙ | | |
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
|
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
|
-
-
-
+
+
|
MODULE_SCOPE int TclFindCompiledLocal(const char *name, int nameChars,
int create, CompileEnv *envPtr);
MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr,
JumpFixup *jumpFixupPtr, int jumpDist,
int distThreshold);
MODULE_SCOPE void TclFreeCompileEnv(CompileEnv *envPtr);
MODULE_SCOPE void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr);
MODULE_SCOPE ByteCode * TclInitByteCode(CompileEnv *envPtr);
MODULE_SCOPE ByteCode * TclInitByteCodeObj(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr, CompileEnv *envPtr);
MODULE_SCOPE void TclInitByteCodeObj(Tcl_Obj *objPtr,
CompileEnv *envPtr);
MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp,
CompileEnv *envPtr, const char *string,
int numBytes, const CmdFrame *invoker, int word);
MODULE_SCOPE void TclInitJumpFixupArray(JumpFixupArray *fixupArrayPtr);
MODULE_SCOPE void TclInitLiteralTable(LiteralTable *tablePtr);
MODULE_SCOPE ExceptionRange *TclGetInnermostExceptionRange(CompileEnv *envPtr,
int returnCode, ExceptionAux **auxPtrPtr);
|
| ︙ | | |
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
|
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
|
-
-
|
Tcl_Obj *objPtr, int maxChars);
MODULE_SCOPE void TclPrintSource(FILE *outFile,
const char *string, int maxChars);
MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp,
Tcl_Token *varTokenPtr, CompileEnv *envPtr,
int flags, int *localIndexPtr,
int *isScalarPtr);
MODULE_SCOPE void TclPreserveByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp,
const char *name, Namespace *nsPtr);
MODULE_SCOPE int TclSingleOpCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int TclSortingOpCmd(ClientData clientData,
|
| ︙ | | |
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
|
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#define TclFetchAuxData(envPtr, index) \
(envPtr)->auxDataArrayPtr[(index)].clientData
#define LITERAL_ON_HEAP 0x01
#define LITERAL_CMD_NAME 0x02
#define LITERAL_UNSHARED 0x04
/*
* Form of TclRegisterLiteral with flags == 0. In that case, it is safe to
* cast away constness, and it is cleanest to do that here, all in one place.
*
* int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes,
* int length);
*/
#define TclRegisterNewLiteral(envPtr, bytes, length) \
TclRegisterLiteral(envPtr, (char *)(bytes), length, /*flags*/ 0)
/*
* Form of TclRegisterLiteral with flags == LITERAL_CMD_NAME. In that case, it
* is safe to cast away constness, and it is cleanest to do that here, all in
* one place.
*
* int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes,
* int length);
*/
#define TclRegisterNewCmdLiteral(envPtr, bytes, length) \
TclRegisterLiteral(envPtr, (char *)(bytes), length, LITERAL_CMD_NAME)
/*
* Macro used to manually adjust the stack requirements; used in cases where
* the stack effect cannot be computed from the opcode and its operands, but
* is still known at compile time.
*
* void TclAdjustStackDepth(int delta, CompileEnv *envPtr);
*/
|
| ︙ | | |
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
|
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
|
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
|
((envPtr)->currStackDepth)
#define TclSetStackDepth(depth, envPtr) \
(envPtr)->currStackDepth = (depth)
#define TclCheckStackDepth(depth, envPtr) \
do { \
int dd = (depth); \
if (dd != (envPtr)->currStackDepth) { \
int _dd = (depth); \
if (_dd != (envPtr)->currStackDepth) { \
Tcl_Panic("bad stack depth computations: is %i, should be %i", \
(envPtr)->currStackDepth, dd); \
(envPtr)->currStackDepth, _dd); \
} \
} while (0)
/*
* Macro used to update the stack requirements. It is called by the macros
* TclEmitOpCode, TclEmitInst1 and TclEmitInst4.
* Remark that the very last instruction of a bytecode always reduces the
* stack level: INST_DONE or INST_POP, so that the maxStackdepth is always
* updated.
*
* void TclUpdateStackReqs(unsigned char op, int i, CompileEnv *envPtr);
*/
#define TclUpdateStackReqs(op, i, envPtr) \
do { \
int delta = tclInstructionTable[(op)].stackEffect; \
if (delta) { \
if (delta == INT_MIN) { \
delta = 1 - (i); \
int _delta = tclInstructionTable[(op)].stackEffect; \
if (_delta) { \
if (_delta == INT_MIN) { \
_delta = 1 - (i); \
} \
TclAdjustStackDepth(delta, envPtr); \
TclAdjustStackDepth(_delta, envPtr); \
} \
} while (0)
/*
* Macros used to update the flag that indicates if we are at the start of a
* command, based on whether the opcode is INST_START_COMMAND.
*
|
| ︙ | | |
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
|
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
|
-
-
-
+
+
+
-
+
|
* CompileEnv. The ANSI C "prototype" for this macro is:
*
* void TclEmitPush(int objIndex, CompileEnv *envPtr);
*/
#define TclEmitPush(objIndex, envPtr) \
do { \
register int objIndexCopy = (objIndex); \
if (objIndexCopy <= 255) { \
TclEmitInstInt1(INST_PUSH1, objIndexCopy, (envPtr)); \
register int _objIndexCopy = (objIndex); \
if (_objIndexCopy <= 255) { \
TclEmitInstInt1(INST_PUSH1, _objIndexCopy, (envPtr)); \
} else { \
TclEmitInstInt4(INST_PUSH4, objIndexCopy, (envPtr)); \
TclEmitInstInt4(INST_PUSH4, _objIndexCopy, (envPtr)); \
} \
} while (0)
/*
* Macros to update a (signed or unsigned) integer starting at a pointer. The
* two variants depend on the number of bytes. The ANSI C "prototypes" for
* these macros are:
|
| ︙ | | |
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
|
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
|
-
+
-
+
|
* static void PushLiteral(CompileEnv *envPtr,
* const char *string, int length);
* static void PushStringLiteral(CompileEnv *envPtr,
* const char *string);
*/
#define PushLiteral(envPtr, string, length) \
TclEmitPush(TclRegisterLiteral(envPtr, string, length, 0), (envPtr))
TclEmitPush(TclRegisterNewLiteral((envPtr), (string), (length)), (envPtr))
#define PushStringLiteral(envPtr, string) \
PushLiteral(envPtr, string, (int) (sizeof(string "") - 1))
PushLiteral((envPtr), (string), (int) (sizeof(string "") - 1))
/*
* Macro to advance to the next token; it is more mnemonic than the address
* arithmetic that it replaces. The ANSI C "prototype" for this macro is:
*
* static Tcl_Token * TokenAfter(Tcl_Token *tokenPtr);
*/
|
| ︙ | | |
Changes to generic/tclConfig.c.
| ︙ | | |
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
-
+
-
+
|
/*
* Maybe a Tcl_Panic is better, because the package data has to be
* present.
*/
Tcl_SetObjResult(interp, Tcl_NewStringObj("package not known", -1));
Tcl_SetErrorCode(interp, "TCL", "FATAL", "PKGCFG_BASE",
TclGetString(pkgName), NULL);
Tcl_GetString(pkgName), NULL);
return TCL_ERROR;
}
switch ((enum subcmds) index) {
case CFG_GET:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "key");
return TCL_ERROR;
}
if (Tcl_DictObjGet(interp, pkgDict, objv[2], &val) != TCL_OK
|| val == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("key not known", -1));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CONFIG",
TclGetString(objv[2]), NULL);
Tcl_GetString(objv[2]), NULL);
return TCL_ERROR;
}
if (cdPtr->encoding) {
venc = Tcl_GetEncoding(interp, cdPtr->encoding);
if (!venc) {
return TCL_ERROR;
|
| ︙ | | |
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
-
+
-
+
|
QCCD *cdPtr = clientData;
Tcl_Obj *pkgName = cdPtr->pkg;
Tcl_Obj *pDB = GetConfigDict(cdPtr->interp);
Tcl_DictObjRemove(NULL, pDB, pkgName);
Tcl_DecrRefCount(pkgName);
if (cdPtr->encoding) {
ckfree(cdPtr->encoding);
ckfree((char *)cdPtr->encoding);
}
ckfree(cdPtr);
ckfree((char *)cdPtr);
}
/*
*-------------------------------------------------------------------------
*
* GetConfigDict --
*
|
| ︙ | | |
Changes to generic/tclDecls.h.
| ︙ | | |
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
|
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
|
-
|
# undef Tcl_FindExecutable
# undef Tcl_GetStringResult
# undef Tcl_Init
# undef Tcl_SetPanicProc
# undef Tcl_SetVar
# undef Tcl_ObjSetVar2
# undef Tcl_StaticPackage
# undef TclFSGetNativePath
# define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp())
# define Tcl_GetStringResult(interp) (tclStubsPtr->tcl_GetStringResult(interp))
# define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp))
# define Tcl_SetPanicProc(proc) (tclStubsPtr->tcl_SetPanicProc(proc))
# define Tcl_SetVar(interp, varName, newValue, flags) \
(tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags))
# define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \
|
| ︙ | | |
Changes to generic/tclDictObj.c.
| ︙ | | |
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
-
+
|
* entries in the order that they are
* created. */
ChainEntry *entryChainTail; /* Other end of linked list of all entries in
* the dictionary. Used for doing traversal of
* the entries in the order that they are
* created. */
int epoch; /* Epoch counter */
size_t refCount; /* Reference counter (see above) */
int refcount; /* Reference counter (see above) */
Tcl_Obj *chain; /* Linked list used for invalidating the
* string representations of updated nested
* dictionaries. */
} Dict;
/*
* Accessor macro for converting between a Tcl_Obj* and a Dict. Note that this
|
| ︙ | | |
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
|
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
|
-
+
|
/*
* Initialise other fields.
*/
newDict->epoch = 0;
newDict->chain = NULL;
newDict->refCount = 1;
newDict->refcount = 1;
/*
* Store in the object.
*/
DICT(copyPtr) = newDict;
copyPtr->internalRep.twoPtrValue.ptr2 = NULL;
|
| ︙ | | |
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
|
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
+
-
+
|
static void
FreeDictInternalRep(
Tcl_Obj *dictPtr)
{
Dict *dict = DICT(dictPtr);
dict->refcount--;
if (dict->refCount-- <= 1) {
if (dict->refcount <= 0) {
DeleteDict(dict);
}
dictPtr->typePtr = NULL;
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
|
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
|
-
+
|
* as possible to allow the conversion code, in particular
* Tcl_GetStringFromObj, to use that old internalRep.
*/
TclFreeIntRep(objPtr);
dict->epoch = 0;
dict->chain = NULL;
dict->refCount = 1;
dict->refcount = 1;
DICT(objPtr) = dict;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &tclDictType;
return TCL_OK;
missingValue:
if (interp != NULL) {
|
| ︙ | | |
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
|
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
|
-
+
|
searchPtr->epoch = -1;
*donePtr = 1;
} else {
*donePtr = 0;
searchPtr->dictionaryPtr = (Tcl_Dict) dict;
searchPtr->epoch = dict->epoch;
searchPtr->next = cPtr->nextPtr;
dict->refCount++;
dict->refcount++;
if (keyPtrPtr != NULL) {
*keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
}
if (valuePtrPtr != NULL) {
*valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
}
}
|
| ︙ | | |
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
|
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
|
+
-
+
|
Tcl_DictSearch *searchPtr) /* Pointer to a hash search context. */
{
Dict *dict;
if (searchPtr->epoch != -1) {
searchPtr->epoch = -1;
dict = (Dict *) searchPtr->dictionaryPtr;
dict->refcount--;
if (dict->refCount-- <= 1) {
if (dict->refcount <= 0) {
DeleteDict(dict);
}
}
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
|
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
|
-
+
|
TclNewObj(dictPtr);
TclInvalidateStringRep(dictPtr);
dict = ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 0;
dict->chain = NULL;
dict->refCount = 1;
dict->refcount = 1;
DICT(dictPtr) = dict;
dictPtr->internalRep.twoPtrValue.ptr2 = NULL;
dictPtr->typePtr = &tclDictType;
return dictPtr;
#endif
}
|
| ︙ | | |
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
|
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
|
-
+
|
TclDbNewObj(dictPtr, file, line);
TclInvalidateStringRep(dictPtr);
dict = ckalloc(sizeof(Dict));
InitChainTable(dict);
dict->epoch = 0;
dict->chain = NULL;
dict->refCount = 1;
dict->refcount = 1;
DICT(dictPtr) = dict;
dictPtr->internalRep.twoPtrValue.ptr2 = NULL;
dictPtr->typePtr = &tclDictType;
return dictPtr;
#else /* !TCL_MEM_DEBUG */
return Tcl_NewDictObj();
#endif
|
| ︙ | | |
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
|
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
|
-
+
|
DictAppendCmd(
ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
int allocatedDict = 0;
int i, allocatedDict = 0;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
return TCL_ERROR;
}
dictPtr = Tcl_ObjGetVar2(interp, objv[1], NULL, 0);
|
| ︙ | | |
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
|
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
-
-
-
-
-
|
if (Tcl_DictObjGet(interp, dictPtr, objv[2], &valuePtr) != TCL_OK) {
if (allocatedDict) {
TclDecrRefCount(dictPtr);
}
return TCL_ERROR;
}
if ((objc > 3) || (valuePtr == NULL)) {
/* Only go through append activites when something will change. */
Tcl_Obj *appendObjPtr = NULL;
if (objc > 3) {
/* Something to append */
if (objc == 4) {
appendObjPtr = objv[3];
} else if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1,
objc-3, objv+3, &appendObjPtr)) {
return TCL_ERROR;
}
}
if (appendObjPtr == NULL) {
/* => (objc == 3) => (valuePtr == NULL) */
TclNewObj(valuePtr);
if (valuePtr == NULL) {
TclNewObj(valuePtr);
} else if (valuePtr == NULL) {
valuePtr = appendObjPtr;
appendObjPtr = NULL;
}
if (appendObjPtr) {
if (Tcl_IsShared(valuePtr)) {
valuePtr = Tcl_DuplicateObj(valuePtr);
}
} else if (Tcl_IsShared(valuePtr)) {
valuePtr = Tcl_DuplicateObj(valuePtr);
}
for (i=3 ; i<objc ; i++) {
Tcl_AppendObjToObj(valuePtr, appendObjPtr);
}
Tcl_AppendObjToObj(valuePtr, objv[i]);
}
Tcl_DictObjPut(NULL, dictPtr, objv[2], valuePtr);
Tcl_DictObjPut(NULL, dictPtr, objv[2], valuePtr);
}
/*
* Even if nothing changed, we still overwrite so that variable
* trace expectations are met.
*/
resultPtr = Tcl_ObjSetVar2(interp, objv[1], NULL, dictPtr,
TCL_LEAVE_ERR_MSG);
if (resultPtr == NULL) {
return TCL_ERROR;
}
Tcl_SetObjResult(interp, resultPtr);
|
| ︙ | | |
Changes to generic/tclDisassemble.c.
| ︙ | | |
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
-
-
+
+
-
|
static Tcl_Obj * DisassembleByteCodeAsDicts(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static Tcl_Obj * DisassembleByteCodeObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static int FormatInstruction(ByteCode *codePtr,
const unsigned char *pc, Tcl_Obj *bufferObj);
static void GetLocationInformation(Tcl_Interp *interp,
Proc *procPtr, Tcl_Obj **fileObjPtr,
static void GetLocationInformation(Proc *procPtr,
Tcl_Obj **fileObjPtr, int *linePtr);
int *linePtr);
static void PrintSourceToObj(Tcl_Obj *appendObj,
const char *stringPtr, int maxChars);
static void UpdateStringOfInstName(Tcl_Obj *objPtr);
/*
* The structure below defines an instruction name Tcl object to allow
* reporting of inner contexts in errorstack without string allocation.
|
| ︙ | | |
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
-
-
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
|
* None.
*
*----------------------------------------------------------------------
*/
static void
GetLocationInformation(
Tcl_Interp *interp, /* Where to look up the location
* information. */
Proc *procPtr, /* What to look up the information for. */
Tcl_Obj **fileObjPtr, /* Where to write the information about what
* file the code came from. Will be written
* to, either with the object (assume shared!)
* that describes what the file was, or with
* NULL if the information is not
* available. */
int *linePtr) /* Where to write the information about what
* line number represented the start of the
* code in question. Will be written to,
* either with the line number or with -1 if
* the information is not available. */
{
Interp *iPtr = (Interp *) interp;
Tcl_HashEntry *hePtr;
CmdFrame *cfPtr;
CmdFrame *cfPtr = TclGetCmdFrameForProcedure(procPtr);
*fileObjPtr = NULL;
*linePtr = -1;
if (iPtr != NULL && procPtr != NULL) {
hePtr = Tcl_FindHashEntry(iPtr->linePBodyPtr, procPtr);
if (hePtr != NULL && (cfPtr = Tcl_GetHashValue(hePtr)) != NULL) {
*linePtr = cfPtr->line[0];
if (cfPtr->type == TCL_LOCATION_SOURCE) {
*fileObjPtr = cfPtr->data.eval.path;
if (cfPtr == NULL) {
return;
}
/*
* Get the source location data out of the CmdFrame.
*/
*linePtr = cfPtr->line[0];
if (cfPtr->type == TCL_LOCATION_SOURCE) {
*fileObjPtr = cfPtr->data.eval.path;
}
}
}
}
#ifdef TCL_COMPILE_DEBUG
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
-
+
|
Tcl_Obj *objPtr, /* Points to the Tcl object whose string
* representation should be printed. */
int maxChars) /* Maximum number of chars to print. */
{
char *bytes;
int length;
bytes = TclGetStringFromObj(objPtr, &length);
bytes = Tcl_GetStringFromObj(objPtr, &length);
TclPrintSource(outFile, bytes, TclMin(length, maxChars));
}
/*
*----------------------------------------------------------------------
*
* TclPrintSource --
|
| ︙ | | |
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
-
+
|
Tcl_AppendPrintfToObj(bufferObj,
"ByteCode 0x%s, refCt %u, epoch %u, interp 0x%s (epoch %u)\n",
ptrBuf1, codePtr->refCount, codePtr->compileEpoch, ptrBuf2,
iPtr->compileEpoch);
Tcl_AppendToObj(bufferObj, " Source ", -1);
PrintSourceToObj(bufferObj, codePtr->source,
TclMin(codePtr->numSrcBytes, 55));
GetLocationInformation(interp, codePtr->procPtr, &fileObj, &line);
GetLocationInformation(codePtr->procPtr, &fileObj, &line);
if (line > -1 && fileObj != NULL) {
Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d",
Tcl_GetString(fileObj), line);
}
Tcl_AppendPrintfToObj(bufferObj,
"\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes,
|
| ︙ | | |
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
|
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
|
-
+
|
}
}
if (suffixObj) {
const char *bytes;
int length;
Tcl_AppendToObj(bufferObj, "\t# ", -1);
bytes = TclGetStringFromObj(codePtr->objArrayPtr[opnd], &length);
bytes = Tcl_GetStringFromObj(codePtr->objArrayPtr[opnd], &length);
PrintSourceToObj(bufferObj, bytes, TclMin(length, 40));
} else if (suffixBuffer[0]) {
Tcl_AppendPrintfToObj(bufferObj, "\t# %s", suffixBuffer);
if (suffixSrc) {
PrintSourceToObj(bufferObj, suffixSrc, 40);
}
}
|
| ︙ | | |
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
|
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
|
-
+
|
#undef Decode
/*
* Get the source file and line number information from the CmdFrame
* system if it is available.
*/
GetLocationInformation(interp, codePtr->procPtr, &file, &line);
GetLocationInformation(codePtr->procPtr, &file, &line);
/*
* Build the overall result.
*/
description = Tcl_NewObj();
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("literals", -1),
|
| ︙ | | |
Changes to generic/tclEncoding.c.
| ︙ | | |
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
-
+
|
* type. Passed to conversion functions. */
LengthProc *lengthProc; /* Function to compute length of
* null-terminated strings in this encoding.
* If nullSize is 1, this is strlen; if
* nullSize is 2, this is a function that
* returns the number of bytes in a 0x0000
* terminated string. */
size_t refCount; /* Number of uses of this structure. */
int refCount; /* Number of uses of this structure. */
Tcl_HashEntry *hPtr; /* Hash table entry that owns this encoding. */
} Encoding;
/*
* The following structure is the clientData for a dynamically-loaded,
* table-driven encoding created by LoadTableEncoding(). It maps between
* Unicode and a single-byte, double-byte, or multibyte (1 or 2 bytes only)
|
| ︙ | | |
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
-
+
|
int
Tcl_GetEncodingFromObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr,
Tcl_Encoding *encodingPtr)
{
const char *name = TclGetString(objPtr);
const char *name = Tcl_GetString(objPtr);
if (objPtr->typePtr != &encodingType) {
Tcl_Encoding encoding = Tcl_GetEncoding(interp, name);
if (encoding == NULL) {
return TCL_ERROR;
}
|
| ︙ | | |
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
|
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
-
|
static void
DupEncodingIntRep(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
dupPtr->internalRep.twoPtrValue.ptr1 = Tcl_GetEncoding(NULL, srcPtr->bytes);
dupPtr->typePtr = &encodingType;
}
/*
*----------------------------------------------------------------------
*
* Tcl_GetEncodingSearchPath --
*
|
| ︙ | | |
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
|
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
|
-
+
|
Tcl_ListObjLength(NULL, searchPath, &numDirs);
if (numDirs == 0) {
return NULL;
}
Tcl_ListObjIndex(NULL, searchPath, 0, &first);
return TclGetString(first);
return Tcl_GetString(first);
}
/*
*-------------------------------------------------------------------------
*
* Tcl_SetDefaultEncodingDir --
*
|
| ︙ | | |
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
|
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
|
-
+
+
+
+
+
|
Tcl_Encoding encoding)
{
Encoding *encodingPtr = (Encoding *) encoding;
if (encodingPtr == NULL) {
return;
}
if (encodingPtr->refCount-- <= 1) {
if (encodingPtr->refCount<=0) {
Tcl_Panic("FreeEncoding: refcount problem !!!");
}
encodingPtr->refCount--;
if (encodingPtr->refCount == 0) {
if (encodingPtr->freeProc != NULL) {
encodingPtr->freeProc(encodingPtr->clientData);
}
if (encodingPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(encodingPtr->hPtr);
}
ckfree(encodingPtr->name);
|
| ︙ | | |
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
|
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
|
-
+
-
+
|
for (i=0; i<numDirs && !verified; i++) {
if (dir[i] == directory) {
verified = 1;
}
}
if (!verified) {
const char *dirString = TclGetString(directory);
const char *dirString = Tcl_GetString(directory);
for (i=0; i<numDirs && !verified; i++) {
if (strcmp(dirString, TclGetString(dir[i])) == 0) {
if (strcmp(dirString, Tcl_GetString(dir[i])) == 0) {
verified = 1;
}
}
}
if (!verified) {
/*
* Directory no longer on the search path. Remove from cache.
|
| ︙ | | |
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
|
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
|
-
+
|
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
for (i = 0; i < numPages; i++) {
int ch;
const char *p;
Tcl_ReadChars(chan, objPtr, 3 + 16 * (16 * 4 + 1), 0);
p = TclGetString(objPtr);
p = Tcl_GetString(objPtr);
hi = (staticHex[UCHAR(p[0])] << 4) + staticHex[UCHAR(p[1])];
dataPtr->toUnicode[hi] = pageMemPtr;
p += 2;
for (lo = 0; lo < 256; lo++) {
if ((lo & 0x0f) == 0) {
p++;
}
|
| ︙ | | |
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
|
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
|
-
+
-
+
|
*
*-------------------------------------------------------------------------
*/
static void
InitializeEncodingSearchPath(
char **valuePtr,
size_t *lengthPtr,
int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
const char *bytes;
int i, numDirs;
int i, numDirs, numBytes;
Tcl_Obj *libPathObj, *encodingObj, *searchPathObj;
TclNewLiteralStringObj(encodingObj, "encoding");
TclNewObj(searchPathObj);
Tcl_IncrRefCount(encodingObj);
Tcl_IncrRefCount(searchPathObj);
libPathObj = TclGetLibraryPath();
|
| ︙ | | |
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
|
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
|
-
+
-
-
-
+
+
+
|
Tcl_DecrRefCount(libPathObj);
Tcl_DecrRefCount(encodingObj);
*encodingPtr = libraryPath.encoding;
if (*encodingPtr) {
((Encoding *)(*encodingPtr))->refCount++;
}
bytes = TclGetString(searchPathObj);
bytes = Tcl_GetStringFromObj(searchPathObj, &numBytes);
*lengthPtr = searchPathObj->length;
*valuePtr = ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, bytes, *lengthPtr + 1);
*lengthPtr = numBytes;
*valuePtr = ckalloc(numBytes + 1);
memcpy(*valuePtr, bytes, (size_t) numBytes + 1);
Tcl_DecrRefCount(searchPathObj);
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclEnsemble.c.
| ︙ | | |
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
|
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
|
-
+
|
}
Tcl_SetEnsembleMappingDict(interp, ensemble, mapDict);
}
Tcl_DStringFree(&buf);
Tcl_DStringFree(&hiddenBuf);
if (nameParts != NULL) {
ckfree(nameParts);
ckfree((char *) nameParts);
}
return ensemble;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
|
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
|
-
+
|
* it (will be an error for a non-unique
* prefix). */
char *fullName = NULL; /* Full name of the subcommand. */
int stringLength, i;
int tableLength = ensemblePtr->subcommandTable.numEntries;
Tcl_Obj *fix;
subcmdName = TclGetStringFromObj(subObj, &stringLength);
subcmdName = Tcl_GetStringFromObj(subObj, &stringLength);
for (i=0 ; i<tableLength ; i++) {
register int cmp = strncmp(subcmdName,
ensemblePtr->subcommandArrayPtr[i],
(unsigned) stringLength);
if (cmp == 0) {
if (fullName != NULL) {
|
| ︙ | | |
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
|
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
|
-
+
|
const char *str;
Tcl_Obj *matchObj = NULL;
if (Tcl_ListObjGetElements(NULL, listObj, &len, &elems) != TCL_OK) {
goto failed;
}
for (i=0 ; i<len ; i++) {
str = TclGetStringFromObj(elems[i], &sclen);
str = Tcl_GetStringFromObj(elems[i], &sclen);
if ((sclen == (int) numBytes) && !memcmp(word, str, numBytes)) {
/*
* Exact match! Excellent!
*/
result = Tcl_DictObjGet(NULL, mapObj,elems[i], &targetCmdObj);
if (result != TCL_OK || targetCmdObj == NULL) {
|
| ︙ | | |
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
|
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
|
-
+
-
-
+
+
-
-
+
+
-
+
-
+
|
Tcl_Obj *replacements,
Command *cmdPtr,
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *tokPtr;
Tcl_Obj *objPtr, **words;
char *bytes;
int i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME;
int length, i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME;
DefineLineInformation;
/*
* Push the words of the command. Take care; the command words may be
* scripts that have backslashes in them, and [info frame 0] can see the
* difference. Hence the call to TclContinuationsEnterDerived...
*/
Tcl_ListObjGetElements(NULL, replacements, &numWords, &words);
for (i = 0, tokPtr = parsePtr->tokenPtr; i < parsePtr->numWords;
i++, tokPtr = TokenAfter(tokPtr)) {
if (i > 0 && i < numWords+1) {
bytes = TclGetString(words[i-1]);
PushLiteral(envPtr, bytes, words[i-1]->length);
bytes = Tcl_GetStringFromObj(words[i-1], &length);
PushLiteral(envPtr, bytes, length);
continue;
}
SetLineInformation(i);
if (tokPtr->type == TCL_TOKEN_SIMPLE_WORD) {
int literal = TclRegisterLiteral(envPtr,
tokPtr[1].start, tokPtr[1].size, 0);
int literal = TclRegisterNewLiteral(envPtr,
tokPtr[1].start, tokPtr[1].size);
if (envPtr->clNext) {
TclContinuationsEnterDerived(
TclFetchLiteral(envPtr, literal),
tokPtr[1].start - envPtr->source,
envPtr->clNext);
}
TclEmitPush(literal, envPtr);
} else {
CompileTokens(envPtr, tokPtr, interp);
}
}
/*
* Push the name of the command we're actually dispatching to as part of
* the implementation.
*/
objPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
bytes = TclGetString(objPtr);
bytes = Tcl_GetStringFromObj(objPtr, &length);
if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) {
extraLiteralFlags |= LITERAL_UNSHARED;
}
cmdLit = TclRegisterLiteral(envPtr, bytes, objPtr->length, extraLiteralFlags);
cmdLit = TclRegisterLiteral(envPtr, (char *)bytes, length, extraLiteralFlags);
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLit), cmdPtr);
TclEmitPush(cmdLit, envPtr);
TclDecrRefCount(objPtr);
/*
* Do the replacing dispatch.
*/
|
| ︙ | | |
Changes to generic/tclEvent.c.
| ︙ | | |
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
|
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
|
-
-
-
|
*/
TclInitThreadStorage(); /* Creates master hash table for
* thread local storage */
#if USE_TCLALLOC
TclInitAlloc(); /* Process wide mutex init */
#endif
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
TclpInitAllocCache();
#endif
#ifdef TCL_MEM_DEBUG
TclInitDbCkalloc(); /* Process wide mutex init */
#endif
TclpInitPlatform(); /* Creates signal handler(s) */
TclInitDoubleConversion(); /* Initializes constants for
* converting to/from double. */
|
| ︙ | | |
Changes to generic/tclExecute.c.
| ︙ | | |
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
-
-
-
+
+
+
-
-
-
+
+
+
|
*/
#if (FLT_RADIX == 2) && (DBL_MANT_DIG == 53) && (DBL_MAX_EXP == 1024)
#define IEEE_FLOATING_POINT
#endif
/*
* A counter that is used to work out when the bytecode engine should call
* Tcl_AsyncReady() to see whether there is a signal that needs handling, and
* other expensive periodic operations.
* A mask (should be 2**n-1) that is used to work out when the bytecode engine
* should call Tcl_AsyncReady() to see whether there is a signal that needs
* handling.
*/
#ifndef ASYNC_CHECK_COUNT
# define ASYNC_CHECK_COUNT 64
#endif /* !ASYNC_CHECK_COUNT */
#ifndef ASYNC_CHECK_COUNT_MASK
# define ASYNC_CHECK_COUNT_MASK 63
#endif /* !ASYNC_CHECK_COUNT_MASK */
/*
* Boolean flag indicating whether the Tcl bytecode interpreter has been
* initialized.
*/
static int execInitialized = 0;
|
| ︙ | | |
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
-
+
-
+
-
+
-
+
|
NEXT_INST_F(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
case INST_JUMP_FALSE4: \
NEXT_INST_F(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
case INST_JUMP_TRUE4: \
NEXT_INST_F(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
default: \
if ((condition) < 0) { \
TclNewLongObj(objResultPtr, -1); \
TclNewIntObj(objResultPtr, -1); \
} else { \
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_F(0, (cleanup), 1); \
} \
} while (0)
#define JUMP_PEEPHOLE_V(condition, pcAdjustment, cleanup) \
do { \
pc += (pcAdjustment); \
switch (*pc) { \
case INST_JUMP_FALSE1: \
NEXT_INST_V(((condition)? 2 : TclGetInt1AtPtr(pc+1)), (cleanup), 0); \
case INST_JUMP_TRUE1: \
NEXT_INST_V(((condition)? TclGetInt1AtPtr(pc+1) : 2), (cleanup), 0); \
case INST_JUMP_FALSE4: \
NEXT_INST_V(((condition)? 5 : TclGetInt4AtPtr(pc+1)), (cleanup), 0); \
case INST_JUMP_TRUE4: \
NEXT_INST_V(((condition)? TclGetInt4AtPtr(pc+1) : 5), (cleanup), 0); \
default: \
if ((condition) < 0) { \
TclNewLongObj(objResultPtr, -1); \
TclNewIntObj(objResultPtr, -1); \
} else { \
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_V(0, (cleanup), 1); \
} \
} while (0)
#else /* TCL_COMPILE_DEBUG */
#define JUMP_PEEPHOLE_F(condition, pcAdjustment, cleanup) \
do{ \
if ((condition) < 0) { \
TclNewLongObj(objResultPtr, -1); \
TclNewIntObj(objResultPtr, -1); \
} else { \
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_F((pcAdjustment), (cleanup), 1); \
} while (0)
#define JUMP_PEEPHOLE_V(condition, pcAdjustment, cleanup) \
do{ \
if ((condition) < 0) { \
TclNewLongObj(objResultPtr, -1); \
TclNewIntObj(objResultPtr, -1); \
} else { \
objResultPtr = TCONST((condition) > 0); \
} \
NEXT_INST_V((pcAdjustment), (cleanup), 1); \
} while (0)
#endif
|
| ︙ | | |
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
|
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
|
-
-
+
-
-
+
|
(&((objPtr)->internalRep.longValue)), TCL_OK) : \
((objPtr)->typePtr == &tclDoubleType) \
? (((TclIsNaN((objPtr)->internalRep.doubleValue)) \
? (*(tPtr) = TCL_NUMBER_NAN) \
: (*(tPtr) = TCL_NUMBER_DOUBLE)), \
*(ptrPtr) = (ClientData) \
(&((objPtr)->internalRep.doubleValue)), TCL_OK) : \
((((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) || \
(((objPtr)->bytes != NULL) && ((objPtr)->length == 0))) \
(((objPtr)->bytes != NULL) && ((objPtr)->length == 0)) \
? (*(tPtr) = TCL_NUMBER_LONG),TCL_ERROR : \
TclGetNumberFromObj((interp), (objPtr), (ptrPtr), (tPtr)))
#else /* !TCL_WIDE_INT_IS_LONG */
#define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \
(((objPtr)->typePtr == &tclIntType) \
? (*(tPtr) = TCL_NUMBER_LONG, \
*(ptrPtr) = (ClientData) \
(&((objPtr)->internalRep.longValue)), TCL_OK) : \
((objPtr)->typePtr == &tclWideIntType) \
? (*(tPtr) = TCL_NUMBER_WIDE, \
*(ptrPtr) = (ClientData) \
(&((objPtr)->internalRep.wideValue)), TCL_OK) : \
((objPtr)->typePtr == &tclDoubleType) \
? (((TclIsNaN((objPtr)->internalRep.doubleValue)) \
? (*(tPtr) = TCL_NUMBER_NAN) \
: (*(tPtr) = TCL_NUMBER_DOUBLE)), \
*(ptrPtr) = (ClientData) \
(&((objPtr)->internalRep.doubleValue)), TCL_OK) : \
((((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) || \
(((objPtr)->bytes != NULL) && ((objPtr)->length == 0))) \
(((objPtr)->bytes != NULL) && ((objPtr)->length == 0)) \
? (*(tPtr) = TCL_NUMBER_LONG),TCL_ERROR : \
TclGetNumberFromObj((interp), (objPtr), (ptrPtr), (tPtr)))
#endif /* TCL_WIDE_INT_IS_LONG */
/*
* Macro used in this file to save a function call for common uses of
* Tcl_GetBooleanFromObj(). The ANSI C "prototype" is:
|
| ︙ | | |
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
|
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
|
-
+
|
{
Interp *iPtr = (Interp *) interp;
ExecEnv *eePtr;
ExecStack *esPtr;
Tcl_Obj **markerPtr, *marker;
if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
ckfree(freePtr);
ckfree((char *) freePtr);
return;
}
/*
* Rewind the stack to the previous marker position. The current marker,
* as set in the last call to GrowEvaluationStack, contains a pointer to
* the previous marker.
|
| ︙ | | |
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
|
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
|
+
+
-
+
|
*----------------------------------------------------------------------
*
* CompileExprObj --
* Compile a Tcl expression value into ByteCode.
*
* Results:
* A (ByteCode *) is returned pointing to the resulting ByteCode.
* The caller must manage its refCount and arrange for a call to
* TclCleanupByteCode() when the last reference disappears.
*
* Side effects:
* The Tcl_ObjType of objPtr is changed to the "exprcode" type,
* The Tcl_ObjType of objPtr is changed to the "bytecode" type,
* and the ByteCode is kept in the internal rep (along with context
* data for checking validity) for faster operations the next time
* CompileExprObj is called on the same value.
*
*----------------------------------------------------------------------
*/
|
| ︙ | | |
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
|
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
|
-
+
+
-
+
-
-
+
+
-
+
-
+
+
+
|
codePtr = objPtr->internalRep.twoPtrValue.ptr1;
if (((Interp *) *codePtr->interpHandle != iPtr)
|| (codePtr->compileEpoch != iPtr->compileEpoch)
|| (codePtr->nsPtr != namespacePtr)
|| (codePtr->nsEpoch != namespacePtr->resolverEpoch)
|| (codePtr->localCachePtr != iPtr->varFramePtr->localCachePtr)) {
TclFreeIntRep(objPtr);
FreeExprCodeInternalRep(objPtr);
}
}
if (objPtr->typePtr != &exprCodeType) {
/*
* TIP #280: No invoker (yet) - Expression compilation.
*/
int length;
const char *string = TclGetString(objPtr);
const char *string = TclGetStringFromObj(objPtr, &length);
TclInitCompileEnv(interp, &compEnv, string, objPtr->length, NULL, 0);
TclCompileExpr(interp, string, objPtr->length, &compEnv, 0);
TclInitCompileEnv(interp, &compEnv, string, length, NULL, 0);
TclCompileExpr(interp, string, length, &compEnv, 0);
/*
* Successful compilation. If the expression yielded no instructions,
* push an zero object as the expression's result.
*/
if (compEnv.codeNext == compEnv.codeStart) {
TclEmitPush(TclRegisterLiteral(&compEnv, "0", 1, 0),
TclEmitPush(TclRegisterNewLiteral(&compEnv, "0", 1),
&compEnv);
}
/*
* Add a "done" instruction as the last instruction and change the
* object into a ByteCode object. Ownership of the literal objects and
* aux data items is given to the ByteCode object.
*/
TclEmitOpcode(INST_DONE, &compEnv);
codePtr = TclInitByteCodeObj(objPtr, &exprCodeType, &compEnv);
TclInitByteCodeObj(objPtr, &compEnv);
objPtr->typePtr = &exprCodeType;
TclFreeCompileEnv(&compEnv);
codePtr = objPtr->internalRep.twoPtrValue.ptr1;
if (iPtr->varFramePtr->localCachePtr) {
codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr;
codePtr->localCachePtr->refCount++;
}
#ifdef TCL_COMPILE_DEBUG
if (tclTraceCompile == 2) {
TclPrintByteCodeObj(interp, objPtr);
|
| ︙ | | |
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
|
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
|
+
+
-
+
+
|
static void
FreeExprCodeInternalRep(
Tcl_Obj *objPtr)
{
ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->typePtr = NULL;
if (codePtr->refCount-- <= 1) {
TclReleaseByteCode(codePtr);
TclCleanupByteCode(codePtr);
}
}
/*
*----------------------------------------------------------------------
*
* TclCompileObj --
*
|
| ︙ | | |
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
|
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
|
-
+
|
Interp *iPtr = (Interp *) interp;
TEBCdata *TD;
int size = sizeof(TEBCdata) - 1
+ (codePtr->maxStackDepth + codePtr->maxExceptDepth)
* sizeof(void *);
int numWords = (size + sizeof(Tcl_Obj *) - 1) / sizeof(Tcl_Obj *);
TclPreserveByteCode(codePtr);
codePtr->refCount++;
/*
* Reserve the stack, setup the TEBCdataPtr (TD) and CallFrame
*
* The execution uses a unified stack: first a TEBCdata, immediately
* above it a CmdFrame, then the catch stack, then the execution stack.
*
|
| ︙ | | |
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
|
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
|
-
-
-
+
+
-
-
-
-
-
|
*/
/*
* Constants: variables that do not change during the execution, used
* sporadically: no special need for speed.
*/
unsigned interruptCounter = 1;
/* Counter that is used to work out when to
* call Tcl_AsyncReady(). This must be 1
int instructionCount = 0; /* Counter that is used to work out when to
* call Tcl_AsyncReady() */
* initially so that we call the async-check
* stanza early, otherwise there are command
* sequences that can make the interpreter
* busy-loop without an opportunity to
* recognise an interrupt. */
const char *curInstName;
#ifdef TCL_COMPILE_DEBUG
int traceInstructions; /* Whether we are doing instruction-level
* tracing or not. */
#endif
Var *compiledLocals = iPtr->varFramePtr->compiledLocals;
|
| ︙ | | |
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
|
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
|
-
+
-
-
+
|
break;
}
cleanup0:
/*
* Check for asynchronous handlers [Bug 746722]; we do the check every
* ASYNC_CHECK_COUNT instructions.
* ASYNC_CHECK_COUNT_MASK instruction, of the form (2**n-1).
*/
if ((--interruptCounter) == 0) {
interruptCounter = ASYNC_CHECK_COUNT;
if ((instructionCount++ & ASYNC_CHECK_COUNT_MASK) == 0) {
DECACHE_STACK_INFO();
if (TclAsyncReady(iPtr)) {
result = Tcl_AsyncInvoke(interp, result);
if (result == TCL_ERROR) {
CACHE_STACK_INFO();
goto gotError;
}
|
| ︙ | | |
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
|
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
|
-
+
|
if (tclTraceExec >= 2) {
if (traceInstructions) {
TRACE(("[%.30s] => YIELD...\n", O2S(valuePtr)));
} else {
/* FIXME: What is the right thing to trace? */
fprintf(stdout, "%d: (%u) yielding to [%.30s]\n",
iPtr->numLevels, (unsigned)(pc - codePtr->codeStart),
TclGetString(valuePtr));
Tcl_GetString(valuePtr));
}
fflush(stdout);
}
#endif
/*
* Install a tailcall record in the caller and continue with the
|
| ︙ | | |
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
|
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
|
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
*b = tmpPtr;
a++; b--;
}
TRACE(("%u => OK\n", opnd));
NEXT_INST_F(5, 0, 0);
}
case INST_STR_CONCAT1:
case INST_STR_CONCAT1: {
int appendLen = 0;
char *bytes, *p;
Tcl_Obj **currPtr;
int onlyb = 1;
opnd = TclGetUInt1AtPtr(pc+1);
/*
* Detect only-bytearray-or-null case.
*/
if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1,
opnd, &OBJ_AT_DEPTH(opnd-1), &objResultPtr)) {
TRACE_ERROR(interp);
goto gotError;
for (currPtr=&OBJ_AT_DEPTH(opnd-1); currPtr<=&OBJ_AT_TOS; currPtr++) {
if (((*currPtr)->typePtr != &tclByteArrayType)
&& ((*currPtr)->bytes != tclEmptyStringRep)) {
onlyb = 0;
break;
} else if (((*currPtr)->typePtr == &tclByteArrayType) &&
((*currPtr)->bytes != NULL)) {
onlyb = 0;
break;
}
}
/*
* Compute the length to be appended.
*/
if (onlyb) {
for (currPtr = &OBJ_AT_DEPTH(opnd-2);
appendLen >= 0 && currPtr <= &OBJ_AT_TOS; currPtr++) {
if ((*currPtr)->bytes != tclEmptyStringRep) {
Tcl_GetByteArrayFromObj(*currPtr, &length);
appendLen += length;
}
}
} else {
for (currPtr = &OBJ_AT_DEPTH(opnd-2);
appendLen >= 0 && currPtr <= &OBJ_AT_TOS; currPtr++) {
bytes = TclGetStringFromObj(*currPtr, &length);
if (bytes != NULL) {
appendLen += length;
}
}
}
if (appendLen < 0) {
/* TODO: convert panic to error ? */
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
}
/*
* If nothing is to be appended, just return the first object by
* dropping all the others from the stack; this saves both the
* computation and copy of the string rep of the first object,
* enabling the fast '$x[set x {}]' idiom for 'K $x [set x {}]'.
*/
if (appendLen == 0) {
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_V(2, (opnd-1), 0);
}
/*
* If the first object is shared, we need a new obj for the result;
* otherwise, we can reuse the first object. In any case, make sure it
* has enough room to accomodate all the concatenated bytes. Note that
* if it is unshared its bytes are copied by ckrealloc, so that we set
* the loop parameters to avoid copying them again: p points to the
* end of the already copied bytes, currPtr to the second object.
*/
objResultPtr = OBJ_AT_DEPTH(opnd-1);
if (!onlyb) {
bytes = TclGetStringFromObj(objResultPtr, &length);
if (length + appendLen < 0) {
/* TODO: convert panic to error ? */
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded",
INT_MAX);
}
#ifndef TCL_COMPILE_DEBUG
if (bytes != tclEmptyStringRep && !Tcl_IsShared(objResultPtr)) {
TclFreeIntRep(objResultPtr);
objResultPtr->bytes = ckrealloc(bytes, length+appendLen+1);
objResultPtr->length = length + appendLen;
p = TclGetString(objResultPtr) + length;
currPtr = &OBJ_AT_DEPTH(opnd - 2);
} else
#endif
{
p = ckalloc(length + appendLen + 1);
TclNewObj(objResultPtr);
objResultPtr->bytes = p;
objResultPtr->length = length + appendLen;
currPtr = &OBJ_AT_DEPTH(opnd - 1);
}
/*
* Append the remaining characters.
*/
for (; currPtr <= &OBJ_AT_TOS; currPtr++) {
bytes = TclGetStringFromObj(*currPtr, &length);
if (bytes != NULL) {
memcpy(p, bytes, (size_t) length);
p += length;
}
}
*p = '\0';
} else {
bytes = (char *) Tcl_GetByteArrayFromObj(objResultPtr, &length);
if (length + appendLen < 0) {
/* TODO: convert panic to error ? */
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded",
INT_MAX);
}
#ifndef TCL_COMPILE_DEBUG
if (!Tcl_IsShared(objResultPtr)) {
bytes = (char *) Tcl_SetByteArrayLength(objResultPtr,
length + appendLen);
p = bytes + length;
currPtr = &OBJ_AT_DEPTH(opnd - 2);
} else
#endif
{
TclNewObj(objResultPtr);
bytes = (char *) Tcl_SetByteArrayLength(objResultPtr,
length + appendLen);
p = bytes;
currPtr = &OBJ_AT_DEPTH(opnd - 1);
}
/*
* Append the remaining characters.
*/
for (; currPtr <= &OBJ_AT_TOS; currPtr++) {
if ((*currPtr)->bytes != tclEmptyStringRep) {
bytes = (char *) Tcl_GetByteArrayFromObj(*currPtr,&length);
memcpy(p, bytes, (size_t) length);
p += length;
}
}
}
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_V(2, opnd, 1);
}
case INST_CONCAT_STK:
/*
* Pop the opnd (objc) top stack elements, run through Tcl_ConcatObj,
* and then decrement their ref counts.
*/
|
| ︙ | | |
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
|
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
|
-
+
|
Tcl_GetCommandFullName(interp, (Tcl_Command) corPtr->cmdPtr,
objResultPtr);
}
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
}
case INST_INFO_LEVEL_NUM:
TclNewLongObj(objResultPtr, iPtr->varFramePtr->level);
TclNewIntObj(objResultPtr, iPtr->varFramePtr->level);
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
case INST_INFO_LEVEL_ARGS: {
int level;
register CallFrame *framePtr = iPtr->varFramePtr;
register CallFrame *rootFramePtr = iPtr->rootFramePtr;
|
| ︙ | | |
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
|
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
|
-
+
|
case INST_LIST_LENGTH:
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
if (TclListObjLength(interp, OBJ_AT_TOS, &length) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
TclNewLongObj(objResultPtr, length);
TclNewIntObj(objResultPtr, length);
TRACE_APPEND(("%d\n", length));
NEXT_INST_F(1, 1, 1);
case INST_LIST_INDEX: /* lindex with objc == 3 */
value2Ptr = OBJ_AT_TOS;
valuePtr = OBJ_UNDER_TOS;
TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));
|
| ︙ | | |
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
|
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
|
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
|
if (fromIdx < 0) {
fromIdx = 0;
}
if (toIdx >= objc) {
toIdx = objc-1;
}
if (fromIdx == 0 && toIdx != objc-1 && !Tcl_IsShared(valuePtr)) {
/*
* BEWARE! This is looking inside the implementation of the
* list type.
*/
Tcl_ListObjReplace(interp, valuePtr,
toIdx + 1, LIST_MAX, 0, NULL);
TRACE_APPEND(("%.30s\n", O2S(valuePtr)));
NEXT_INST_F(9, 0, 0);
List *listPtr = valuePtr->internalRep.twoPtrValue.ptr1;
if (listPtr->refCount == 1) {
for (index=toIdx+1; index<objc ; index++) {
TclDecrRefCount(objv[index]);
}
listPtr->elemCount = toIdx+1;
listPtr->canonicalFlag = 1;
TclInvalidateStringRep(valuePtr);
TRACE_APPEND(("%.30s\n", O2S(valuePtr)));
NEXT_INST_F(9, 0, 0);
}
}
objResultPtr = Tcl_NewListObj(toIdx-fromIdx+1, objv+fromIdx);
} else {
TclNewObj(objResultPtr);
}
TRACE_APPEND(("\"%.30s\"", O2S(objResultPtr)));
|
| ︙ | | |
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
|
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
|
-
+
|
TRACE(("\"%.20s\" \"%.20s\" => %d\n", O2S(valuePtr), O2S(value2Ptr),
(match < 0 ? -1 : match > 0 ? 1 : 0)));
JUMP_PEEPHOLE_F(match, 1, 2);
case INST_STR_LEN:
valuePtr = OBJ_AT_TOS;
length = Tcl_GetCharLength(valuePtr);
TclNewLongObj(objResultPtr, length);
TclNewIntObj(objResultPtr, length);
TRACE(("\"%.20s\" => %d\n", O2S(valuePtr), length));
NEXT_INST_F(1, 1, 1);
case INST_STR_UPPER:
valuePtr = OBJ_AT_TOS;
TRACE(("\"%.20s\" => ", O2S(valuePtr)));
if (Tcl_IsShared(valuePtr)) {
|
| ︙ | | |
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
|
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
|
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
}
doneStringMap:
TRACE_WITH_OBJ(("%.20s %.20s %.20s => ",
O2S(value2Ptr), O2S(value3Ptr), O2S(valuePtr)), objResultPtr);
NEXT_INST_V(1, 3, 1);
case INST_STR_FIND:
ustring1 = Tcl_GetUnicodeFromObj(OBJ_AT_TOS, &length); /* Haystack */
ustring2 = Tcl_GetUnicodeFromObj(OBJ_UNDER_TOS, &length2);/* Needle */
match = TclStringFind(OBJ_UNDER_TOS, OBJ_AT_TOS, 0);
match = -1;
if (length2 > 0 && length2 <= length) {
end = ustring1 + length - length2 + 1;
for (p=ustring1 ; p<end ; p++) {
if ((*p == *ustring2) &&
memcmp(ustring2,p,sizeof(Tcl_UniChar)*length2) == 0) {
match = p - ustring1;
break;
}
}
}
TRACE(("%.20s %.20s => %d\n",
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match));
TclNewLongObj(objResultPtr, match);
TclNewIntObj(objResultPtr, match);
NEXT_INST_F(1, 2, 1);
case INST_STR_FIND_LAST:
ustring1 = Tcl_GetUnicodeFromObj(OBJ_AT_TOS, &length); /* Haystack */
ustring2 = Tcl_GetUnicodeFromObj(OBJ_UNDER_TOS, &length2);/* Needle */
match = TclStringLast(OBJ_UNDER_TOS, OBJ_AT_TOS, INT_MAX - 1);
match = -1;
if (length2 > 0 && length2 <= length) {
for (p=ustring1+length-length2 ; p>=ustring1 ; p--) {
if ((*p == *ustring2) &&
memcmp(ustring2,p,sizeof(Tcl_UniChar)*length2) == 0) {
match = p - ustring1;
break;
}
}
}
TRACE(("%.20s %.20s => %d\n",
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match));
TclNewLongObj(objResultPtr, match);
TclNewIntObj(objResultPtr, match);
NEXT_INST_F(1, 2, 1);
case INST_STR_CLASS:
opnd = TclGetInt1AtPtr(pc+1);
valuePtr = OBJ_AT_TOS;
TRACE(("%s \"%.30s\" => ", tclStringClassTable[opnd].name,
O2S(valuePtr)));
|
| ︙ | | |
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
|
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
|
-
+
-
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
/* [string is wideinteger] is -UWIDE_MAX to UWIDE_MAX range */
Tcl_WideInt w;
if (Tcl_GetWideIntFromObj(NULL, OBJ_AT_TOS, &w) == TCL_OK) {
type1 = TCL_NUMBER_WIDE;
}
}
TclNewLongObj(objResultPtr, type1);
TclNewIntObj(objResultPtr, type1);
TRACE(("\"%.20s\" => %d\n", O2S(OBJ_AT_TOS), type1));
NEXT_INST_F(1, 1, 1);
case INST_EQ:
case INST_NEQ:
case INST_LT:
case INST_GT:
case INST_LE:
case INST_GE: {
int iResult = 0, compare = 0;
value2Ptr = OBJ_AT_TOS;
valuePtr = OBJ_UNDER_TOS;
if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK) {
if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK
|| GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2) != TCL_OK) {
/*
* At least one non-numeric argument - compare as strings.
*/
goto stringCompare;
}
if (type1 == TCL_NUMBER_NAN) {
if (type1 == TCL_NUMBER_NAN || type2 == TCL_NUMBER_NAN) {
/*
* NaN first arg: NaN != to everything, other compares are false.
* NaN arg: NaN != to everything, other compares are false.
*/
iResult = (*pc == INST_NEQ);
goto foundResult;
}
if (valuePtr == value2Ptr) {
compare = MP_EQ;
goto convertComparison;
}
if (GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2) != TCL_OK) {
/*
* At least one non-numeric argument - compare as strings.
*/
goto stringCompare;
}
if (type2 == TCL_NUMBER_NAN) {
/*
* NaN 2nd arg: NaN != to everything, other compares are false.
*/
iResult = (*pc == INST_NEQ);
goto foundResult;
}
if ((type1 == TCL_NUMBER_LONG) && (type2 == TCL_NUMBER_LONG)) {
l1 = *((const long *)ptr1);
l2 = *((const long *)ptr2);
compare = (l1 < l2) ? MP_LT : ((l1 > l2) ? MP_GT : MP_EQ);
} else {
compare = TclCompareTwoNumbers(valuePtr, value2Ptr);
}
|
| ︙ | | |
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
|
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
|
-
+
|
* 4e9 and the latter 32 or 64...
*/
TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
if (l1 > 0L) {
objResultPtr = TCONST(0);
} else {
TclNewLongObj(objResultPtr, -1);
TclNewIntObj(objResultPtr, -1);
}
TRACE(("%s\n", O2S(objResultPtr)));
NEXT_INST_F(1, 2, 1);
}
/*
* Handle shifts within the native long range.
|
| ︙ | | |
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
|
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
|
-
+
|
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
iPtr->objResultPtr = objPtr;
NEXT_INST_F(1, 0, -1);
case INST_PUSH_RETURN_CODE:
TclNewLongObj(objResultPtr, result);
TclNewIntObj(objResultPtr, result);
TRACE(("=> %u\n", result));
NEXT_INST_F(1, 0, 1);
case INST_PUSH_RETURN_OPTIONS:
DECACHE_STACK_INFO();
objResultPtr = Tcl_GetReturnOptions(interp, result);
CACHE_STACK_INFO();
|
| ︙ | | |
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
|
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
NEXT_INST_F(5, 2, 0);
}
/*
* End of dictionary-related instructions.
* -----------------------------------------------------------------
*/
case INST_CLOCK_READ:
{ /* Read the wall clock */
Tcl_WideInt wval;
Tcl_Time now;
switch(TclGetUInt1AtPtr(pc+1)) {
case 0: /* clicks */
#ifdef TCL_WIDE_CLICKS
wval = TclpGetWideClicks();
#else
wval = (Tcl_WideInt) TclpGetClicks();
#endif
break;
case 1: /* microseconds */
Tcl_GetTime(&now);
wval = (Tcl_WideInt) now.sec * 1000000 + now.usec;
break;
case 2: /* milliseconds */
Tcl_GetTime(&now);
wval = (Tcl_WideInt) now.sec * 1000 + now.usec / 1000;
break;
case 3: /* seconds */
Tcl_GetTime(&now);
wval = (Tcl_WideInt) now.sec;
break;
default:
Tcl_Panic("clockRead instruction with unknown clock#");
}
/* TclNewWideObj(objResultPtr, wval); doesn't exist */
objResultPtr = Tcl_NewWideIntObj(wval);
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(2, 0, 1);
}
default:
Tcl_Panic("TclNRExecuteByteCode: unrecognized opCode %u", *pc);
} /* end of switch on opCode */
/*
* Block for variables needed to process exception returns.
|
| ︙ | | |
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
|
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
|
+
-
+
+
|
(unsigned) CURR_DEPTH, (unsigned) 0);
Tcl_Panic("TclNRExecuteByteCode execution failure: end stack top < start stack top");
}
CLANG_ASSERT(bcFramePtr);
}
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
if (codePtr->refCount-- <= 1) {
TclReleaseByteCode(codePtr);
TclCleanupByteCode(codePtr);
}
TclStackFree(interp, TD); /* free my stack */
return result;
/*
* INST_START_CMD failure case removed where it doesn't bother that much
*
|
| ︙ | | |
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
|
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
|
-
+
|
mp_clear(&big2);
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"exponent too large", -1));
return GENERAL_ARITHMETIC_ERROR;
}
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
mp_init(&bigResult);
mp_expt_d_ex(&big1, big2.dp[0], &bigResult, 1);
mp_expt_d(&big1, big2.dp[0], &bigResult);
mp_clear(&big1);
mp_clear(&big2);
BIG_RESULT(&bigResult);
}
case INST_ADD:
case INST_SUB:
|
| ︙ | | |
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
|
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
|
-
+
|
*/
int
TclCompareTwoNumbers(
Tcl_Obj *valuePtr,
Tcl_Obj *value2Ptr)
{
int type1, type2, compare;
int type1 = TCL_NUMBER_NAN, type2 = TCL_NUMBER_NAN, compare;
ClientData ptr1, ptr2;
mp_int big1, big2;
double d1, d2, tmp;
long l1, l2;
#ifndef TCL_WIDE_INT_IS_LONG
Tcl_WideInt w1, w2;
#endif
|
| ︙ | | |
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
|
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
|
-
-
-
+
+
+
|
PrintByteCodeInfo(
register ByteCode *codePtr) /* The bytecode whose summary is printed to
* stdout. */
{
Proc *procPtr = codePtr->procPtr;
Interp *iPtr = (Interp *) *codePtr->interpHandle;
fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %" TCL_LL_MODIFIER "u, epoch %" TCL_LL_MODIFIER "u, interp 0x%p (epoch %" TCL_LL_MODIFIER "u)\n",
codePtr, (Tcl_WideInt)codePtr->refCount, (Tcl_WideInt)codePtr->compileEpoch, iPtr,
(Tcl_WideInt)iPtr->compileEpoch);
fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %u, epoch %u, interp 0x%p (epoch %u)\n",
codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr,
iPtr->compileEpoch);
fprintf(stdout, " Source: ");
TclPrintSource(stdout, codePtr->source, 60);
fprintf(stdout, "\n Cmds %d, src %d, inst %u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
codePtr->numCommands, codePtr->numSrcBytes,
codePtr->numCodeBytes, codePtr->numLitObjects,
|
| ︙ | | |
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
|
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
|
-
+
|
stackTop, relativePc, stackUpperBound);
if (cmd != NULL) {
Tcl_Obj *message;
TclNewLiteralStringObj(message, "\n executing ");
Tcl_IncrRefCount(message);
Tcl_AppendLimitedToObj(message, cmd, numChars, 100, NULL);
fprintf(stderr,"%s\n", TclGetString(message));
fprintf(stderr,"%s\n", Tcl_GetString(message));
Tcl_DecrRefCount(message);
} else {
fprintf(stderr, "\n");
}
Tcl_Panic("TclNRExecuteByteCode execution failure: bad stack top");
}
}
|
| ︙ | | |
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
|
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
|
-
+
|
operator = "**";
} else if (opcode <= INST_LNOT) {
operator = operatorStrings[opcode - INST_LOR];
}
if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) {
int numBytes;
const char *bytes = TclGetStringFromObj(opndPtr, &numBytes);
const char *bytes = Tcl_GetStringFromObj(opndPtr, &numBytes);
if (numBytes == 0) {
description = "empty string";
} else if (TclCheckBadOctal(NULL, bytes)) {
description = "invalid octal number";
} else {
description = "non-numeric string";
|
| ︙ | | |
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
|
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
|
-
+
|
Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, NULL);
}
} else {
Tcl_Obj *objPtr = Tcl_ObjPrintf(
"unknown floating-point error, errno = %d", errno);
Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN",
TclGetString(objPtr), NULL);
Tcl_GetString(objPtr), NULL);
Tcl_SetObjResult(interp, objPtr);
}
}
#ifdef TCL_COMPILE_STATS
/*
*----------------------------------------------------------------------
|
| ︙ | | |
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
|
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
|
-
+
|
strBytesSharedOnce = 0.0;
for (i = 0; i < globalTablePtr->numBuckets; i++) {
for (entryPtr = globalTablePtr->buckets[i]; entryPtr != NULL;
entryPtr = entryPtr->nextPtr) {
if (entryPtr->objPtr->typePtr == &tclByteCodeType) {
numByteCodeLits++;
}
(void) TclGetStringFromObj(entryPtr->objPtr, &length);
(void) Tcl_GetStringFromObj(entryPtr->objPtr, &length);
refCountSum += entryPtr->refCount;
objBytesIfUnshared += (entryPtr->refCount * sizeof(Tcl_Obj));
strBytesIfUnshared += (entryPtr->refCount * (length+1));
if (entryPtr->refCount > 1) {
numSharedMultX++;
strBytesSharedMultX += (length+1);
} else {
|
| ︙ | | |
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
|
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
|
-
+
|
#endif
Tcl_AppendPrintfToObj(objPtr, "\n----------------------------------------------------------------\n");
if (objc == 1) {
Tcl_SetObjResult(interp, objPtr);
} else {
Tcl_Channel outChan;
char *str = TclGetStringFromObj(objv[1], &length);
char *str = Tcl_GetStringFromObj(objv[1], &length);
if (length) {
if (strcmp(str, "stdout") == 0) {
outChan = Tcl_GetStdChannel(TCL_STDOUT);
} else if (strcmp(str, "stderr") == 0) {
outChan = Tcl_GetStdChannel(TCL_STDERR);
} else {
|
| ︙ | | |
Changes to generic/tclFCmd.c.
| ︙ | | |
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
|
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
|
-
+
+
+
+
|
"bad option \"%s\", there are no file attributes in this"
" filesystem", TclGetString(objv[0])));
Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", NULL);
goto end;
}
if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings,
"option", INDEX_TEMP_TABLE, &index) != TCL_OK) {
"option", 0, &index) != TCL_OK) {
goto end;
}
if (attributeStringsAllocated != NULL) {
TclFreeIntRep(objv[0]);
}
if (Tcl_FSFileAttrsGet(interp, index, filePtr,
&objPtr) != TCL_OK) {
goto end;
}
Tcl_SetObjResult(interp, objPtr);
} else {
|
| ︙ | | |
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
|
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
|
-
+
+
+
+
|
" filesystem", TclGetString(objv[0])));
Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", NULL);
goto end;
}
for (i = 0; i < objc ; i += 2) {
if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings,
"option", INDEX_TEMP_TABLE, &index) != TCL_OK) {
"option", 0, &index) != TCL_OK) {
goto end;
}
if (attributeStringsAllocated != NULL) {
TclFreeIntRep(objv[i]);
}
if (i + 1 == objc) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"value for \"%s\" missing", TclGetString(objv[i])));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FATTR",
"NOVALUE", NULL);
goto end;
|
| ︙ | | |
Changes to generic/tclFileName.c.
| ︙ | | |
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
-
+
|
Tcl_Obj *pathPtr, /* Native path of interest */
int *driveNameLengthPtr, /* Returns length of drive, if non-NULL and
* path was absolute */
Tcl_Obj **driveNameRef)
{
Tcl_PathType type = TCL_PATH_ABSOLUTE;
int pathLen;
const char *path = TclGetStringFromObj(pathPtr, &pathLen);
const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen);
if (path[0] == '~') {
/*
* This case is common to all platforms. Paths that begin with ~ are
* absolute.
*/
|
| ︙ | | |
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
-
+
-
+
|
/*
* Calculate space required for the result.
*/
size = 1;
for (i = 0; i < *argcPtr; i++) {
Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
TclGetStringFromObj(eltPtr, &len);
Tcl_GetStringFromObj(eltPtr, &len);
size += len + 1;
}
/*
* Allocate a buffer large enough to hold the contents of all of the list
* plus the argv pointers and the terminating NULL pointer.
*/
*argvPtr = ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
/*
* Position p after the last argv pointer and copy the contents of the
* list in, piece by piece.
*/
p = (char *) &(*argvPtr)[(*argcPtr) + 1];
for (i = 0; i < *argcPtr; i++) {
Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
str = TclGetStringFromObj(eltPtr, &len);
str = Tcl_GetStringFromObj(eltPtr, &len);
memcpy(p, str, (size_t) len+1);
p += len+1;
}
/*
* Now set up the argv pointers.
*/
|
| ︙ | | |
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
|
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
|
-
+
|
const char *joining)
{
int length, needsSep;
char *dest;
const char *p;
const char *start;
start = TclGetStringFromObj(prefix, &length);
start = Tcl_GetStringFromObj(prefix, &length);
/*
* Remove the ./ from tilde prefixed elements, and drive-letter prefixed
* elements on Windows, unless it is the first component.
*/
p = joining;
|
| ︙ | | |
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
|
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
|
-
+
|
case TCL_PLATFORM_UNIX:
/*
* Append a separator if needed.
*/
if (length > 0 && (start[length-1] != '/')) {
Tcl_AppendToObj(prefix, "/", 1);
TclGetStringFromObj(prefix, &length);
Tcl_GetStringFromObj(prefix, &length);
}
needsSep = 0;
/*
* Append the element, eliminating duplicate and trailing slashes.
*/
|
| ︙ | | |
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
|
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
|
-
+
|
/*
* Check to see if we need to append a separator.
*/
if ((length > 0) &&
(start[length-1] != '/') && (start[length-1] != ':')) {
Tcl_AppendToObj(prefix, "/", 1);
TclGetStringFromObj(prefix, &length);
Tcl_GetStringFromObj(prefix, &length);
}
needsSep = 0;
/*
* Append the element, eliminating duplicate and trailing slashes.
*/
|
| ︙ | | |
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
|
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
|
-
+
|
Tcl_IncrRefCount(resultObj);
Tcl_DecrRefCount(listObj);
/*
* Store the result.
*/
resultStr = TclGetStringFromObj(resultObj, &len);
resultStr = Tcl_GetStringFromObj(resultObj, &len);
Tcl_DStringAppend(resultPtr, resultStr, len);
Tcl_DecrRefCount(resultObj);
/*
* Return a pointer to the result.
*/
|
| ︙ | | |
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
|
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
|
-
+
|
globFlags = 0;
join = 0;
dir = PATH_NONE;
typePtr = NULL;
for (i = 1; i < objc; i++) {
if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
&index) != TCL_OK) {
string = TclGetStringFromObj(objv[i], &length);
string = Tcl_GetStringFromObj(objv[i], &length);
if (string[0] == '-') {
/*
* It looks like the command contains an option so signal an
* error.
*/
return TCL_ERROR;
|
| ︙ | | |
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
|
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
|
-
+
|
separators = "/\\:";
break;
}
if (dir == PATH_GENERAL) {
int pathlength;
const char *last;
const char *first = TclGetStringFromObj(pathOrDir,&pathlength);
const char *first = Tcl_GetStringFromObj(pathOrDir,&pathlength);
/*
* Find the last path separator in the path
*/
last = first + pathlength;
for (; last != first; last--) {
|
| ︙ | | |
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
|
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
|
-
+
|
globTypes->macCreator = NULL;
while (--length >= 0) {
int len;
const char *str;
Tcl_ListObjIndex(interp, typePtr, length, &look);
str = TclGetStringFromObj(look, &len);
str = Tcl_GetStringFromObj(look, &len);
if (strcmp("readonly", str) == 0) {
globTypes->perm |= TCL_GLOB_PERM_RONLY;
} else if (strcmp("hidden", str) == 0) {
globTypes->perm |= TCL_GLOB_PERM_HIDDEN;
} else if (len == 1) {
switch (str[0]) {
case 'r':
|
| ︙ | | |
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
|
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
|
-
+
-
+
|
* If this length has never been set, set it here.
*/
if (pathPrefix == NULL) {
Tcl_Panic("Called TclGlob with TCL_GLOBMODE_TAILS and pathPrefix==NULL");
}
pre = TclGetStringFromObj(pathPrefix, &prefixLen);
pre = Tcl_GetStringFromObj(pathPrefix, &prefixLen);
if (prefixLen > 0
&& (strchr(separators, pre[prefixLen-1]) == NULL)) {
/*
* If we're on Windows and the prefix is a volume relative one
* like 'C:', then there won't be a path separator in between, so
* no need to skip it here.
*/
if ((tclPlatform != TCL_PLATFORM_WINDOWS) || (prefixLen != 2)
|| (pre[1] != ':')) {
prefixLen++;
}
}
Tcl_ListObjGetElements(NULL, filenamesObj, &objc, &objv);
for (i = 0; i< objc; i++) {
int len;
const char *oldStr = TclGetStringFromObj(objv[i], &len);
const char *oldStr = Tcl_GetStringFromObj(objv[i], &len);
Tcl_Obj *elem;
if (len == prefixLen) {
if ((pattern[0] == '\0')
|| (strchr(separators, pattern[0]) == NULL)) {
TclNewLiteralStringObj(elem, ".");
} else {
|
| ︙ | | |
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
|
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
|
-
+
|
Tcl_ListObjLength(NULL, matchesObj, &end);
while (repair < end) {
const char *bytes;
int numBytes;
Tcl_Obj *fixme, *newObj;
Tcl_ListObjIndex(NULL, matchesObj, repair, &fixme);
bytes = TclGetStringFromObj(fixme, &numBytes);
bytes = Tcl_GetStringFromObj(fixme, &numBytes);
newObj = Tcl_NewStringObj(bytes+2, numBytes-2);
Tcl_ListObjReplace(NULL, matchesObj, repair, 1,
1, &newObj);
repair++;
}
repair = -1;
}
|
| ︙ | | |
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
|
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
|
-
+
|
* approach).
*/
Tcl_DStringInit(&append);
Tcl_DStringAppend(&append, pattern, p-pattern);
if (pathPtr != NULL) {
(void) TclGetStringFromObj(pathPtr, &length);
(void) Tcl_GetStringFromObj(pathPtr, &length);
} else {
length = 0;
}
switch (tclPlatform) {
case TCL_PLATFORM_WINDOWS:
if (length == 0 && (Tcl_DStringLength(&append) == 0)) {
|
| ︙ | | |
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
|
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
|
-
+
|
joinedPtr = Tcl_DuplicateObj(pathPtr);
if (strchr(separators, Tcl_DStringValue(&append)[0]) == NULL) {
/*
* The current prefix must end in a separator.
*/
int len;
const char *joined = TclGetStringFromObj(joinedPtr,&len);
const char *joined = Tcl_GetStringFromObj(joinedPtr,&len);
if (strchr(separators, joined[len-1]) == NULL) {
Tcl_AppendToObj(joinedPtr, "/", 1);
}
}
Tcl_AppendToObj(joinedPtr, Tcl_DStringValue(&append),
Tcl_DStringLength(&append));
|
| ︙ | | |
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
|
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
|
-
+
|
* volume-relative path. In particular globbing in Windows shares,
* when not using -dir or -path, e.g. 'glob [file join
* //machine/share/subdir *]' requires adding a separator here.
* This behaviour is not currently tested for in the test suite.
*/
int len;
const char *joined = TclGetStringFromObj(joinedPtr,&len);
const char *joined = Tcl_GetStringFromObj(joinedPtr,&len);
if (strchr(separators, joined[len-1]) == NULL) {
if (Tcl_FSGetPathType(pathPtr) != TCL_PATH_VOLUME_RELATIVE) {
Tcl_AppendToObj(joinedPtr, "/", 1);
}
}
}
|
| ︙ | | |
Changes to generic/tclHash.c.
| ︙ | | |
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
-
+
|
/*
* Prototypes for the array hash key methods.
*/
static Tcl_HashEntry * AllocArrayEntry(Tcl_HashTable *tablePtr, void *keyPtr);
static int CompareArrayKeys(void *keyPtr, Tcl_HashEntry *hPtr);
static TCL_HASH_TYPE HashArrayKey(Tcl_HashTable *tablePtr, void *keyPtr);
static unsigned int HashArrayKey(Tcl_HashTable *tablePtr, void *keyPtr);
/*
* Prototypes for the one word hash key methods. Not actually declared because
* this is a critical path that is implemented in the core hash table access
* function.
*/
|
| ︙ | | |
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
-
+
|
/*
* Prototypes for the string hash key methods.
*/
static Tcl_HashEntry * AllocStringEntry(Tcl_HashTable *tablePtr,
void *keyPtr);
static int CompareStringKeys(void *keyPtr, Tcl_HashEntry *hPtr);
static TCL_HASH_TYPE HashStringKey(Tcl_HashTable *tablePtr, void *keyPtr);
static unsigned int HashStringKey(Tcl_HashTable *tablePtr, void *keyPtr);
/*
* Function prototypes for static functions in this file:
*/
static Tcl_HashEntry * BogusFind(Tcl_HashTable *tablePtr, const char *key);
static Tcl_HashEntry * BogusCreate(Tcl_HashTable *tablePtr, const char *key,
|
| ︙ | | |
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
+
+
+
+
|
*/
if (typePtr->compareKeysProc) {
Tcl_CompareHashKeysProc *compareKeysProc = typePtr->compareKeysProc;
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
#if TCL_HASH_KEY_STORE_HASH
if (hash != PTR2UINT(hPtr->hash)) {
continue;
}
#endif
if (((void *) key == hPtr) || compareKeysProc((void *) key, hPtr)) {
if (newPtr) {
*newPtr = 0;
}
return hPtr;
}
}
} else {
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
#if TCL_HASH_KEY_STORE_HASH
if (hash != PTR2UINT(hPtr->hash)) {
continue;
}
#endif
if (key == hPtr->key.oneWordValue) {
if (newPtr) {
*newPtr = 0;
}
return hPtr;
}
}
|
| ︙ | | |
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
|
+
+
+
+
+
+
|
} else {
hPtr = ckalloc(sizeof(Tcl_HashEntry));
hPtr->key.oneWordValue = (char *) key;
hPtr->clientData = 0;
}
hPtr->tablePtr = tablePtr;
#if TCL_HASH_KEY_STORE_HASH
hPtr->hash = UINT2PTR(hash);
hPtr->nextPtr = tablePtr->buckets[index];
tablePtr->buckets[index] = hPtr;
#else
hPtr->bucketPtr = &tablePtr->buckets[index];
hPtr->nextPtr = *hPtr->bucketPtr;
*hPtr->bucketPtr = hPtr;
#endif
tablePtr->numEntries++;
/*
* If the table has exceeded a decent size, rebuild it with many more
* buckets.
*/
|
| ︙ | | |
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
|
+
+
+
+
+
+
|
Tcl_DeleteHashEntry(
Tcl_HashEntry *entryPtr)
{
register Tcl_HashEntry *prevPtr;
const Tcl_HashKeyType *typePtr;
Tcl_HashTable *tablePtr;
Tcl_HashEntry **bucketPtr;
#if TCL_HASH_KEY_STORE_HASH
int index;
#endif
tablePtr = entryPtr->tablePtr;
if (tablePtr->keyType == TCL_STRING_KEYS) {
typePtr = &tclStringHashKeyType;
} else if (tablePtr->keyType == TCL_ONE_WORD_KEYS) {
typePtr = &tclOneWordHashKeyType;
} else if (tablePtr->keyType == TCL_CUSTOM_TYPE_KEYS
|| tablePtr->keyType == TCL_CUSTOM_PTR_KEYS) {
typePtr = tablePtr->typePtr;
} else {
typePtr = &tclArrayHashKeyType;
}
#if TCL_HASH_KEY_STORE_HASH
if (typePtr->hashKeyProc == NULL
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
index = RANDOM_INDEX(tablePtr, PTR2INT(entryPtr->hash));
} else {
index = PTR2UINT(entryPtr->hash) & tablePtr->mask;
}
bucketPtr = &tablePtr->buckets[index];
#else
bucketPtr = entryPtr->bucketPtr;
#endif
if (*bucketPtr == entryPtr) {
*bucketPtr = entryPtr->nextPtr;
} else {
for (prevPtr = *bucketPtr; ; prevPtr = prevPtr->nextPtr) {
if (prevPtr == NULL) {
Tcl_Panic("malformed bucket chain in Tcl_DeleteHashEntry");
|
| ︙ | | |
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
|
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
-
+
-
+
|
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static TCL_HASH_TYPE
static unsigned int
HashArrayKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
register const int *array = (const int *) keyPtr;
register unsigned int result;
int count;
for (result = 0, count = tablePtr->keyType; count > 0;
count--, array++) {
result += *array;
}
return (TCL_HASH_TYPE) result;
return result;
}
/*
*----------------------------------------------------------------------
*
* AllocStringEntry --
*
|
| ︙ | | |
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
|
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
|
-
+
|
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static TCL_HASH_TYPE
static unsigned
HashStringKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
register const char *string = keyPtr;
register unsigned int result;
register char c;
|
| ︙ | | |
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
|
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
|
-
+
-
+
|
*/
if ((result = UCHAR(*string)) != 0) {
while ((c = *++string) != 0) {
result += (result << 3) + UCHAR(c);
}
}
return (TCL_HASH_TYPE) result;
return result;
}
/*
*----------------------------------------------------------------------
*
* BogusFind --
*
* This function is invoked when Tcl_FindHashEntry is called on a
* This function is invoked when an Tcl_FindHashEntry is called on a
* table that has been deleted.
*
* Results:
* If Tcl_Panic returns (which it shouldn't) this function returns NULL.
*
* Side effects:
* Generates a panic.
|
| ︙ | | |
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
|
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
|
-
+
|
}
/*
*----------------------------------------------------------------------
*
* BogusCreate --
*
* This function is invoked when Tcl_CreateHashEntry is called on a
* This function is invoked when an Tcl_CreateHashEntry is called on a
* table that has been deleted.
*
* Results:
* If panic returns (which it shouldn't) this function returns NULL.
*
* Side effects:
* Generates a panic.
|
| ︙ | | |
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
|
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Rehash all of the existing entries into the new bucket array.
*/
for (oldChainPtr = oldBuckets; oldSize > 0; oldSize--, oldChainPtr++) {
for (hPtr = *oldChainPtr; hPtr != NULL; hPtr = *oldChainPtr) {
*oldChainPtr = hPtr->nextPtr;
#if TCL_HASH_KEY_STORE_HASH
if (typePtr->hashKeyProc == NULL
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
index = RANDOM_INDEX(tablePtr, PTR2INT(hPtr->hash));
} else {
index = PTR2UINT(hPtr->hash) & tablePtr->mask;
}
hPtr->nextPtr = tablePtr->buckets[index];
tablePtr->buckets[index] = hPtr;
#else
void *key = Tcl_GetHashKey(tablePtr, hPtr);
if (typePtr->hashKeyProc) {
unsigned int hash;
hash = typePtr->hashKeyProc(tablePtr, key);
if (typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
index = RANDOM_INDEX(tablePtr, hash);
} else {
index = hash & tablePtr->mask;
}
} else {
index = RANDOM_INDEX(tablePtr, key);
}
hPtr->bucketPtr = &tablePtr->buckets[index];
hPtr->nextPtr = *hPtr->bucketPtr;
*hPtr->bucketPtr = hPtr;
#endif
}
}
/*
* Free up the old bucket array, if it was dynamically allocated.
*/
|
| ︙ | | |
Changes to generic/tclIO.c.
| ︙ | | |
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
-
+
|
*/
typedef struct ResolvedChanName {
ChannelState *statePtr; /* The saved lookup result */
Tcl_Interp *interp; /* The interp in which the lookup was done. */
int epoch; /* The epoch of the channel when the lookup
* was done. Use to verify validity. */
size_t refCount; /* Share this struct among many Tcl_Obj. */
int refCount; /* Share this struct among many Tcl_Obj. */
} ResolvedChanName;
static void DupChannelIntRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
static void FreeChannelIntRep(Tcl_Obj *objPtr);
static const Tcl_ObjType chanObjType = {
"channel", /* name for this type */
|
| ︙ | | |
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
|
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
|
-
+
|
/* Split the overflowing buffer in two */
int extra = (int) (inBytes - csPtr->toRead);
/* Note that going with int for extra assumes that inBytes is not too
* much over toRead to require a wide itself. If that gets violated
* then the calculations involving extra must be made wide too.
*
* Noted with Win32/MSVC debug build treating the warning (possible of
* data in int64 to int conversion) as error.
* data in __int64 to int conversion) as error.
*/
bufPtr = AllocChannelBuffer(extra);
tail->nextAdded -= extra;
memcpy(InsertPoint(bufPtr), InsertPoint(tail), extra);
bufPtr->nextAdded += extra;
|
| ︙ | | |
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
|
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
|
-
+
|
static void
FreeChannelIntRep(
Tcl_Obj *objPtr) /* Object with internal rep to free. */
{
ResolvedChanName *resPtr = objPtr->internalRep.twoPtrValue.ptr1;
objPtr->typePtr = NULL;
if (resPtr->refCount-- > 1) {
if (--resPtr->refCount) {
return;
}
Tcl_Release(resPtr->statePtr);
ckfree(resPtr);
}
#if 0
|
| ︙ | | |
Changes to generic/tclIOCmd.c.
| ︙ | | |
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
-
+
-
+
+
|
#include "tclInt.h"
/*
* Callback structure for accept callback in a TCP server.
*/
typedef struct AcceptCallback {
Tcl_Obj *script; /* Script to invoke. */
char *script; /* Script to invoke. */
Tcl_Interp *interp; /* Interpreter in which to run it. */
} AcceptCallback;
/*
* Thread local storage used to maintain a per-thread stdout channel obj.
* It must be per-thread because of std channel limitations.
*/
typedef struct ThreadSpecificData {
int initialized; /* Set to 1 when the module is initialized. */
Tcl_Obj *stdoutObjPtr; /* Cached stdout channel Tcl_Obj */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
* Static functions for this file:
*/
static void FinalizeIOCmdTSD(ClientData clientData);
static Tcl_TcpAcceptProc AcceptCallbackProc;
static void AcceptCallbackProc(ClientData callbackData,
Tcl_Channel chan, char *address, int port);
static int ChanPendingObjCmd(ClientData unused,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int ChanTruncateObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static void RegisterTcpServerInterpCleanup(Tcl_Interp *interp,
|
| ︙ | | |
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
|
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
|
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
-
+
+
|
/*
* Check if the callback is still valid; the interpreter may have gone
* away, this is signalled by setting the interp field of the callback
* data to NULL.
*/
if (acceptCallbackPtr->interp != NULL) {
char portBuf[TCL_INTEGER_SPACE];
char *script = acceptCallbackPtr->script;
Tcl_Interp *interp = acceptCallbackPtr->interp;
Tcl_Obj *script, *objv[2];
int result = TCL_OK;
int result;
objv[0] = acceptCallbackPtr->script;
objv[1] = Tcl_NewListObj(3, NULL);
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(
Tcl_GetChannelName(chan), -1));
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(address, -1));
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewIntObj(port));
script = Tcl_ConcatObj(2, objv);
Tcl_IncrRefCount(script);
Tcl_DecrRefCount(objv[1]);
Tcl_Preserve(script);
Tcl_Preserve(interp);
Tcl_Preserve(interp);
TclFormatInt(portBuf, port);
Tcl_RegisterChannel(interp, chan);
/*
* Artificially bump the refcount to protect the channel from being
* deleted while the script is being evaluated.
*/
Tcl_RegisterChannel(NULL, chan);
result = Tcl_EvalObjEx(interp, script, TCL_EVAL_DIRECT|TCL_EVAL_GLOBAL);
result = Tcl_VarEval(interp, script, " ", Tcl_GetChannelName(chan),
Tcl_DecrRefCount(script);
" ", address, " ", portBuf, NULL);
if (result != TCL_OK) {
Tcl_BackgroundException(interp, result);
Tcl_UnregisterChannel(interp, chan);
}
/*
* Decrement the artificially bumped refcount. After this it is not
* safe anymore to use "chan", because it may now be deleted.
*/
Tcl_UnregisterChannel(NULL, chan);
Tcl_Release(interp);
Tcl_Release(script);
} else {
/*
* The interpreter has been deleted, so there is no useful way to use
* the client socket - just close it.
*/
Tcl_Close(NULL, chan);
|
| ︙ | | |
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
|
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
|
-
+
|
AcceptCallback *acceptCallbackPtr = callbackData;
/* The actual data. */
if (acceptCallbackPtr->interp != NULL) {
UnregisterTcpServerInterpCleanupProc(acceptCallbackPtr->interp,
acceptCallbackPtr);
}
Tcl_DecrRefCount(acceptCallbackPtr->script);
Tcl_EventuallyFree(acceptCallbackPtr->script, TCL_DYNAMIC);
ckfree(acceptCallbackPtr);
}
/*
*----------------------------------------------------------------------
*
* Tcl_SocketObjCmd --
|
| ︙ | | |
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
|
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
|
-
+
-
|
static const char *const socketOptions[] = {
"-async", "-myaddr", "-myport", "-server", NULL
};
enum socketOptions {
SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_SERVER
};
int optionIndex, a, server = 0, port, myport = 0, async = 0;
const char *host, *myaddr = NULL;
const char *host, *script = NULL, *myaddr = NULL;
Tcl_Obj *script = NULL;
Tcl_Channel chan;
if (TclpHasSockets(interp) != TCL_OK) {
return TCL_ERROR;
}
for (a = 1; a < objc; a++) {
|
| ︙ | | |
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
|
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
|
-
+
|
server = 1;
a++;
if (a >= objc) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"no argument given for -server option", -1));
return TCL_ERROR;
}
script = objv[a];
script = TclGetString(objv[a]);
break;
default:
Tcl_Panic("Tcl_SocketObjCmd: bad option index to SocketOptions");
}
}
if (server) {
host = myaddr; /* NULL implies INADDR_ANY */
|
| ︙ | | |
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
|
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
|
+
+
-
-
+
+
-
+
|
} else {
goto wrongNumArgs;
}
if (server) {
AcceptCallback *acceptCallbackPtr =
ckalloc(sizeof(AcceptCallback));
unsigned len = strlen(script) + 1;
char *copyScript = ckalloc(len);
Tcl_IncrRefCount(script);
acceptCallbackPtr->script = script;
memcpy(copyScript, script, len);
acceptCallbackPtr->script = copyScript;
acceptCallbackPtr->interp = interp;
chan = Tcl_OpenTcpServer(interp, port, host, AcceptCallbackProc,
acceptCallbackPtr);
if (chan == NULL) {
Tcl_DecrRefCount(script);
ckfree(copyScript);
ckfree(acceptCallbackPtr);
return TCL_ERROR;
}
/*
* Register with the interpreter to let us know when the interpreter
* is deleted (by having the callback set the interp field of the
|
| ︙ | | |
Changes to generic/tclIOGT.c.
| ︙ | | |
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
-
+
-
+
|
* the transformation. Used to execute the
* code below. */
Tcl_Obj *command; /* Tcl code to execute for a buffer */
ResultBuffer result; /* Internal buffer used to store the result of
* a transformation of incoming data. Also
* serves as buffer of all data not yet
* consumed by the reader. */
size_t refCount;
int refCount;
};
static void
PreserveData(
TransformChannelData *dataPtr)
{
dataPtr->refCount++;
}
static void
ReleaseData(
TransformChannelData *dataPtr)
{
if (dataPtr->refCount-- > 1) {
if (--dataPtr->refCount) {
return;
}
ResultClear(&dataPtr->result);
Tcl_DecrRefCount(dataPtr->command);
ckfree(dataPtr);
}
|
| ︙ | | |
Changes to generic/tclIORChan.c.
| ︙ | | |
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
|
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
|
-
+
|
* Check for non-optionals through the mask.
* Compare open mode against optional r/w.
*/
if (Tcl_ListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned non-list: %s",
TclGetString(cmdObj), TclGetString(resObj)));
Tcl_GetString(cmdObj), Tcl_GetString(resObj)));
Tcl_DecrRefCount(resObj);
goto error;
}
methods = 0;
while (listc > 0) {
if (Tcl_GetIndexFromObj(interp, listv[listc-1], methodNames,
|
| ︙ | | |
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
-
+
-
+
-
+
-
+
-
+
|
listc--;
}
Tcl_DecrRefCount(resObj);
if ((REQUIRED_METHODS & methods) != REQUIRED_METHODS) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" does not support all required methods",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
if ((mode & TCL_READABLE) && !HAS(methods, METH_READ)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" lacks a \"read\" method",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
if ((mode & TCL_WRITABLE) && !HAS(methods, METH_WRITE)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" lacks a \"write\" method",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
if (!IMPLIES(HAS(methods, METH_CGET), HAS(methods, METH_CGETALL))) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" supports \"cget\" but not \"cgetall\"",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
if (!IMPLIES(HAS(methods, METH_CGETALL), HAS(methods, METH_CGET))) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" supports \"cgetall\" but not \"cget\"",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
Tcl_ResetResult(interp);
/*
* Everything is fine now.
|
| ︙ | | |
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
|
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
|
-
+
|
FreeReceivedError(&p);
}
}
#endif
tctPtr = ((Channel *)rcPtr->chan)->typePtr;
if (tctPtr && tctPtr != &tclRChannelType) {
ckfree(tctPtr);
ckfree((char *)tctPtr);
((Channel *)rcPtr->chan)->typePtr = NULL;
}
Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel);
return EOK;
}
/*
|
| ︙ | | |
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
|
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
|
-
+
|
if (hPtr) {
Tcl_DeleteHashEntry(hPtr);
}
}
#endif
tctPtr = ((Channel *)rcPtr->chan)->typePtr;
if (tctPtr && tctPtr != &tclRChannelType) {
ckfree(tctPtr);
ckfree((char *)tctPtr);
((Channel *)rcPtr->chan)->typePtr = NULL;
}
Tcl_EventuallyFree(rcPtr, (Tcl_FreeProc *) FreeReflectedChannel);
return (result == TCL_OK) ? EOK : EINVAL;
}
/*
|
| ︙ | | |
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
|
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
|
-
+
|
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"Expected list with even number of "
"elements, got %d element%s instead", listc,
(listc == 1 ? "" : "s")));
goto error;
} else {
int len;
const char *str = TclGetStringFromObj(resObj, &len);
const char *str = Tcl_GetStringFromObj(resObj, &len);
if (len) {
TclDStringAppendLiteral(dsPtr, " ");
Tcl_DStringAppend(dsPtr, str, len);
}
goto ok;
}
|
| ︙ | | |
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
|
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
|
-
+
|
*
* This is complex and ugly, and would be completely unnecessary
* if we only added support for a TCL_FORBID_EXCEPTIONS flag.
*/
if (result != TCL_ERROR) {
int cmdLen;
const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);
const char *cmdString = Tcl_GetStringFromObj(cmd, &cmdLen);
Tcl_IncrRefCount(cmd);
Tcl_ResetResult(rcPtr->interp);
Tcl_SetObjResult(rcPtr->interp, Tcl_ObjPrintf(
"chan handler returned bad code: %d", result));
Tcl_LogCommandInfo(rcPtr->interp, cmdString, cmdString,
cmdLen);
|
| ︙ | | |
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
|
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
|
-
+
|
sr = Tcl_SaveInterpState(rcPtr->interp, 0 /* Dummy */);
UnmarshallErrorResult(rcPtr->interp, resObj);
resObj = Tcl_GetObjResult(rcPtr->interp);
if (((Tcl_GetIntFromObj(rcPtr->interp, resObj, &code) != TCL_OK)
|| (code >= 0))) {
if (strcmp("EAGAIN", TclGetString(resObj)) == 0) {
if (strcmp("EAGAIN", Tcl_GetString(resObj)) == 0) {
code = -EAGAIN;
} else {
code = 0;
}
}
Tcl_RestoreInterpState(rcPtr->interp, sr);
|
| ︙ | | |
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
|
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
|
-
+
|
sprintf(buf,
"{Expected list with even number of elements, got %d %s instead}",
listc, (listc == 1 ? "element" : "elements"));
ForwardSetDynamicError(paramPtr, buf);
} else {
int len;
const char *str = TclGetStringFromObj(resObj, &len);
const char *str = Tcl_GetStringFromObj(resObj, &len);
if (len) {
TclDStringAppendLiteral(paramPtr->getOpt.value, " ");
Tcl_DStringAppend(paramPtr->getOpt.value, str, len);
}
}
}
|
| ︙ | | |
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
|
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
|
-
+
|
static void
ForwardSetObjError(
ForwardParam *paramPtr,
Tcl_Obj *obj)
{
int len;
const char *msgStr = TclGetStringFromObj(obj, &len);
const char *msgStr = Tcl_GetStringFromObj(obj, &len);
len++;
ForwardSetDynamicError(paramPtr, ckalloc(len));
memcpy(paramPtr->base.msgStr, msgStr, (unsigned) len);
}
#endif
|
| ︙ | | |
Changes to generic/tclIORTrans.c.
| ︙ | | |
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
|
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
|
-
+
|
}
/*
* First argument is a channel handle.
*/
chanObj = objv[CHAN];
parentChan = Tcl_GetChannel(interp, TclGetString(chanObj), &mode);
parentChan = Tcl_GetChannel(interp, Tcl_GetString(chanObj), &mode);
if (parentChan == NULL) {
return TCL_ERROR;
}
parentChan = Tcl_GetTopChannel(parentChan);
/*
* Second argument is command prefix, i.e. list of words, first word is
|
| ︙ | | |
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
|
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
|
-
+
-
+
-
+
|
* - List, of method names. Convert to mask. Check for non-optionals
* through the mask. Compare open mode against optional r/w.
*/
if (Tcl_ListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned non-list: %s",
TclGetString(cmdObj), TclGetString(resObj)));
Tcl_GetString(cmdObj), Tcl_GetString(resObj)));
Tcl_DecrRefCount(resObj);
goto error;
}
methods = 0;
while (listc > 0) {
if (Tcl_GetIndexFromObj(interp, listv[listc-1], methodNames,
"method", TCL_EXACT, &methIndex) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned %s",
TclGetString(cmdObj),
Tcl_GetString(cmdObj),
Tcl_GetString(Tcl_GetObjResult(interp))));
Tcl_DecrRefCount(resObj);
goto error;
}
methods |= FLAG(methIndex);
listc--;
}
Tcl_DecrRefCount(resObj);
if ((REQUIRED_METHODS & methods) != REQUIRED_METHODS) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" does not support all required methods",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
/*
* Mode tell us what the parent channel supports. The methods tell us what
* the handler supports. We remove the non-supported bits from the mode
* and check that the channel is not completely inacessible. Afterward the
|
| ︙ | | |
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
|
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
|
-
+
-
+
-
+
-
+
-
+
|
if (!HAS(methods, METH_WRITE)) {
mode &= ~TCL_WRITABLE;
}
if (!mode) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" makes the channel inaccessible",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
/*
* The mode and support for it is ok, now check the internal constraints.
*/
if (!IMPLIES(HAS(methods, METH_DRAIN), HAS(methods, METH_READ))) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" supports \"drain\" but not \"read\"",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
if (!IMPLIES(HAS(methods, METH_FLUSH), HAS(methods, METH_WRITE))) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s\" supports \"flush\" but not \"write\"",
TclGetString(cmdObj)));
Tcl_GetString(cmdObj)));
goto error;
}
Tcl_ResetResult(interp);
/*
* Everything is fine now.
*/
rtPtr->methods = methods;
rtPtr->mode = mode;
rtPtr->chan = Tcl_StackChannel(interp, &tclRTransformType, rtPtr, mode,
rtPtr->parent);
/*
* Register the transform in our our map for proper handling of deleted
* interpreters and/or threads.
*/
rtmPtr = GetReflectedTransformMap(interp);
hPtr = Tcl_CreateHashEntry(&rtmPtr->map, TclGetString(rtId), &isNew);
hPtr = Tcl_CreateHashEntry(&rtmPtr->map, Tcl_GetString(rtId), &isNew);
if (!isNew && rtPtr != Tcl_GetHashValue(hPtr)) {
Tcl_Panic("TclChanPushObjCmd: duplicate transformation handle");
}
Tcl_SetHashValue(hPtr, rtPtr);
#ifdef TCL_THREADS
rtmPtr = GetThreadReflectedTransformMap();
hPtr = Tcl_CreateHashEntry(&rtmPtr->map, TclGetString(rtId), &isNew);
hPtr = Tcl_CreateHashEntry(&rtmPtr->map, Tcl_GetString(rtId), &isNew);
Tcl_SetHashValue(hPtr, rtPtr);
#endif /* TCL_THREADS */
/*
* Return the channel as the result of the command.
*/
|
| ︙ | | |
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
|
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
|
-
+
|
* In a threaded interpreter we manage a per-thread map as well,
* to allow us to survive if the script level pulls the rug out
* under a channel by deleting the owning thread.
*/
#ifdef TCL_THREADS
rtmPtr = GetThreadReflectedTransformMap();
hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle));
hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle));
if (hPtr) {
Tcl_DeleteHashEntry(hPtr);
}
#endif /* TCL_THREADS */
}
Tcl_EventuallyFree (rtPtr, (Tcl_FreeProc *) FreeReflectedTransform);
|
| ︙ | | |
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
|
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
|
-
+
|
*
* This is complex and ugly, and would be completely unnecessary
* if we only added support for a TCL_FORBID_EXCEPTIONS flag.
*/
if (result != TCL_ERROR) {
Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rtPtr->argv);
int cmdLen;
const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);
const char *cmdString = Tcl_GetStringFromObj(cmd, &cmdLen);
Tcl_IncrRefCount(cmd);
Tcl_ResetResult(rtPtr->interp);
Tcl_SetObjResult(rtPtr->interp, Tcl_ObjPrintf(
"chan handler returned bad code: %d", result));
Tcl_LogCommandInfo(rtPtr->interp, cmdString, cmdString, cmdLen);
Tcl_DecrRefCount(cmd);
|
| ︙ | | |
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
|
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
|
-
+
-
+
|
/*
* Remove the channel from the map before releasing the memory, to
* prevent future accesses (like by 'postevent') from finding and
* dereferencing a dangling pointer.
*/
rtmPtr = GetReflectedTransformMap(interp);
hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle));
hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle));
Tcl_DeleteHashEntry(hPtr);
/*
* In a threaded interpreter we manage a per-thread map as well, to
* allow us to survive if the script level pulls the rug out under a
* channel by deleting the owning thread.
*/
rtmPtr = GetThreadReflectedTransformMap();
hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle));
hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle));
Tcl_DeleteHashEntry(hPtr);
FreeReflectedTransformArgs(rtPtr);
break;
case ForwardedInput: {
Tcl_Obj *bufObj = Tcl_NewByteArrayObj((unsigned char *)
|
| ︙ | | |
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
|
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
|
-
+
|
static void
ForwardSetObjError(
ForwardParam *paramPtr,
Tcl_Obj *obj)
{
int len;
const char *msgStr = TclGetStringFromObj(obj, &len);
const char *msgStr = Tcl_GetStringFromObj(obj, &len);
len++;
ForwardSetDynamicError(paramPtr, ckalloc(len));
memcpy(paramPtr->base.msgStr, msgStr, (unsigned) len);
}
#endif /* TCL_THREADS */
|
| ︙ | | |
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
|
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
|
-
+
|
{
rPtr->used = 0;
if (!rPtr->allocated) {
return;
}
ckfree(rPtr->buf);
ckfree((char *) rPtr->buf);
rPtr->buf = NULL;
rPtr->allocated = 0;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
Changes to generic/tclIOSock.c.
| ︙ | | |
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
-
-
+
+
|
*
*---------------------------------------------------------------------------
*/
int
TclSockGetPort(
Tcl_Interp *interp,
const char *string, /* Integer or service name */
const char *proto, /* "tcp" or "udp", typically */
const char *string, /* Integer or service name */
const char *proto, /* "tcp" or "udp", typically */
int *portPtr) /* Return port number */
{
struct servent *sp; /* Protocol info for named services */
Tcl_DString ds;
const char *native;
if (Tcl_GetInt(NULL, string, portPtr) != TCL_OK) {
|
| ︙ | | |
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
|
* Fills in the *sockaddrPtr structure.
*
*----------------------------------------------------------------------
*/
int
TclCreateSocketAddress(
Tcl_Interp *interp, /* Interpreter for querying the desired socket
* family */
struct addrinfo **addrlist, /* Socket address list */
const char *host, /* Host. NULL implies INADDR_ANY */
int port, /* Port number */
int willBind, /* Is this an address to bind() to or to
* connect() to? */
const char **errorMsgPtr) /* Place to store the error message detail, if
* available. */
Tcl_Interp *interp, /* Interpreter for querying
* the desired socket family */
struct addrinfo **addrlist, /* Socket address list */
const char *host, /* Host. NULL implies INADDR_ANY */
int port, /* Port number */
int willBind, /* Is this an address to bind() to or
* to connect() to? */
const char **errorMsgPtr) /* Place to store the error message
* detail, if available. */
{
struct addrinfo hints;
struct addrinfo *p;
struct addrinfo *v4head = NULL, *v4ptr = NULL;
struct addrinfo *v6head = NULL, *v6ptr = NULL;
char *native = NULL, portbuf[TCL_INTEGER_SPACE], *portstring;
const char *family = NULL;
Tcl_DString ds;
int result;
if (host != NULL) {
native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
}
/*
* Workaround for OSX's apparent inability to resolve "localhost", "0"
* when the loopback device is the only available network interface.
*/
if (host != NULL && port == 0) {
portstring = NULL;
portstring = NULL;
} else {
TclFormatInt(portbuf, port);
portstring = portbuf;
TclFormatInt(portbuf, port);
portstring = portbuf;
}
(void) memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
/*
* Magic variable to enforce a certain address family; to be superseded
* by a TIP that adds explicit switches to [socket].
* Magic variable to enforce a certain address family - to be superseded
* by a TIP that adds explicit switches to [socket]
*/
if (interp != NULL) {
family = Tcl_GetVar2(interp, "::tcl::unsupported::socketAF", NULL, 0);
if (family != NULL) {
if (strcmp(family, "inet") == 0) {
hints.ai_family = AF_INET;
} else if (strcmp(family, "inet6") == 0) {
hints.ai_family = AF_INET6;
}
}
family = Tcl_GetVar(interp, "::tcl::unsupported::socketAF", 0);
if (family != NULL) {
if (strcmp(family, "inet") == 0) {
hints.ai_family = AF_INET;
} else if (strcmp(family, "inet6") == 0) {
hints.ai_family = AF_INET6;
}
}
}
hints.ai_socktype = SOCK_STREAM;
#if 0
/*
* We found some problems when using AI_ADDRCONFIG, e.g. on systems that
|
| ︙ | | |
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
-
|
/*
* Put IPv4 addresses before IPv6 addresses to maximize backwards
* compatibility of [fconfigure -sockname] output.
*
* There might be more elegant/efficient ways to do this.
*/
if (willBind) {
for (p = *addrlist; p != NULL; p = p->ai_next) {
if (p->ai_family == AF_INET) {
if (v4head == NULL) {
v4head = p;
} else {
v4ptr->ai_next = p;
|
| ︙ | | |
Changes to generic/tclIOUtil.c.
| ︙ | | |
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
-
-
+
+
|
if (tsdPtr->cwdPathPtr == *pathPtrPtr) {
return 1;
} else {
int len1, len2;
const char *str1, *str2;
str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1);
str2 = TclGetStringFromObj(*pathPtrPtr, &len2);
str1 = Tcl_GetStringFromObj(tsdPtr->cwdPathPtr, &len1);
str2 = Tcl_GetStringFromObj(*pathPtrPtr, &len2);
if ((len1 == len2) && !memcmp(str1, str2, len1)) {
/*
* They are equal, but different objects. Update so they will be
* the same object in the future.
*/
Tcl_DecrRefCount(*pathPtrPtr);
|
| ︙ | | |
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
|
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
|
-
+
|
ClientData clientData)
{
int len;
const char *str = NULL;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
if (cwdObj != NULL) {
str = TclGetStringFromObj(cwdObj, &len);
str = Tcl_GetStringFromObj(cwdObj, &len);
}
Tcl_MutexLock(&cwdMutex);
if (cwdPathPtr != NULL) {
Tcl_DecrRefCount(cwdPathPtr);
}
if (cwdClientData != NULL) {
|
| ︙ | | |
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
|
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
|
-
-
+
+
|
* i.e. the representation which is relative to pathPtr.
*/
norm = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (norm != NULL) {
const char *path, *mount;
mount = TclGetStringFromObj(mElt, &mlen);
path = TclGetStringFromObj(norm, &len);
mount = Tcl_GetStringFromObj(mElt, &mlen);
path = Tcl_GetStringFromObj(norm, &len);
if (path[len-1] == '/') {
/*
* Deal with the root of the volume.
*/
len--;
}
|
| ︙ | | |
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
|
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
|
-
+
|
goto end;
}
iPtr = (Interp *) interp;
oldScriptFile = iPtr->scriptFile;
iPtr->scriptFile = pathPtr;
Tcl_IncrRefCount(iPtr->scriptFile);
string = TclGetStringFromObj(objPtr, &length);
string = Tcl_GetStringFromObj(objPtr, &length);
/*
* TIP #280 Force the evaluator to open a frame for a sourced file.
*/
iPtr->evalFlags |= TCL_EVAL_FILE;
result = TclEvalEx(interp, string, length, 0, 1, NULL, string);
|
| ︙ | | |
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
|
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
|
-
+
|
if (result == TCL_RETURN) {
result = TclUpdateReturnInfo(iPtr);
} else if (result == TCL_ERROR) {
/*
* Record information telling where the error occurred.
*/
const char *pathString = TclGetStringFromObj(pathPtr, &length);
const char *pathString = Tcl_GetStringFromObj(pathPtr, &length);
int limit = 150;
int overflow = (length > limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (file \"%.*s%s\" line %d)",
(overflow ? limit : length), pathString,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
|
| ︙ | | |
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
|
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
|
-
+
|
result = TclUpdateReturnInfo(iPtr);
} else if (result == TCL_ERROR) {
/*
* Record information telling where the error occurred.
*/
int length;
const char *pathString = TclGetStringFromObj(pathPtr, &length);
const char *pathString = Tcl_GetStringFromObj(pathPtr, &length);
const int limit = 150;
int overflow = (length > limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (file \"%.*s%s\" line %d)",
(overflow ? limit : length), pathString,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
|
| ︙ | | |
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
|
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
|
-
-
+
+
|
* 'Tcl_FSEqualPaths', and in addition avoid a nasty infinite loop
* bug when trying to normalize tsdPtr->cwdPathPtr.
*/
int len1, len2;
const char *str1, *str2;
str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1);
str2 = TclGetStringFromObj(norm, &len2);
str1 = Tcl_GetStringFromObj(tsdPtr->cwdPathPtr, &len1);
str2 = Tcl_GetStringFromObj(norm, &len2);
if ((len1 == len2) && (strcmp(str1, str2) == 0)) {
/*
* If the paths were equal, we can be more efficient and
* retain the old path object which will probably already be
* shared. In this case we can simply free the normalized path
* we just calculated.
*/
|
| ︙ | | |
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
|
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
|
-
+
|
Tcl_Obj **driveNameRef) /* If the path is absolute, and this is
* non-NULL, then set to the name of the
* drive, network-volume which contains the
* path, already with a refCount for the
* caller. */
{
int pathLen;
const char *path = TclGetStringFromObj(pathPtr, &pathLen);
const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen);
Tcl_PathType type;
type = TclFSNonnativePathType(path, pathLen, filesystemPtrPtr,
driveNameLengthPtr, driveNameRef);
if (type != TCL_PATH_ABSOLUTE) {
type = TclpGetNativePathType(pathPtr, driveNameLengthPtr,
|
| ︙ | | |
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
|
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
|
-
+
|
while (numVolumes > 0) {
Tcl_Obj *vol;
int len;
const char *strVol;
numVolumes--;
Tcl_ListObjIndex(NULL, thisFsVolumes, numVolumes, &vol);
strVol = TclGetStringFromObj(vol,&len);
strVol = Tcl_GetStringFromObj(vol,&len);
if (pathLen < len) {
continue;
}
if (strncmp(strVol, path, (size_t) len) == 0) {
type = TCL_PATH_ABSOLUTE;
if (filesystemPtrPtr != NULL) {
*filesystemPtrPtr = fsRecPtr->fsPtr;
|
| ︙ | | |
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
|
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
|
-
-
+
+
|
if (cwdPtr != NULL) {
const char *cwdStr, *normPathStr;
int cwdLen, normLen;
Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (normPath != NULL) {
normPathStr = TclGetStringFromObj(normPath, &normLen);
cwdStr = TclGetStringFromObj(cwdPtr, &cwdLen);
normPathStr = Tcl_GetStringFromObj(normPath, &normLen);
cwdStr = Tcl_GetStringFromObj(cwdPtr, &cwdLen);
if ((cwdLen >= normLen) && (strncmp(normPathStr, cwdStr,
(size_t) normLen) == 0)) {
/*
* The cwd is inside the directory, so we perform a 'cd
* [file dirname $path]'.
*/
|
| ︙ | | |
Changes to generic/tclIndexObj.c.
| ︙ | | |
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
+
-
+
|
* value of objPtr; last entry must be NULL
* and there must not be duplicate entries. */
const char *msg, /* Identifying word to use in error
* messages. */
int flags, /* 0 or TCL_EXACT */
int *indexPtr) /* Place to store resulting integer index. */
{
/*
* See if there is a valid cached result from a previous lookup (doing the
* check here saves the overhead of calling Tcl_GetIndexFromObjStruct in
* the common case where the result is cached).
*/
if (!(flags & INDEX_TEMP_TABLE) && objPtr->typePtr == &indexType) {
if (objPtr->typePtr == &indexType) {
IndexRep *indexRep = objPtr->internalRep.twoPtrValue.ptr1;
/*
* Here's hoping we don't get hit by unfortunate packing constraints
* on odd platforms like a Cray PVP...
*/
|
| ︙ | | |
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
-
+
+
+
+
+
+
|
}
tablePtr[t] = Tcl_GetString(objv[t]);
}
tablePtr[objc] = NULL;
result = Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr,
sizeof(char *), msg, flags | INDEX_TEMP_TABLE, indexPtr);
sizeof(char *), msg, flags, indexPtr);
/*
* The internal rep must be cleared since tablePtr will go away.
*/
TclFreeIntRep(objPtr);
ckfree(tablePtr);
return result;
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
-
+
|
if (offset < (int)sizeof(char *)) {
offset = (int)sizeof(char *);
}
/*
* See if there is a valid cached result from a previous lookup.
*/
if (!(flags & INDEX_TEMP_TABLE) && objPtr->typePtr == &indexType) {
if (objPtr->typePtr == &indexType) {
indexRep = objPtr->internalRep.twoPtrValue.ptr1;
if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
*indexPtr = indexRep->index;
return TCL_OK;
}
}
|
| ︙ | | |
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
|
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
|
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
|
done:
/*
* 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.
*/
if (!(flags & INDEX_TEMP_TABLE)) {
if (objPtr->typePtr == &indexType) {
indexRep = objPtr->internalRep.twoPtrValue.ptr1;
} else {
TclFreeIntRep(objPtr);
indexRep = ckalloc(sizeof(IndexRep));
objPtr->internalRep.twoPtrValue.ptr1 = indexRep;
objPtr->typePtr = &indexType;
}
indexRep->tablePtr = (void *) tablePtr;
indexRep->offset = offset;
indexRep->index = index;
if (objPtr->typePtr == &indexType) {
indexRep = objPtr->internalRep.twoPtrValue.ptr1;
} else {
TclFreeIntRep(objPtr);
indexRep = ckalloc(sizeof(IndexRep));
objPtr->internalRep.twoPtrValue.ptr1 = indexRep;
objPtr->typePtr = &indexType;
}
indexRep->tablePtr = (void *) tablePtr;
indexRep->offset = offset;
indexRep->index = index;
}
*indexPtr = index;
return TCL_OK;
error:
if (interp != NULL) {
/*
|
| ︙ | | |
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
|
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
|
-
+
-
+
|
}
result = Tcl_ListObjGetElements(interp, objv[1], &tableObjc, &tableObjv);
if (result != TCL_OK) {
return result;
}
resultPtr = Tcl_NewListObj(0, NULL);
string = TclGetStringFromObj(objv[2], &length);
string = Tcl_GetStringFromObj(objv[2], &length);
for (t = 0; t < tableObjc; t++) {
elemString = TclGetStringFromObj(tableObjv[t], &elemLength);
elemString = Tcl_GetStringFromObj(tableObjv[t], &elemLength);
/*
* A prefix cannot match if it is longest.
*/
if (length <= elemLength) {
if (TclpUtfNcmp2(elemString, string, length) == 0) {
|
| ︙ | | |
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
|
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
-
+
-
+
|
return TCL_ERROR;
}
result = Tcl_ListObjGetElements(interp, objv[1], &tableObjc, &tableObjv);
if (result != TCL_OK) {
return result;
}
string = TclGetStringFromObj(objv[2], &length);
string = Tcl_GetStringFromObj(objv[2], &length);
resultString = NULL;
resultLength = 0;
for (t = 0; t < tableObjc; t++) {
elemString = TclGetStringFromObj(tableObjv[t], &elemLength);
elemString = Tcl_GetStringFromObj(tableObjv[t], &elemLength);
/*
* First check if the prefix string matches the element. A prefix
* cannot match if it is longest.
*/
if ((length > elemLength) ||
|
| ︙ | | |
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
|
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
|
-
+
|
srcIndex = dstIndex = 1;
objc = *objcPtr-1;
while (objc > 0) {
curArg = objv[srcIndex];
srcIndex++;
objc--;
str = TclGetStringFromObj(curArg, &length);
str = Tcl_GetStringFromObj(curArg, &length);
if (length > 0) {
c = str[1];
} else {
c = 0;
}
/*
|
| ︙ | | |
Changes to generic/tclInt.decls.
| ︙ | | |
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
|
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
|
-
+
|
declare 250 {
void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags, int force)
}
# Allow extensions for optimization
declare 251 {
int TclRegisterLiteral(void *envPtr,
const char *bytes, int length, int flags)
char *bytes, int length, int flags)
}
##############################################################################
# Define the platform specific internal Tcl interface. These functions are
# only available on the designated platform.
|
| ︙ | | |
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
|
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
|
-
+
|
Tcl_GlobTypeData *types)
}
declare 19 macosx {
void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode)
}
declare 29 {win unix} {
int TclWinCPUID(int index, int *regs)
int TclWinCPUID(unsigned int index, unsigned int *regs)
}
# Added in 8.6; core of TclpOpenTemporaryFile
declare 30 {win unix} {
int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj,
Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj)
}
# Local Variables:
# mode: tcl
# End:
|
Changes to generic/tclInt.h.
| ︙ | | |
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
-
-
-
-
-
-
-
-
-
-
-
-
-
|
/*
* Some numerics configuration options.
*/
#undef ACCEPT_NAN
/*
* In Tcl 8.7, stop supporting special hacks for legacy Itcl 3.
* Itcl 4 doesn't need them. Itcl 3 can be updated to not need them
* using the Tcl(Init|Reset)RewriteEnsemble() routines in all Tcl 8.6+
* releases. Perhaps Tcl 8.7 will add even better public interfaces
* supporting all the re-invocation mechanisms extensions like Itcl 3
* need. As an absolute last resort, folks who must make Itcl 3 work
* unchanged with Tcl 8.7 can remove this line to regain the migration
* support. Tcl 9 will no longer offer even that option.
*/
#define AVOID_HACKS_FOR_ITCL 1
/*
* Common include files needed by most of the Tcl source files are included
* here, so that system-dependent personalizations for the include files only
* have to be made in once place. This results in a few extra includes, but
* greater modularity. The order of the three groups of #includes is
* important. For example, stdio.h is needed by tcl.h.
*/
|
| ︙ | | |
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
|
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
|
-
+
|
* values. */
int unused1; /* No longer used (was termOffset) */
LiteralTable literalTable; /* Contains LiteralEntry's describing all Tcl
* objects holding literals of scripts
* compiled by the interpreter. Indexed by the
* string representations of literals. Used to
* avoid creating duplicate objects. */
unsigned int compileEpoch; /* Holds the current "compilation epoch" for
int compileEpoch; /* Holds the current "compilation epoch" for
* this interpreter. This is incremented to
* invalidate existing ByteCodes when, e.g., a
* command with a compile procedure is
* redefined. */
Proc *compiledProcPtr; /* If a procedure is being compiled, a pointer
* to its Proc structure; otherwise, this is
* NULL. Set by ObjInterpProc in tclProc.c and
|
| ︙ | | |
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
|
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
|
-
-
-
-
-
-
-
-
-
|
Tcl_Obj *fileName, Tcl_Obj *attrObjPtr);
typedef struct TclFileAttrProcs {
TclGetFileAttrProc *getProc;/* The procedure for getting attrs. */
TclSetFileAttrProc *setProc;/* The procedure for setting attrs. */
} TclFileAttrProcs;
/*
* Private flag value which controls Tcl_GetIndexFromObj*() routines
* to instruct them not to cache lookups because the table will not
* live long enough to make it worthwhile. Must not clash with public
* flag value TCL_EXACT.
*/
#define INDEX_TEMP_TABLE 2
/*
* Opaque handle used in pipeline routines to encapsulate platform-dependent
* state.
*/
typedef struct TclFile_ *TclFile;
|
| ︙ | | |
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
|
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
|
-
+
-
+
-
+
|
/*
*----------------------------------------------------------------
* Data structures for process-global values.
*----------------------------------------------------------------
*/
typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, size_t *lengthPtr,
typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, int *lengthPtr,
Tcl_Encoding *encodingPtr);
/*
* A ProcessGlobalValue struct exists for each internal value in Tcl that is
* to be shared among several threads. Each thread sees a (Tcl_Obj) copy of
* the value, and the master is kept as a counted string, with epoch and mutex
* control. Each ProcessGlobalValue struct should be a static variable in some
* file.
*/
typedef struct ProcessGlobalValue {
size_t epoch; /* Epoch counter to detect changes in the
int epoch; /* Epoch counter to detect changes in the
* master value. */
size_t numBytes; /* Length of the master string. */
int numBytes; /* Length of the master string. */
char *value; /* The master string value. */
Tcl_Encoding encoding; /* system encoding when master string was
* initialized. */
TclInitProcessGlobalValueProc *proc;
/* A procedure to initialize the master string
* copy when a "get" request comes in before
* any "set" request has been received. */
|
| ︙ | | |
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
|
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
|
+
|
MODULE_SCOPE const Tcl_ObjType tclDoubleType;
MODULE_SCOPE const Tcl_ObjType tclEndOffsetType;
MODULE_SCOPE const Tcl_ObjType tclIntType;
MODULE_SCOPE const Tcl_ObjType tclListType;
MODULE_SCOPE const Tcl_ObjType tclDictType;
MODULE_SCOPE const Tcl_ObjType tclProcBodyType;
MODULE_SCOPE const Tcl_ObjType tclStringType;
MODULE_SCOPE const Tcl_ObjType tclArraySearchType;
MODULE_SCOPE const Tcl_ObjType tclEnsembleCmdType;
#ifndef TCL_WIDE_INT_IS_LONG
MODULE_SCOPE const Tcl_ObjType tclWideIntType;
#endif
MODULE_SCOPE const Tcl_ObjType tclRegexpType;
MODULE_SCOPE Tcl_ObjType tclCmdNameType;
|
| ︙ | | |
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
|
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
|
+
-
+
|
const char *encodingName);
MODULE_SCOPE void TclFSUnloadTempFile(Tcl_LoadHandle loadHandle);
MODULE_SCOPE int * TclGetAsyncReadyPtr(void);
MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp);
MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tcl_Channel *chanPtr,
int *modePtr, int flags);
MODULE_SCOPE CmdFrame * TclGetCmdFrameForProcedure(Proc *procPtr);
MODULE_SCOPE int TclGetCompletionCodeFromObj(Tcl_Interp *interp,
MODULE_SCOPE int TclGetCompletionCodeFromObj(Tcl_Interp *interp,
Tcl_Obj *value, int *code);
MODULE_SCOPE int TclGetNumberFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, ClientData *clientDataPtr,
int *typePtr);
MODULE_SCOPE int TclGetOpenModeEx(Tcl_Interp *interp,
const char *modeString, int *seekFlagPtr,
int *binaryPtr);
|
| ︙ | | |
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
|
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
|
-
+
|
const char *host, int port, int willBind,
const char **errorMsgPtr);
MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr,
Tcl_ThreadCreateProc *proc, ClientData clientData,
int stackSize, int flags);
MODULE_SCOPE int TclpFindVariable(const char *name, int *lengthPtr);
MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr,
size_t *lengthPtr, Tcl_Encoding *encodingPtr);
int *lengthPtr, Tcl_Encoding *encodingPtr);
MODULE_SCOPE void TclpInitLock(void);
MODULE_SCOPE void TclpInitPlatform(void);
MODULE_SCOPE void TclpInitUnlock(void);
MODULE_SCOPE Tcl_Obj * TclpObjListVolumes(void);
MODULE_SCOPE void TclpMasterLock(void);
MODULE_SCOPE void TclpMasterUnlock(void);
MODULE_SCOPE int TclpMatchFiles(Tcl_Interp *interp, char *separators,
|
| ︙ | | |
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
|
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
|
-
-
-
-
-
-
-
-
-
-
|
Tcl_Obj *newValue, Tcl_Encoding encoding);
MODULE_SCOPE void TclSignalExitThread(Tcl_ThreadId id, int result);
MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp,
Tcl_Obj *const *objv, int objc, int subIdx,
Tcl_Obj *bad, Tcl_Obj *fix);
MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr,
int numBytes);
MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int inPlace,
int objc, Tcl_Obj *const objv[],
Tcl_Obj **objPtrPtr);
MODULE_SCOPE int TclStringFind(Tcl_Obj *needle, Tcl_Obj *haystack,
int start);
MODULE_SCOPE int TclStringLast(Tcl_Obj *needle, Tcl_Obj *haystack,
int last);
MODULE_SCOPE int TclStringMatch(const char *str, int strLen,
const char *pattern, int ptnLen, int flags);
MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj,
Tcl_Obj *patternObj, int flags);
MODULE_SCOPE Tcl_Obj * TclStringObjReverse(Tcl_Obj *objPtr);
MODULE_SCOPE int TclStringRepeat(Tcl_Interp *interp, Tcl_Obj *objPtr,
int count, Tcl_Obj **objPtrPtr);
MODULE_SCOPE void TclSubstCompile(Tcl_Interp *interp, const char *bytes,
int numBytes, int flags, int line,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, int numOpts,
Tcl_Obj *const opts[], int *flagPtr);
MODULE_SCOPE void TclSubstParse(Tcl_Interp *interp, const char *bytes,
int numBytes, int flags, Tcl_Parse *parsePtr,
Tcl_InterpState *statePtr);
MODULE_SCOPE int TclSubstTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr,
int count, int *tokensLeftPtr, int line,
int *clNextOuter, const char *outerScript);
MODULE_SCOPE int TclTrimLeft(const char *bytes, int numBytes,
const char *trim, int numTrim);
MODULE_SCOPE int TclTrimRight(const char *bytes, int numBytes,
const char *trim, int numTrim);
MODULE_SCOPE int TclUtfCasecmp(const char *cs, const char *ct);
MODULE_SCOPE int TclUtfCount(int ch);
MODULE_SCOPE Tcl_Obj * TclpNativeToNormalized(ClientData clientData);
MODULE_SCOPE Tcl_Obj * TclpFilesystemPathType(Tcl_Obj *pathPtr);
MODULE_SCOPE int TclpDlopen(Tcl_Interp *interp, Tcl_Obj *pathPtr,
Tcl_LoadHandle *loadHandle,
Tcl_FSUnloadFileProc **unloadProcPtr, int flags);
MODULE_SCOPE int TclpUtime(Tcl_Obj *pathPtr, struct utimbuf *tval);
#ifdef TCL_LOAD_FROM_MEMORY
|
| ︙ | | |
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
|
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
|
-
+
-
-
+
-
|
/* Assemble command function */
MODULE_SCOPE int Tcl_AssembleObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int TclNRAssembleObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE Tcl_Command TclInitEncodingCmd(Tcl_Interp *interp);
MODULE_SCOPE int Tcl_EncodingObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
MODULE_SCOPE int TclMakeEncodingCommandSafe(Tcl_Interp *interp);
Tcl_Obj *const objv[]);
MODULE_SCOPE int Tcl_EofObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int Tcl_ErrorObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int Tcl_EvalObjCmd(ClientData clientData,
|
| ︙ | | |
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
|
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
|
+
+
+
+
+
+
|
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileBreakCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileCatchCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileClockClicksCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileClockReadingCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileConcatCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileContinueCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
|
| ︙ | | |
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
|
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
|
-
+
|
struct CompileEnv *envPtr);
MODULE_SCOPE int TclCompileAssembleCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
struct CompileEnv *envPtr);
/*
* Functions defined in generic/tclVar.c and currenttly exported only for use
* Functions defined in generic/tclVar.c and currently exported only for use
* by the bytecode compiler and engine. Some of these could later be placed in
* the public interface.
*/
MODULE_SCOPE Var * TclObjLookupVarEx(Tcl_Interp * interp,
Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags,
const char *msg, const int createPart1,
|
| ︙ | | |
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
|
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
|
-
+
|
/*
* So tclObj.c and tclDictObj.c can share these implementations.
*/
MODULE_SCOPE int TclCompareObjKeys(void *keyPtr, Tcl_HashEntry *hPtr);
MODULE_SCOPE void TclFreeObjEntry(Tcl_HashEntry *hPtr);
MODULE_SCOPE TCL_HASH_TYPE TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr);
MODULE_SCOPE unsigned TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr);
MODULE_SCOPE int TclFullFinalizationRequested(void);
/*
*----------------------------------------------------------------
* Macros used by the Tcl core to create and release Tcl objects.
* TclNewObj(objPtr) creates a new object denoting an empty string.
|
| ︙ | | |
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
|
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
|
-
+
|
# define TclDecrRefCount(objPtr) \
if ((objPtr)->refCount-- > 1) ; else { \
if (!(objPtr)->typePtr || !(objPtr)->typePtr->freeIntRepProc) { \
TCL_DTRACE_OBJ_FREE(objPtr); \
if ((objPtr)->bytes \
&& ((objPtr)->bytes != tclEmptyStringRep)) { \
ckfree((objPtr)->bytes); \
ckfree((char *) (objPtr)->bytes); \
} \
(objPtr)->length = -1; \
TclFreeObjStorage(objPtr); \
TclIncrObjsFreed(); \
} else { \
TclFreeObj(objPtr); \
} \
|
| ︙ | | |
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
|
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
|
-
+
-
|
* track memory leaks.
*/
# define TclAllocObjStorageEx(interp, objPtr) \
(objPtr) = (Tcl_Obj *) ckalloc(sizeof(Tcl_Obj))
# define TclFreeObjStorageEx(interp, objPtr) \
ckfree(objPtr)
ckfree((char *) (objPtr))
#undef USE_THREAD_ALLOC
#undef USE_TCLALLOC
#elif defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
/*
* The TCL_THREADS mode is like the regular mode but allocates Tcl_Obj's from
* per-thread caches.
*/
MODULE_SCOPE Tcl_Obj * TclThreadAllocObj(void);
MODULE_SCOPE void TclThreadFreeObj(Tcl_Obj *);
MODULE_SCOPE Tcl_Mutex *TclpNewAllocMutex(void);
MODULE_SCOPE void TclFreeAllocCache(void *);
MODULE_SCOPE void * TclpGetAllocCache(void);
MODULE_SCOPE void TclpSetAllocCache(void *);
MODULE_SCOPE void TclpFreeAllocMutex(Tcl_Mutex *mutex);
MODULE_SCOPE void TclpInitAllocCache(void);
MODULE_SCOPE void TclpFreeAllocCache(void *);
/*
* These macros need to be kept in sync with the code of TclThreadAllocObj()
* and TclThreadFreeObj().
*
* Note that the optimiser should resolve the case (interp==NULL) at compile
|
| ︙ | | |
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
|
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
|
-
+
|
* caller. The ANSI C "prototype" for this macro is:
*
* MODULE_SCOPE char * TclGetString(Tcl_Obj *objPtr);
*----------------------------------------------------------------
*/
#define TclGetString(objPtr) \
((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString(objPtr))
((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString((objPtr)))
#define TclGetStringFromObj(objPtr, lenPtr) \
((objPtr)->bytes \
? (*(lenPtr) = (objPtr)->length, (objPtr)->bytes) \
: Tcl_GetStringFromObj((objPtr), (lenPtr)))
/*
|
| ︙ | | |
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
|
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
|
-
-
-
+
+
+
-
+
|
* The ANSI C "prototype" for this macro is:
*
* MODULE_SCOPE void TclInvalidateStringRep(Tcl_Obj *objPtr);
*----------------------------------------------------------------
*/
#define TclInvalidateStringRep(objPtr) \
if ((objPtr)->bytes != NULL) { \
if ((objPtr)->bytes != tclEmptyStringRep) { \
ckfree((objPtr)->bytes); \
if (objPtr->bytes != NULL) { \
if (objPtr->bytes != tclEmptyStringRep) { \
ckfree((char *) objPtr->bytes); \
} \
(objPtr)->bytes = NULL; \
objPtr->bytes = NULL; \
}
/*
*----------------------------------------------------------------
* Macros used by the Tcl core to grow Tcl_Token arrays. They use the same
* growth algorithm as used in tclStringObj.c for growing strings. The ANSI C
* "prototype" for this macro is:
|
| ︙ | | |
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
|
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
|
-
-
+
+
-
-
+
+
-
+
|
#ifndef TCL_MIN_TOKEN_GROWTH
#define TCL_MIN_TOKEN_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Token)
#endif
#define TCL_MAX_TOKENS (int)(UINT_MAX / sizeof(Tcl_Token))
#define TclGrowTokenArray(tokenPtr, used, available, append, staticPtr) \
do { \
int needed = (used) + (append); \
if (needed > TCL_MAX_TOKENS) { \
int _needed = (used) + (append); \
if (_needed > TCL_MAX_TOKENS) { \
Tcl_Panic("max # of tokens for a Tcl parse (%d) exceeded", \
TCL_MAX_TOKENS); \
} \
if (needed > (available)) { \
int allocated = 2 * needed; \
if (_needed > (available)) { \
int allocated = 2 * _needed; \
Tcl_Token *oldPtr = (tokenPtr); \
Tcl_Token *newPtr; \
if (oldPtr == (staticPtr)) { \
oldPtr = NULL; \
} \
if (allocated > TCL_MAX_TOKENS) { \
allocated = TCL_MAX_TOKENS; \
} \
newPtr = (Tcl_Token *) attemptckrealloc((char *) oldPtr, \
(unsigned int) (allocated * sizeof(Tcl_Token))); \
if (newPtr == NULL) { \
allocated = needed + (append) + TCL_MIN_TOKEN_GROWTH; \
allocated = _needed + (append) + TCL_MIN_TOKEN_GROWTH; \
if (allocated > TCL_MAX_TOKENS) { \
allocated = TCL_MAX_TOKENS; \
} \
newPtr = (Tcl_Token *) ckrealloc((char *) oldPtr, \
(unsigned int) (allocated * sizeof(Tcl_Token))); \
} \
(available) = allocated; \
|
| ︙ | | |
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
|
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
|
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
+
|
* MODULE_SCOPE void TclNumUtfChars(int numChars, const char *bytes,
* int numBytes);
*----------------------------------------------------------------
*/
#define TclNumUtfChars(numChars, bytes, numBytes) \
do { \
int count, i = (numBytes); \
unsigned char *str = (unsigned char *) (bytes); \
while (i && (*str < 0xC0)) { i--; str++; } \
count = (numBytes) - i; \
if (i) { \
count += Tcl_NumUtfChars((bytes) + count, i); \
int _count, _i = (numBytes); \
unsigned char *_str = (unsigned char *) (bytes); \
while (_i && (*_str < 0xC0)) { _i--; _str++; } \
_count = (numBytes) - _i; \
if (_i) { \
_count += Tcl_NumUtfChars((bytes) + _count, _i); \
} \
(numChars) = count; \
(numChars) = _count; \
} while (0);
/*
*----------------------------------------------------------------
* Macro that encapsulates the logic that determines when it is safe to
* interpret a string as a byte array directly. In summary, the object must be
* a byte array and must not have a string representation (as the operations
* that it is used in are defined on strings, not byte arrays). Theoretically
* it is possible to also be efficient in the case where the object's bytes
* field is filled by generation from the byte array (c.f. list canonicality)
* but we don't do that at the moment since this is purely about efficiency.
* The ANSI C "prototype" for this macro is:
*
* MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr);
*----------------------------------------------------------------
*/
MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr);
#define TclIsPureByteArray(objPtr) \
(((objPtr)->typePtr==&tclByteArrayType) && ((objPtr)->bytes==NULL))
/*
*----------------------------------------------------------------
* Macro used by the Tcl core to compare Unicode strings. On big-endian
* systems we can use the more efficient memcmp, but this would not be
* lexically correct on little-endian systems. The ANSI C "prototype" for
* this macro is:
|
| ︙ | | |
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
|
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
|
+
-
-
+
+
+
+
+
|
/*
*----------------------------------------------------------------
* Macros used by the Tcl core to create and initialise objects of standard
* types, avoiding the corresponding function calls in time critical parts of
* the core. The ANSI C "prototypes" for these macros are:
*
* MODULE_SCOPE void TclNewIntObj(Tcl_Obj *objPtr, int i);
* MODULE_SCOPE void TclNewLongObj(Tcl_Obj *objPtr, long l);
* MODULE_SCOPE void TclNewBooleanObj(Tcl_Obj *objPtr, int b);
* MODULE_SCOPE void TclNewWideObj(Tcl_Obj *objPtr, Tcl_WideInt w);
* MODULE_SCOPE void TclNewDoubleObj(Tcl_Obj *objPtr, double d);
* MODULE_SCOPE void TclNewStringObj(Tcl_Obj *objPtr, const char *s, int len);
* MODULE_SCOPE void TclNewLiteralStringObj(Tcl_Obj*objPtr, const char *sLiteral);
* MODULE_SCOPE void TclNewStringObj(Tcl_Obj *objPtr, char *s, int len);
* MODULE_SCOPE void TclNewLiteralStringObj(Tcl_Obj*objPtr, char*sLiteral);
*
*----------------------------------------------------------------
*/
#ifndef TCL_MEM_DEBUG
#define TclNewLongObj(objPtr, i) \
do { \
TclIncrObjsAllocated(); \
TclAllocObjStorage(objPtr); \
(objPtr)->refCount = 0; \
(objPtr)->bytes = NULL; \
(objPtr)->internalRep.longValue = (long)(i); \
(objPtr)->typePtr = &tclIntType; \
TCL_DTRACE_OBJ_CREATE(objPtr); \
} while (0)
#define TclNewIntObj(objPtr, l) \
TclNewLongObj(objPtr, l)
/*
* NOTE: There is to be no such thing as a "pure" boolean.
* See comment above TclSetBooleanObj macro above.
*/
#define TclNewBooleanObj(objPtr, b) \
TclNewLongObj((objPtr), (b)!=0)
|
| ︙ | | |
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
|
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
|
+
+
+
|
(objPtr)->refCount = 0; \
TclInitStringRep((objPtr), (s), (len)); \
(objPtr)->typePtr = NULL; \
TCL_DTRACE_OBJ_CREATE(objPtr); \
} while (0)
#else /* TCL_MEM_DEBUG */
#define TclNewIntObj(objPtr, i) \
(objPtr) = Tcl_NewIntObj(i)
#define TclNewLongObj(objPtr, l) \
(objPtr) = Tcl_NewLongObj(l)
#define TclNewBooleanObj(objPtr, b) \
(objPtr) = Tcl_NewBooleanObj(b)
#define TclNewDoubleObj(objPtr, d) \
|
| ︙ | | |
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
|
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
|
-
+
|
*----------------------------------------------------------------
* Inline version of TclCleanupCommand; still need the function as it is in
* the internal stubs, but the core can use the macro instead.
*/
#define TclCleanupCommandMacro(cmdPtr) \
if ((cmdPtr)->refCount-- <= 1) { \
ckfree(cmdPtr);\
ckfree((char *) (cmdPtr));\
}
/*
*----------------------------------------------------------------
* Inline versions of Tcl_LimitReady() and Tcl_LimitExceeded to limit number
* of calls out of the critical path. Note that this code isn't particularly
* readable; the non-inline version (in tclInterp.c) is much easier to
|
| ︙ | | |
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
|
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
|
-
+
-
-
+
+
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
|
#define TclSmallFree(memPtr) \
TclSmallFreeEx(NULL, (memPtr))
#ifndef TCL_MEM_DEBUG
#define TclSmallAllocEx(interp, nbytes, memPtr) \
do { \
Tcl_Obj *objPtr; \
Tcl_Obj *_objPtr; \
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclIncrObjsAllocated(); \
TclAllocObjStorageEx((interp), (objPtr)); \
memPtr = (ClientData) (objPtr); \
TclAllocObjStorageEx((interp), (_objPtr)); \
memPtr = (ClientData) (_objPtr); \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
do { \
TclFreeObjStorageEx((interp), (Tcl_Obj *) (memPtr)); \
TclIncrObjsFreed(); \
} while (0)
#else /* TCL_MEM_DEBUG */
#define TclSmallAllocEx(interp, nbytes, memPtr) \
do { \
Tcl_Obj *objPtr; \
Tcl_Obj *_objPtr; \
TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \
TclNewObj(objPtr); \
memPtr = (ClientData) objPtr; \
TclNewObj(_objPtr); \
memPtr = (ClientData) _objPtr; \
} while (0)
#define TclSmallFreeEx(interp, memPtr) \
do { \
Tcl_Obj *objPtr = (Tcl_Obj *) memPtr; \
objPtr->bytes = NULL; \
objPtr->typePtr = NULL; \
objPtr->refCount = 1; \
TclDecrRefCount(objPtr); \
Tcl_Obj *_objPtr = (Tcl_Obj *) memPtr; \
_objPtr->bytes = NULL; \
_objPtr->typePtr = NULL; \
_objPtr->refCount = 1; \
TclDecrRefCount(_objPtr); \
} while (0)
#endif /* TCL_MEM_DEBUG */
/*
* Support for Clang Static Analyzer <http://clang-analyzer.llvm.org>
*/
|
| ︙ | | |
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
|
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
|
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
|
/*
* Inline version of Tcl_NRAddCallback.
*/
#define TclNRAddCallback(interp,postProcPtr,data0,data1,data2,data3) \
do { \
NRE_callback *callbackPtr; \
TCLNR_ALLOC((interp), (callbackPtr)); \
callbackPtr->procPtr = (postProcPtr); \
callbackPtr->data[0] = (ClientData)(data0); \
callbackPtr->data[1] = (ClientData)(data1); \
callbackPtr->data[2] = (ClientData)(data2); \
callbackPtr->data[3] = (ClientData)(data3); \
callbackPtr->nextPtr = TOP_CB(interp); \
TOP_CB(interp) = callbackPtr; \
NRE_callback *_callbackPtr; \
TCLNR_ALLOC((interp), (_callbackPtr)); \
_callbackPtr->procPtr = (postProcPtr); \
_callbackPtr->data[0] = (ClientData)(data0); \
_callbackPtr->data[1] = (ClientData)(data1); \
_callbackPtr->data[2] = (ClientData)(data2); \
_callbackPtr->data[3] = (ClientData)(data3); \
_callbackPtr->nextPtr = TOP_CB(interp); \
TOP_CB(interp) = _callbackPtr; \
} while (0)
#if NRE_USE_SMALL_ALLOC
#define TCLNR_ALLOC(interp, ptr) \
TclSmallAllocEx(interp, sizeof(NRE_callback), (ptr))
#define TCLNR_FREE(interp, ptr) TclSmallFreeEx((interp), (ptr))
#else
#define TCLNR_ALLOC(interp, ptr) \
(ptr = ((ClientData) ckalloc(sizeof(NRE_callback))))
#define TCLNR_FREE(interp, ptr) ckfree(ptr)
#define TCLNR_FREE(interp, ptr) ckfree((char *) (ptr))
#endif
#if NRE_ENABLE_ASSERTS
#define NRE_ASSERT(expr) assert((expr))
#else
#define NRE_ASSERT(expr)
#endif
|
| ︙ | | |
Changes to generic/tclIntDecls.h.
| ︙ | | |
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
|
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
|
-
+
|
/* 249 */
EXTERN char * TclDoubleDigits(double dv, int ndigits, int flags,
int *decpt, int *signum, char **endPtr);
/* 250 */
EXTERN void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags,
int force);
/* 251 */
EXTERN int TclRegisterLiteral(void *envPtr, const char *bytes,
EXTERN int TclRegisterLiteral(void *envPtr, char *bytes,
int length, int flags);
typedef struct TclIntStubs {
int magic;
void *hooks;
void (*reserved0)(void);
|
| ︙ | | |
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
|
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
|
-
+
|
Tcl_HashTable * (*tclGetNamespaceChildTable) (Tcl_Namespace *nsPtr); /* 244 */
Tcl_HashTable * (*tclGetNamespaceCommandTable) (Tcl_Namespace *nsPtr); /* 245 */
int (*tclInitRewriteEnsemble) (Tcl_Interp *interp, int numRemoved, int numInserted, Tcl_Obj *const *objv); /* 246 */
void (*tclResetRewriteEnsemble) (Tcl_Interp *interp, int isRootEnsemble); /* 247 */
int (*tclCopyChannel) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, Tcl_WideInt toRead, Tcl_Obj *cmdPtr); /* 248 */
char * (*tclDoubleDigits) (double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); /* 249 */
void (*tclSetSlaveCancelFlags) (Tcl_Interp *interp, int flags, int force); /* 250 */
int (*tclRegisterLiteral) (void *envPtr, const char *bytes, int length, int flags); /* 251 */
int (*tclRegisterLiteral) (void *envPtr, char *bytes, int length, int flags); /* 251 */
} TclIntStubs;
extern const TclIntStubs *tclIntStubsPtr;
#ifdef __cplusplus
}
#endif
|
| ︙ | | |
Changes to generic/tclIntPlatDecls.h.
| ︙ | | |
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
-
+
|
/* Slot 23 is reserved */
/* Slot 24 is reserved */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* Slot 27 is reserved */
/* Slot 28 is reserved */
/* 29 */
EXTERN int TclWinCPUID(int index, int *regs);
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
/* 30 */
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj);
#endif /* UNIX */
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
/* 0 */
|
| ︙ | | |
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
-
+
|
/* 26 */
EXTERN void TclWinSetInterfaces(int wide);
/* 27 */
EXTERN void TclWinFlushDirtyChannels(void);
/* 28 */
EXTERN void TclWinResetInterfaces(void);
/* 29 */
EXTERN int TclWinCPUID(int index, int *regs);
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
/* 30 */
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj);
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
/* 0 */
|
| ︙ | | |
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
-
+
|
/* Slot 23 is reserved */
/* Slot 24 is reserved */
/* Slot 25 is reserved */
/* Slot 26 is reserved */
/* Slot 27 is reserved */
/* Slot 28 is reserved */
/* 29 */
EXTERN int TclWinCPUID(int index, int *regs);
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
/* 30 */
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj);
#endif /* MACOSX */
typedef struct TclIntPlatStubs {
|
| ︙ | | |
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
-
+
|
void (*reserved22)(void);
void (*reserved23)(void);
void (*reserved24)(void);
void (*reserved25)(void);
void (*reserved26)(void);
void (*reserved27)(void);
void (*reserved28)(void);
int (*tclWinCPUID) (int index, int *regs); /* 29 */
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
#endif /* UNIX */
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
void (*tclWinConvertError) (DWORD errCode); /* 0 */
void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */
|
| ︙ | | |
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
-
+
|
TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
void (*reserved23)(void);
char * (*tclWinNoBackslash) (char *path); /* 24 */
void (*reserved25)(void);
void (*tclWinSetInterfaces) (int wide); /* 26 */
void (*tclWinFlushDirtyChannels) (void); /* 27 */
void (*tclWinResetInterfaces) (void); /* 28 */
int (*tclWinCPUID) (int index, int *regs); /* 29 */
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
#endif /* WIN */
#ifdef MAC_OSX_TCL /* MACOSX */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
int (*tclpCloseFile) (TclFile file); /* 1 */
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
| ︙ | | |
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
-
+
|
void (*reserved22)(void);
void (*reserved23)(void);
void (*reserved24)(void);
void (*reserved25)(void);
void (*reserved26)(void);
void (*reserved27)(void);
void (*reserved28)(void);
int (*tclWinCPUID) (int index, int *regs); /* 29 */
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
#endif /* MACOSX */
} TclIntPlatStubs;
extern const TclIntPlatStubs *tclIntPlatStubsPtr;
#ifdef __cplusplus
|
| ︙ | | |
Changes to generic/tclInterp.c.
| ︙ | | |
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
-
+
|
*/
int
Tcl_Init(
Tcl_Interp *interp) /* Interpreter to initialize. */
{
if (tclPreInitScript != NULL) {
if (Tcl_EvalEx(interp, tclPreInitScript, -1, 0) == TCL_ERROR) {
if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) {
return TCL_ERROR;
}
}
/*
* In order to find init.tcl during initialization, the following script
* is invoked by Tcl_Init(). It looks in several different directories:
|
| ︙ | | |
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
-
+
|
* The first directory on this path that contains a valid init.tcl script
* will be set as the value of tcl_library.
*
* Note that this entire search mechanism can be bypassed by defining an
* alternate tclInit command before calling Tcl_Init().
*/
return Tcl_EvalEx(interp,
return Tcl_Eval(interp,
"if {[namespace which -command tclInit] eq \"\"} {\n"
" proc tclInit {} {\n"
" global tcl_libPath tcl_library env tclDefaultLibrary\n"
" rename tclInit {}\n"
" if {[info exists tcl_library]} {\n"
" set scripts {{set tcl_library}}\n"
" } else {\n"
|
| ︙ | | |
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
406
407
408
409
410
411
412
413
414
415
416
417
418
419
|
-
|
" lappend scripts {\n"
"set parentDir [file dirname [file dirname [info nameofexecutable]]]\n"
"set grandParentDir [file dirname $parentDir]\n"
"file join $parentDir lib tcl[info tclversion]} \\\n"
" {file join $grandParentDir lib tcl[info tclversion]} \\\n"
" {file join $parentDir library} \\\n"
" {file join $grandParentDir library} \\\n"
" {file join $grandParentDir tcl[info tclversion] library} \\\n"
" {file join $grandParentDir tcl[info patchlevel] library} \\\n"
" {\n"
"file join [file dirname $grandParentDir] tcl[info patchlevel] library}\n"
" if {[info exists tcl_libPath]\n"
" && [catch {llength $tcl_libPath} len] == 0} {\n"
" for {set i 0} {$i < $len} {incr i} {\n"
" lappend scripts [list lindex \\$tcl_libPath $i]\n"
|
| ︙ | | |
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
|
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
|
-
+
|
" set msg \"Can't find a usable init.tcl in the following directories: \n\"\n"
" append msg \" $dirs\n\n\"\n"
" append msg \"$errors\n\n\"\n"
" append msg \"This probably means that Tcl wasn't installed properly.\n\"\n"
" error $msg\n"
" }\n"
"}\n"
"tclInit", -1, 0);
"tclInit");
}
/*
*---------------------------------------------------------------------------
*
* TclInterpInit --
*
|
| ︙ | | |
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
|
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
|
-
+
|
slavePtr->masterInterp = masterInterp;
slavePtr->slaveEntryPtr = hPtr;
slavePtr->slaveInterp = slaveInterp;
slavePtr->interpCmd = Tcl_NRCreateCommand(masterInterp, path,
SlaveObjCmd, NRSlaveCmd, slaveInterp, SlaveObjCmdDeleteProc);
Tcl_InitHashTable(&slavePtr->aliasTable, TCL_STRING_KEYS);
Tcl_SetHashValue(hPtr, slavePtr);
Tcl_SetVar2(slaveInterp, "tcl_interactive", NULL, "0", TCL_GLOBAL_ONLY);
Tcl_SetVar(slaveInterp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
/*
* Inherit the recursion limit.
*/
((Interp *) slaveInterp)->maxNestingDepth =
((Interp *) masterInterp)->maxNestingDepth;
|
| ︙ | | |
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
|
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
|
-
-
+
+
|
/*
* Alias these function implementations in the slave to those in the
* master; the overall implementations are safe, but they're normally
* defined by init.tcl which is not sourced by safe interpreters.
* Assume these functions all work. [Bug 2895741]
*/
(void) Tcl_EvalEx(interp,
"namespace eval ::tcl {namespace eval mathfunc {}}", -1, 0);
(void) Tcl_Eval(interp,
"namespace eval ::tcl {namespace eval mathfunc {}}");
(void) Tcl_CreateAlias(interp, "::tcl::mathfunc::min", master,
"::tcl::mathfunc::min", 0, NULL);
(void) Tcl_CreateAlias(interp, "::tcl::mathfunc::max", master,
"::tcl::mathfunc::max", 0, NULL);
}
iPtr->flags |= SAFE_INTERP;
|
| ︙ | | |
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
|
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
|
-
+
-
+
|
if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum Options) index) {
case OPT_CMD:
scriptObj = objv[i+1];
(void) TclGetStringFromObj(scriptObj, &scriptLen);
(void) Tcl_GetStringFromObj(objv[i+1], &scriptLen);
break;
case OPT_GRAN:
granObj = objv[i+1];
if (TclGetIntFromObj(interp, objv[i+1], &gran) != TCL_OK) {
return TCL_ERROR;
}
if (gran < 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"granularity must be at least 1", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
break;
case OPT_VAL:
limitObj = objv[i+1];
(void) TclGetStringFromObj(objv[i+1], &limitLen);
(void) Tcl_GetStringFromObj(objv[i+1], &limitLen);
if (limitLen == 0) {
break;
}
if (TclGetIntFromObj(interp, objv[i+1], &limit) != TCL_OK) {
return TCL_ERROR;
}
if (limit < 0) {
|
| ︙ | | |
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
|
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
|
-
+
-
+
-
+
|
if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum Options) index) {
case OPT_CMD:
scriptObj = objv[i+1];
(void) TclGetStringFromObj(objv[i+1], &scriptLen);
(void) Tcl_GetStringFromObj(objv[i+1], &scriptLen);
break;
case OPT_GRAN:
granObj = objv[i+1];
if (TclGetIntFromObj(interp, objv[i+1], &gran) != TCL_OK) {
return TCL_ERROR;
}
if (gran < 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"granularity must be at least 1", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
break;
case OPT_MILLI:
milliObj = objv[i+1];
(void) TclGetStringFromObj(objv[i+1], &milliLen);
(void) Tcl_GetStringFromObj(objv[i+1], &milliLen);
if (milliLen == 0) {
break;
}
if (TclGetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
return TCL_ERROR;
}
if (tmp < 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"milliseconds must be at least 0", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
limitMoment.usec = ((long) tmp)*1000;
break;
case OPT_SEC:
secObj = objv[i+1];
(void) TclGetStringFromObj(objv[i+1], &secLen);
(void) Tcl_GetStringFromObj(objv[i+1], &secLen);
if (secLen == 0) {
break;
}
if (TclGetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
return TCL_ERROR;
}
if (tmp < 0) {
|
| ︙ | | |
Changes to generic/tclLink.c.
| ︙ | | |
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
-
-
-
+
+
+
-
|
/*
* Forward references to functions defined later in this file:
*/
static char * LinkTraceProc(ClientData clientData,Tcl_Interp *interp,
const char *name1, const char *name2, int flags);
static Tcl_Obj * ObjValue(Link *linkPtr);
static int GetInvalidIntFromObj(Tcl_Obj *objPtr,
int *intPtr);
static int GetInvalidDoubleFromObj(Tcl_Obj *objPtr,
static int GetInvalidIntFromObj(Tcl_Obj *objPtr, int *intPtr);
static int GetInvalidWideFromObj(Tcl_Obj *objPtr, Tcl_WideInt *widePtr);
static int GetInvalidDoubleFromObj(Tcl_Obj *objPtr, double *doublePtr);
double *doublePtr);
/*
* Convenience macro for accessing the value of the C variable pointed to by a
* link. Note that this macro produces something that may be regarded as an
* lvalue or rvalue; it may be assigned to as well as read. Also note that
* this macro assumes the name of the variable being accessed (linkPtr); this
* is not strictly a good thing, but it keeps the code much shorter and
|
| ︙ | | |
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
-
+
+
|
ClientData clientData, /* Contains information about the link. */
Tcl_Interp *interp, /* Interpreter containing Tcl variable. */
const char *name1, /* First part of variable name. */
const char *name2, /* Second part of variable name. */
int flags) /* Miscellaneous additional information. */
{
Link *linkPtr = clientData;
int changed, valueLength;
int changed;
size_t valueLength;
const char *value;
char **pp;
Tcl_Obj *valueObj;
int valueInt;
Tcl_WideInt valueWide;
double valueDouble;
|
| ︙ | | |
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
|
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
|
-
+
-
-
+
-
-
+
-
+
-
-
+
-
-
+
-
-
+
-
+
-
-
-
+
-
-
+
-
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
-
+
+
-
+
|
*/
return (char *) "internal error: linked variable couldn't be read";
}
switch (linkPtr->type) {
case TCL_LINK_INT:
if (Tcl_GetIntFromObj(NULL, valueObj, &linkPtr->lastValue.i)
if (Tcl_GetIntFromObj(NULL, valueObj, &linkPtr->lastValue.i) != TCL_OK
!= TCL_OK) {
if (GetInvalidIntFromObj(valueObj, &linkPtr->lastValue.i)
&& GetInvalidIntFromObj(valueObj, &linkPtr->lastValue.i) != TCL_OK) {
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have integer value";
return (char *) "variable must have integer value";
}
}
LinkedVar(int) = linkPtr->lastValue.i;
break;
case TCL_LINK_WIDE_INT:
if (Tcl_GetWideIntFromObj(NULL, valueObj, &linkPtr->lastValue.w)
if (Tcl_GetWideIntFromObj(NULL, valueObj, &linkPtr->lastValue.w) != TCL_OK
!= TCL_OK) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
&& GetInvalidWideFromObj(valueObj, &linkPtr->lastValue.w) != TCL_OK) {
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have integer value";
return (char *) "variable must have integer value";
}
linkPtr->lastValue.w = (Tcl_WideInt) valueInt;
}
LinkedVar(Tcl_WideInt) = linkPtr->lastValue.w;
break;
case TCL_LINK_DOUBLE:
if (Tcl_GetDoubleFromObj(NULL, valueObj, &linkPtr->lastValue.d)
if (Tcl_GetDoubleFromObj(NULL, valueObj, &linkPtr->lastValue.d) != TCL_OK) {
!= TCL_OK) {
#ifdef ACCEPT_NAN
if (valueObj->typePtr != &tclDoubleType) {
#endif
if (GetInvalidDoubleFromObj(valueObj, &linkPtr->lastValue.d)
if (GetInvalidDoubleFromObj(valueObj, &linkPtr->lastValue.d) != TCL_OK) {
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have real value";
}
#ifdef ACCEPT_NAN
}
linkPtr->lastValue.d = valueObj->internalRep.doubleValue;
#endif
}
LinkedVar(double) = linkPtr->lastValue.d;
break;
case TCL_LINK_BOOLEAN:
if (Tcl_GetBooleanFromObj(NULL, valueObj, &linkPtr->lastValue.i)
if (Tcl_GetBooleanFromObj(NULL, valueObj, &linkPtr->lastValue.i) != TCL_OK) {
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have boolean value";
}
LinkedVar(int) = linkPtr->lastValue.i;
break;
case TCL_LINK_CHAR:
if (Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
if ((Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
&& GetInvalidIntFromObj(valueObj, &valueInt) != TCL_OK)
|| valueInt < SCHAR_MIN || valueInt > SCHAR_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have char value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have char value";
}
}
linkPtr->lastValue.c = (char)valueInt;
LinkedVar(char) = linkPtr->lastValue.c;
LinkedVar(char) = linkPtr->lastValue.c = (char)valueInt;
break;
case TCL_LINK_UCHAR:
if (Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
if ((Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
&& GetInvalidIntFromObj(valueObj, &valueInt) != TCL_OK)
|| valueInt < 0 || valueInt > UCHAR_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned char value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned char value";
}
}
linkPtr->lastValue.uc = (unsigned char) valueInt;
LinkedVar(unsigned char) = linkPtr->lastValue.uc;
LinkedVar(unsigned char) = linkPtr->lastValue.uc = (unsigned char) valueInt;
break;
case TCL_LINK_SHORT:
if (Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
if ((Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
&& GetInvalidIntFromObj(valueObj, &valueInt) != TCL_OK)
|| valueInt < SHRT_MIN || valueInt > SHRT_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have short value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have short value";
}
}
linkPtr->lastValue.s = (short)valueInt;
LinkedVar(short) = linkPtr->lastValue.s;
LinkedVar(short) = linkPtr->lastValue.s = (short)valueInt;
break;
case TCL_LINK_USHORT:
if (Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
if ((Tcl_GetIntFromObj(NULL, valueObj, &valueInt) != TCL_OK
&& GetInvalidIntFromObj(valueObj, &valueInt) != TCL_OK)
|| valueInt < 0 || valueInt > USHRT_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned short value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned short value";
}
}
linkPtr->lastValue.us = (unsigned short)valueInt;
LinkedVar(unsigned short) = linkPtr->lastValue.us;
LinkedVar(unsigned short) = linkPtr->lastValue.us = (unsigned short)valueInt;
break;
case TCL_LINK_UINT:
if (Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
if ((Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
&& GetInvalidWideFromObj(valueObj, &valueWide) != TCL_OK)
|| valueWide < 0 || valueWide > UINT_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned int value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned int value";
}
linkPtr->lastValue.ui = (unsigned int)valueInt;
} else {
linkPtr->lastValue.ui = (unsigned int)valueWide;
}
LinkedVar(unsigned int) = linkPtr->lastValue.ui;
LinkedVar(unsigned int) = linkPtr->lastValue.ui = (unsigned int)valueWide;
break;
case TCL_LINK_LONG:
if (Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
if ((Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
&& GetInvalidWideFromObj(valueObj, &valueWide) != TCL_OK)
|| valueWide < LONG_MIN || valueWide > LONG_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have long value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have long value";
}
linkPtr->lastValue.l = (long)valueInt;
} else {
linkPtr->lastValue.l = (long)valueWide;
}
LinkedVar(long) = linkPtr->lastValue.l;
LinkedVar(long) = linkPtr->lastValue.l = (long)valueWide;
break;
case TCL_LINK_ULONG:
if (Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
if ((Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
&& GetInvalidWideFromObj(valueObj, &valueWide) != TCL_OK)
|| valueWide < 0 || (Tcl_WideUInt) valueWide > ULONG_MAX) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned long value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned long value";
}
linkPtr->lastValue.ul = (unsigned long)valueInt;
} else {
linkPtr->lastValue.ul = (unsigned long)valueWide;
}
LinkedVar(unsigned long) = linkPtr->lastValue.ul;
LinkedVar(unsigned long) = linkPtr->lastValue.ul = (unsigned long)valueWide;
break;
case TCL_LINK_WIDE_UINT:
/*
* FIXME: represent as a bignum.
*/
if (Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK) {
if (GetInvalidIntFromObj(valueObj, &valueInt)
if (Tcl_GetWideIntFromObj(NULL, valueObj, &valueWide) != TCL_OK
&& GetInvalidWideFromObj(valueObj, &valueWide) != TCL_OK) {
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned wide int value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have unsigned wide int value";
}
linkPtr->lastValue.uw = (Tcl_WideUInt)valueInt;
} else {
linkPtr->lastValue.uw = (Tcl_WideUInt)valueWide;
}
LinkedVar(Tcl_WideUInt) = linkPtr->lastValue.uw;
LinkedVar(Tcl_WideUInt) = linkPtr->lastValue.uw = (Tcl_WideUInt)valueWide;
break;
case TCL_LINK_FLOAT:
if (Tcl_GetDoubleFromObj(NULL, valueObj, &valueDouble) != TCL_OK
if ((Tcl_GetDoubleFromObj(NULL, valueObj, &valueDouble) != TCL_OK
&& GetInvalidDoubleFromObj(valueObj, &valueDouble) != TCL_OK)
|| valueDouble < -FLT_MAX || valueDouble > FLT_MAX) {
if (GetInvalidDoubleFromObj(valueObj, &valueDouble)
!= TCL_OK) {
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have float value";
}
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
return (char *) "variable must have float value";
}
}
linkPtr->lastValue.f = (float)valueDouble;
LinkedVar(float) = linkPtr->lastValue.f;
LinkedVar(float) = linkPtr->lastValue.f = (float)valueDouble;
break;
case TCL_LINK_STRING:
value = TclGetStringFromObj(valueObj, &valueLength);
valueLength++;
value = TclGetString(valueObj);
valueLength = valueObj->length + 1;
pp = (char **) linkPtr->addr;
*pp = ckrealloc(*pp, valueLength);
memcpy(*pp, value, (unsigned) valueLength);
memcpy(*pp, value, valueLength);
break;
default:
return (char *) "internal error: bad linked variable type";
}
return NULL;
}
|
| ︙ | | |
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
|
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
|
-
+
|
linkPtr->lastValue.w = LinkedVar(Tcl_WideInt);
return Tcl_NewWideIntObj(linkPtr->lastValue.w);
case TCL_LINK_DOUBLE:
linkPtr->lastValue.d = LinkedVar(double);
return Tcl_NewDoubleObj(linkPtr->lastValue.d);
case TCL_LINK_BOOLEAN:
linkPtr->lastValue.i = LinkedVar(int);
return Tcl_NewBooleanObj(linkPtr->lastValue.i);
return Tcl_NewBooleanObj(linkPtr->lastValue.i != 0);
case TCL_LINK_CHAR:
linkPtr->lastValue.c = LinkedVar(char);
return Tcl_NewIntObj(linkPtr->lastValue.c);
case TCL_LINK_UCHAR:
linkPtr->lastValue.uc = LinkedVar(unsigned char);
return Tcl_NewIntObj(linkPtr->lastValue.uc);
case TCL_LINK_SHORT:
|
| ︙ | | |
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
|
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
|
-
-
+
+
-
-
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
|
return TCL_ERROR;
}
/*
* This function checks for integer representations, which are valid
* when linking with C variables, but which are invalid in other
* contexts in Tcl. Handled are "+", "-", "0x", "0b" and "0o" (upper-
* and lowercase). See bug [39f6304c2e].
* contexts in Tcl. Handled are "+", "-", "", "0x", "0b" and "0o"
* (upperand lowercase). See bug [39f6304c2e].
*/
int
GetInvalidIntFromObj(Tcl_Obj *objPtr,
int *intPtr)
{
int length;
const char *str = TclGetStringFromObj(objPtr, &length);
const char *str = TclGetString(objPtr);
if ((length == 1) && strchr("+-", str[0])) {
*intPtr = (str[0] == '+');
if ((objPtr->length == 0) ||
((objPtr->length == 2) && (str[0] == '0') && strchr("xXbBoO", str[1]))) {
*intPtr = 0;
return TCL_OK;
} else if ((length == 2) && (str[0] == '0') && strchr("xXbBoO", str[1])) {
*intPtr = 0;
} else if ((objPtr->length == 1) && strchr("+-", str[0])) {
*intPtr = (str[0] == '+');
return TCL_OK;
}
return TCL_ERROR;
}
int
GetInvalidWideFromObj(Tcl_Obj *objPtr, Tcl_WideInt *widePtr)
{
int intValue;
if (GetInvalidIntFromObj(objPtr, &intValue) != TCL_OK) {
return TCL_ERROR;
}
*widePtr = intValue;
return TCL_OK;
}
/*
* This function checks for double representations, which are valid
* when linking with C variables, but which are invalid in other
* contexts in Tcl. Handled are ".", "+", "-", "0x", "0b" and "0o"
* contexts in Tcl. Handled are "+", "-", "", ".", "0x", "0b" and "0o"
* (upper- and lowercase) and sequences like "1e-". See bug [39f6304c2e].
*/
int
GetInvalidDoubleFromObj(Tcl_Obj *objPtr,
double *doublePtr)
{
int intValue, result;
int intValue;
if ((objPtr->typePtr == &invalidRealType) ||
(SetInvalidRealFromAny(NULL, objPtr) == TCL_OK)) {
if (objPtr->typePtr == &invalidRealType) {
goto gotdouble;
}
if (GetInvalidIntFromObj(objPtr, &intValue) == TCL_OK) {
*doublePtr = (double) intValue;
return TCL_OK;
}
if (SetInvalidRealFromAny(NULL, objPtr) == TCL_OK) {
gotdouble:
*doublePtr = objPtr->internalRep.doubleValue;
return TCL_OK;
}
result = GetInvalidIntFromObj(objPtr, &intValue);
if (result == TCL_OK) {
*doublePtr = (double) intValue;
}
return result;
return TCL_ERROR;
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclListObj.c.
| ︙ | | |
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
|
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
|
-
+
|
int elemSize, literal;
if (TCL_OK != TclFindElement(interp, nextElem, limit - nextElem,
&elemStart, &nextElem, &elemSize, &literal)) {
while (--elemPtrs >= &listRepPtr->elements) {
Tcl_DecrRefCount(*elemPtrs);
}
ckfree(listRepPtr);
ckfree((char *) listRepPtr);
return TCL_ERROR;
}
if (elemStart == limit) {
break;
}
/* TODO: replace panic with error on alloc failure? */
|
| ︙ | | |
Changes to generic/tclLiteral.c.
| ︙ | | |
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
-
+
|
*
*----------------------------------------------------------------------
*/
Tcl_Obj *
TclCreateLiteral(
Interp *iPtr,
const char *bytes, /* The start of the string. Note that this is
char *bytes, /* The start of the string. Note that this is
* not a NUL-terminated string. */
int length, /* Number of bytes in the string. */
unsigned hash, /* The string's hash. If -1, it will be
* computed here. */
int *newPtr,
Namespace *nsPtr,
int flags,
|
| ︙ | | |
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
-
+
+
-
+
-
-
-
-
-
-
|
if ((flags & LITERAL_ON_HEAP)) {
ckfree(bytes);
}
return NULL;
}
/*
* The literal is new to the interpreter.
* The literal is new to the interpreter. Add it to the global literal
* table.
*/
TclNewObj(objPtr);
if ((flags & LITERAL_ON_HEAP)) {
objPtr->bytes = (char *) bytes;
objPtr->bytes = bytes;
objPtr->length = length;
} else {
TclInitStringRep(objPtr, bytes, length);
}
/* Should the new literal be shared globally? */
if ((flags & LITERAL_UNSHARED)) {
/*
* No, do *not* add it the global literal table
* Make clear, that no global value is returned
*/
if (globalPtrPtr != NULL) {
*globalPtrPtr = NULL;
}
return objPtr;
}
/*
* Yes, add it to the global literal table.
*/
#ifdef TCL_COMPILE_DEBUG
if (LookupLiteralEntry((Tcl_Interp *) iPtr, objPtr) != NULL) {
Tcl_Panic("%s: literal \"%.*s\" found globally but shouldn't be",
"TclRegisterLiteral", (length>60? 60 : length), bytes);
}
#endif
|
| ︙ | | |
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
-
+
|
*----------------------------------------------------------------------
*/
int
TclRegisterLiteral(
void *ePtr, /* Points to the CompileEnv in whose object
* array an object is found or created. */
register const char *bytes, /* Points to string for which to find or
register char *bytes, /* Points to string for which to find or
* create an object in CompileEnv's object
* array. */
int length, /* Number of bytes in the string. If < 0, the
* string consists of all bytes up to the
* first null character. */
int flags) /* If LITERAL_ON_HEAP then the caller already
* malloc'd bytes and ownership is passed to
|
| ︙ | | |
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
|
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
|
-
+
|
if (localPtr->objPtr == objPtr) {
found = 1;
}
}
}
if (!found) {
bytes = TclGetStringFromObj(objPtr, &length);
bytes = Tcl_GetStringFromObj(objPtr, &length);
Tcl_Panic("%s: literal \"%.*s\" wasn't found locally",
"AddLocalLiteralEntry", (length>60? 60 : length), bytes);
}
}
#endif /*TCL_COMPILE_DEBUG*/
return objIndex;
|
| ︙ | | |
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
|
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
|
-
+
|
* command literal. */
const char *name, /* Points to the start of the cmd literal
* name. */
Namespace *nsPtr) /* The namespace for which to lookup and
* invalidate a cmd literal. */
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *literalObjPtr = TclCreateLiteral(iPtr, name,
Tcl_Obj *literalObjPtr = TclCreateLiteral(iPtr, (char *) name,
strlen(name), -1, NULL, nsPtr, 0, NULL);
if (literalObjPtr != NULL) {
if (literalObjPtr->typePtr == &tclCmdNameType) {
TclFreeIntRep(literalObjPtr);
}
/* Balance the refcount effects of TclCreateLiteral() above */
|
| ︙ | | |
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
|
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
|
-
+
|
count = 0;
for (i=0 ; i<localTablePtr->numBuckets ; i++) {
for (localPtr=localTablePtr->buckets[i] ; localPtr!=NULL;
localPtr=localPtr->nextPtr) {
count++;
if (localPtr->refCount != -1) {
bytes = TclGetStringFromObj(localPtr->objPtr, &length);
bytes = Tcl_GetStringFromObj(localPtr->objPtr, &length);
Tcl_Panic("%s: local literal \"%.*s\" had bad refCount %d",
"TclVerifyLocalLiteralTable",
(length>60? 60 : length), bytes, localPtr->refCount);
}
if (localPtr->objPtr->bytes == NULL) {
Tcl_Panic("%s: literal has NULL string rep",
"TclVerifyLocalLiteralTable");
|
| ︙ | | |
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
|
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
|
-
+
|
count = 0;
for (i=0 ; i<globalTablePtr->numBuckets ; i++) {
for (globalPtr=globalTablePtr->buckets[i] ; globalPtr!=NULL;
globalPtr=globalPtr->nextPtr) {
count++;
if (globalPtr->refCount < 1) {
bytes = TclGetStringFromObj(globalPtr->objPtr, &length);
bytes = Tcl_GetStringFromObj(globalPtr->objPtr, &length);
Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %d",
"TclVerifyGlobalLiteralTable",
(length>60? 60 : length), bytes, globalPtr->refCount);
}
if (globalPtr->objPtr->bytes == NULL) {
Tcl_Panic("%s: literal has NULL string rep",
"TclVerifyGlobalLiteralTable");
|
| ︙ | | |
Changes to generic/tclLoad.c.
| ︙ | | |
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
|
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
|
-
+
|
/*
*----------------------------------------------------------------------
*
* TclGetLoadedPackages --
*
* This function returns information about all of the files that are
* loaded (either in a particular interpreter, or for all interpreters).
* loaded (either in a particular intepreter, or for all interpreters).
*
* Results:
* The return value is a standard Tcl completion code. If successful, a
* list of lists is placed in the interp's result. Each sublist
* corresponds to one loaded file; its first element is the name of the
* file (or an empty string for something that's statically loaded) and
* the second element is the name of the package in that file.
|
| ︙ | | |
Changes to generic/tclMain.c.
| ︙ | | |
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
-
+
|
typedef enum {
PROMPT_NONE, /* Print no prompt */
PROMPT_START, /* Print prompt for command start */
PROMPT_CONTINUE /* Print prompt for command continuation */
} PromptType;
typedef struct {
typedef struct InteractiveState {
Tcl_Channel input; /* The standard input channel from which lines
* are read. */
int tty; /* Non-zero means standard input is a
* terminal-like device. Zero means it's a
* file. */
Tcl_Obj *commandPtr; /* Used to assemble lines of input into Tcl
* commands. */
|
| ︙ | | |
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
-
+
-
-
-
-
+
-
-
+
|
Tcl_SourceRCFile(
Tcl_Interp *interp) /* Interpreter to source rc file into. */
{
Tcl_DString temp;
const char *fileName;
Tcl_Channel chan;
fileName = Tcl_GetVar2(interp, "tcl_rcFileName", NULL, TCL_GLOBAL_ONLY);
fileName = Tcl_GetVar(interp, "tcl_rcFileName", TCL_GLOBAL_ONLY);
if (fileName != NULL) {
Tcl_Channel c;
const char *fullName;
Tcl_DStringInit(&temp);
fullName = Tcl_TranslateFileName(interp, fileName, &temp);
if (fullName == NULL) {
/*
* Couldn't translate the file name (e.g. it referred to a bogus
* user or there was no HOME environment variable). Just do
* nothing.
*/
} else {
/*
* Test for the existence of the rc file before trying to read it.
*/
c = Tcl_OpenFileChannel(NULL, fullName, "r", 0);
if (c != NULL) {
Tcl_Obj *fullNameObj = Tcl_NewStringObj(fullName, -1);
Tcl_Close(NULL, c);
Tcl_IncrRefCount(fullNameObj);
if (Tcl_FSEvalFileEx(interp, fullNameObj, NULL) != TCL_OK) {
if (Tcl_EvalFile(interp, fullName) != TCL_OK) {
chan = Tcl_GetStdChannel(TCL_STDERR);
if (chan) {
Tcl_WriteObj(chan, Tcl_GetObjResult(interp));
Tcl_WriteChars(chan, "\n", 1);
}
}
Tcl_DecrRefCount(fullNameObj);
}
}
Tcl_DStringFree(&temp);
}
}
#endif /* !TCL_ASCII_MAIN */
/*----------------------------------------------------------------------
*
* Tcl_MainEx --
* Tcl_Main, Tcl_MainEx --
*
* Main program for tclsh and most other Tcl-based applications.
*
* Results:
* None. This function never returns (it exits the process when it's
* done).
*
|
| ︙ | | |
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
|
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
|
-
+
-
+
|
is.prompt = PROMPT_START;
/*
* The final newline is syntactically redundant, and causes some
* error messages troubles deeper in, so lop it back off.
*/
TclGetStringFromObj(is.commandPtr, &length);
Tcl_GetStringFromObj(is.commandPtr, &length);
Tcl_SetObjLength(is.commandPtr, --length);
code = Tcl_RecordAndEvalObj(interp, is.commandPtr,
TCL_EVAL_GLOBAL);
is.input = Tcl_GetStdChannel(TCL_STDIN);
Tcl_DecrRefCount(is.commandPtr);
is.commandPtr = Tcl_NewObj();
Tcl_IncrRefCount(is.commandPtr);
if (code != TCL_OK) {
chan = Tcl_GetStdChannel(TCL_STDERR);
if (chan) {
Tcl_WriteObj(chan, Tcl_GetObjResult(interp));
Tcl_WriteChars(chan, "\n", 1);
}
} else if (is.tty) {
resultPtr = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(resultPtr);
TclGetStringFromObj(resultPtr, &length);
Tcl_GetStringFromObj(resultPtr, &length);
chan = Tcl_GetStdChannel(TCL_STDOUT);
if ((length > 0) && chan) {
Tcl_WriteObj(chan, resultPtr);
Tcl_WriteChars(chan, "\n", 1);
}
Tcl_DecrRefCount(resultPtr);
}
|
| ︙ | | |
634
635
636
637
638
639
640
641
642
643
644
645
646
647
|
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
* happening. Maybe interp has been deleted; maybe [exit] was redefined,
* maybe we've blown up because of an exceeded limit. We still want to
* cleanup and exit.
*/
Tcl_Exit(exitCode);
}
#if (TCL_MAJOR_VERSION == 8) && !defined(UNICODE)
#undef Tcl_Main
extern DLLEXPORT void
Tcl_Main(
int argc, /* Number of arguments. */
char **argv, /* Array of argument strings. */
Tcl_AppInitProc *appInitProc)
/* Application-specific initialization
* function to call after most initialization
* but before starting to execute commands. */
{
Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp());
}
#endif /* TCL_MAJOR_VERSION == 8 && !UNICODE */
#ifndef TCL_ASCII_MAIN
/*
*---------------------------------------------------------------
*
* Tcl_SetMainLoop --
|
| ︙ | | |
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
|
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
|
-
+
|
}
Tcl_AppendToObj(commandPtr, "\n", 1);
if (!TclObjCommandComplete(commandPtr)) {
isPtr->prompt = PROMPT_CONTINUE;
goto prompt;
}
isPtr->prompt = PROMPT_START;
TclGetStringFromObj(commandPtr, &length);
Tcl_GetStringFromObj(commandPtr, &length);
Tcl_SetObjLength(commandPtr, --length);
/*
* Disable the stdin channel handler while evaluating the command;
* otherwise if the command re-enters the event loop we might process
* commands from stdin before the current command is finished. Among other
* things, this will trash the text of the command being evaluated.
|
| ︙ | | |
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
|
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
|
-
+
|
Tcl_WriteChars(chan, "\n", 1);
}
} else if (isPtr->tty) {
Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
chan = Tcl_GetStdChannel(TCL_STDOUT);
Tcl_IncrRefCount(resultPtr);
TclGetStringFromObj(resultPtr, &length);
Tcl_GetStringFromObj(resultPtr, &length);
if ((length > 0) && (chan != NULL)) {
Tcl_WriteObj(chan, resultPtr);
Tcl_WriteChars(chan, "\n", 1);
}
Tcl_DecrRefCount(resultPtr);
}
|
| ︙ | | |
Changes to generic/tclNamesp.c.
| ︙ | | |
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
-
+
|
/*
* Thread-local storage used to avoid having a global lock on data that is not
* limited to a single interpreter.
*/
typedef struct ThreadSpecificData {
size_t numNsCreated; /* Count of the number of namespaces created
long numNsCreated; /* Count of the number of namespaces created
* within the thread. This value is used as a
* unique id for each namespace. Cannot be
* per-interp because the nsId is used to
* distinguish objects which can be passed
* around between interps in the same thread,
* but does not need to be global because
* object internal reps are always per-thread
|
| ︙ | | |
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
-
+
|
typedef struct ResolvedNsName {
Namespace *nsPtr; /* A cached pointer to the Namespace that the
* name resolved to. */
Namespace *refNsPtr; /* Points to the namespace context in which
* the name was resolved. NULL if the name is
* fully qualified and thus the resolution
* does not depend on the context. */
size_t refCount; /* Reference count: 1 for each nsName object
int refCount; /* Reference count: 1 for each nsName object
* that has a pointer to this ResolvedNsName
* structure as its internal rep. This
* structure can be freed when refCount
* becomes zero. */
} ResolvedNsName;
/*
|
| ︙ | | |
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
|
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
|
+
-
+
|
*----------------------------------------------------------------------
*/
void
TclNsDecrRefCount(
Namespace *nsPtr)
{
nsPtr->refCount--;
if ((nsPtr->refCount-- <= 1) && (nsPtr->flags & NS_DEAD)) {
if ((nsPtr->refCount == 0) && (nsPtr->flags & NS_DEAD)) {
NamespaceFree(nsPtr);
}
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
|
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
|
-
-
-
+
+
+
|
* Check that the ResolvedNsName is still valid; avoid letting the ref
* cross interps.
*/
resNamePtr = objPtr->internalRep.twoPtrValue.ptr1;
nsPtr = resNamePtr->nsPtr;
refNsPtr = resNamePtr->refNsPtr;
if (!(nsPtr->flags & NS_DYING) && (interp == nsPtr->interp)
&& (!refNsPtr || (refNsPtr ==
(Namespace *) TclGetCurrentNamespace(interp)))) {
if (!(nsPtr->flags & NS_DYING) && (interp == nsPtr->interp) &&
(!refNsPtr || ((interp == refNsPtr->interp) &&
(refNsPtr== (Namespace *) Tcl_GetCurrentNamespace(interp))))){
*nsPtrPtr = (Tcl_Namespace *) nsPtr;
return TCL_OK;
}
}
if (SetNsNameFromAny(interp, objPtr) == TCL_OK) {
resNamePtr = objPtr->internalRep.twoPtrValue.ptr1;
*nsPtrPtr = (Tcl_Namespace *) resNamePtr->nsPtr;
|
| ︙ | | |
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
|
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
|
+
-
+
|
ResolvedNsName *resNamePtr = objPtr->internalRep.twoPtrValue.ptr1;
/*
* Decrement the reference count of the namespace. If there are no more
* references, free it up.
*/
resNamePtr->refCount--;
if (resNamePtr->refCount-- <= 1) {
if (resNamePtr->refCount == 0) {
/*
* Decrement the reference count for the cached namespace. If the
* namespace is dead, and there are no more references to it, free
* it.
*/
TclNsDecrRefCount(resNamePtr->nsPtr);
|
| ︙ | | |
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
|
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
|
-
+
|
nsPtr->refCount++;
resNamePtr = ckalloc(sizeof(ResolvedNsName));
resNamePtr->nsPtr = nsPtr;
if ((name[0] == ':') && (name[1] == ':')) {
resNamePtr->refNsPtr = NULL;
} else {
resNamePtr->refNsPtr = (Namespace *) TclGetCurrentNamespace(interp);
resNamePtr->refNsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp);
}
resNamePtr->refCount = 1;
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = resNamePtr;
objPtr->typePtr = &nsNameType;
return TCL_OK;
}
|
| ︙ | | |
Changes to generic/tclOO.c.
| ︙ | | |
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
-
+
|
}
/*
* Run our initialization script and, if that works, declare the package
* to be fully provided.
*/
if (Tcl_EvalEx(interp, initScript, -1, 0) != TCL_OK) {
if (Tcl_Eval(interp, initScript) != TCL_OK) {
return TCL_ERROR;
}
return Tcl_PkgProvideEx(interp, "TclOO", TCLOO_PATCHLEVEL,
(ClientData) &tclOOStubs);
}
|
| ︙ | | |
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
|
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
|
-
+
|
/*
* Now make the class of slots.
*/
if (TclOODefineSlots(fPtr) != TCL_OK) {
return TCL_ERROR;
}
return Tcl_EvalEx(interp, slotScript, -1, 0);
return Tcl_Eval(interp, slotScript);
}
/*
* ----------------------------------------------------------------------
*
* DeletedDefineNamespace, DeletedObjdefNamespace, DeletedHelpersNamespace --
*
|
| ︙ | | |
Changes to generic/tclOO.h.
| ︙ | | |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
-
+
|
*
* tests/oo.test
* tests/ooNext2.test
* unix/tclooConfig.sh
* win/tclooConfig.sh
*/
#define TCLOO_VERSION "1.0.4"
#define TCLOO_VERSION "1.0.5"
#define TCLOO_PATCHLEVEL TCLOO_VERSION
#include "tcl.h"
/*
* For C++ compilers, use extern "C"
*/
|
| ︙ | | |
Changes to generic/tclOOCall.c.
| ︙ | | |
615
616
617
618
619
620
621
622
623
624
625
626
627
628
|
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
+
|
int isNew;
hPtr = Tcl_CreateHashEntry(namesPtr, (char *) namePtr, &isNew);
if (isNew) {
int isWanted = (!(flags & PUBLIC_METHOD)
|| (mPtr->flags & PUBLIC_METHOD)) ? IN_LIST : 0;
isWanted |= (mPtr->typePtr == NULL ? NO_IMPLEMENTATION : 0);
Tcl_SetHashValue(hPtr, INT2PTR(isWanted));
} else if ((PTR2INT(Tcl_GetHashValue(hPtr)) & NO_IMPLEMENTATION)
&& mPtr->typePtr != NULL) {
int isWanted = PTR2INT(Tcl_GetHashValue(hPtr));
isWanted &= ~NO_IMPLEMENTATION;
Tcl_SetHashValue(hPtr, INT2PTR(isWanted));
|
| ︙ | | |
Changes to generic/tclOODefineCmds.c.
| ︙ | | |
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
|
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
|
-
+
|
Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_UNKNOWN", NULL);
return TCL_ERROR;
}
if (TclOOGetDefineCmdContext(interp) == NULL) {
return TCL_ERROR;
}
soughtStr = TclGetStringFromObj(objv[1], &soughtLen);
soughtStr = Tcl_GetStringFromObj(objv[1], &soughtLen);
if (soughtLen == 0) {
goto noMatch;
}
hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
while (hPtr != NULL) {
const char *nameStr = Tcl_GetHashKey(&nsPtr->cmdTable, hPtr);
|
| ︙ | | |
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
|
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
|
-
+
|
static Tcl_Command
FindCommand(
Tcl_Interp *interp,
Tcl_Obj *stringObj,
Tcl_Namespace *const namespacePtr)
{
int length;
const char *nameStr, *string = TclGetStringFromObj(stringObj, &length);
const char *nameStr, *string = Tcl_GetStringFromObj(stringObj, &length);
register Namespace *const nsPtr = (Namespace *) namespacePtr;
FOREACH_HASH_DECLS;
Tcl_Command cmd, cmd2;
/*
* If someone is playing games, we stop playing right now.
*/
|
| ︙ | | |
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
-
+
|
const char *typeOfSubject) /* Part of the message, saying whether it was
* an object, class or class-as-object that
* was being configured. */
{
int length;
Tcl_Obj *realNameObj = Tcl_ObjectDeleted((Tcl_Object) oPtr)
? savedNameObj : TclOOObjectName(interp, oPtr);
const char *objName = TclGetStringFromObj(realNameObj, &length);
const char *objName = Tcl_GetStringFromObj(realNameObj, &length);
int limit = OBJNAME_LENGTH_IN_ERRORINFO_LIMIT;
int overflow = (length > limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (in definition script for %s \"%.*s%s\" line %d)",
typeOfSubject, (overflow ? limit : length), objName,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
|
| ︙ | | |
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
|
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
|
-
+
|
oPtr = (Object *) TclOOGetDefineCmdContext(interp);
if (oPtr == NULL) {
return TCL_ERROR;
}
clsPtr = oPtr->classPtr;
TclGetStringFromObj(objv[2], &bodyLength);
Tcl_GetStringFromObj(objv[2], &bodyLength);
if (bodyLength > 0) {
/*
* Create the method structure.
*/
method = (Tcl_Method) TclOONewProcMethod(interp, clsPtr,
PUBLIC_METHOD, NULL, objv[1], objv[2], NULL);
|
| ︙ | | |
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
|
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
|
-
+
|
oPtr = (Object *) TclOOGetDefineCmdContext(interp);
if (oPtr == NULL) {
return TCL_ERROR;
}
clsPtr = oPtr->classPtr;
TclGetStringFromObj(objv[1], &bodyLength);
Tcl_GetStringFromObj(objv[1], &bodyLength);
if (bodyLength > 0) {
/*
* Create the method structure.
*/
method = (Tcl_Method) TclOONewProcMethod(interp, clsPtr,
PUBLIC_METHOD, NULL, NULL, objv[1], NULL);
|
| ︙ | | |
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
|
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
|
-
+
-
+
|
}
}
if (TclOOIsReachable(oPtr->classPtr, superclasses[i])) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"attempt to form circular dependency graph", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL);
failedAfterAlloc:
ckfree(superclasses);
ckfree((char *) superclasses);
return TCL_ERROR;
}
}
}
/*
* Install the list of superclasses into the class. Note that this also
* involves splicing the class out of the superclasses' subclass list that
* it used to be a member of and splicing it into the new superclasses'
* subclass list.
*/
if (oPtr->classPtr->superclasses.num != 0) {
FOREACH(superPtr, oPtr->classPtr->superclasses) {
TclOORemoveFromSubclasses(oPtr->classPtr, superPtr);
}
ckfree(oPtr->classPtr->superclasses.list);
ckfree((char *) oPtr->classPtr->superclasses.list);
}
oPtr->classPtr->superclasses.list = superclasses;
oPtr->classPtr->superclasses.num = superc;
FOREACH(superPtr, oPtr->classPtr->superclasses) {
TclOOAddToSubclasses(oPtr->classPtr, superPtr);
}
BumpGlobalEpoch(interp, oPtr->classPtr);
|
| ︙ | | |
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
|
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
|
-
+
|
return TCL_ERROR;
} else if (Tcl_ListObjGetElements(interp, objv[0], &varc,
&varv) != TCL_OK) {
return TCL_ERROR;
}
for (i=0 ; i<varc ; i++) {
const char *varName = TclGetString(varv[i]);
const char *varName = Tcl_GetString(varv[i]);
if (strstr(varName, "::") != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid declared variable name \"%s\": must not %s",
varName, "contain namespace separators"));
Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", NULL);
return TCL_ERROR;
|
| ︙ | | |
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
|
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
|
-
+
|
Tcl_IncrRefCount(varv[i]);
}
FOREACH(variableObj, oPtr->classPtr->variables) {
Tcl_DecrRefCount(variableObj);
}
if (i != varc) {
if (varc == 0) {
ckfree(oPtr->classPtr->variables.list);
ckfree((char *) oPtr->classPtr->variables.list);
} else if (i) {
oPtr->classPtr->variables.list = (Tcl_Obj **)
ckrealloc((char *) oPtr->classPtr->variables.list,
sizeof(Tcl_Obj *) * varc);
} else {
oPtr->classPtr->variables.list = (Tcl_Obj **)
ckalloc(sizeof(Tcl_Obj *) * varc);
|
| ︙ | | |
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
|
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
|
-
+
|
objv += Tcl_ObjectContextSkippedArgs(context);
if (Tcl_ListObjGetElements(interp, objv[0], &varc,
&varv) != TCL_OK) {
return TCL_ERROR;
}
for (i=0 ; i<varc ; i++) {
const char *varName = TclGetString(varv[i]);
const char *varName = Tcl_GetString(varv[i]);
if (strstr(varName, "::") != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid declared variable name \"%s\": must not %s",
varName, "contain namespace separators"));
Tcl_SetErrorCode(interp, "TCL", "OO", "BAD_DECLVAR", NULL);
return TCL_ERROR;
|
| ︙ | | |
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
|
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
|
-
+
|
}
FOREACH(variableObj, oPtr->variables) {
Tcl_DecrRefCount(variableObj);
}
if (i != varc) {
if (varc == 0) {
ckfree(oPtr->variables.list);
ckfree((char *) oPtr->variables.list);
} else if (i) {
oPtr->variables.list = (Tcl_Obj **)
ckrealloc((char *) oPtr->variables.list,
sizeof(Tcl_Obj *) * varc);
} else {
oPtr->variables.list = (Tcl_Obj **)
ckalloc(sizeof(Tcl_Obj *) * varc);
|
| ︙ | | |
Changes to generic/tclOOInt.h.
| ︙ | | |
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
-
+
|
/*
* Alternatives to Tcl_Preserve/Tcl_EventuallyFree/Tcl_Release.
*/
#define AddRef(ptr) ((ptr)->refCount++)
#define DelRef(ptr) do { \
if ((ptr)->refCount-- <= 1) { \
ckfree(ptr); \
ckfree((char *) (ptr)); \
} \
} while(0)
#endif /* TCL_OO_INTERNAL_H */
/*
* Local Variables:
|
| ︙ | | |
Changes to generic/tclOOMethod.c.
| ︙ | | |
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
|
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
|
-
+
|
Tcl_Interp *interp,
Tcl_Obj *methodNameObj)
{
int nameLen, objectNameLen;
CallContext *contextPtr = ((Interp *) interp)->varFramePtr->clientData;
Method *mPtr = contextPtr->callPtr->chain[contextPtr->index].mPtr;
const char *objectName, *kindName, *methodName =
TclGetStringFromObj(mPtr->namePtr, &nameLen);
Tcl_GetStringFromObj(mPtr->namePtr, &nameLen);
Object *declarerPtr;
if (mPtr->declaringObjectPtr != NULL) {
declarerPtr = mPtr->declaringObjectPtr;
kindName = "object";
} else {
if (mPtr->declaringClassPtr == NULL) {
|
| ︙ | | |
Changes to generic/tclObj.c.
| ︙ | | |
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
-
+
|
* if so, this cached pointer is invalid. */
int cmdEpoch; /* Value of the command's cmdEpoch when this
* pointer was cached. Before using the cached
* pointer, we check if the cmd's epoch was
* incremented; if so, the cmd was renamed,
* deleted, hidden, or exposed, and so the
* pointer is invalid. */
size_t refCount; /* Reference count: 1 for each cmdName object
int refCount; /* Reference count: 1 for each cmdName object
* that has a pointer to this ResolvedCmdName
* structure as its internal rep. This
* structure can be freed when refCount
* becomes zero. */
} ResolvedCmdName;
/*
|
| ︙ | | |
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
+
|
Tcl_RegisterObjType(&tclDoubleType);
Tcl_RegisterObjType(&tclEndOffsetType);
Tcl_RegisterObjType(&tclIntType);
Tcl_RegisterObjType(&tclStringType);
Tcl_RegisterObjType(&tclListType);
Tcl_RegisterObjType(&tclDictType);
Tcl_RegisterObjType(&tclByteCodeType);
Tcl_RegisterObjType(&tclArraySearchType);
Tcl_RegisterObjType(&tclCmdNameType);
Tcl_RegisterObjType(&tclRegexpType);
Tcl_RegisterObjType(&tclProcBodyType);
/* For backward compatibility only ... */
Tcl_RegisterObjType(&oldBooleanType);
#ifndef TCL_WIDE_INT_IS_LONG
|
| ︙ | | |
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
|
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
|
-
+
|
* debugging. */
{
register Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
objPtr->bytes = NULL;
objPtr->internalRep.longValue = (boolValue != 0);
objPtr->internalRep.longValue = (boolValue? 1 : 0);
objPtr->typePtr = &tclIntType;
return objPtr;
}
#else /* if not TCL_MEM_DEBUG */
Tcl_Obj *
|
| ︙ | | |
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
|
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
|
-
+
|
Tcl_Obj *
Tcl_NewIntObj(
register int intValue) /* Int used to initialize the new object. */
{
register Tcl_Obj *objPtr;
TclNewLongObj(objPtr, intValue);
TclNewIntObj(objPtr, intValue);
return objPtr;
}
#endif /* if TCL_MEM_DEBUG */
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
|
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
|
-
+
|
goto tooLarge;
}
#endif
if (objPtr->typePtr == &tclDoubleType) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected integer but got \"%s\"",
Tcl_GetString(objPtr)));
TclGetString(objPtr)));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL);
}
return TCL_ERROR;
}
if (objPtr->typePtr == &tclBignumType) {
/*
* Must check for those bignum values that can fit in a long, even
|
| ︙ | | |
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
|
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
|
-
+
|
*wideIntPtr = (Tcl_WideInt) objPtr->internalRep.longValue;
return TCL_OK;
}
if (objPtr->typePtr == &tclDoubleType) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected integer but got \"%s\"",
Tcl_GetString(objPtr)));
TclGetString(objPtr)));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL);
}
return TCL_ERROR;
}
if (objPtr->typePtr == &tclBignumType) {
/*
* Must check for those bignum values that can fit in a
|
| ︙ | | |
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
|
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
|
-
+
|
return TCL_OK;
}
#endif
if (objPtr->typePtr == &tclDoubleType) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected integer but got \"%s\"",
Tcl_GetString(objPtr)));
TclGetString(objPtr)));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INTEGER", NULL);
}
return TCL_ERROR;
}
} while (TclParseNumber(interp, objPtr, "integer", NULL, -1, NULL,
TCL_PARSE_INTEGER_ONLY)==TCL_OK);
return TCL_ERROR;
|
| ︙ | | |
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
|
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
|
-
+
|
TclCompareObjKeys(
void *keyPtr, /* New key to compare. */
Tcl_HashEntry *hPtr) /* Existing key to compare. */
{
Tcl_Obj *objPtr1 = keyPtr;
Tcl_Obj *objPtr2 = (Tcl_Obj *) hPtr->key.oneWordValue;
register const char *p1, *p2;
register int l1, l2;
register size_t l1, l2;
/*
* If the object pointers are the same then they match.
* OPT: this comparison was moved to the caller
if (objPtr1 == objPtr2) return 1;
*/
|
| ︙ | | |
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
|
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
|
-
+
|
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
TCL_HASH_TYPE
unsigned int
TclHashObjKey(
Tcl_HashTable *tablePtr, /* Hash table. */
void *keyPtr) /* Key from which to compute hash value. */
{
Tcl_Obj *objPtr = keyPtr;
int length;
const char *string = TclGetStringFromObj(objPtr, &length);
|
| ︙ | | |
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
|
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
|
-
+
|
if (length > 0) {
result = UCHAR(*string);
while (--length) {
result += (result << 3) + UCHAR(*++string);
}
}
return (TCL_HASH_TYPE) result;
return result;
}
/*
*----------------------------------------------------------------------
*
* Tcl_GetCommandFromObj --
*
|
| ︙ | | |
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
|
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
|
-
+
+
-
+
|
* is not deleted.
*
* If any check fails, then force another conversion to the command type,
* to discard the old rep and create a new one.
*/
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (objPtr->typePtr == &tclCmdNameType) {
if ((objPtr->typePtr == &tclCmdNameType) && (resPtr != NULL)) {
register Command *cmdPtr = resPtr->cmdPtr;
if ((cmdPtr->cmdEpoch == resPtr->cmdEpoch)
&& !(cmdPtr->flags & CMD_IS_DELETED)
&& (interp == cmdPtr->nsPtr->interp)
&& !(cmdPtr->nsPtr->flags & NS_DYING)) {
register Namespace *refNsPtr = (Namespace *)
TclGetCurrentNamespace(interp);
if ((resPtr->refNsPtr == NULL)
|| ((refNsPtr == resPtr->refNsPtr)
&& (resPtr->refNsId == refNsPtr->nsId)
&& (resPtr->refNsCmdEpoch == refNsPtr->cmdRefEpoch))) {
return (Tcl_Command) cmdPtr;
}
}
}
/*
* OK, must create a new internal representation (or fail) as any cache we
* had is invalid one way or another.
*/
/* See [07d13d99b0a9] why we cannot call SetCmdNameFromAny() directly here. */
/* See [] why we cannot call SetCmdNameFromAny() directly here. */
if (tclCmdNameType.setFromAnyProc(interp, objPtr) != TCL_OK) {
return NULL;
}
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
return (Tcl_Command) (resPtr ? resPtr->cmdPtr : NULL);
}
|
| ︙ | | |
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
|
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
* changed. The refcount in the Command structure is incremented to keep
* it from being freed if the command is later deleted until
* TclNRExecuteByteCode has a chance to recognize that it was deleted.
*
*----------------------------------------------------------------------
*/
static void
SetCmdNameObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr,
Command *cmdPtr,
ResolvedCmdName *resPtr)
{
Interp *iPtr = (Interp *) interp;
ResolvedCmdName *fillPtr;
const char *name = TclGetString(objPtr);
if (resPtr) {
fillPtr = resPtr;
} else {
fillPtr = ckalloc(sizeof(ResolvedCmdName));
fillPtr->refCount = 1;
}
fillPtr->cmdPtr = cmdPtr;
cmdPtr->refCount++;
fillPtr->cmdEpoch = cmdPtr->cmdEpoch;
/* NOTE: relying on NULL termination here. */
if ((name[0] == ':') && (name[1] == ':')) {
/*
* Fully qualified names always resolve to same thing. No need
* to record resolution context information.
*/
fillPtr->refNsPtr = NULL;
fillPtr->refNsId = 0; /* Will not be read */
fillPtr->refNsCmdEpoch = 0; /* Will not be read */
} else {
/*
* Record current state of current namespace as the resolution
* context of this command name lookup.
*/
Namespace *currNsPtr = iPtr->varFramePtr->nsPtr;
fillPtr->refNsPtr = currNsPtr;
fillPtr->refNsId = currNsPtr->nsId;
fillPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch;
}
if (resPtr == NULL) {
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = fillPtr;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &tclCmdNameType;
}
}
void
TclSetCmdNameObj(
Tcl_Interp *interp, /* Points to interpreter containing command
* that should be cached in objPtr. */
register Tcl_Obj *objPtr, /* Points to Tcl object to be changed to a
* CmdName object. */
Command *cmdPtr) /* Points to Command structure that the
* CmdName object should refer to. */
{
Interp *iPtr = (Interp *) interp;
register ResolvedCmdName *resPtr;
register Namespace *currNsPtr;
const char *name;
if (objPtr->typePtr == &tclCmdNameType) {
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (resPtr != NULL && resPtr->cmdPtr == cmdPtr) {
return;
}
}
cmdPtr->refCount++;
resPtr = ckalloc(sizeof(ResolvedCmdName));
resPtr->cmdPtr = cmdPtr;
resPtr->cmdEpoch = cmdPtr->cmdEpoch;
resPtr->refCount = 1;
SetCmdNameObj(interp, objPtr, cmdPtr, NULL);
name = TclGetString(objPtr);
if ((*name++ == ':') && (*name == ':')) {
/*
* The name is fully qualified: set the referring namespace to
* NULL.
*/
resPtr->refNsPtr = NULL;
} else {
/*
* Get the current namespace.
*/
currNsPtr = iPtr->varFramePtr->nsPtr;
resPtr->refNsPtr = currNsPtr;
resPtr->refNsId = currNsPtr->nsId;
resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch;
}
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = resPtr;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &tclCmdNameType;
}
/*
*----------------------------------------------------------------------
*
* FreeCmdNameInternalRep --
*
|
| ︙ | | |
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
|
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
|
+
-
+
+
|
static void
FreeCmdNameInternalRep(
register Tcl_Obj *objPtr) /* CmdName object with internal
* representation to free. */
{
register ResolvedCmdName *resPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (resPtr != NULL) {
/*
* Decrement the reference count of the ResolvedCmdName structure. If
* there are no more uses, free the ResolvedCmdName structure.
*/
if (resPtr->refCount-- <= 1) {
if (resPtr->refCount-- == 1) {
/*
* Now free the cached command, unless it is still in its hash
* table or if there are other references to it from other cmdName
* objects.
*/
Command *cmdPtr = resPtr->cmdPtr;
TclCleanupCommandMacro(cmdPtr);
ckfree(resPtr);
}
}
objPtr->typePtr = NULL;
}
/*
*----------------------------------------------------------------------
*
* DupCmdNameInternalRep --
|
| ︙ | | |
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
|
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
|
+
+
|
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
register Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
register ResolvedCmdName *resPtr = srcPtr->internalRep.twoPtrValue.ptr1;
copyPtr->internalRep.twoPtrValue.ptr1 = resPtr;
copyPtr->internalRep.twoPtrValue.ptr2 = NULL;
if (resPtr != NULL) {
resPtr->refCount++;
}
copyPtr->typePtr = &tclCmdNameType;
}
/*
*----------------------------------------------------------------------
*
* SetCmdNameFromAny --
|
| ︙ | | |
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
|
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
|
+
+
-
-
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
*/
static int
SetCmdNameFromAny(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
register Tcl_Obj *objPtr) /* The object to convert. */
{
Interp *iPtr = (Interp *) interp;
const char *name;
register Command *cmdPtr;
Namespace *currNsPtr;
register ResolvedCmdName *resPtr;
if (interp == NULL) {
return TCL_ERROR;
}
/*
* Find the Command structure, if any, that describes the command called
* "name". Build a ResolvedCmdName that holds a cached pointer to this
* Command, and bump the reference count in the referenced Command
* structure. A Command structure will not be deleted as long as it is
* referenced from a CmdName object.
*/
name = TclGetString(objPtr);
cmdPtr = (Command *)
Tcl_FindCommand(interp, name, /*ns*/ NULL, /*flags*/ 0);
/*
* Stop shimmering and caching nothing when we found nothing. Just
* report the failure to find the command as an error.
* Free the old internalRep before setting the new one. Do this after
* getting the string rep to allow the conversion code (in particular,
* Tcl_GetStringFromObj) to use that old internalRep.
*/
if (cmdPtr == NULL) {
if (cmdPtr) {
return TCL_ERROR;
}
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
if ((objPtr->typePtr == &tclCmdNameType) && (resPtr->refCount == 1)) {
/*
* Re-use existing ResolvedCmdName struct when possible.
cmdPtr->refCount++;
resPtr = objPtr->internalRep.twoPtrValue.ptr1;
if ((objPtr->typePtr == &tclCmdNameType)
&& resPtr && (resPtr->refCount == 1)) {
/*
* Reuse the old ResolvedCmdName struct instead of freeing it
* Cleanup the old fields that need it.
*/
Command *oldCmdPtr = resPtr->cmdPtr;
if (oldCmdPtr->refCount-- <= 1) {
*/
Command *oldCmdPtr = resPtr->cmdPtr;
if (--oldCmdPtr->refCount == 0) {
TclCleanupCommandMacro(oldCmdPtr);
}
} else {
TclFreeIntRep(objPtr);
resPtr = ckalloc(sizeof(ResolvedCmdName));
resPtr->refCount = 1;
objPtr->internalRep.twoPtrValue.ptr1 = resPtr;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &tclCmdNameType;
}
resPtr->cmdPtr = cmdPtr;
resPtr->cmdEpoch = cmdPtr->cmdEpoch;
if ((*name++ == ':') && (*name == ':')) {
TclCleanupCommandMacro(oldCmdPtr);
}
} else {
resPtr = NULL;
}
SetCmdNameObj(interp, objPtr, cmdPtr, resPtr);
/*
* The name is fully qualified: set the referring namespace to
* NULL.
*/
resPtr->refNsPtr = NULL;
} else {
/*
* Get the current namespace.
*/
currNsPtr = iPtr->varFramePtr->nsPtr;
resPtr->refNsPtr = currNsPtr;
resPtr->refNsId = currNsPtr->nsId;
resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch;
}
} else {
TclFreeIntRep(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &tclCmdNameType;
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* Tcl_RepresentationCmd --
|
| ︙ | | |
Changes to generic/tclOptimize.c.
| ︙ | | |
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
-
+
-
+
|
blank = size + InstLength(nextInst);
} else if (nextInst == INST_STR_CONCAT1
&& TclGetUInt1AtPtr(currentInstPtr + size + 1) == 2) {
Tcl_Obj *litPtr = TclFetchLiteral(envPtr,
TclGetUInt1AtPtr(currentInstPtr + 1));
int numBytes;
(void) TclGetStringFromObj(litPtr, &numBytes);
(void) Tcl_GetStringFromObj(litPtr, &numBytes);
if (numBytes == 0) {
blank = size + InstLength(nextInst);
}
}
break;
case INST_PUSH4:
if (nextInst == INST_POP) {
blank = size + 1;
} else if (nextInst == INST_STR_CONCAT1
&& TclGetUInt1AtPtr(currentInstPtr + size + 1) == 2) {
Tcl_Obj *litPtr = TclFetchLiteral(envPtr,
TclGetUInt4AtPtr(currentInstPtr + 1));
int numBytes;
(void) TclGetStringFromObj(litPtr, &numBytes);
(void) Tcl_GetStringFromObj(litPtr, &numBytes);
if (numBytes == 0) {
blank = size + InstLength(nextInst);
}
}
break;
case INST_LNOT:
|
| ︙ | | |
Changes to generic/tclParse.c.
| ︙ | | |
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
-
-
|
static inline int CommandComplete(const char *script, int numBytes);
static int ParseComment(const char *src, int numBytes,
Tcl_Parse *parsePtr);
static int ParseTokens(const char *src, int numBytes, int mask,
int flags, Tcl_Parse *parsePtr);
static int ParseWhiteSpace(const char *src, int numBytes,
int *incompletePtr, char *typePtr);
static int ParseAllWhiteSpace(const char *src, int numBytes,
int *incompletePtr);
/*
*----------------------------------------------------------------------
*
* TclParseInit --
*
* Initialize the fields of a Tcl_Parse struct.
|
| ︙ | | |
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
|
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* The following loop parses the words of the command, one word in each
* iteration through the loop.
*/
parsePtr->commandStart = src;
type = CHAR_TYPE(*src);
scanned = 1; /* Can't have missing whitepsace before first word. */
while (1) {
int expandWord = 0;
/* Are we at command termination? */
if ((numBytes == 0) || (type & terminators) != 0) {
parsePtr->term = src;
parsePtr->commandSize = src + (numBytes != 0)
- parsePtr->commandStart;
return TCL_OK;
}
/* Are we missing white space after previous word? */
if (scanned == 0) {
if (src[-1] == '"') {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"extra characters after close-quote", -1));
}
parsePtr->errorType = TCL_PARSE_QUOTE_EXTRA;
} else {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"extra characters after close-brace", -1));
}
parsePtr->errorType = TCL_PARSE_BRACE_EXTRA;
}
parsePtr->term = src;
error:
Tcl_FreeParse(parsePtr);
parsePtr->commandSize = parsePtr->end - parsePtr->commandStart;
return TCL_ERROR;
}
/*
* Create the token for the word.
*/
TclGrowParseTokenArray(parsePtr, 1);
wordIndex = parsePtr->numTokens;
tokenPtr = &parsePtr->tokenPtr[wordIndex];
tokenPtr->type = TCL_TOKEN_WORD;
/*
* Skip white space before the word. Also skip a backslash-newline
* sequence: it should be treated just like white space.
*/
scanned = ParseWhiteSpace(src,numBytes, &parsePtr->incomplete, &type);
src += scanned;
numBytes -= scanned;
if (numBytes == 0) {
parsePtr->term = src;
break;
}
if ((type & terminators) != 0) {
parsePtr->term = src;
src++;
break;
}
tokenPtr->start = src;
parsePtr->numTokens++;
parsePtr->numWords++;
/*
* At this point the word can have one of four forms: something
* enclosed in quotes, something enclosed in braces, and expanding
|
| ︙ | | |
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
|
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
|
+
+
+
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
tokenPtr->type = TCL_TOKEN_EXPAND_WORD;
}
} else if ((tokenPtr->numComponents == 1)
&& (tokenPtr[1].type == TCL_TOKEN_TEXT)) {
tokenPtr->type = TCL_TOKEN_SIMPLE_WORD;
}
/*
* Do two additional checks: (a) make sure we're really at the end of
* a word (there might have been garbage left after a quoted or braced
/* Parse the whitespace between words. */
* word), and (b) check for the end of the command.
*/
scanned = ParseWhiteSpace(src,numBytes, &parsePtr->incomplete, &type);
if (scanned) {
src += scanned;
numBytes -= scanned;
}
src += scanned;
numBytes -= scanned;
continue;
}
if (numBytes == 0) {
parsePtr->term = src;
break;
}
if ((type & terminators) != 0) {
parsePtr->term = src;
src++;
break;
}
if (src[-1] == '"') {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"extra characters after close-quote", -1));
}
parsePtr->errorType = TCL_PARSE_QUOTE_EXTRA;
} else {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"extra characters after close-brace", -1));
}
parsePtr->errorType = TCL_PARSE_BRACE_EXTRA;
}
parsePtr->term = src;
goto error;
}
parsePtr->commandSize = src - parsePtr->commandStart;
return TCL_OK;
error:
Tcl_FreeParse(parsePtr);
parsePtr->commandSize = parsePtr->end - parsePtr->commandStart;
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* TclIsSpaceProc --
*
|
| ︙ | | |
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
|
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
|
*
* Results:
* Returns the number of bytes recognized as white space.
*
*----------------------------------------------------------------------
*/
static int
ParseAllWhiteSpace(
const char *src, /* First character to parse. */
int numBytes, /* Max number of byes to scan */
int *incompletePtr) /* Set true if parse is incomplete. */
{
char type;
const char *p = src;
do {
int scanned = ParseWhiteSpace(p, numBytes, incompletePtr, &type);
p += scanned;
numBytes -= scanned;
} while (numBytes && (*p == '\n') && (p++, --numBytes));
return (p-src);
}
int
TclParseAllWhiteSpace(
const char *src, /* First character to parse. */
int numBytes) /* Max number of byes to scan */
{
int dummy;
char type;
const char *p = src;
do {
return ParseAllWhiteSpace(src, numBytes, &dummy);
int scanned = ParseWhiteSpace(p, numBytes, &dummy, &type);
p += scanned;
numBytes -= scanned;
} while (numBytes && (*p == '\n') && (p++, --numBytes));
return (p-src);
}
/*
*----------------------------------------------------------------------
*
* TclParseHex --
*
|
| ︙ | | |
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
|
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
|
-
+
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
|
const char *src, /* First character to parse. */
register int numBytes, /* Max number of bytes to scan. */
Tcl_Parse *parsePtr) /* Information about parse in progress.
* Updated if parsing indicates an incomplete
* command. */
{
register const char *p = src;
int incomplete = parsePtr->incomplete;
while (numBytes) {
char type;
int scanned;
do {
int scanned = ParseAllWhiteSpace(p, numBytes, &incomplete);
p += scanned;
numBytes -= scanned;
scanned = ParseWhiteSpace(p, numBytes,
&parsePtr->incomplete, &type);
p += scanned;
numBytes -= scanned;
} while (numBytes && (*p == '\n') && (p++,numBytes--));
if ((numBytes == 0) || (*p != '#')) {
break;
}
if (parsePtr->commentStart == NULL) {
parsePtr->commentStart = p;
}
p++;
numBytes--;
while (numBytes) {
if (*p == '\n') {
p++;
numBytes--;
break;
}
if (*p == '\\') {
scanned = ParseWhiteSpace(p, numBytes, &parsePtr->incomplete,
&type);
if (scanned) {
p += scanned;
numBytes -= scanned;
} else {
/*
* General backslash substitution in comments isn't part
* of the formal spec, but test parse-15.47 and history
* indicate that it has been the de facto rule. Don't
* change it now.
*/
TclParseBackslash(p, numBytes, &scanned, NULL);
p += scanned;
numBytes -= scanned;
}
if (*p == '\\') {
} else {
p++;
numBytes--;
if (numBytes == 0) {
if (p[-1] == '\n') {
break;
}
}
incomplete = (*p == '\n');
p++;
numBytes--;
}
parsePtr->commentSize = p - parsePtr->commentStart;
}
parsePtr->incomplete = incomplete;
return (p - src);
}
/*
*----------------------------------------------------------------------
*
* ParseTokens --
|
| ︙ | | |
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
|
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
|
+
+
+
-
+
|
* parse information.
*/
src++;
numBytes--;
nestedPtr = TclStackAlloc(parsePtr->interp, sizeof(Tcl_Parse));
while (1) {
const char *curEnd;
if (Tcl_ParseCommand(parsePtr->interp, src, numBytes, 1,
nestedPtr) != TCL_OK) {
parsePtr->errorType = nestedPtr->errorType;
parsePtr->term = nestedPtr->term;
parsePtr->incomplete = nestedPtr->incomplete;
TclStackFree(parsePtr->interp, nestedPtr);
return TCL_ERROR;
}
curEnd = src + numBytes;
src = nestedPtr->commandStart + nestedPtr->commandSize;
numBytes = parsePtr->end - src;
numBytes = curEnd - src;
Tcl_FreeParse(nestedPtr);
/*
* Check for the closing ']' that ends the command
* substitution. It must have been the last character of the
* parsed command.
*/
|
| ︙ | | |
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
|
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
|
-
+
|
&& (tokenPtr->start[1] == '\n')) {
if (isLiteral) {
int clPos;
if (result == 0) {
clPos = 0;
} else {
TclGetStringFromObj(result, &clPos);
Tcl_GetStringFromObj(result, &clPos);
}
if (numCL >= maxNumCL) {
maxNumCL *= 2;
clPosition = ckrealloc(clPosition,
maxNumCL * sizeof(int));
}
|
| ︙ | | |
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
|
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
|
-
+
|
int
TclObjCommandComplete(
Tcl_Obj *objPtr) /* Points to object holding script to
* check. */
{
int length;
const char *script = TclGetStringFromObj(objPtr, &length);
const char *script = Tcl_GetStringFromObj(objPtr, &length);
return CommandComplete(script, length);
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclPathObj.c.
| ︙ | | |
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
-
+
|
int curLen;
if (retVal == NULL) {
const char *path = TclGetString(pathPtr);
retVal = Tcl_NewStringObj(path, dirSep - path);
Tcl_IncrRefCount(retVal);
}
TclGetStringFromObj(retVal, &curLen);
Tcl_GetStringFromObj(retVal, &curLen);
if (curLen == 0) {
Tcl_AppendToObj(retVal, dirSep, 1);
}
dirSep += 2;
oldDirSep = dirSep;
if (dirSep[0] != 0 && dirSep[1] == '.') {
goto again;
|
| ︙ | | |
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
-
+
|
if (retVal == NULL) {
const char *path = TclGetString(pathPtr);
retVal = Tcl_NewStringObj(path, dirSep - path);
Tcl_IncrRefCount(retVal);
}
TclGetStringFromObj(retVal, &curLen);
Tcl_GetStringFromObj(retVal, &curLen);
if (curLen == 0) {
Tcl_AppendToObj(retVal, dirSep, 1);
}
if (!first || (tclPlatform == TCL_PLATFORM_UNIX)) {
linkObj = Tcl_FSLink(retVal, NULL, 0);
/* Safety check in case driver caused sharing */
|
| ︙ | | |
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
-
+
-
+
-
+
-
+
|
/*
* We need to follow this link which is relative
* to retVal's directory. This means concatenating
* the link onto the directory of the path so far.
*/
const char *path =
TclGetStringFromObj(retVal, &curLen);
Tcl_GetStringFromObj(retVal, &curLen);
while (--curLen >= 0) {
if (IsSeparatorOrNull(path[curLen])) {
break;
}
}
/*
* We want the trailing slash.
*/
Tcl_SetObjLength(retVal, curLen+1);
Tcl_AppendObjToObj(retVal, linkObj);
TclDecrRefCount(linkObj);
linkStr = TclGetStringFromObj(retVal, &curLen);
linkStr = Tcl_GetStringFromObj(retVal, &curLen);
} else {
/*
* Absolute link.
*/
TclDecrRefCount(retVal);
if (Tcl_IsShared(linkObj)) {
retVal = Tcl_DuplicateObj(linkObj);
TclDecrRefCount(linkObj);
} else {
retVal = linkObj;
}
linkStr = TclGetStringFromObj(retVal, &curLen);
linkStr = Tcl_GetStringFromObj(retVal, &curLen);
/*
* Convert to forward-slashes on windows.
*/
if (tclPlatform == TCL_PLATFORM_WINDOWS) {
int i;
for (i = 0; i < curLen; i++) {
if (linkStr[i] == '\\') {
linkStr[i] = '/';
}
}
}
}
} else {
linkStr = TclGetStringFromObj(retVal, &curLen);
linkStr = Tcl_GetStringFromObj(retVal, &curLen);
}
/*
* Either way, we now remove the last path element (but
* not the first character of the path).
*/
|
| ︙ | | |
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
|
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
|
-
+
|
/*
* Ensure a windows drive like C:/ has a trailing separator.
*/
if (tclPlatform == TCL_PLATFORM_WINDOWS) {
int len;
const char *path = TclGetStringFromObj(retVal, &len);
const char *path = Tcl_GetStringFromObj(retVal, &len);
if (len == 2 && path[0] != 0 && path[1] == ':') {
if (Tcl_IsShared(retVal)) {
TclDecrRefCount(retVal);
retVal = Tcl_DuplicateObj(retVal);
Tcl_IncrRefCount(retVal);
}
|
| ︙ | | |
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
|
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
|
-
+
|
* part with the dirname of the joined-on bit. We could handle
* that special case here, but we don't, and instead just use
* the standardPath code.
*/
int numBytes;
const char *rest =
TclGetStringFromObj(fsPathPtr->normPathPtr, &numBytes);
Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &numBytes);
if (strchr(rest, '/') != NULL) {
goto standardPath;
}
/*
* If the joined-on bit is empty, then [file dirname] is
* documented to return all but the last non-empty element
|
| ︙ | | |
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
|
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
|
-
+
|
* it. If so, the 'tail' would be only the part following the
* last delimiter. We could handle that special case here, but
* we don't, and instead just use the standardPath code.
*/
int numBytes;
const char *rest =
TclGetStringFromObj(fsPathPtr->normPathPtr, &numBytes);
Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &numBytes);
if (strchr(rest, '/') != NULL) {
goto standardPath;
}
/*
* If the joined-on bit is empty, then [file tail] is
* documented to return the last non-empty element
|
| ︙ | | |
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
|
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
|
-
+
|
}
case TCL_PATH_EXTENSION:
return GetExtension(fsPathPtr->normPathPtr);
case TCL_PATH_ROOT: {
const char *fileName, *extension;
int length;
fileName = TclGetStringFromObj(fsPathPtr->normPathPtr,
fileName = Tcl_GetStringFromObj(fsPathPtr->normPathPtr,
&length);
extension = TclGetExtension(fileName);
if (extension == NULL) {
/*
* There is no extension so the root is the same as the
* path we were given.
*/
|
| ︙ | | |
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
|
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
|
-
+
|
resultPtr = NULL;
if (portion == TCL_PATH_EXTENSION) {
return GetExtension(pathPtr);
} else if (portion == TCL_PATH_ROOT) {
int length;
const char *fileName, *extension;
fileName = TclGetStringFromObj(pathPtr, &length);
fileName = Tcl_GetStringFromObj(pathPtr, &length);
extension = TclGetExtension(fileName);
if (extension == NULL) {
Tcl_IncrRefCount(pathPtr);
return pathPtr;
} else {
Tcl_Obj *root = Tcl_NewStringObj(fileName,
(int) (length - strlen(extension)));
|
| ︙ | | |
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
|
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
|
-
+
|
Tcl_Obj *tailObj = objv[i+1];
type = TclGetPathType(tailObj, NULL, NULL, NULL);
if (type == TCL_PATH_RELATIVE) {
const char *str;
int len;
str = TclGetStringFromObj(tailObj, &len);
str = Tcl_GetStringFromObj(tailObj, &len);
if (len == 0) {
/*
* This happens if we try to handle the root volume '/'.
* There's no need to return a special path object, when
* the base itself is just fine!
*/
|
| ︙ | | |
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
|
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
|
+
+
-
+
+
+
+
+
+
+
+
+
|
*/
if ((tclPlatform != TCL_PLATFORM_WINDOWS)
|| (strchr(Tcl_GetString(elt), '\\') == NULL)) {
if (res != NULL) {
TclDecrRefCount(res);
}
if (PATHFLAGS(elt)) {
return TclNewFSPathObj(elt, str, len);
return TclNewFSPathObj(elt, str, len);
}
if (TCL_PATH_ABSOLUTE != Tcl_FSGetPathType(elt)) {
return TclNewFSPathObj(elt, str, len);
}
(void) Tcl_FSGetNormalizedPath(NULL, elt);
if (elt == PATHOBJ(elt)->normPathPtr) {
return TclNewFSPathObj(elt, str, len);
}
}
}
/*
* Otherwise we don't have an easy join, and we must let the
* more general code below handle things.
*/
|
| ︙ | | |
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
|
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
|
-
+
+
|
TclDecrRefCount(res);
}
return tailObj;
}
}
}
}
strElt = TclGetStringFromObj(elt, &strEltLen);
strElt = Tcl_GetStringFromObj(elt, &strEltLen);
driveNameLength = 0;
type = TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName);
if (type != TCL_PATH_RELATIVE) {
/*
* Zero out the current result.
*/
if (res != NULL) {
|
| ︙ | | |
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
|
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
|
+
+
+
+
+
+
|
if (tclPlatform == TCL_PLATFORM_WINDOWS) {
if (strchr(strElt, '\\') != NULL) {
goto noQuickReturn;
}
}
ptr = strElt;
/* [Bug f34cf83dd0] */
if (driveNameLength > 0) {
if (ptr[0] == '/' && ptr[-1] == '/') {
goto noQuickReturn;
}
}
while (*ptr != '\0') {
if (*ptr == '/' && (ptr[1] == '/' || ptr[1] == '\0')) {
/*
* We have a repeated file separator, which means the path
* is not in normalized form
*/
|
| ︙ | | |
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
|
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
|
-
+
-
+
|
* The path element was not of a suitable form to be returned as is.
* We need to perform a more complex operation here.
*/
noQuickReturn:
if (res == NULL) {
res = Tcl_NewObj();
ptr = TclGetStringFromObj(res, &length);
ptr = Tcl_GetStringFromObj(res, &length);
} else {
ptr = TclGetStringFromObj(res, &length);
ptr = Tcl_GetStringFromObj(res, &length);
}
/*
* Strip off any './' before a tilde, unless this is the beginning of
* the path.
*/
|
| ︙ | | |
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
|
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
|
-
+
|
res = Tcl_DuplicateObj(res);
Tcl_IncrRefCount(res);
}
}
if (length > 0 && ptr[length -1] != '/') {
Tcl_AppendToObj(res, &separator, 1);
TclGetStringFromObj(res, &length);
Tcl_GetStringFromObj(res, &length);
}
Tcl_SetObjLength(res, length + (int) strlen(strElt));
ptr = TclGetString(res) + length;
for (; *strElt != '\0'; strElt++) {
if (*strElt == separator) {
while (strElt[1] == separator) {
|
| ︙ | | |
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
|
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
|
-
+
|
* This is likely buggy when dealing with virtual filesystem drivers
* that use some character other than "/" as a path separator. I know
* of no evidence that such a foolish thing exists. This solution was
* chosen so that "JoinPath" operations that pass through either path
* intrep produce the same results; that is, bugward compatibility. If
* we need to fix that bug here, it needs fixing in TclJoinPath() too.
*/
bytes = TclGetStringFromObj(tail, &numBytes);
bytes = Tcl_GetStringFromObj(tail, &numBytes);
if (numBytes == 0) {
Tcl_AppendToObj(copy, "/", 1);
} else {
TclpNativeJoinPath(copy, bytes);
}
return copy;
}
|
| ︙ | | |
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
|
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
|
-
+
-
+
|
* better test than the '!= sep' might be to simply check if 'cwd' is a
* root volume.
*
* Note that if we get this wrong, we will strip off either too much or
* too little below, leading to wrong answers returned by glob.
*/
tempStr = TclGetStringFromObj(cwdPtr, &cwdLen);
tempStr = Tcl_GetStringFromObj(cwdPtr, &cwdLen);
/*
* Should we perhaps use 'Tcl_FSPathSeparator'? But then what about the
* Windows special case? Perhaps we should just check if cwd is a root
* volume.
*/
switch (tclPlatform) {
case TCL_PLATFORM_UNIX:
if (tempStr[cwdLen-1] != '/') {
cwdLen++;
}
break;
case TCL_PLATFORM_WINDOWS:
if (tempStr[cwdLen-1] != '/' && tempStr[cwdLen-1] != '\\') {
cwdLen++;
}
break;
}
tempStr = TclGetStringFromObj(pathPtr, &len);
tempStr = Tcl_GetStringFromObj(pathPtr, &len);
return Tcl_NewStringObj(tempStr + cwdLen, len - cwdLen);
}
/*
*---------------------------------------------------------------------------
*
|
| ︙ | | |
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
|
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
|
-
+
|
Tcl_Interp *interp,
Tcl_Obj *pathPtr)
{
Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(interp, pathPtr);
if (transPtr != NULL) {
int len;
const char *orig = TclGetStringFromObj(transPtr, &len);
const char *orig = Tcl_GetStringFromObj(transPtr, &len);
char *result = ckalloc(len+1);
memcpy(result, orig, (size_t) len+1);
TclDecrRefCount(transPtr);
return result;
}
|
| ︙ | | |
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
|
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
|
-
+
-
+
|
return NULL;
}
/* TODO: Figure out why this is needed. */
if (pathPtr->bytes == NULL) {
UpdateStringOfFsPath(pathPtr);
}
TclGetStringFromObj(fsPathPtr->normPathPtr, &tailLen);
Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &tailLen);
if (tailLen) {
copy = AppendPath(dir, fsPathPtr->normPathPtr);
} else {
copy = Tcl_DuplicateObj(dir);
}
Tcl_IncrRefCount(dir);
Tcl_IncrRefCount(copy);
/*
* We now own a reference on both 'dir' and 'copy'
*/
(void) TclGetStringFromObj(dir, &cwdLen);
(void) Tcl_GetStringFromObj(dir, &cwdLen);
cwdLen += (Tcl_GetString(copy)[cwdLen] == '/');
/* Normalize the combined string. */
if (PATHFLAGS(pathPtr) & TCLPATH_NEEDNORM) {
/*
* If the "tail" part has components (like /../) that cause the
|
| ︙ | | |
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
|
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
|
-
+
|
fsPathPtr = PATHOBJ(pathPtr);
} else if (fsPathPtr->normPathPtr == NULL) {
int cwdLen;
Tcl_Obj *copy;
copy = AppendPath(fsPathPtr->cwdPtr, pathPtr);
(void) TclGetStringFromObj(fsPathPtr->cwdPtr, &cwdLen);
(void) Tcl_GetStringFromObj(fsPathPtr->cwdPtr, &cwdLen);
cwdLen += (Tcl_GetString(copy)[cwdLen] == '/');
/*
* Normalize the combined string, but only starting after the end
* of the previously normalized 'dir'. This should be much faster!
*/
|
| ︙ | | |
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
|
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
|
-
+
|
* We remove any trailing directory separator.
*
* However, the split/join routines are quite complex, and one has to make
* sure not to break anything on Unix or Win (fCmd.test, fileName.test and
* cmdAH.test exercise most of the code).
*/
name = TclGetStringFromObj(pathPtr, &len);
name = Tcl_GetStringFromObj(pathPtr, &len);
/*
* Handle tilde substitutions, if needed.
*/
if (name[0] == '~') {
Tcl_DString temp;
|
| ︙ | | |
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
|
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
|
-
+
|
if (PATHFLAGS(pathPtr) == 0 || fsPathPtr->cwdPtr == NULL) {
Tcl_Panic("Called UpdateStringOfFsPath with invalid object");
}
copy = AppendPath(fsPathPtr->cwdPtr, fsPathPtr->normPathPtr);
pathPtr->bytes = TclGetStringFromObj(copy, &cwdLen);
pathPtr->bytes = Tcl_GetStringFromObj(copy, &cwdLen);
pathPtr->length = cwdLen;
copy->bytes = tclEmptyStringRep;
copy->length = 0;
TclDecrRefCount(copy);
}
/*
|
| ︙ | | |
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
|
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
|
-
+
|
* It is somewhat unusual to reach this code path without the object
* being of tclFsPathType. However, we do our best to deal with the
* situation.
*/
int len;
(void) TclGetStringFromObj(pathPtr, &len);
(void) Tcl_GetStringFromObj(pathPtr, &len);
if (len == 0) {
/*
* We reject the empty path "".
*/
return -1;
}
|
| ︙ | | |
Changes to generic/tclPipe.c.
| ︙ | | |
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
-
+
|
* None.
*
*----------------------------------------------------------------------
*/
static TclFile
FileForRedirect(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tcl_Interp *interp, /* Intepreter to use for error reporting. */
const char *spec, /* Points to character just after redirection
* character. */
int atOK, /* Non-zero means that '@' notation can be
* used to specify a channel, zero means that
* it isn't. */
const char *arg, /* Pointer to entire argument containing spec:
* used for error reporting. */
|
| ︙ | | |
Changes to generic/tclPkg.c.
| ︙ | | |
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
|
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
|
-
+
|
ckfree(argv3i);
return TCL_OK;
}
pkgPtr = Tcl_GetHashValue(hPtr);
} else {
pkgPtr = FindPackage(interp, argv2);
}
argv3 = TclGetStringFromObj(objv[3], &length);
argv3 = Tcl_GetStringFromObj(objv[3], &length);
for (availPtr = pkgPtr->availPtr, prevPtr = NULL; availPtr != NULL;
prevPtr = availPtr, availPtr = availPtr->nextPtr) {
if (CheckVersionAndConvert(interp, availPtr->version, &avi,
NULL) != TCL_OK) {
ckfree(argv3i);
return TCL_ERROR;
|
| ︙ | | |
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
|
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
|
-
+
|
availPtr->nextPtr = pkgPtr->availPtr;
pkgPtr->availPtr = availPtr;
} else {
availPtr->nextPtr = prevPtr->nextPtr;
prevPtr->nextPtr = availPtr;
}
}
argv4 = TclGetStringFromObj(objv[4], &length);
argv4 = Tcl_GetStringFromObj(objv[4], &length);
DupBlock(availPtr->script, argv4, (unsigned) length + 1);
break;
}
case PKG_NAMES:
if (objc != 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
|
| ︙ | | |
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
|
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
|
-
+
|
Tcl_SetObjResult(interp,
Tcl_NewStringObj(iPtr->packageUnknown, -1));
}
} else if (objc == 3) {
if (iPtr->packageUnknown != NULL) {
ckfree(iPtr->packageUnknown);
}
argv2 = TclGetStringFromObj(objv[2], &length);
argv2 = Tcl_GetStringFromObj(objv[2], &length);
if (argv2[0] == 0) {
iPtr->packageUnknown = NULL;
} else {
DupBlock(iPtr->packageUnknown, argv2, (unsigned) length+1);
}
} else {
Tcl_WrongNumArgs(interp, 2, objv, "?command?");
|
| ︙ | | |
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
|
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
|
-
+
|
Tcl_Obj *const reqv[]) /* 0 means to use the latest version
* available. */
{
Tcl_Obj *result = Tcl_GetObjResult(interp);
int i, length;
for (i = 0; i < reqc; i++) {
const char *v = TclGetStringFromObj(reqv[i], &length);
const char *v = Tcl_GetStringFromObj(reqv[i], &length);
if ((length & 0x1) && (v[length/2] == '-')
&& (strncmp(v, v+((length+1)/2), length/2) == 0)) {
Tcl_AppendPrintfToObj(result, " exactly %s", v+((length+1)/2));
} else {
Tcl_AppendPrintfToObj(result, " %s", v);
}
|
| ︙ | | |
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
|
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
|
-
+
|
Tcl_PkgInitStubsCheck(
Tcl_Interp *interp,
const char * version,
int exact)
{
const char *actualVersion = Tcl_PkgPresent(interp, "Tcl", version, 0);
if ((exact&1) && actualVersion) {
if (exact && actualVersion) {
const char *p = version;
int count = 0;
while (*p) {
count += !isdigit(UCHAR(*p++));
}
if (count == 1) {
|
| ︙ | | |
Changes to generic/tclPreserve.c.
| ︙ | | |
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
+
|
* The following data structure is used to keep track of all the Tcl_Preserve
* calls that are still in effect. It grows as needed to accommodate any
* number of calls in effect.
*/
typedef struct {
ClientData clientData; /* Address of preserved block. */
size_t refCount; /* Number of Tcl_Preserve calls in effect for
int refCount; /* Number of Tcl_Preserve calls in effect for
* block. */
int mustFree; /* Non-zero means Tcl_EventuallyFree was
* called while a Tcl_Preserve call was in
* effect, so the structure must be freed when
* refCount becomes zero. */
Tcl_FreeProc *freeProc; /* Function to call to free. */
} Reference;
|
| ︙ | | |
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
+
|
* block is deleted. This field must be the
* first in the structure. */
#ifdef TCL_MEM_DEBUG
void *ptr2; /* Backup copy of the above pointer used to
* ensure that the contents of the handle are
* not changed by anyone else. */
#endif
size_t refCount; /* Number of TclHandlePreserve() calls in
int refCount; /* Number of TclHandlePreserve() calls in
* effect on this handle. */
} HandleStruct;
/*
*----------------------------------------------------------------------
*
* TclFinalizePreserve --
|
| ︙ | | |
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
-
+
|
int mustFree;
Tcl_FreeProc *freeProc;
if (refPtr->clientData != clientData) {
continue;
}
if (refPtr->refCount-- > 1) {
if (--refPtr->refCount != 0) {
Tcl_MutexUnlock(&preserveMutex);
return;
}
/*
* Must remove information from the slot before calling freeProc to
* avoid reentrancy problems if the freeProc calls Tcl_Preserve on the
|
| ︙ | | |
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
-
+
|
Tcl_Panic("using previously disposed TclHandle %p", handlePtr);
}
if ((handlePtr->ptr != NULL) && (handlePtr->ptr != handlePtr->ptr2)) {
Tcl_Panic("someone has changed the block referenced by the handle %p\nfrom %p to %p",
handlePtr, handlePtr->ptr2, handlePtr->ptr);
}
#endif
if ((handlePtr->refCount-- <= 1) && (handlePtr->ptr == NULL)) {
if ((--handlePtr->refCount == 0) && (handlePtr->ptr == NULL)) {
ckfree(handlePtr);
}
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclProc.c.
| ︙ | | |
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
-
+
|
procArgs++;
}
/*
* The argument list is just "args"; check the body
*/
procBody = TclGetStringFromObj(objv[3], &numBytes);
procBody = Tcl_GetStringFromObj(objv[3], &numBytes);
if (TclParseAllWhiteSpace(procBody, numBytes) < numBytes) {
goto done;
}
/*
* The body is just spaces: link the compileProc
*/
|
| ︙ | | |
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
|
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
|
-
+
|
MakeProcError(
Tcl_Interp *interp, /* The interpreter in which the procedure was
* called. */
Tcl_Obj *procNameObj) /* Name of the procedure. Used for error
* messages and trace information. */
{
int overflow, limit = 60, nameLen;
const char *procName = TclGetStringFromObj(procNameObj, &nameLen);
const char *procName = Tcl_GetStringFromObj(procNameObj, &nameLen);
overflow = (nameLen > limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (procedure \"%.*s%s\" line %d)",
(overflow ? limit : nameLen), procName,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
}
|
| ︙ | | |
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
|
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
* necessary.
*/
lambdaPtr = objv[1];
if (lambdaPtr->typePtr == &tclLambdaType) {
procPtr = lambdaPtr->internalRep.twoPtrValue.ptr1;
}
#define JOE_EXTENSION 0
/*
* Note: this code is NOT FUNCTIONAL due to the NR implementation; DO NOT
* ENABLE! Leaving here as reminder to (a) TIP the suggestion, and (b) adapt
* the code. (MS)
*/
#if JOE_EXTENSION
else {
/*
* Joe English's suggestion to allow cmdNames to function as lambdas.
*/
Tcl_Obj *elemPtr;
int numElem;
if ((lambdaPtr->typePtr == &tclCmdNameType) ||
(TclListObjGetElements(interp, lambdaPtr, &numElem,
&elemPtr) == TCL_OK && numElem == 1)) {
return Tcl_EvalObjv(interp, objc-1, objv+1, 0);
}
}
#endif
if ((procPtr == NULL) || (procPtr->iPtr != iPtr)) {
result = SetLambdaFromAny(interp, lambdaPtr);
if (result != TCL_OK) {
return result;
}
procPtr = lambdaPtr->internalRep.twoPtrValue.ptr1;
|
| ︙ | | |
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
|
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
MakeLambdaError(
Tcl_Interp *interp, /* The interpreter in which the procedure was
* called. */
Tcl_Obj *procNameObj) /* Name of the procedure. Used for error
* messages and trace information. */
{
int overflow, limit = 60, nameLen;
const char *procName = TclGetStringFromObj(procNameObj, &nameLen);
const char *procName = Tcl_GetStringFromObj(procNameObj, &nameLen);
overflow = (nameLen > limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (lambda term \"%.*s%s\" line %d)",
(overflow ? limit : nameLen), procName,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
}
/*
*----------------------------------------------------------------------
*
* TclGetCmdFrameForProcedure --
*
* How to get the CmdFrame information for a procedure.
*
* Results:
* A pointer to the CmdFrame (only guaranteed to be valid until the next
* Tcl command is processed or the interpreter's state is otherwise
* modified) or a NULL if the information is not available.
*
* Side effects:
* none.
*
*----------------------------------------------------------------------
*/
CmdFrame *
TclGetCmdFrameForProcedure(
Proc *procPtr) /* The procedure whose cmd-frame is to be
* looked up. */
{
Tcl_HashEntry *hePtr;
if (procPtr == NULL || procPtr->iPtr == NULL) {
return NULL;
}
hePtr = Tcl_FindHashEntry(procPtr->iPtr->linePBodyPtr, procPtr);
if (hePtr == NULL) {
return NULL;
}
return (CmdFrame *) Tcl_GetHashValue(hePtr);
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclRegexp.c.
| ︙ | | |
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
|
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
|
-
-
-
-
-
-
-
-
-
-
+
+
+
|
Tcl_Interp *interp, /* Used for error reporting. May be NULL. */
Tcl_Obj *textObj, /* Object containing the String to search. */
Tcl_Obj *patternObj) /* Regular expression to match against
* string. */
{
Tcl_RegExp re;
/*
* For performance reasons, first try compiling the RE without support for
* subexpressions. On failure, try again without TCL_REG_NOSUB in case the
* RE has backreferences in it. Closely related to [Bug 1366683]. If this
* still fails, an error message will be left in the interpreter.
*/
if (!(re = Tcl_GetRegExpFromObj(interp, patternObj,
TCL_REG_ADVANCED | TCL_REG_NOSUB))
&& !(re = Tcl_GetRegExpFromObj(interp, patternObj, TCL_REG_ADVANCED))) {
re = Tcl_GetRegExpFromObj(interp, patternObj,
TCL_REG_ADVANCED | TCL_REG_NOSUB);
if (re == NULL) {
return -1;
}
return Tcl_RegExpExecObj(interp, re, textObj, 0 /* offset */,
0 /* nmatches */, 0 /* flags */);
}
/*
|
| ︙ | | |
Changes to generic/tclRegexp.h.
| ︙ | | |
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
-
+
|
Tcl_Obj *globObjPtr; /* Glob pattern rep of RE or NULL if none. */
regmatch_t *matches; /* Array of indices into the Tcl_UniChar
* representation of the last string matched
* with this regexp to indicate the location
* of subexpressions. */
rm_detail_t details; /* Detailed information on match (currently
* used only for REG_EXPECT). */
unsigned int refCount; /* Count of number of references to this
int refCount; /* Count of number of references to this
* compiled regexp. */
} TclRegexp;
#endif /* _TCLREGEXP */
/*
* Local Variables:
|
| ︙ | | |
Changes to generic/tclStrToD.c.
| ︙ | | |
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
|
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
|
-
+
|
if (m2plus > m2minus) {
mp_mul_2d(&mplus, 1, &mplus);
}
mp_div_d(&S, 5, &S, NULL);
--s5;
/*
* IDEA: It might possibly be a win to fall back to int64
* IDEA: It might possibly be a win to fall back to int64_t
* arithmetic here if S < 2**64/10. But it's a win only for
* a fairly narrow range of magnitudes so perhaps not worth
* bothering. We already know that we shorten the
* denominator by at least 1 mp_digit, perhaps 2, as we do
* the conversion for 17 digits of significance.
* Possible savings:
* 10**26 1 trip through loop before fallback possible
|
| ︙ | | |
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
|
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
|
-
+
|
}
mp_mul_2d(&b, g, &b);
/*
* As with the shortening bignum conversion, it's possible at this
* point that we will have reduced the denominator to less than
* 2**64/10, at which point it would be possible to fall back to
* to int64 arithmetic. But the potential payoff is tremendously
* to int64_t arithmetic. But the potential payoff is tremendously
* less - unless we're working in F format - because we know that
* three groups of digits will always suffice for %#.17e, the
* longest format that doesn't introduce empty precision.
*
* Extract the next group of digits.
*/
|
| ︙ | | |
Changes to generic/tclStringObj.c.
| ︙ | | |
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
+
+
+
+
+
+
+
+
+
|
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
#include "tommath.h"
#include "tclStringRep.h"
/*
* Set COMPAT to 1 to restore the shimmering patterns to those of Tcl 8.5.
* This is an escape hatch in case the changes have some unexpected unwelcome
* impact on performance. If things go well, this mechanism can go away when
* post-8.6 development begins.
*/
#define COMPAT 0
/*
* Prototypes for functions defined later in this file:
*/
static void AppendPrintfToObjVA(Tcl_Obj *objPtr,
const char *format, va_list argList);
static void AppendUnicodeToUnicodeRep(Tcl_Obj *objPtr,
|
| ︙ | | |
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
-
-
-
-
-
-
-
-
-
|
Tcl_GetCharLength(
Tcl_Obj *objPtr) /* The String object to get the num chars
* of. */
{
String *stringPtr;
int numChars;
/*
* Quick, no-shimmer return for short string reps.
*/
if ((objPtr->bytes) && (objPtr->length < 2)) {
/* 0 bytes -> 0 chars; 1 byte -> 1 char */
return objPtr->length;
}
/*
* Optimize the case where we're really dealing with a bytearray object
* without string representation; we don't need to convert to a string to
* perform the get-length operation.
*/
if (TclIsPureByteArray(objPtr)) {
|
| ︙ | | |
441
442
443
444
445
446
447
448
449
450
451
452
453
454
|
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* If numChars is unknown, compute it.
*/
if (numChars == -1) {
TclNumUtfChars(numChars, objPtr->bytes, objPtr->length);
stringPtr->numChars = numChars;
#if COMPAT
if (numChars < objPtr->length) {
/*
* Since we've just computed the number of chars, and not all UTF
* chars are 1-byte long, go ahead and populate the unicode
* string.
*/
FillUnicodeRep(objPtr);
}
#endif
}
return numChars;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
|
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
|
-
+
+
+
+
+
|
/*
* If objPtr has a valid Unicode rep, then append the "unicode" to the
* objPtr's Unicode rep, otherwise the UTF conversion of "unicode" to
* objPtr's string rep.
*/
if (stringPtr->hasUnicode) {
if (stringPtr->hasUnicode
#if COMPAT
&& stringPtr->numChars > 0
#endif
) {
AppendUnicodeToUnicodeRep(objPtr, unicode, length);
} else {
AppendUnicodeToUtfRep(objPtr, unicode, length);
}
}
/*
|
| ︙ | | |
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
|
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
|
-
+
+
+
+
+
|
stringPtr = GET_STRING(objPtr);
/*
* If objPtr has a valid Unicode rep, then get a Unicode string from
* appendObjPtr and append it.
*/
if (stringPtr->hasUnicode) {
if (stringPtr->hasUnicode
#if COMPAT
&& stringPtr->numChars > 0
#endif
) {
/*
* If appendObjPtr is not of the "String" type, don't convert it.
*/
if (appendObjPtr->typePtr == &tclStringType) {
Tcl_UniChar *unicode =
Tcl_GetUnicodeFromObj(appendObjPtr, &numChars);
|
| ︙ | | |
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
|
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
|
-
+
+
+
+
+
|
if ((numChars >= 0) && (appendObjPtr->typePtr == &tclStringType)) {
String *appendStringPtr = GET_STRING(appendObjPtr);
appendNumChars = appendStringPtr->numChars;
}
AppendUtfToUtfRep(objPtr, bytes, length);
if (numChars >= 0 && appendNumChars >= 0) {
if (numChars >= 0 && appendNumChars >= 0
#if COMPAT
&& appendNumChars == length
#endif
) {
stringPtr->numChars = numChars + appendNumChars;
}
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
|
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
|
+
+
+
+
+
+
+
+
|
String *stringPtr = GET_STRING(objPtr);
numChars = ExtendStringRepWithUnicode(objPtr, unicode, numChars);
if (stringPtr->numChars != -1) {
stringPtr->numChars += numChars;
}
#if COMPAT
/*
* Invalidate the unicode rep.
*/
stringPtr->hasUnicode = 0;
#endif
}
/*
*----------------------------------------------------------------------
*
* AppendUtfToUnicodeRep --
*
|
| ︙ | | |
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
|
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
|
-
-
+
+
+
+
+
|
/*
* Format string is NUL-terminated.
*/
while (*format != '\0') {
char *end;
int gotMinus, gotHash, gotZero, gotSpace, gotPlus, sawFlag;
int width, gotPrecision, precision, useShort, useWide, useBig;
int gotMinus = 0, gotHash = 0, gotZero = 0, gotSpace = 0, gotPlus = 0;
int width, gotPrecision, precision, sawFlag, useShort = 0, useBig = 0;
#ifndef TCL_WIDE_INT_IS_LONG
int useWide = 0;
#endif
int newXpg, numChars, allocSegment = 0, segmentLimit, segmentNumBytes;
Tcl_Obj *segment;
Tcl_UniChar ch;
int step = Tcl_UtfToUniChar(format, &ch);
format += step;
if (ch != '%') {
|
| ︙ | | |
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
|
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
|
-
|
goto errorMsg;
}
/*
* Step 2. Set of flags.
*/
gotMinus = gotHash = gotZero = gotSpace = gotPlus = 0;
sawFlag = 1;
do {
switch (ch) {
case '-':
gotMinus = 1;
break;
case '#':
|
| ︙ | | |
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
|
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
|
-
-
-
-
-
-
-
-
-
|
step = Tcl_UtfToUniChar(format, &ch);
}
/*
* Step 5. Length modifier.
*/
useShort = useWide = useBig = 0;
if (ch == 'h') {
useShort = 1;
format += step;
step = Tcl_UtfToUniChar(format, &ch);
} else if (ch == 'l') {
format += step;
step = Tcl_UtfToUniChar(format, &ch);
if (ch == 'l') {
useBig = 1;
format += step;
step = Tcl_UtfToUniChar(format, &ch);
#ifndef TCL_WIDE_INT_IS_LONG
} else {
useWide = 1;
#endif
}
} else if ((ch == 'I') && (format[1] == '6') && (format[2] == '4')) {
format += (step + 2);
step = Tcl_UtfToUniChar(format, &ch);
useBig = 1;
} else if (ch == 'L') {
format += step;
step = Tcl_UtfToUniChar(format, &ch);
useBig = 1;
}
format += step;
span = format;
/*
* Step 6. The actual conversion character.
|
| ︙ | | |
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
|
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
|
+
+
|
int toAppend, isNegative = 0;
if (useBig) {
if (Tcl_GetBignumFromObj(interp, segment, &big) != TCL_OK) {
goto error;
}
isNegative = (mp_cmp_d(&big, 0) == MP_LT);
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
if (Tcl_GetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
Tcl_Obj *objPtr;
if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
goto error;
}
mp_mod_2d(&big, (int) CHAR_BIT*sizeof(Tcl_WideInt), &big);
objPtr = Tcl_NewBignumObj(&big);
Tcl_IncrRefCount(objPtr);
Tcl_GetWideIntFromObj(NULL, objPtr, &w);
Tcl_DecrRefCount(objPtr);
}
isNegative = (w < (Tcl_WideInt) 0);
#endif
} else if (TclGetLongFromObj(NULL, segment, &l) != TCL_OK) {
if (Tcl_GetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
Tcl_Obj *objPtr;
if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
goto error;
}
|
| ︙ | | |
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
|
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
|
+
+
|
case 'd': {
int length;
Tcl_Obj *pure;
const char *bytes;
if (useShort) {
pure = Tcl_NewIntObj((int) s);
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
pure = Tcl_NewWideIntObj(w);
#endif
} else if (useBig) {
pure = Tcl_NewBignumObj(&big);
} else {
pure = Tcl_NewLongObj(l);
}
Tcl_IncrRefCount(pure);
bytes = TclGetStringFromObj(pure, &length);
|
| ︙ | | |
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
|
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
|
+
+
|
unsigned short us = (unsigned short) s;
bits = (Tcl_WideUInt) us;
while (us) {
numDigits++;
us /= base;
}
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
Tcl_WideUInt uw = (Tcl_WideUInt) w;
bits = uw;
while (uw) {
numDigits++;
uw /= base;
}
#endif
} else if (useBig && big.used) {
int leftover = (big.used * DIGIT_BIT) % numBits;
mp_digit mask = (~(mp_digit)0) << (DIGIT_BIT-leftover);
numDigits = 1 +
(((Tcl_WideInt) big.used * DIGIT_BIT) / numBits);
while ((mask & big.dp[big.used-1]) == 0) {
|
| ︙ | | |
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
|
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
|
-
-
-
-
|
Tcl_ListObjAppendElement(NULL, list, Tcl_NewLongObj(
(long) va_arg(argList, int)));
break;
case 1:
Tcl_ListObjAppendElement(NULL, list, Tcl_NewLongObj(
va_arg(argList, long)));
break;
case 2:
Tcl_ListObjAppendElement(NULL, list, Tcl_NewWideIntObj(
va_arg(argList, Tcl_WideInt)));
break;
}
break;
case 'e':
case 'E':
case 'f':
case 'g':
case 'G':
|
| ︙ | | |
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
|
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
|
-
+
-
-
-
-
-
+
-
-
-
-
-
-
-
|
p = end;
break;
}
case '.':
gotPrecision = 1;
p++;
break;
/* TODO: support for bignum arguments */
/* TODO: support for wide (and bignum?) arguments */
case 'l':
++size;
p++;
break;
case 'L':
size = 2;
size = 1;
p++;
break;
case 'I':
if (p[1]=='6' && p[2]=='4') {
p += 2;
size = 2;
}
p++;
break;
case 'h':
size = -1;
default:
p++;
}
|
| ︙ | | |
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
|
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
return TclGetStringFromObj(objPtr, (int *)sizePtr);
}
stringPtr = GET_STRING(objPtr);
*sizePtr = stringPtr->allocated;
return objPtr->bytes;
}
/*
*---------------------------------------------------------------------------
*
* TclStringRepeat --
*
* Performs the [string repeat] function.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* Writes to *objPtrPtr the address of Tcl_Obj that is concatenation
* of count copies of the value in objPtr.
*
*---------------------------------------------------------------------------
*/
int
TclStringRepeat(
Tcl_Interp *interp,
Tcl_Obj *objPtr,
int count,
Tcl_Obj **objPtrPtr)
{
Tcl_Obj *objResultPtr;
int length = 0, unichar = 0, done = 1;
int binary = TclIsPureByteArray(objPtr);
/* assert (count >= 2) */
/*
* Analyze to determine what representation result should be.
* GOALS: Avoid shimmering & string rep generation.
* Produce pure bytearray when possible.
* Error on overflow.
*/
if (!binary) {
if (objPtr->typePtr == &tclStringType) {
String *stringPtr = GET_STRING(objPtr);
if (stringPtr->hasUnicode) {
unichar = 1;
}
}
}
if (binary) {
/* Result will be pure byte array. Pre-size it */
Tcl_GetByteArrayFromObj(objPtr, &length);
} else if (unichar) {
/* Result will be pure Tcl_UniChar array. Pre-size it. */
Tcl_GetUnicodeFromObj(objPtr, &length);
} else {
/* Result will be concat of string reps. Pre-size it. */
Tcl_GetStringFromObj(objPtr, &length);
}
if (length == 0) {
/* Any repeats of empty is empty. */
*objPtrPtr = objPtr;
return TCL_OK;
}
if (count > INT_MAX/length) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"max size for a Tcl value (%d bytes) exceeded", INT_MAX));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
if (binary) {
/* Efficiently produce a pure byte array result */
objResultPtr = Tcl_IsShared(objPtr) ? Tcl_DuplicateObj(objPtr)
: objPtr;
Tcl_SetByteArrayLength(objResultPtr, count*length); /* PANIC? */
Tcl_SetByteArrayLength(objResultPtr, length);
while (count - done > done) {
Tcl_AppendObjToObj(objResultPtr, objResultPtr);
done *= 2;
}
TclAppendBytesToByteArray(objResultPtr,
Tcl_GetByteArrayFromObj(objResultPtr, NULL),
(count - done) * length);
} else if (unichar) {
/* Efficiently produce a pure Tcl_UniChar array result */
if (Tcl_IsShared(objPtr)) {
objResultPtr = Tcl_NewUnicodeObj(Tcl_GetUnicode(objPtr), length);
} else {
TclInvalidateStringRep(objPtr);
objResultPtr = objPtr;
}
if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"string size overflow: unable to alloc %"
TCL_LL_MODIFIER "u bytes",
(Tcl_WideUInt)STRING_SIZE(count*length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
Tcl_SetObjLength(objResultPtr, length);
while (count - done > done) {
Tcl_AppendObjToObj(objResultPtr, objResultPtr);
done *= 2;
}
Tcl_AppendUnicodeToObj(objResultPtr, Tcl_GetUnicode(objResultPtr),
(count - done) * length);
} else {
/* Efficiently concatenate string reps */
if (Tcl_IsShared(objPtr)) {
objResultPtr = Tcl_NewStringObj(Tcl_GetString(objPtr), length);
} else {
TclFreeIntRep(objPtr);
objResultPtr = objPtr;
}
if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"string size overflow: unable to alloc %u bytes",
count*length));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
Tcl_SetObjLength(objResultPtr, length);
while (count - done > done) {
Tcl_AppendObjToObj(objResultPtr, objResultPtr);
done *= 2;
}
Tcl_AppendToObj(objResultPtr, Tcl_GetString(objResultPtr),
(count - done) * length);
}
*objPtrPtr = objResultPtr;
return TCL_OK;
}
/*
*---------------------------------------------------------------------------
*
* TclStringCatObjv --
*
* Performs the [string cat] function.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* Writes to *objPtrPtr the address of Tcl_Obj that is concatenation
* of all objc values in objv.
*
*---------------------------------------------------------------------------
*/
int
TclStringCatObjv(
Tcl_Interp *interp,
int inPlace,
int objc,
Tcl_Obj * const objv[],
Tcl_Obj **objPtrPtr)
{
Tcl_Obj *objPtr, *objResultPtr, * const *ov;
int oc, length = 0, binary = 1, first = 0;
int allowUniChar = 1, requestUniChar = 0;
/* assert (objc >= 2) */
/*
* Analyze to determine what representation result should be.
* GOALS: Avoid shimmering & string rep generation.
* Produce pure bytearray when possible.
* Error on overflow.
*/
ov = objv, oc = objc;
while (oc-- && (binary || allowUniChar)) {
objPtr = *ov++;
if (objPtr->bytes) {
/* Value has a string rep. */
if (objPtr->length) {
/*
* Non-empty string rep. Not a pure bytearray, so we
* won't create a pure bytearray
*/
binary = 0;
if ((objPtr->typePtr) && (objPtr->typePtr != &tclStringType)) {
/* Prevent shimmer of non-string types. */
allowUniChar = 0;
}
}
} else {
/* assert (objPtr->typePtr != NULL) -- stork! */
if (TclIsPureByteArray(objPtr)) {
allowUniChar = 0;
} else {
binary = 0;
if (objPtr->typePtr == &tclStringType) {
/* Have a pure Unicode value; ask to preserve it */
requestUniChar = 1;
} else {
/* Have another type; prevent shimmer */
allowUniChar = 0;
}
}
}
}
if (binary) {
/* Result will be pure byte array. Pre-size it */
ov = objv; oc = objc;
while (oc-- && (length >= 0)) {
objPtr = *ov++;
if (objPtr->bytes == NULL) {
int numBytes;
Tcl_GetByteArrayFromObj(objPtr, &numBytes); /* PANIC? */
if (length == 0) {
first = objc - oc - 1;
}
length += numBytes;
}
}
} else if (allowUniChar && requestUniChar) {
/* Result will be pure Tcl_UniChar array. Pre-size it. */
ov = objv; oc = objc;
while (oc-- && (length >= 0)) {
objPtr = *ov++;
if ((objPtr->bytes == NULL) || (objPtr->length)) {
int numChars;
Tcl_GetUnicodeFromObj(objPtr, &numChars); /* PANIC? */
if (length == 0) {
first = objc - oc - 1;
}
length += numChars;
}
}
} else {
/* Result will be concat of string reps. Pre-size it. */
ov = objv; oc = objc;
while (oc-- && (length >= 0)) {
int numBytes;
objPtr = *ov++;
Tcl_GetStringFromObj(objPtr, &numBytes); /* PANIC? */
if ((length == 0) && numBytes) {
first = objc - oc - 1;
}
length += numBytes;
}
}
if (length < 0) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"max size for a Tcl value (%d bytes) exceeded", INT_MAX));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
if (length == 0) {
/* Total length of zero means every value has length zero */
*objPtrPtr = objv[0];
return TCL_OK;
}
objv += first; objc -= first;
if (binary) {
/* Efficiently produce a pure byte array result */
unsigned char *dst;
/*
* Broken interface! Byte array value routines offer no way
* to handle failure to allocate enough space. Following
* stanza may panic.
*/
if (inPlace && !Tcl_IsShared(*objv)) {
int start;
objResultPtr = *objv++; objc--;
Tcl_GetByteArrayFromObj(objResultPtr, &start);
dst = Tcl_SetByteArrayLength(objResultPtr, length) + start;
} else {
objResultPtr = Tcl_NewByteArrayObj(NULL, length);
dst = Tcl_SetByteArrayLength(objResultPtr, length);
}
while (objc--) {
Tcl_Obj *objPtr = *objv++;
if (objPtr->bytes == NULL) {
int more;
unsigned char *src = Tcl_GetByteArrayFromObj(objPtr, &more);
memcpy(dst, src, (size_t) more);
dst += more;
}
}
} else if (allowUniChar && requestUniChar) {
/* Efficiently produce a pure Tcl_UniChar array result */
Tcl_UniChar *dst;
if (inPlace && !Tcl_IsShared(*objv)) {
int start;
objResultPtr = *objv++; objc--;
/* Ugly interface! Force resize of the unicode array. */
Tcl_GetUnicodeFromObj(objResultPtr, &start);
Tcl_InvalidateStringRep(objResultPtr);
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"concatenation failed: unable to alloc %"
TCL_LL_MODIFIER "u bytes",
(Tcl_WideUInt)STRING_SIZE(length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
dst = Tcl_GetUnicode(objResultPtr) + start;
} else {
Tcl_UniChar ch = 0;
/* Ugly interface! No scheme to init array size. */
objResultPtr = Tcl_NewUnicodeObj(&ch, 0); /* PANIC? */
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"concatenation failed: unable to alloc %"
TCL_LL_MODIFIER "u bytes",
(Tcl_WideUInt)STRING_SIZE(length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
dst = Tcl_GetUnicode(objResultPtr);
}
while (objc--) {
Tcl_Obj *objPtr = *objv++;
if ((objPtr->bytes == NULL) || (objPtr->length)) {
int more;
Tcl_UniChar *src = Tcl_GetUnicodeFromObj(objPtr, &more);
memcpy(dst, src, more * sizeof(Tcl_UniChar));
dst += more;
}
}
} else {
/* Efficiently concatenate string reps */
char *dst;
if (inPlace && !Tcl_IsShared(*objv)) {
int start;
objResultPtr = *objv++; objc--;
Tcl_GetStringFromObj(objResultPtr, &start);
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"concatenation failed: unable to alloc %u bytes",
length));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
dst = Tcl_GetString(objResultPtr) + start;
if (length > start) {
TclFreeIntRep(objResultPtr);
}
} else {
objResultPtr = Tcl_NewObj(); /* PANIC? */
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"concatenation failed: unable to alloc %u bytes",
length));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
}
dst = Tcl_GetString(objResultPtr);
}
while (objc--) {
Tcl_Obj *objPtr = *objv++;
if ((objPtr->bytes == NULL) || (objPtr->length)) {
int more;
char *src = Tcl_GetStringFromObj(objPtr, &more);
memcpy(dst, src, (size_t) more);
dst += more;
}
}
}
*objPtrPtr = objResultPtr;
return TCL_OK;
}
/*
*---------------------------------------------------------------------------
*
* TclStringFind --
*
* Implements the [string first] operation.
*
* Results:
* If needle is found as a substring of haystack, the index of the
* first instance of such a find is returned. If needle is not present
* as a substring of haystack, -1 is returned.
*
* Side effects:
* needle and haystack may have their Tcl_ObjType changed.
*
*---------------------------------------------------------------------------
*/
int
TclStringFind(
Tcl_Obj *needle,
Tcl_Obj *haystack,
int start)
{
int lh, ln = Tcl_GetCharLength(needle);
if (ln == 0) {
/*
* We don't find empty substrings. Bizarre!
*
* TODO: When we one day make this a true substring
* finder, change this to "return 0"
*/
return -1;
}
if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) {
unsigned char *end, *try, *bh;
unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln);
bh = Tcl_GetByteArrayFromObj(haystack, &lh);
end = bh + lh;
try = bh + start;
while (try + ln <= end) {
try = memchr(try, bn[0], end - try);
if (try == NULL) {
return -1;
}
if (0 == memcmp(try+1, bn+1, ln-1)) {
return (try - bh);
}
try++;
}
return -1;
}
lh = Tcl_GetCharLength(haystack);
if (haystack->bytes && (lh == haystack->length)) {
/* haystack is all single-byte chars */
if (needle->bytes && (ln == needle->length)) {
/* needle is also all single-byte chars */
char *found = strstr(haystack->bytes + start, needle->bytes);
if (found) {
return (found - haystack->bytes);
} else {
return -1;
}
} else {
/*
* Cannot find substring with a multi-byte char inside
* a string with no multi-byte chars.
*/
return -1;
}
} else {
Tcl_UniChar *try, *end, *uh;
Tcl_UniChar *un = Tcl_GetUnicodeFromObj(needle, &ln);
uh = Tcl_GetUnicodeFromObj(haystack, &lh);
end = uh + lh;
try = uh + start;
while (try + ln <= end) {
if ((*try == *un)
&& (0 == memcmp(try+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
return (try - uh);
}
try++;
}
return -1;
}
}
/*
*---------------------------------------------------------------------------
*
* TclStringLast --
*
* Implements the [string last] operation.
*
* Results:
* If needle is found as a substring of haystack, the index of the
* last instance of such a find is returned. If needle is not present
* as a substring of haystack, -1 is returned.
*
* Side effects:
* needle and haystack may have their Tcl_ObjType changed.
*
*---------------------------------------------------------------------------
*/
int
TclStringLast(
Tcl_Obj *needle,
Tcl_Obj *haystack,
int last)
{
int lh, ln = Tcl_GetCharLength(needle);
if (ln == 0) {
/*
* We don't find empty substrings. Bizarre!
*
* TODO: When we one day make this a true substring
* finder, change this to "return 0"
*/
return -1;
}
if (ln > last + 1) {
return -1;
}
if (TclIsPureByteArray(needle) && TclIsPureByteArray(haystack)) {
unsigned char *try, *bh;
unsigned char *bn = Tcl_GetByteArrayFromObj(needle, &ln);
bh = Tcl_GetByteArrayFromObj(haystack, &lh);
if (last + 1 > lh) {
last = lh - 1;
}
try = bh + last + 1 - ln;
while (try >= bh) {
if ((*try == bn[0])
&& (0 == memcmp(try+1, bn+1, ln-1))) {
return (try - bh);
}
try--;
}
return -1;
}
lh = Tcl_GetCharLength(haystack);
if (last + 1 > lh) {
last = lh - 1;
}
if (haystack->bytes && (lh == haystack->length)) {
/* haystack is all single-byte chars */
if (needle->bytes && (ln == needle->length)) {
/* needle is also all single-byte chars */
char *try = haystack->bytes + last + 1 - ln;
while (try >= haystack->bytes) {
if ((*try == needle->bytes[0])
&& (0 == memcmp(try+1, needle->bytes + 1, ln - 1))) {
return (try - haystack->bytes);
}
try--;
}
return -1;
} else {
/*
* Cannot find substring with a multi-byte char inside
* a string with no multi-byte chars.
*/
return -1;
}
} else {
Tcl_UniChar *try, *uh;
Tcl_UniChar *un = Tcl_GetUnicodeFromObj(needle, &ln);
uh = Tcl_GetUnicodeFromObj(haystack, &lh);
try = uh + last + 1 - ln;
while (try >= uh) {
if ((*try == un[0])
&& (0 == memcmp(try+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
return (try - uh);
}
try--;
}
return -1;
}
}
/*
*---------------------------------------------------------------------------
*
* TclStringObjReverse --
*
* Implements the [string reverse] operation.
*
|
| ︙ | | |
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
|
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
|
+
|
* an internal rep of type "String". */
Tcl_Obj *copyPtr) /* Object with internal rep to set. Must not
* currently have an internal rep.*/
{
String *srcStringPtr = GET_STRING(srcPtr);
String *copyStringPtr = NULL;
#if COMPAT==0
if (srcStringPtr->numChars == -1) {
/*
* The String struct in the source value holds zero useful data. Don't
* bother copying it. Don't even bother allocating space in which to
* copy it. Just let the copy be untyped.
*/
|
| ︙ | | |
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
|
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Tricky point: the string value was copied by generic object management
* code, so it doesn't contain any extra bytes that might exist in the
* source object.
*/
copyStringPtr->allocated = copyPtr->bytes ? copyPtr->length : 0;
#else /* COMPAT!=0 */
/*
* If the src obj is a string of 1-byte Utf chars, then copy the string
* rep of the source object and create an "empty" Unicode internal rep for
* the new object. Otherwise, copy Unicode internal rep, and invalidate
* the string rep of the new object.
*/
if (srcStringPtr->hasUnicode && srcStringPtr->numChars > 0) {
/*
* Copy the full allocation for the Unicode buffer.
*/
copyStringPtr = stringAlloc(srcStringPtr->maxChars);
copyStringPtr->maxChars = srcStringPtr->maxChars;
memcpy(copyStringPtr->unicode, srcStringPtr->unicode,
srcStringPtr->numChars * sizeof(Tcl_UniChar));
copyStringPtr->unicode[srcStringPtr->numChars] = 0;
copyStringPtr->allocated = 0;
} else {
copyStringPtr = stringAlloc(0);
copyStringPtr->unicode[0] = 0;
copyStringPtr->maxChars = 0;
/*
* Tricky point: the string value was copied by generic object
* management code, so it doesn't contain any extra bytes that might
* exist in the source object.
*/
copyStringPtr->allocated = copyPtr->length;
}
copyStringPtr->numChars = srcStringPtr->numChars;
copyStringPtr->hasUnicode = srcStringPtr->hasUnicode;
#endif /* COMPAT==0 */
SET_STRING(copyPtr, copyStringPtr);
copyPtr->typePtr = &tclStringType;
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
|
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
|
-
+
|
int numChars)
{
/*
* Pre-condition: this is the "string" Tcl_ObjType.
*/
int i, origLength, size = 0;
char *dst;
char *dst, buf[TCL_UTF_MAX];
String *stringPtr = GET_STRING(objPtr);
if (numChars < 0) {
numChars = UnicodeLength(unicode);
}
if (numChars == 0) {
|
| ︙ | | |
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
|
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
|
-
+
|
if (numChars <= (INT_MAX - size)/TCL_UTF_MAX
&& stringPtr->allocated >= size + numChars * TCL_UTF_MAX) {
goto copyBytes;
}
for (i = 0; i < numChars && size >= 0; i++) {
size += TclUtfCount(unicode[i]);
size += Tcl_UniCharToUtf((int) unicode[i], buf);
}
if (size < 0) {
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
}
/*
* Grow space if needed.
|
| ︙ | | |
Changes to generic/tclStringRep.h.
| ︙ | | |
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
-
+
|
*
* Under normal configurations, what Tcl calls "Unicode" is actually UTF-16
* restricted to the Basic Multilingual Plane (i.e. U+00000 to U+0FFFF). This
* can be officially modified by altering the definition of Tcl_UniChar in
* tcl.h, but do not do that unless you are sure what you're doing!
*/
typedef struct {
typedef struct String {
int numChars; /* The number of chars in the string. -1 means
* this value has not been calculated. >= 0
* means that there is a valid Unicode rep, or
* that the number of UTF bytes == the number
* of chars. */
int allocated; /* The amount of space actually allocated for
* the UTF string (minus 1 byte for the
|
| ︙ | | |
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
-
+
-
+
-
+
-
+
-
+
|
(int)(((size_t)UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar))
#define STRING_SIZE(numChars) \
(sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))
#define stringCheckLimits(numChars) \
do { \
if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
(int)STRING_MAXCHARS); \
STRING_MAXCHARS); \
} \
} while (0)
#define stringAttemptAlloc(numChars) \
(String *) attemptckalloc(STRING_SIZE(numChars))
(String *) attemptckalloc((unsigned) STRING_SIZE(numChars))
#define stringAlloc(numChars) \
(String *) ckalloc(STRING_SIZE(numChars))
(String *) ckalloc((unsigned) STRING_SIZE(numChars))
#define stringRealloc(ptr, numChars) \
(String *) ckrealloc((ptr), STRING_SIZE(numChars))
(String *) ckrealloc((ptr), (unsigned) STRING_SIZE(numChars))
#define stringAttemptRealloc(ptr, numChars) \
(String *) attemptckrealloc((ptr), STRING_SIZE(numChars))
(String *) attemptckrealloc((ptr), (unsigned) STRING_SIZE(numChars))
#define GET_STRING(objPtr) \
((String *) (objPtr)->internalRep.twoPtrValue.ptr1)
#define SET_STRING(objPtr, stringPtr) \
((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (stringPtr))
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
Changes to generic/tclStubInit.c.
| ︙ | | |
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
|
745
746
747
748
749
750
751
752
753
754
755
756
757
758
|
-
|
TclBN_s_mp_sub, /* 60 */
TclBN_mp_init_set_int, /* 61 */
TclBN_mp_set_int, /* 62 */
TclBN_mp_cnt_lsb, /* 63 */
TclBNInitBignumFromLong, /* 64 */
TclBNInitBignumFromWideInt, /* 65 */
TclBNInitBignumFromWideUInt, /* 66 */
TclBN_mp_expt_d_ex, /* 67 */
};
static const TclStubHooks tclStubHooks = {
&tclPlatStubs,
&tclIntStubs,
&tclIntPlatStubs
};
|
| ︙ | | |
Changes to generic/tclStubLib.c.
| ︙ | | |
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
+
-
+
+
+
+
|
const TclStubs *tclStubsPtr = NULL;
const TclPlatStubs *tclPlatStubsPtr = NULL;
const TclIntStubs *tclIntStubsPtr = NULL;
const TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
/*
* Use our own ISDIGIT to avoid linking to libc on windows
* Use our own isDigit to avoid linking to libc on windows
*/
#define ISDIGIT(c) (((unsigned)((c)-'0')) <= 9)
static int isDigit(const int c)
{
return (c >= '0' && c <= '9');
}
/*
*----------------------------------------------------------------------
*
* Tcl_InitStubs --
*
* Tries to initialise the stub table pointers and ensures that the
|
| ︙ | | |
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
-
+
-
-
-
+
+
-
+
-
+
-
+
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
|
*----------------------------------------------------------------------
*/
#undef Tcl_InitStubs
MODULE_SCOPE const char *
Tcl_InitStubs(
Tcl_Interp *interp,
const char *version,
int exact,
int exact)
int magic)
{
Interp *iPtr = (Interp *) interp;
const char *actualVersion = NULL;
ClientData pkgData = NULL;
const TclStubs *stubsPtr = iPtr->stubTable;
/*
* We can't optimize this check by caching tclStubsPtr because that
* prevents apps from being able to load/unload Tcl dynamically multiple
* times. [Bug 615304]
*/
if (!stubsPtr || (stubsPtr->magic != (((exact&0xff00) >= 0x900) ? magic : TCL_STUB_MAGIC))) {
iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism";
if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) {
iPtr->result = "interpreter uses an incompatible stubs mechanism";
iPtr->freeProc = TCL_STATIC;
return NULL;
}
actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 0, &pkgData);
if (actualVersion == NULL) {
return NULL;
}
if (exact&1) {
if (exact) {
const char *p = version;
int count = 0;
while (*p) {
count += !ISDIGIT(*p++);
count += !isDigit(*p++);
}
if (count == 1) {
const char *q = actualVersion;
p = version;
while (*p && (*p == *q)) {
p++; q++;
}
if (*p || ISDIGIT(*q)) {
if (*p || isDigit(*q)) {
/* Construct error message */
stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
return NULL;
}
} else {
actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL);
if (actualVersion == NULL) {
return NULL;
}
}
}
if (((exact&0xff00) < 0x900)) {
/* We are running Tcl 8.x */
stubsPtr = (TclStubs *)pkgData;
}
tclStubsPtr = (TclStubs *)pkgData;
tclStubsPtr = stubsPtr;
if (stubsPtr->hooks) {
tclPlatStubsPtr = stubsPtr->hooks->tclPlatStubs;
tclIntStubsPtr = stubsPtr->hooks->tclIntStubs;
tclIntPlatStubsPtr = stubsPtr->hooks->tclIntPlatStubs;
if (tclStubsPtr->hooks) {
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
} else {
tclPlatStubsPtr = NULL;
tclIntStubsPtr = NULL;
tclIntPlatStubsPtr = NULL;
}
return actualVersion;
|
| ︙ | | |
Changes to generic/tclTest.c.
| ︙ | | |
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
+
+
+
+
+
+
+
+
-
-
+
+
|
*/
#include "tclIO.h"
/*
* Declare external functions used in Windows tests.
*/
/*
* TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
* Tcltest_Init declaration is in the source file itself, which is only
* accessed when we are building a library.
*/
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT
DLLEXPORT int Tcltest_Init(Tcl_Interp *interp);
DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp);
EXTERN int Tcltest_Init(Tcl_Interp *interp);
EXTERN int Tcltest_SafeInit(Tcl_Interp *interp);
/*
* Dynamic string shared by TestdcallCmd and DelCallbackProc; used to collect
* the results of the various deletion callbacks.
*/
static Tcl_DString delString;
|
| ︙ | | |
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
-
-
-
-
-
-
-
-
|
Tcl_Obj *const objv[]);
static int TestparsevarObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int TestparsevarnameObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int TestpreferstableObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int TestprintObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int TestregexpObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int TestreturnObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static void TestregexpXflags(const char *string,
int length, int *cflagsPtr, int *eflagsPtr);
#ifndef TCL_NO_DEPRECATED
static int TestsaveresultCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static void TestsaveresultFree(char *blockPtr);
#endif /* TCL_NO_DEPRECATED */
static int TestsetassocdataCmd(ClientData dummy,
Tcl_Interp *interp, int argc, const char **argv);
static int TestsetCmd(ClientData dummy,
Tcl_Interp *interp, int argc, const char **argv);
static int Testset2Cmd(ClientData dummy,
Tcl_Interp *interp, int argc, const char **argv);
static int TestseterrorcodeCmd(ClientData dummy,
|
| ︙ | | |
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
-
-
-
+
-
+
|
*----------------------------------------------------------------------
*/
int
Tcltest_Init(
Tcl_Interp *interp) /* Interpreter for application. */
{
#ifndef TCL_NO_DEPRECATED
Tcl_ValueType t3ArgTypes[2];
#endif /* TCL_NO_DEPRECATED */
Tcl_Obj *listPtr;
Tcl_Obj **objv;
int objc, index;
static const char *const specialOptions[] = {
"-appinitprocerror", "-appinitprocdeleteinterp",
"-appinitprocclosestderr", "-appinitprocsetrcfile", NULL
};
if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
if (Tcl_InitStubs(interp, "8.5", 0) == NULL) {
return TCL_ERROR;
}
if (Tcl_TomMath_InitStubs(interp, "8.5-") == NULL) {
if (Tcl_TomMath_InitStubs(interp, "8.5") == NULL) {
return TCL_ERROR;
}
if (Tcl_OOInitStubs(interp) == NULL) {
return TCL_ERROR;
}
/* TIP #268: Full patchlevel instead of just major.minor */
|
| ︙ | | |
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
|
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
|
-
-
-
-
-
-
|
Tcl_CreateObjCommand(interp, "testparseargs", TestparseargsCmd,NULL,NULL);
Tcl_CreateObjCommand(interp, "testparser", TestparserObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testparsevar", TestparsevarObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testparsevarname", TestparsevarnameObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testpreferstable", TestpreferstableObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testprint", TestprintObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testregexp", TestregexpObjCmd,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testreturn", TestreturnObjCmd,
NULL, NULL);
#ifndef TCL_NO_DEPRECATED
Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd,
NULL, NULL);
#endif /* TCL_NO_DEPRECATED */
Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testsetnoerr", TestsetCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testseterr", TestsetCmd,
(ClientData) TCL_LEAVE_ERR_MSG, NULL);
Tcl_CreateCommand(interp, "testset2", Testset2Cmd,
|
| ︙ | | |
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
|
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
|
-
-
-
-
|
Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "teststaticpkg", TeststaticpkgCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testtranslatefilename",
TesttranslatefilenameCmd, NULL, NULL);
Tcl_CreateCommand(interp, "testupvar", TestupvarCmd, NULL, NULL);
#ifndef TCL_NO_DEPRECATED
Tcl_CreateMathFunc(interp, "T1", 0, NULL, TestMathFunc, (ClientData) 123);
Tcl_CreateMathFunc(interp, "T2", 0, NULL, TestMathFunc, (ClientData) 345);
#endif /* TCL_NO_DEPRECATED */
Tcl_CreateCommand(interp, "testmainthread", TestmainthreadCmd, NULL,
NULL);
Tcl_CreateCommand(interp, "testsetmainloop", TestsetmainloopCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testexitmainloop", TestexitmainloopCmd,
NULL, NULL);
#if defined(HAVE_CPUID) || defined(_WIN32)
Tcl_CreateObjCommand(interp, "testcpuid", TestcpuidCmd,
(ClientData) 0, NULL);
#endif
#ifndef TCL_NO_DEPRECATED
t3ArgTypes[0] = TCL_EITHER;
t3ArgTypes[1] = TCL_EITHER;
Tcl_CreateMathFunc(interp, "T3", 2, t3ArgTypes, TestMathFunc2,
NULL);
#endif /* TCL_NO_DEPRECATED */
Tcl_CreateObjCommand(interp, "testnreunwind", TestNREUnwind,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testnrelevels", TestNRELevels,
NULL, NULL);
Tcl_CreateObjCommand(interp, "testinterpresolver", TestInterpResolverCmd,
NULL, NULL);
|
| ︙ | | |
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
|
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
-
+
|
*----------------------------------------------------------------------
*/
int
Tcltest_SafeInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
if (Tcl_InitStubs(interp, "8.5", 0) == NULL) {
return TCL_ERROR;
}
return Procbodytest_SafeInit(interp);
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
|
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
|
-
+
-
+
|
static int deleteCalled;
deleteCalled = 0;
cmdTrace = Tcl_CreateObjTrace(interp, 50000,
TCL_ALLOW_INLINE_COMPILATION, ObjTraceProc,
(ClientData) &deleteCalled, ObjTraceDeleteProc);
result = Tcl_EvalEx(interp, argv[2], -1, 0);
result = Tcl_Eval(interp, argv[2]);
Tcl_DeleteTrace(interp, cmdTrace);
if (!deleteCalled) {
Tcl_SetResult(interp, "Delete wasn't called", TCL_STATIC);
return TCL_ERROR;
} else {
return result;
}
} else if (strcmp(argv[1], "doubletest") == 0) {
Tcl_Trace t1, t2;
Tcl_DStringInit(&buffer);
t1 = Tcl_CreateTrace(interp, 1, CmdTraceProc, &buffer);
t2 = Tcl_CreateTrace(interp, 50000, CmdTraceProc, &buffer);
result = Tcl_EvalEx(interp, argv[2], -1, 0);
result = Tcl_Eval(interp, argv[2]);
if (result == TCL_OK) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, Tcl_DStringValue(&buffer), NULL);
}
Tcl_DeleteTrace(interp, t2);
Tcl_DeleteTrace(interp, t1);
Tcl_DStringFree(&buffer);
|
| ︙ | | |
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
|
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
|
-
+
|
static void
DelDeleteProc(
ClientData clientData) /* String command to evaluate. */
{
DelCmd *dPtr = clientData;
Tcl_EvalEx(dPtr->interp, dPtr->deleteCmd, -1, 0);
Tcl_Eval(dPtr->interp, dPtr->deleteCmd);
Tcl_ResetResult(dPtr->interp);
ckfree(dPtr->deleteCmd);
ckfree(dPtr);
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
|
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
Tcl_FreeParse(&parse);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TestpreferstableObjCmd --
*
* This procedure implements the "testpreferstable" command. It is
* used for being able to test the "package" command even when the
* environment variable TCL_PKG_PREFER_LATEST is set in your environment.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
TestpreferstableObjCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Interp *iPtr = (Interp *) interp;
iPtr->packagePrefer = PKG_PREFER_STABLE;
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TestprintObjCmd --
*
* This procedure implements the "testprint" command. It is
* used for being able to test the Tcl_ObjPrintf() function.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
TestprintObjCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
Tcl_WideInt argv1 = 0;
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "format wideint");
}
if (objc > 1) {
Tcl_GetWideIntFromObj(interp, objv[2], &argv1);
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf(Tcl_GetString(objv[1]), argv1));
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TestregexpObjCmd --
*
* This procedure implements the "testregexp" command. It is used to give
* a direct interface for regexp flags. It's identical to
* Tcl_RegexpObjCmd except for the -xflags option, and the consequences
* thereof (including the REG_EXPECT kludge).
*
|
| ︙ | | |
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
|
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
|
-
+
-
+
|
const char *value;
int start, end;
char resinfo[TCL_INTEGER_SPACE * 2];
varName = Tcl_GetString(objv[2]);
TclRegExpRangeUniChar(regExpr, -1, &start, &end);
sprintf(resinfo, "%d %d", start, end-1);
value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0);
value = Tcl_SetVar(interp, varName, resinfo, 0);
if (value == NULL) {
Tcl_AppendResult(interp, "couldn't set variable \"",
varName, "\"", NULL);
return TCL_ERROR;
}
} else if (cflags & TCL_REG_CANMATCH) {
const char *varName;
const char *value;
char resinfo[TCL_INTEGER_SPACE * 2];
Tcl_RegExpGetInfo(regExpr, &info);
varName = Tcl_GetString(objv[2]);
sprintf(resinfo, "%ld", info.extendStart);
value = Tcl_SetVar2(interp, varName, NULL, resinfo, 0);
value = Tcl_SetVar(interp, varName, resinfo, 0);
if (value == NULL) {
Tcl_AppendResult(interp, "couldn't set variable \"",
varName, "\"", NULL);
return TCL_ERROR;
}
}
return TCL_OK;
|
| ︙ | | |
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
|
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
|
-
+
|
}
static int
StaticInitProc(
Tcl_Interp *interp) /* Interpreter in which package is supposedly
* being loaded. */
{
Tcl_SetVar2(interp, "x", NULL, "loaded", TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "x", "loaded", TCL_GLOBAL_ONLY);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TesttranslatefilenameCmd --
|
| ︙ | | |
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
|
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
|
-
+
|
if (argc == 5) {
if (strcmp(argv[4], "global") == 0) {
flags = TCL_GLOBAL_ONLY;
} else if (strcmp(argv[4], "namespace") == 0) {
flags = TCL_NAMESPACE_ONLY;
}
return Tcl_UpVar2(interp, argv[1], argv[2], NULL, argv[3], flags);
return Tcl_UpVar(interp, argv[1], argv[2], argv[3], flags);
} else {
if (strcmp(argv[5], "global") == 0) {
flags = TCL_GLOBAL_ONLY;
} else if (strcmp(argv[5], "namespace") == 0) {
flags = TCL_NAMESPACE_ONLY;
}
return Tcl_UpVar2(interp, argv[1], argv[2],
|
| ︙ | | |
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
|
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
|
-
+
-
+
-
+
|
}
Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per hashtable lookup of \"gettimes\"\n",
timePer/100000);
/* Tcl_SetVar 100000 times */
fprintf(stderr, "Tcl_SetVar2 of \"12345\" 100000 times\n");
fprintf(stderr, "Tcl_SetVar of \"12345\" 100000 times\n");
Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
s = Tcl_SetVar2(interp, "a", NULL, "12345", TCL_LEAVE_ERR_MSG);
s = Tcl_SetVar(interp, "a", "12345", TCL_LEAVE_ERR_MSG);
if (s == NULL) {
return TCL_ERROR;
}
}
Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_SetVar of a to \"12345\"\n",
timePer/100000);
/* Tcl_GetVar 100000 times */
fprintf(stderr, "Tcl_GetVar of a==\"12345\" 100000 times\n");
Tcl_GetTime(&start);
for (i = 0; i < 100000; i++) {
s = Tcl_GetVar2(interp, "a", NULL, TCL_LEAVE_ERR_MSG);
s = Tcl_GetVar(interp, "a", TCL_LEAVE_ERR_MSG);
if (s == NULL) {
return TCL_ERROR;
}
}
Tcl_GetTime(&stop);
timePer = (stop.sec - start.sec)*1000000 + (stop.usec - start.usec);
fprintf(stderr, " %.3f usec per Tcl_GetVar of a==\"12345\"\n",
|
| ︙ | | |
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
|
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
|
-
|
} else {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0], " varName elemName ?newValue?\"", NULL);
return TCL_ERROR;
}
}
#ifndef TCL_NO_DEPRECATED
/*
*----------------------------------------------------------------------
*
* TestsaveresultCmd --
*
* Implements the "testsaveresult" cmd that is used when testing the
* Tcl_SaveResult, Tcl_RestoreResult, and Tcl_DiscardResult interfaces.
|
| ︙ | | |
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
|
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
|
-
+
|
freeCount = 0;
Tcl_SaveResult(interp, &state);
if (((enum options) index) == RESULT_OBJECT) {
result = Tcl_EvalObjEx(interp, objv[2], 0);
} else {
result = Tcl_EvalEx(interp, Tcl_GetString(objv[2]), -1, 0);
result = Tcl_Eval(interp, Tcl_GetString(objv[2]));
}
if (discard) {
Tcl_DiscardResult(&state);
} else {
Tcl_RestoreResult(interp, &state);
result = TCL_OK;
|
| ︙ | | |
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
|
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
|
-
|
static void
TestsaveresultFree(
char *blockPtr)
{
freeCount++;
}
#endif /* TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
*
* TestmainthreadCmd --
*
* Implements the "testmainthread" cmd that is used to test the
|
| ︙ | | |
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
|
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
|
-
+
|
if (arg2 != NULL) {
Tcl_DStringAppendElement(&ds, Tcl_GetString(arg2));
}
Tcl_DStringEndSublist(&ds);
savedResult = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(savedResult);
Tcl_SetObjResult(interp, Tcl_NewObj());
Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, 0);
Tcl_Eval(interp, Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
Tcl_ResetResult(interp);
Tcl_SetObjResult(interp, savedResult);
Tcl_DecrRefCount(savedResult);
}
}
|
| ︙ | | |
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
|
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
|
-
+
-
+
-
+
|
TestcpuidCmd(
ClientData dummy,
Tcl_Interp* interp, /* Tcl interpreter */
int objc, /* Parameter count */
Tcl_Obj *const * objv) /* Parameter vector */
{
int status, index, i;
int regs[4];
unsigned int regs[4];
Tcl_Obj *regsObjs[4];
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "eax");
return TCL_ERROR;
}
if (Tcl_GetIntFromObj(interp, objv[1], &index) != TCL_OK) {
return TCL_ERROR;
}
status = TclWinCPUID(index, regs);
status = TclWinCPUID((unsigned) index, regs);
if (status != TCL_OK) {
Tcl_SetObjResult(interp,
Tcl_NewStringObj("operation not available", -1));
return status;
}
for (i=0 ; i<4 ; ++i) {
regsObjs[i] = Tcl_NewIntObj(regs[i]);
regsObjs[i] = Tcl_NewIntObj((int) regs[i]);
}
Tcl_SetObjResult(interp, Tcl_NewListObj(4, regsObjs));
return TCL_OK;
}
#endif
/*
|
| ︙ | | |
Changes to generic/tclTestObj.c.
| ︙ | | |
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
|
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
|
}
argv = ckalloc((objc-3) * sizeof(char *));
for (i = 4; i < objc; i++) {
argv[i-4] = Tcl_GetString(objv[i]);
}
argv[objc-4] = NULL;
/*
* Tcl_GetIndexFromObj assumes that the table is statically-allocated so
* that its address is different for each index object. If we accidently
* allocate a table at the same address as that cached in the index
* object, clear out the object's cached state.
*/
if (objv[3]->typePtr != NULL
&& !strcmp("index", objv[3]->typePtr->name)) {
indexRep = objv[3]->internalRep.twoPtrValue.ptr1;
if (indexRep->tablePtr == (void *) argv) {
TclFreeIntRep(objv[3]);
}
}
result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3],
argv, "token", INDEX_TEMP_TABLE|(allowAbbrev? 0 : TCL_EXACT),
argv, "token", (allowAbbrev? 0 : TCL_EXACT), &index);
&index);
ckfree(argv);
if (result == TCL_OK) {
Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
}
return result;
}
|
| ︙ | | |
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
|
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
|
-
+
|
index = Tcl_GetString(objv[2]);
if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) {
return TCL_ERROR;
}
if (CheckIfVarUnset(interp, varPtr,varIndex)) {
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(varPtr[varIndex]->refCount));
Tcl_SetObjResult(interp, Tcl_NewIntObj(varPtr[varIndex]->refCount));
} else if (strcmp(subCmd, "type") == 0) {
if (objc != 3) {
goto wrongNumArgs;
}
index = Tcl_GetString(objv[2]);
if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) {
return TCL_ERROR;
|
| ︙ | | |
Changes to generic/tclThreadTest.c.
| ︙ | | |
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
-
+
|
*/
if (objc == 2) {
idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
} else if (objc == 3
&& strcmp("-main", Tcl_GetString(objv[2])) == 0) {
Tcl_MutexLock(&threadMutex);
idObj = Tcl_NewLongObj((long)(size_t)mainThreadId);
idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)mainThreadId);
Tcl_MutexUnlock(&threadMutex);
} else {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, idObj);
|
| ︙ | | |
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
|
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
|
-
+
|
Tcl_Channel errChannel;
const char *errorInfo, *argv[3];
char *script;
char buf[TCL_DOUBLE_SPACE+1];
sprintf(buf, "%" TCL_LL_MODIFIER "d", (Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
errorInfo = Tcl_GetVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY);
errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
if (errorProcString == NULL) {
errChannel = Tcl_GetStdChannel(TCL_STDERR);
Tcl_WriteChars(errChannel, "Error from thread ", -1);
Tcl_WriteChars(errChannel, buf, -1);
Tcl_WriteChars(errChannel, "\n", 1);
Tcl_WriteChars(errChannel, errorInfo, -1);
Tcl_WriteChars(errChannel, "\n", 1);
|
| ︙ | | |
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
|
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
|
-
-
+
+
|
} else {
Tcl_Preserve(interp);
Tcl_ResetResult(interp);
Tcl_CreateThreadExitHandler(ThreadFreeProc, threadEventPtr->script);
code = Tcl_EvalEx(interp, threadEventPtr->script,-1,TCL_EVAL_GLOBAL);
Tcl_DeleteThreadExitHandler(ThreadFreeProc, threadEventPtr->script);
if (code != TCL_OK) {
errorCode = Tcl_GetVar2(interp, "errorCode", NULL, TCL_GLOBAL_ONLY);
errorInfo = Tcl_GetVar2(interp, "errorInfo", NULL, TCL_GLOBAL_ONLY);
errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY);
errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
} else {
errorCode = errorInfo = NULL;
}
result = Tcl_GetStringResult(interp);
}
ckfree(threadEventPtr->script);
if (resultPtr) {
|
| ︙ | | |
Changes to generic/tclTimer.c.
| ︙ | | |
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
-
+
|
* of the following structure. For multi-threaded implementations, there is
* one instance of this structure for each thread.
*
* Notice that different structures with the same name appear in other files.
* The structure defined below is used in this file only.
*/
typedef struct {
typedef struct ThreadSpecificData {
TimerHandler *firstTimerHandlerPtr; /* First event in queue. */
int lastTimerId; /* Timer identifier of most recently created
* timer. */
int timerPending; /* 1 if a timer event is in the queue. */
IdleHandler *idleList; /* First in list of all idle handlers. */
IdleHandler *lastIdlePtr; /* Last in list (or NULL for empty list). */
int idleGeneration; /* Used to fill in the "generation" fields of
|
| ︙ | | |
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
|
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
|
-
+
-
+
|
return TCL_ERROR;
}
if (objc == 3) {
commandPtr = objv[2];
} else {
commandPtr = Tcl_ConcatObj(objc-2, objv+2);;
}
command = TclGetStringFromObj(commandPtr, &length);
command = Tcl_GetStringFromObj(commandPtr, &length);
for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL;
afterPtr = afterPtr->nextPtr) {
tempCommand = TclGetStringFromObj(afterPtr->commandPtr,
tempCommand = Tcl_GetStringFromObj(afterPtr->commandPtr,
&tempLength);
if ((length == tempLength)
&& !memcmp(command, tempCommand, (unsigned) length)) {
break;
}
}
if (afterPtr == NULL) {
|
| ︙ | | |
Changes to generic/tclTomMath.decls.
| ︙ | | |
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
-
+
|
declare 20 {
int TclBN_mp_grow(mp_int *a, int size)
}
declare 21 {
int TclBN_mp_init(mp_int *a)
}
declare 22 {
int TclBN_mp_init_copy(mp_int *a, const mp_int *b)
int TclBN_mp_init_copy(mp_int *a, mp_int *b)
}
declare 23 {
int TclBN_mp_init_multi(mp_int *a, ...)
}
declare 24 {
int TclBN_mp_init_set(mp_int *a, mp_digit b)
}
|
| ︙ | | |
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
-
+
|
declare 33 {
int TclBN_mp_neg(const mp_int *a, mp_int *b)
}
declare 34 {
int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c)
}
declare 35 {
int TclBN_mp_radix_size(const mp_int *a, int radix, int *size)
int TclBN_mp_radix_size(mp_int *a, int radix, int *size)
}
declare 36 {
int TclBN_mp_read_radix(mp_int *a, const char *str, int radix)
}
declare 37 {
void TclBN_mp_rshd(mp_int *a, int shift)
}
|
| ︙ | | |
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
229
230
231
232
233
234
235
236
237
238
|
-
-
-
-
-
|
declare 65 {
void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal)
}
declare 66 {
void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal)
}
# Added in libtommath 1.0
declare 67 {
int TclBN_mp_expt_d_ex(mp_int *a, mp_digit b, mp_int *c, int fast)
}
# Local Variables:
# mode: tcl
# End:
|
Changes to generic/tclTomMath.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
-
-
-
-
-
+
-
+
-
-
-
-
-
-
+
+
-
+
-
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
-
+
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
|
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
* LibTomMath is a library that provides multiple-precision
* integer arithmetic as well as number theoretic functionality.
*
* The library was designed directly after the MPI library by
* Michael Fromberger but has been written from scratch with
* additional optimizations in place.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://math.libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
*/
#ifndef BN_H_
#define BN_H_
#include "tclTomMathDecls.h"
#ifndef MODULE_SCOPE
#define MODULE_SCOPE extern
#endif
#ifndef MIN
# define MIN(x,y) ((x)<(y)?(x):(y))
#endif
#ifndef MAX
# define MAX(x,y) ((x)>(y)?(x):(y))
#endif
#ifdef __cplusplus
extern "C" {
/* C++ compilers don't like assigning void * to mp_digit * */
#define OPT_CAST(x) (x *)
#else
/* C on the other hand doesn't care */
#define OPT_CAST(x)
#endif
/* detect 64-bit mode if possible */
#if defined(NEVER) /* 128-bit ints fail in too many places */
#if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
#define MP_64BIT
#endif
#if defined(NEVER) /* 128-bit ints fail in too many places */
# if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
# define MP_64BIT
# endif
#endif
/* some default configurations.
*
* A "mp_digit" must be able to hold DIGIT_BIT + 1 bits
* A "mp_word" must be able to hold 2*DIGIT_BIT + 1 bits
*
* At the very least a mp_digit must be able to hold 7 bits
* [any size beyond that is ok provided it doesn't overflow the data type]
*/
#ifdef MP_8BIT
#ifndef MP_DIGIT_DECLARED
typedef uint8_t mp_digit;
typedef unsigned char mp_digit;
#define MP_DIGIT_DECLARED
#endif
typedef uint16_t mp_word;
typedef unsigned short mp_word;
#define MP_SIZEOF_MP_DIGIT 1
#ifdef DIGIT_BIT
#error You must not define DIGIT_BIT when using MP_8BIT
#endif
#elif defined(MP_16BIT)
#ifndef MP_DIGIT_DECLARED
typedef uint16_t mp_digit;
typedef unsigned short mp_digit;
#define MP_DIGIT_DECLARED
#endif
typedef uint32_t mp_word;
typedef unsigned long mp_word;
#define MP_SIZEOF_MP_DIGIT 2
#ifdef DIGIT_BIT
#error You must not define DIGIT_BIT when using MP_16BIT
#endif
#elif defined(MP_64BIT)
/* for GCC only on supported platforms */
#ifndef CRYPT
typedef unsigned long long ulong64;
typedef signed long long long64;
typedef unsigned long long ulong64;
typedef signed long long long64;
#endif
#ifndef MP_DIGIT_DECLARED
typedef ulong64 mp_digit;
typedef unsigned long mp_digit;
#define MP_DIGIT_DECLARED
#endif
#if defined(_WIN32)
typedef unsigned __int128 mp_word;
#elif defined(__GNUC__)
typedef unsigned long mp_word __attribute__ ((mode(TI)));
typedef unsigned long mp_word __attribute__ ((mode(TI)));
#else
/* it seems you have a problem
* but we assume you can somewhere define your own uint128_t */
typedef uint128_t mp_word;
#endif
#define DIGIT_BIT 60
# define DIGIT_BIT 60
#else
/* this is the default case, 28-bit digits */
/* this is to make porting into LibTomCrypt easier :-) */
#ifndef CRYPT
# if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 ulong64;
typedef signed __int64 long64;
# else
typedef unsigned long long ulong64;
typedef signed long long long64;
typedef unsigned long long ulong64;
typedef signed long long long64;
# endif
#endif
#ifndef MP_DIGIT_DECLARED
typedef uint32_t mp_digit;
typedef unsigned int mp_digit;
#define MP_DIGIT_DECLARED
#endif
typedef ulong64 mp_word;
typedef ulong64 mp_word;
#ifdef MP_31BIT
/* this is an extension that uses 31-bit digits */
#define DIGIT_BIT 31
# define DIGIT_BIT 31
#else
/* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */
#define DIGIT_BIT 28
#define MP_28BIT
# define DIGIT_BIT 28
# define MP_28BIT
#endif
#endif
/* define heap macros */
#if 0 /* these are macros in tclTomMathDecls.h */
#ifndef CRYPT
/* default to libc stuff */
# ifndef XMALLOC
# define XMALLOC malloc
# define XFREE free
# define XREALLOC realloc
# define XCALLOC calloc
# else
/* prototypes for our heap functions */
extern void *XMALLOC(size_t n);
extern void *XREALLOC(void *p, size_t n);
extern void *XCALLOC(size_t n, size_t s);
extern void XFREE(void *p);
# endif
#endif
#endif
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
#ifndef DIGIT_BIT
#define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
typedef uint_least32_t mp_min_u32;
#else
typedef mp_digit mp_min_u32;
#endif
# define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1))) /* bits per digit */
/* platforms that can use a better rand function */
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
#define MP_USE_ALT_RAND 1
#endif
/* use arc4random on platforms that support it */
#ifdef MP_USE_ALT_RAND
#define MP_GEN_RANDOM() arc4random()
#else
#define MP_GEN_RANDOM() rand()
#endif
#define MP_DIGIT_BIT DIGIT_BIT
#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
#define MP_DIGIT_MAX MP_MASK
/* equalities */
|
| ︙ | | |
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
-
-
-
-
-
+
+
+
+
+
-
+
+
-
+
+
|
#endif
/* define this to use lower memory usage routines (exptmods mostly) */
/* #define MP_LOW_MEM */
/* default precision */
#ifndef MP_PREC
#ifndef MP_LOW_MEM
#define MP_PREC 32 /* default digits of precision */
#else
#define MP_PREC 8 /* default digits of precision */
#endif
# ifndef MP_LOW_MEM
# define MP_PREC 32 /* default digits of precision */
# else
# define MP_PREC 8 /* default digits of precision */
# endif
#endif
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
#define MP_WARRAY (1 << (((sizeof(mp_word) * CHAR_BIT) - (2 * DIGIT_BIT)) + 1))
#define MP_WARRAY (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
/* the infamous mp_int structure */
#ifndef MP_INT_DECLARED
#define MP_INT_DECLARED
typedef struct mp_int mp_int;
#endif
struct mp_int {
int used, alloc, sign;
mp_digit *dp;
};
/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
#define USED(m) ((m)->used)
#define DIGIT(m,k) ((m)->dp[(k)])
#define SIGN(m) ((m)->sign)
/* error code to char* string */
/*
const char *mp_error_to_string(int code);
char *mp_error_to_string(int code);
*/
/* ---> init and deinit bignum functions <--- */
/* init a bignum */
/*
int mp_init(mp_int *a);
*/
|
| ︙ | | |
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
|
/* init to a given number of digits */
/*
int mp_init_size(mp_int *a, int size);
*/
/* ---> Basic Manipulations <--- */
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
#define mp_iseven(a) ((((a)->used == 0) || (((a)->dp[0] & 1u) == 0u)) ? MP_YES : MP_NO)
#define mp_isodd(a) ((((a)->used > 0) && (((a)->dp[0] & 1u) == 1u)) ? MP_YES : MP_NO)
#define mp_iseven(a) (((a)->used == 0 || (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
#define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
#define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
/* set to zero */
/*
void mp_zero(mp_int *a);
*/
/* set to a digit */
/*
void mp_set(mp_int *a, mp_digit b);
*/
/* set a 32-bit const */
/*
int mp_set_int(mp_int *a, unsigned long b);
*/
/* set a platform dependent unsigned long value */
/*
int mp_set_long(mp_int *a, unsigned long b);
*/
/* set a platform dependent unsigned long long value */
/*
int mp_set_long_long(mp_int *a, unsigned long long b);
*/
/* get a 32-bit value */
unsigned long mp_get_int(mp_int * a);
/* get a platform dependent unsigned long value */
unsigned long mp_get_long(mp_int * a);
/* get a platform dependent unsigned long long value */
unsigned long long mp_get_long_long(mp_int * a);
/* initialize and set a digit */
/*
int mp_init_set (mp_int * a, mp_digit b);
*/
/* initialize and set 32-bit value */
/*
int mp_init_set_int (mp_int * a, unsigned long b);
*/
/* copy, b = a */
/*
int mp_copy(const mp_int *a, mp_int *b);
*/
/* inits and copies, a = b */
/*
int mp_init_copy(mp_int *a, const mp_int *b);
int mp_init_copy(mp_int *a, mp_int *b);
*/
/* trim unused digits */
/*
void mp_clamp(mp_int *a);
*/
/* import binary data */
/*
int mp_import(mp_int* rop, size_t count, int order, size_t size, int endian, size_t nails, const void* op);
*/
/* export binary data */
/*
int mp_export(void* rop, size_t* countp, int order, size_t size, int endian, size_t nails, mp_int* op);
*/
/* ---> digit manipulation <--- */
/* right shift by "b" digits */
/*
void mp_rshd(mp_int *a, int b);
*/
/* left shift by "b" digits */
/*
int mp_lshd(mp_int *a, int b);
*/
/* c = a / 2**b, implemented as c = a >> b */
/* c = a / 2**b */
/*
int mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d);
*/
/* b = a/2 */
/*
int mp_div_2(mp_int *a, mp_int *b);
*/
/* c = a * 2**b, implemented as c = a << b */
/* c = a * 2**b */
/*
int mp_mul_2d(const mp_int *a, int b, mp_int *c);
*/
/* b = a*2 */
/*
int mp_mul_2(mp_int *a, mp_int *b);
*/
/* c = a mod 2**b */
/* c = a mod 2**d */
/*
int mp_mod_2d(const mp_int *a, int b, mp_int *c);
*/
/* computes a = 2**b */
/*
int mp_2expt(mp_int *a, int b);
|
| ︙ | | |
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
|
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
-
-
-
|
int mp_div_3(mp_int *a, mp_int *c, mp_digit *d);
*/
/* c = a**b */
/*
int mp_expt_d(mp_int *a, mp_digit b, mp_int *c);
*/
/*
int mp_expt_d_ex (mp_int * a, mp_digit b, mp_int * c, int fast);
*/
/* c = a mod b, 0 <= c < b */
/*
int mp_mod_d(mp_int *a, mp_digit b, mp_digit *c);
*/
/* ---> number theory <--- */
|
| ︙ | | |
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
|
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
|
-
-
-
-
-
-
-
-
|
/* finds one of the b'th root of a, such that |c|**b <= |a|
*
* returns error if a < 0 and b is even
*/
/*
int mp_n_root(mp_int *a, mp_digit b, mp_int *c);
*/
/*
int mp_n_root_ex (mp_int * a, mp_digit b, mp_int * c, int fast);
*/
/* special sqrt algo */
/*
int mp_sqrt(mp_int *arg, mp_int *ret);
*/
/* special sqrt (mod prime) */
/*
int mp_sqrtmod_prime(mp_int *arg, mp_int *prime, mp_int *ret);
*/
/* is number a square? */
/*
int mp_is_square(mp_int *arg, int *ret);
*/
/* computes the jacobi c = (a | n) (or Legendre if b is prime) */
/*
|
| ︙ | | |
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
|
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
-
+
|
# define PRIME_SIZE 31
#else
# define PRIME_SIZE 256
#endif
/* table of first PRIME_SIZE primes */
#if defined(BUILD_tcl) || !defined(_WIN32)
MODULE_SCOPE const mp_digit ltm_prime_tab[PRIME_SIZE];
MODULE_SCOPE const mp_digit ltm_prime_tab[];
#endif
/* result=1 if a is divisible by one of the first PRIME_SIZE primes */
/*
int mp_prime_is_divisible(mp_int *a, int *result);
*/
|
| ︙ | | |
709
710
711
712
713
714
715
716
717
718
719
720
721
722
|
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
|
+
|
/* makes a truly random prime of a given size (bits),
*
* Flags are as follows:
*
* LTM_PRIME_BBS - make prime congruent to 3 mod 4
* LTM_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies LTM_PRIME_BBS)
* LTM_PRIME_2MSB_OFF - make the 2nd highest bit zero
* LTM_PRIME_2MSB_ON - make the 2nd highest bit one
*
* You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can
* have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself
* so it can be NULL
*
*/
|
| ︙ | | |
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
|
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
|
/*
int mp_toradix(mp_int *a, char *str, int radix);
*/
/*
int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen);
*/
/*
int mp_radix_size(const mp_int *a, int radix, int *size);
int mp_radix_size(mp_int *a, int radix, int *size);
*/
#ifndef LTM_NO_FILE
/*
int mp_fread(mp_int *a, int radix, FILE *stream);
*/
/*
int mp_fwrite(mp_int *a, int radix, FILE *stream);
*/
#endif
#define mp_read_raw(mp, str, len) mp_read_signed_bin((mp), (str), (len))
#define mp_raw_size(mp) mp_signed_bin_size(mp)
#define mp_toraw(mp, str) mp_to_signed_bin((mp), (str))
#define mp_read_mag(mp, str, len) mp_read_unsigned_bin((mp), (str), (len))
#define mp_mag_size(mp) mp_unsigned_bin_size(mp)
#define mp_tomag(mp, str) mp_to_unsigned_bin((mp), (str))
#define mp_tobinary(M, S) mp_toradix((M), (S), 2)
#define mp_tooctal(M, S) mp_toradix((M), (S), 8)
#define mp_todecimal(M, S) mp_toradix((M), (S), 10)
#define mp_tohex(M, S) mp_toradix((M), (S), 16)
/* lowlevel functions, do not call! */
/*
int s_mp_add(mp_int *a, mp_int *b, mp_int *c);
*/
/*
int s_mp_sub(mp_int *a, mp_int *b, mp_int *c);
*/
#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
/*
int fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs);
*/
/*
int s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs);
*/
/*
int fast_s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs);
*/
/*
int s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs);
*/
/*
int fast_s_mp_sqr(mp_int *a, mp_int *b);
*/
/*
int s_mp_sqr(mp_int *a, mp_int *b);
*/
/*
int mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c);
*/
/*
int mp_toom_mul(mp_int *a, mp_int *b, mp_int *c);
*/
/*
int mp_karatsuba_sqr(mp_int *a, mp_int *b);
*/
/*
int mp_toom_sqr(mp_int *a, mp_int *b);
*/
/*
int fast_mp_invmod(mp_int *a, mp_int *b, mp_int *c);
*/
/*
int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
*/
/*
int fast_mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp);
*/
/*
int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int mode);
*/
/*
int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode);
*/
/*
void bn_reverse(unsigned char *s, int len);
*/
#if defined(BUILD_tcl) || !defined(_WIN32)
MODULE_SCOPE const char *mp_s_rmap;
#endif
#ifdef __cplusplus
}
}
#endif
#endif
/* $Source$ */
/* $Revision$ */
/* $Date$ */
|
Changes to generic/tclTomMathDecls.h.
| ︙ | | |
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
-
|
#define mp_div TclBN_mp_div
#define mp_div_2 TclBN_mp_div_2
#define mp_div_2d TclBN_mp_div_2d
#define mp_div_3 TclBN_mp_div_3
#define mp_div_d TclBN_mp_div_d
#define mp_exch TclBN_mp_exch
#define mp_expt_d TclBN_mp_expt_d
#define mp_expt_d_ex TclBN_mp_expt_d_ex
#define mp_grow TclBN_mp_grow
#define mp_init TclBN_mp_init
#define mp_init_copy TclBN_mp_init_copy
#define mp_init_multi TclBN_mp_init_multi
#define mp_init_set TclBN_mp_init_set
#define mp_init_set_int TclBN_mp_init_set_int
#define mp_init_size TclBN_mp_init_size
|
| ︙ | | |
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
-
+
|
/* 19 */
EXTERN int TclBN_mp_expt_d(mp_int *a, mp_digit b, mp_int *c);
/* 20 */
EXTERN int TclBN_mp_grow(mp_int *a, int size);
/* 21 */
EXTERN int TclBN_mp_init(mp_int *a);
/* 22 */
EXTERN int TclBN_mp_init_copy(mp_int *a, const mp_int *b);
EXTERN int TclBN_mp_init_copy(mp_int *a, mp_int *b);
/* 23 */
EXTERN int TclBN_mp_init_multi(mp_int *a, ...);
/* 24 */
EXTERN int TclBN_mp_init_set(mp_int *a, mp_digit b);
/* 25 */
EXTERN int TclBN_mp_init_size(mp_int *a, int size);
/* 26 */
|
| ︙ | | |
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
-
+
-
|
/* 32 */
EXTERN int TclBN_mp_mul_2d(const mp_int *a, int d, mp_int *p);
/* 33 */
EXTERN int TclBN_mp_neg(const mp_int *a, mp_int *b);
/* 34 */
EXTERN int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c);
/* 35 */
EXTERN int TclBN_mp_radix_size(const mp_int *a, int radix,
EXTERN int TclBN_mp_radix_size(mp_int *a, int radix, int *size);
int *size);
/* 36 */
EXTERN int TclBN_mp_read_radix(mp_int *a, const char *str,
int radix);
/* 37 */
EXTERN void TclBN_mp_rshd(mp_int *a, int shift);
/* 38 */
EXTERN int TclBN_mp_shrink(mp_int *a);
|
| ︙ | | |
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
-
-
-
|
EXTERN void TclBNInitBignumFromLong(mp_int *bignum, long initVal);
/* 65 */
EXTERN void TclBNInitBignumFromWideInt(mp_int *bignum,
Tcl_WideInt initVal);
/* 66 */
EXTERN void TclBNInitBignumFromWideUInt(mp_int *bignum,
Tcl_WideUInt initVal);
/* 67 */
EXTERN int TclBN_mp_expt_d_ex(mp_int *a, mp_digit b, mp_int *c,
int fast);
typedef struct TclTomMathStubs {
int magic;
void *hooks;
int (*tclBN_epoch) (void); /* 0 */
int (*tclBN_revision) (void); /* 1 */
|
| ︙ | | |
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
|
-
+
-
+
|
int (*tclBN_mp_div_2) (mp_int *a, mp_int *q); /* 15 */
int (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r); /* 16 */
int (*tclBN_mp_div_3) (mp_int *a, mp_int *q, mp_digit *r); /* 17 */
void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
int (*tclBN_mp_expt_d) (mp_int *a, mp_digit b, mp_int *c); /* 19 */
int (*tclBN_mp_grow) (mp_int *a, int size); /* 20 */
int (*tclBN_mp_init) (mp_int *a); /* 21 */
int (*tclBN_mp_init_copy) (mp_int *a, const mp_int *b); /* 22 */
int (*tclBN_mp_init_copy) (mp_int *a, mp_int *b); /* 22 */
int (*tclBN_mp_init_multi) (mp_int *a, ...); /* 23 */
int (*tclBN_mp_init_set) (mp_int *a, mp_digit b); /* 24 */
int (*tclBN_mp_init_size) (mp_int *a, int size); /* 25 */
int (*tclBN_mp_lshd) (mp_int *a, int shift); /* 26 */
int (*tclBN_mp_mod) (mp_int *a, mp_int *b, mp_int *r); /* 27 */
int (*tclBN_mp_mod_2d) (const mp_int *a, int b, mp_int *r); /* 28 */
int (*tclBN_mp_mul) (mp_int *a, mp_int *b, mp_int *p); /* 29 */
int (*tclBN_mp_mul_d) (mp_int *a, mp_digit b, mp_int *p); /* 30 */
int (*tclBN_mp_mul_2) (mp_int *a, mp_int *p); /* 31 */
int (*tclBN_mp_mul_2d) (const mp_int *a, int d, mp_int *p); /* 32 */
int (*tclBN_mp_neg) (const mp_int *a, mp_int *b); /* 33 */
int (*tclBN_mp_or) (mp_int *a, mp_int *b, mp_int *c); /* 34 */
int (*tclBN_mp_radix_size) (const mp_int *a, int radix, int *size); /* 35 */
int (*tclBN_mp_radix_size) (mp_int *a, int radix, int *size); /* 35 */
int (*tclBN_mp_read_radix) (mp_int *a, const char *str, int radix); /* 36 */
void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
int (*tclBN_mp_shrink) (mp_int *a); /* 38 */
void (*tclBN_mp_set) (mp_int *a, mp_digit b); /* 39 */
int (*tclBN_mp_sqr) (mp_int *a, mp_int *b); /* 40 */
int (*tclBN_mp_sqrt) (mp_int *a, mp_int *b); /* 41 */
int (*tclBN_mp_sub) (mp_int *a, mp_int *b, mp_int *c); /* 42 */
|
| ︙ | | |
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
355
356
357
358
359
360
361
362
363
364
365
366
367
368
|
-
|
int (*tclBN_s_mp_sub) (mp_int *a, mp_int *b, mp_int *c); /* 60 */
int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
int (*tclBN_mp_expt_d_ex) (mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
} TclTomMathStubs;
extern const TclTomMathStubs *tclTomMathStubsPtr;
#ifdef __cplusplus
}
#endif
|
| ︙ | | |
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
|
-
-
|
(tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
#define TclBNInitBignumFromLong \
(tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */
#define TclBNInitBignumFromWideInt \
(tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */
#define TclBNInitBignumFromWideUInt \
(tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */
#define TclBN_mp_expt_d_ex \
(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
#endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TCLINTDECLS */
|
Changes to generic/tclTrace.c.
| ︙ | | |
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
-
+
|
* traces, store the level at which the step
* trace was invoked */
char *startCmd; /* Used for bookkeeping with step execution
* traces, store the command name which
* invoked step trace */
int curFlags; /* Trace flags for the current command */
int curCode; /* Return code for the current command */
size_t refCount; /* Used to ensure this structure is not
int refCount; /* Used to ensure this structure is not
* deleted too early. Keeps track of how many
* pieces of code have a pointer to this
* structure. */
char command[1]; /* Space for Tcl command to invoke. Actual
* size will be as large as necessary to hold
* command. This field must be the last in the
* structure, so that it can be larger than 1
|
| ︙ | | |
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
-
+
|
const char *part2, register VarTrace *tracePtr);
/*
* The following structure holds the client data for string-based
* trace procs
*/
typedef struct {
typedef struct StringTraceData {
ClientData clientData; /* Client data from Tcl_CreateTrace */
Tcl_CmdTraceProc *proc; /* Trace function from Tcl_CreateTrace */
} StringTraceData;
/*
* Convenience macros for iterating over the list of traces. Note that each of
* these *must* be treated as a command, and *must* have a block following it.
|
| ︙ | | |
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
-
+
|
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "name ops command");
return TCL_ERROR;
}
opsList = Tcl_NewObj();
Tcl_IncrRefCount(opsList);
flagOps = TclGetStringFromObj(objv[3], &numFlags);
flagOps = Tcl_GetStringFromObj(objv[3], &numFlags);
if (numFlags == 0) {
Tcl_DecrRefCount(opsList);
goto badVarOps;
}
for (p = flagOps; *p != 0; p++) {
Tcl_Obj *opObj;
|
| ︙ | | |
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
-
+
|
flags |= TCL_TRACE_ENTER_DURING_EXEC;
break;
case TRACE_EXEC_LEAVE_STEP:
flags |= TCL_TRACE_LEAVE_DURING_EXEC;
break;
}
}
command = TclGetStringFromObj(objv[5], &commandLength);
command = Tcl_GetStringFromObj(objv[5], &commandLength);
length = (size_t) commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
TraceCommandInfo *tcmdPtr = ckalloc(
TclOffset(TraceCommandInfo, command) + 1 + length);
tcmdPtr->flags = flags;
tcmdPtr->stepTrace = NULL;
|
| ︙ | | |
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
|
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
|
-
+
|
break;
case TRACE_CMD_DELETE:
flags |= TCL_TRACE_DELETE;
break;
}
}
command = TclGetStringFromObj(objv[5], &commandLength);
command = Tcl_GetStringFromObj(objv[5], &commandLength);
length = (size_t) commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
TraceCommandInfo *tcmdPtr = ckalloc(
TclOffset(TraceCommandInfo, command) + 1 + length);
tcmdPtr->flags = flags;
tcmdPtr->stepTrace = NULL;
|
| ︙ | | |
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
|
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
|
-
+
|
flags |= TCL_TRACE_UNSETS;
break;
case TRACE_VAR_WRITE:
flags |= TCL_TRACE_WRITES;
break;
}
}
command = TclGetStringFromObj(objv[5], &commandLength);
command = Tcl_GetStringFromObj(objv[5], &commandLength);
length = (size_t) commandLength;
if ((enum traceOptions) optionIndex == TRACE_ADD) {
CombinedTraceVarInfo *ctvarPtr = ckalloc(
TclOffset(CombinedTraceVarInfo, traceCmdInfo.command)
+ 1 + length);
ctvarPtr->traceCmdInfo.flags = flags;
|
| ︙ | | |
Changes to generic/tclUtf.c.
| ︙ | | |
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
+
+
+
+
+
+
-
+
-
-
+
+
|
#if TCL_UTF_MAX > 3
4,4,4,4,4,4,4,4,
#else
1,1,1,1,1,1,1,1,
#endif
1,1,1,1,1,1,1,1
};
/*
* Functions used only in this module.
*/
static int UtfCount(int ch);
/*
*---------------------------------------------------------------------------
*
* TclUtfCount --
* UtfCount --
*
* Find the number of bytes in the Utf character "ch".
*
* Results:
* The return values is the number of bytes in the Utf character "ch".
*
* Side effects:
* None.
*
*---------------------------------------------------------------------------
*/
int
TclUtfCount(
INLINE static int
UtfCount(
int ch) /* The Tcl_UniChar whose size is returned. */
{
if ((unsigned)(ch - 1) < (UNICODE_SELF - 1)) {
return 1;
}
if (ch <= 0x7FF) {
return 2;
|
| ︙ | | |
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
-
+
|
*
* Side effects:
* None.
*
*---------------------------------------------------------------------------
*/
int
INLINE int
Tcl_UniCharToUtf(
int ch, /* The Tcl_UniChar to be stored in the
* buffer. */
char *buf) /* Buffer in which the UTF-8 representation of
* the Tcl_UniChar is stored. Buffer must be
* large enough to hold the UTF-8 character
* (at most TCL_UTF_MAX bytes). */
|
| ︙ | | |
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
|
-
+
|
/*
* To keep badly formed Utf strings from getting inflated by the
* conversion (thereby causing a segfault), only copy the upper case
* char to dst if its size is <= the original char.
*/
if (bytes < TclUtfCount(upChar)) {
if (bytes < UtfCount(upChar)) {
memcpy(dst, src, (size_t) bytes);
dst += bytes;
} else {
dst += Tcl_UniCharToUtf(upChar, dst);
}
src += bytes;
}
|
| ︙ | | |
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
|
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
|
-
+
|
/*
* To keep badly formed Utf strings from getting inflated by the
* conversion (thereby causing a segfault), only copy the lower case
* char to dst if its size is <= the original char.
*/
if (bytes < TclUtfCount(lowChar)) {
if (bytes < UtfCount(lowChar)) {
memcpy(dst, src, (size_t) bytes);
dst += bytes;
} else {
dst += Tcl_UniCharToUtf(lowChar, dst);
}
src += bytes;
}
|
| ︙ | | |
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
|
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
|
-
+
-
+
|
src = dst = str;
if (*src) {
bytes = TclUtfToUniChar(src, &ch);
titleChar = Tcl_UniCharToTitle(ch);
if (bytes < TclUtfCount(titleChar)) {
if (bytes < UtfCount(titleChar)) {
memcpy(dst, src, (size_t) bytes);
dst += bytes;
} else {
dst += Tcl_UniCharToUtf(titleChar, dst);
}
src += bytes;
}
while (*src) {
bytes = TclUtfToUniChar(src, &ch);
lowChar = Tcl_UniCharToLower(ch);
if (bytes < TclUtfCount(lowChar)) {
if (bytes < UtfCount(lowChar)) {
memcpy(dst, src, (size_t) bytes);
dst += bytes;
} else {
dst += Tcl_UniCharToUtf(lowChar, dst);
}
src += bytes;
}
|
| ︙ | | |
Changes to generic/tclUtil.c.
| ︙ | | |
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
|
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
|
-
+
|
for (i = 0; i < objc; i++) {
int length;
objPtr = objv[i];
if (TclListObjIsCanonical(objPtr)) {
continue;
}
TclGetStringFromObj(objPtr, &length);
Tcl_GetStringFromObj(objPtr, &length);
if (length > 0) {
break;
}
}
if (i == objc) {
resPtr = NULL;
for (i = 0; i < objc; i++) {
|
| ︙ | | |
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
|
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
|
-
+
|
char *
TclDStringAppendObj(
Tcl_DString *dsPtr,
Tcl_Obj *objPtr)
{
int length;
char *bytes = TclGetStringFromObj(objPtr, &length);
char *bytes = Tcl_GetStringFromObj(objPtr, &length);
return Tcl_DStringAppend(dsPtr, bytes, length);
}
char *
TclDStringAppendDString(
Tcl_DString *dsPtr,
|
| ︙ | | |
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
|
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
|
-
+
|
&& !Tcl_IsShared(iPtr->objResultPtr)) {
if (iPtr->objResultPtr->bytes == tclEmptyStringRep) {
dsPtr->string = dsPtr->staticSpace;
dsPtr->string[0] = 0;
dsPtr->length = 0;
dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE;
} else {
dsPtr->string = TclGetString(iPtr->objResultPtr);
dsPtr->string = Tcl_GetString(iPtr->objResultPtr);
dsPtr->length = iPtr->objResultPtr->length;
dsPtr->spaceAvl = dsPtr->length + 1;
TclFreeIntRep(iPtr->objResultPtr);
iPtr->objResultPtr->bytes = tclEmptyStringRep;
iPtr->objResultPtr->length = 0;
}
return;
|
| ︙ | | |
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
|
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
|
-
+
|
/*
* Report a parse error.
*/
parseError:
if (interp != NULL) {
bytes = TclGetString(objPtr);
bytes = Tcl_GetString(objPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer? or"
" end?[+-]integer?", bytes));
if (!strncmp(bytes, "end-", 4)) {
bytes += 4;
}
TclCheckBadOctal(interp, bytes);
|
| ︙ | | |
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
|
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
|
-
-
+
-
+
-
+
|
pgvPtr->epoch++;
if (NULL != pgvPtr->value) {
ckfree(pgvPtr->value);
} else {
Tcl_CreateExitHandler(FreeProcessGlobalValue, pgvPtr);
}
bytes = TclGetString(newValue);
pgvPtr->numBytes = newValue->length;
bytes = Tcl_GetStringFromObj(newValue, &pgvPtr->numBytes);
pgvPtr->value = ckalloc(pgvPtr->numBytes + 1);
memcpy(pgvPtr->value, bytes, pgvPtr->numBytes + 1);
memcpy(pgvPtr->value, bytes, (unsigned) pgvPtr->numBytes + 1);
if (pgvPtr->encoding) {
Tcl_FreeEncoding(pgvPtr->encoding);
}
pgvPtr->encoding = encoding;
/*
* Fill the local thread copy directly with the Tcl_Obj value to avoid
* loss of the intrep. Increment newValue refCount early to handle case
* where we set a PGV to itself.
*/
Tcl_IncrRefCount(newValue);
cacheMap = GetThreadHash(&pgvPtr->key);
ClearHash(cacheMap);
hPtr = Tcl_CreateHashEntry(cacheMap, (void *)(pgvPtr->epoch), &dummy);
hPtr = Tcl_CreateHashEntry(cacheMap, INT2PTR(pgvPtr->epoch), &dummy);
Tcl_SetHashValue(hPtr, newValue);
Tcl_MutexUnlock(&pgvPtr->mutex);
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
|
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
|
-
+
-
+
+
-
+
|
Tcl_Obj *
TclGetProcessGlobalValue(
ProcessGlobalValue *pgvPtr)
{
Tcl_Obj *value = NULL;
Tcl_HashTable *cacheMap;
Tcl_HashEntry *hPtr;
size_t epoch = pgvPtr->epoch;
int epoch = pgvPtr->epoch;
if (pgvPtr->encoding) {
Tcl_Encoding current = Tcl_GetEncoding(NULL, NULL);
if (pgvPtr->encoding != current) {
/*
* The system encoding has changed since the master string value
* was saved. Convert the master value to be based on the new
* system encoding.
*/
Tcl_DString native, newValue;
Tcl_MutexLock(&pgvPtr->mutex);
epoch = ++pgvPtr->epoch;
pgvPtr->epoch++;
epoch = pgvPtr->epoch;
Tcl_UtfToExternalDString(pgvPtr->encoding, pgvPtr->value,
pgvPtr->numBytes, &native);
Tcl_ExternalToUtfDString(current, Tcl_DStringValue(&native),
Tcl_DStringLength(&native), &newValue);
Tcl_DStringFree(&native);
ckfree(pgvPtr->value);
pgvPtr->value = ckalloc(Tcl_DStringLength(&newValue) + 1);
memcpy(pgvPtr->value, Tcl_DStringValue(&newValue),
(size_t) Tcl_DStringLength(&newValue) + 1);
Tcl_DStringFree(&newValue);
Tcl_FreeEncoding(pgvPtr->encoding);
pgvPtr->encoding = current;
Tcl_MutexUnlock(&pgvPtr->mutex);
} else {
Tcl_FreeEncoding(current);
}
}
cacheMap = GetThreadHash(&pgvPtr->key);
hPtr = Tcl_FindHashEntry(cacheMap, (void *) (epoch));
hPtr = Tcl_FindHashEntry(cacheMap, (char *) INT2PTR(epoch));
if (NULL == hPtr) {
int dummy;
/*
* No cache for the current epoch - must be a new one.
*
* First, clear the cacheMap, as anything in it must refer to some
|
| ︙ | | |
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
|
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
|
-
+
|
/*
* Store a copy of the shared value in our epoch-indexed cache.
*/
value = Tcl_NewStringObj(pgvPtr->value, pgvPtr->numBytes);
hPtr = Tcl_CreateHashEntry(cacheMap,
(void *)(pgvPtr->epoch), &dummy);
INT2PTR(pgvPtr->epoch), &dummy);
Tcl_MutexUnlock(&pgvPtr->mutex);
Tcl_SetHashValue(hPtr, value);
Tcl_IncrRefCount(value);
}
return Tcl_GetHashValue(hPtr);
}
|
| ︙ | | |
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
|
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
|
-
-
+
+
+
-
+
|
*
*----------------------------------------------------------------------
*/
const char *
Tcl_GetNameOfExecutable(void)
{
Tcl_Obj *obj = TclGetObjNameOfExecutable();
const char *bytes = TclGetString(obj);
int numBytes;
const char *bytes =
Tcl_GetStringFromObj(TclGetObjNameOfExecutable(), &numBytes);
if (obj->length == 0) {
if (numBytes == 0) {
return NULL;
}
return bytes;
}
/*
*----------------------------------------------------------------------
|
| ︙ | | |
Changes to generic/tclVar.c.
| ︙ | | |
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
-
|
/*
* The following structure describes an enumerative search in progress on an
* array variable; this are invoked with options to the "array" command.
*/
typedef struct ArraySearch {
Tcl_Obj *name; /* Name of this search */
int id; /* Integer id used to distinguish among
* multiple concurrent searches for the same
* array. */
struct Var *varPtr; /* Pointer to array variable that's being
* searched. */
Tcl_HashSearch search; /* Info kept by the hash module about progress
* through the array. */
|
| ︙ | | |
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
-
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
const char *otherP2, const int otherFlags,
Tcl_Obj *myNamePtr, int myFlags, int index);
static ArraySearch * ParseSearchId(Tcl_Interp *interp, const Var *varPtr,
Tcl_Obj *varNamePtr, Tcl_Obj *handleObj);
static void UnsetVarStruct(Var *varPtr, Var *arrayPtr,
Interp *iPtr, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, int flags, int index);
static Var * VerifyArray(Tcl_Interp *interp, Tcl_Obj *varNameObj);
static int SetArraySearchObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
/*
* Functions defined in this file that may be exported in the future for use
* by the bytecode compiler and engine or to the public interface.
*/
MODULE_SCOPE Var * TclLookupSimpleVar(Tcl_Interp *interp,
Tcl_Obj *varNamePtr, int flags, const int create,
const char **errMsgPtr, int *indexPtr);
static Tcl_DupInternalRepProc DupLocalVarName;
static Tcl_FreeInternalRepProc FreeLocalVarName;
static Tcl_UpdateStringProc PanicOnUpdateVarName;
static Tcl_FreeInternalRepProc FreeParsedVarName;
static Tcl_DupInternalRepProc DupParsedVarName;
static Tcl_UpdateStringProc UpdateParsedVarName;
static Tcl_UpdateStringProc PanicOnUpdateVarName;
static Tcl_SetFromAnyProc PanicOnSetVarName;
/*
* Types of Tcl_Objs used to cache variable lookups.
*
* localVarName - INTERNALREP DEFINITION:
* twoPtrValue.ptr1: pointer to name obj in varFramePtr->localCache
* or NULL if it is this same obj
* twoPtrValue.ptr2: index into locals table
*
* parsedVarName - INTERNALREP DEFINITION:
* twoPtrValue.ptr1: pointer to the array name Tcl_Obj, or NULL if it is a
* scalar variable
* twoPtrValue.ptr2: pointer to the element name string (owned by this
* Tcl_Obj), or NULL if it is a scalar variable
*/
static const Tcl_ObjType localVarNameType = {
"localVarName",
FreeLocalVarName, DupLocalVarName, NULL, NULL
FreeLocalVarName, DupLocalVarName, PanicOnUpdateVarName, PanicOnSetVarName
};
static const Tcl_ObjType tclParsedVarNameType = {
"parsedVarName",
FreeParsedVarName, DupParsedVarName, NULL, NULL
FreeParsedVarName, DupParsedVarName, UpdateParsedVarName, PanicOnSetVarName
};
/*
* Type of Tcl_Objs used to speed up array searches.
*
* INTERNALREP DEFINITION:
* twoPtrValue.ptr1: searchIdNumber (cast to pointer)
* twoPtrValue.ptr2: variableNameStartInString (cast to pointer)
*
* Note that the value stored in ptr2 is the offset into the string of the
* start of the variable name and not the address of the variable name itself,
* as this can be safely copied.
*/
const Tcl_ObjType tclArraySearchType = {
"array search",
NULL, NULL, NULL, SetArraySearchObj
};
Var *
TclVarHashCreateVar(
TclVarHashTable *tablePtr,
const char *key,
int *newPtr)
{
|
| ︙ | | |
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
|
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
-
-
-
+
+
+
+
-
+
+
+
+
-
+
|
* return error if it doesn't exist. */
Var **arrayPtrPtr) /* If the name refers to an element of an
* array, *arrayPtrPtr gets filled in with
* address of array variable. Otherwise this
* is set to NULL. */
{
Interp *iPtr = (Interp *) interp;
CallFrame *varFramePtr = iPtr->varFramePtr;
register Var *varPtr; /* Points to the variable's in-frame Var
* structure. */
const char *errMsg = NULL;
int index, parsed = 0;
const char *part1;
int index, len1, len2;
int parsed = 0;
Tcl_Obj *objPtr;
const Tcl_ObjType *typePtr = part1Ptr->typePtr;
const char *errMsg = NULL;
CallFrame *varFramePtr = iPtr->varFramePtr;
const char *part2 = part2Ptr? TclGetString(part2Ptr):NULL;
char *newPart2 = NULL;
*arrayPtrPtr = NULL;
if (typePtr == &localVarNameType) {
int localIndex;
localVarNameTypeHandling:
localIndex = PTR2INT(part1Ptr->internalRep.twoPtrValue.ptr2);
if (HasLocalVars(varFramePtr)
&& !(flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY))
&& (localIndex < varFramePtr->numCompiledLocals)) {
/*
* Use the cached index if the names coincide.
*/
Tcl_Obj *namePtr = part1Ptr->internalRep.twoPtrValue.ptr1;
Tcl_Obj *checkNamePtr = localName(varFramePtr, localIndex);
Tcl_Obj *checkNamePtr = localName(iPtr->varFramePtr, localIndex);
if ((!namePtr && (checkNamePtr == part1Ptr)) ||
(namePtr && (checkNamePtr == namePtr))) {
varPtr = (Var *) &(varFramePtr->compiledLocals[localIndex]);
goto donePart1;
}
}
|
| ︙ | | |
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
|
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
|
-
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
-
+
-
-
+
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
|
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg,
noSuchVar, -1);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME", NULL);
}
return NULL;
}
part2Ptr = part1Ptr->internalRep.twoPtrValue.ptr2;
part2 = newPart2 = part1Ptr->internalRep.twoPtrValue.ptr2;
if (newPart2) {
part2Ptr = Tcl_NewStringObj(newPart2, -1);
if (createPart2) {
Tcl_IncrRefCount(part2Ptr);
}
}
part1Ptr = part1Ptr->internalRep.twoPtrValue.ptr1;
typePtr = part1Ptr->typePtr;
if (typePtr == &localVarNameType) {
goto localVarNameTypeHandling;
}
}
parsed = 1;
}
part1 = TclGetStringFromObj(part1Ptr, &len1);
if (!parsed) {
if (!parsed && len1 && (*(part1 + len1 - 1) == ')')) {
/*
* part1Ptr is possibly an unparsed array element.
*/
int len;
register int i;
const char *part1 = TclGetStringFromObj(part1Ptr, &len);
if (len > 1 && (part1[len - 1] == ')')) {
len2 = -1;
const char *part2 = strchr(part1, '(');
for (i = 0; i < len1; i++) {
if (part2) {
Tcl_Obj *arrayPtr;
if (*(part1 + i) == '(') {
if (part2Ptr != NULL) {
if (flags & TCL_LEAVE_ERR_MSG) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg,
needArray, -1);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "VARNAME",
NULL);
}
return NULL;
}
/*
* part1Ptr points to an array element; first copy the element
* name to a new string part2.
*/
arrayPtr = Tcl_NewStringObj(part1, (part2 - part1));
part2Ptr = Tcl_NewStringObj(part2 + 1, len - (part2 - part1) - 2);
TclFreeIntRep(part1Ptr);
part2 = part1 + i + 1;
len2 = len1 - i - 2;
len1 = i;
newPart2 = ckalloc(len2 + 1);
memcpy(newPart2, part2, (unsigned) len2);
*(newPart2+len2) = '\0';
part2 = newPart2;
part2Ptr = Tcl_NewStringObj(newPart2, -1);
if (createPart2) {
Tcl_IncrRefCount(part2Ptr);
}
/*
* Free the internal rep of the original part1Ptr, now renamed
* objPtr, and set it to tclParsedVarNameType.
*/
objPtr = part1Ptr;
TclFreeIntRep(objPtr);
objPtr->typePtr = &tclParsedVarNameType;
/*
* Define a new string object to hold the new part1Ptr, i.e.,
* the array name. Set the internal rep of objPtr, reset
* typePtr and part1 to contain the references to the array
* name.
*/
TclNewStringObj(part1Ptr, part1, len1);
Tcl_IncrRefCount(arrayPtr);
part1Ptr->internalRep.twoPtrValue.ptr1 = arrayPtr;
Tcl_IncrRefCount(part1Ptr);
objPtr->internalRep.twoPtrValue.ptr1 = part1Ptr;
Tcl_IncrRefCount(part2Ptr);
part1Ptr->internalRep.twoPtrValue.ptr2 = part2Ptr;
objPtr->internalRep.twoPtrValue.ptr2 = (void *) part2;
part1Ptr->typePtr = &tclParsedVarNameType;
part1Ptr = arrayPtr;
}
typePtr = part1Ptr->typePtr;
part1 = TclGetString(part1Ptr);
break;
}
}
}
doneParsing:
/*
* part1Ptr is not an array element; look it up, and convert it to one of
* the cached types if possible.
*/
TclFreeIntRep(part1Ptr);
varPtr = TclLookupSimpleVar(interp, part1Ptr, flags, createPart1,
&errMsg, &index);
if (varPtr == NULL) {
if ((errMsg != NULL) && (flags & TCL_LEAVE_ERR_MSG)) {
TclObjVarErrMsg(interp, part1Ptr, part2Ptr, msg, errMsg, -1);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
TclGetString(part1Ptr), NULL);
}
if (newPart2) {
Tcl_DecrRefCount(part2Ptr);
}
return NULL;
}
/*
* Cache the newly found variable if possible.
*/
TclFreeIntRep(part1Ptr);
if (index >= 0) {
/*
* An indexed local variable.
*/
Tcl_Obj *cachedNamePtr = localName(varFramePtr, index);
Tcl_Obj *cachedNamePtr = localName(iPtr->varFramePtr, index);
part1Ptr->typePtr = &localVarNameType;
if (part1Ptr != cachedNamePtr) {
part1Ptr->internalRep.twoPtrValue.ptr1 = cachedNamePtr;
Tcl_IncrRefCount(cachedNamePtr);
if (cachedNamePtr->typePtr != &localVarNameType
|| cachedNamePtr->internalRep.twoPtrValue.ptr1 != NULL) {
|
| ︙ | | |
665
666
667
668
669
670
671
672
673
674
675
676
677
678
|
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
|
+
+
+
|
/*
* Array element sought: look it up.
*/
*arrayPtrPtr = varPtr;
varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr, flags, msg,
createPart1, createPart2, varPtr, -1);
if (newPart2) {
Tcl_DecrRefCount(part2Ptr);
}
}
return varPtr;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
|
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
|
-
-
-
+
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
+
+
-
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
* Side effects:
* See the user documentation.
*
*----------------------------------------------------------------------
*/
/* ARGSUSED */
static Var *
VerifyArray(
static int
ArrayStartSearchCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *varNameObj)
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
Var *varPtr, *arrayPtr;
Tcl_HashEntry *hPtr;
Tcl_Obj *varNameObj;
int isNew;
ArraySearch *searchPtr;
const char *varName = TclGetString(varNameObj);
Var *arrayPtr;
const char *varName;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
return TCL_ERROR;
}
varNameObj = objv[1];
/*
* Locate the array variable.
*/
Var *varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0,
varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0,
/*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
varName = TclGetString(varNameObj);
/*
* Special array trace used to keep the env array in sync for array names,
* array get, etc.
*/
if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY)
&& (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) {
if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL,
(TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY|
TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) {
return NULL;
return TCL_ERROR;
}
}
/*
* Verify that it is indeed an array variable. This test comes after the
* traces - the variable may actually become an array as an effect of said
* traces.
*/
if ((varPtr == NULL) || !TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr)) {
if ((varPtr == NULL) || !TclIsVarArray(varPtr)
|| TclIsVarUndefined(varPtr)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"\"%s\" isn't an array", varName));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", varName, NULL);
return NULL;
}
return varPtr;
}
static int
ArrayStartSearchCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
Var *varPtr;
Tcl_HashEntry *hPtr;
int isNew;
ArraySearch *searchPtr;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName");
return TCL_ERROR;
}
varPtr = VerifyArray(interp, objv[1]);
if (varPtr == NULL) {
return TCL_ERROR;
}
/*
* Make a new array search with a free name.
*/
|
| ︙ | | |
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
|
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
|
-
-
-
+
+
|
searchPtr->id = ((ArraySearch *) Tcl_GetHashValue(hPtr))->id + 1;
searchPtr->nextPtr = Tcl_GetHashValue(hPtr);
}
searchPtr->varPtr = varPtr;
searchPtr->nextEntry = VarHashFirstEntry(varPtr->value.tablePtr,
&searchPtr->search);
Tcl_SetHashValue(hPtr, searchPtr);
searchPtr->name = Tcl_ObjPrintf("s-%d-%s", searchPtr->id, TclGetString(objv[1]));
Tcl_IncrRefCount(searchPtr->name);
Tcl_SetObjResult(interp, searchPtr->name);
Tcl_SetObjResult(interp,
Tcl_ObjPrintf("s-%d-%s", searchPtr->id, varName));
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* ArrayAnyMoreCmd --
|
| ︙ | | |
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
|
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
|
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
ArrayAnyMoreCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
Var *varPtr;
Var *varPtr, *arrayPtr;
Tcl_Obj *varNameObj, *searchObj;
int gotValue;
ArraySearch *searchPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
return TCL_ERROR;
}
varNameObj = objv[1];
searchObj = objv[2];
/*
* Locate the array variable.
*/
varPtr = VerifyArray(interp, varNameObj);
if (varPtr == NULL) {
varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0,
/*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
/*
* Special array trace used to keep the env array in sync for array names,
* array get, etc.
*/
if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY)
&& (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) {
if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL,
(TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY|
TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) {
return TCL_ERROR;
}
}
/*
* Verify that it is indeed an array variable. This test comes after the
* traces - the variable may actually become an array as an effect of said
* traces.
*/
if ((varPtr == NULL) || !TclIsVarArray(varPtr)
|| TclIsVarUndefined(varPtr)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"\"%s\" isn't an array", TclGetString(varNameObj)));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY",
TclGetString(varNameObj), NULL);
return TCL_ERROR;
}
/*
* Get the search.
*/
|
| ︙ | | |
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
|
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
|
+
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
static int
ArrayNextElementCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
Var *varPtr;
Var *varPtr, *arrayPtr;
Tcl_Obj *varNameObj, *searchObj;
ArraySearch *searchPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
return TCL_ERROR;
}
varNameObj = objv[1];
searchObj = objv[2];
/*
* Locate the array variable.
*/
varPtr = VerifyArray(interp, varNameObj);
if (varPtr == NULL) {
varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0,
/*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
/*
* Special array trace used to keep the env array in sync for array names,
* array get, etc.
*/
if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY)
&& (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) {
if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL,
(TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY|
TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) {
return TCL_ERROR;
}
}
/*
* Verify that it is indeed an array variable. This test comes after the
* traces - the variable may actually become an array as an effect of said
* traces.
*/
if ((varPtr == NULL) || !TclIsVarArray(varPtr)
|| TclIsVarUndefined(varPtr)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"\"%s\" isn't an array", TclGetString(varNameObj)));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY",
TclGetString(varNameObj), NULL);
return TCL_ERROR;
}
/*
* Get the search.
*/
|
| ︙ | | |
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
|
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
|
-
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
ArrayDoneSearchCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Interp *iPtr = (Interp *) interp;
Var *varPtr;
Var *varPtr, *arrayPtr;
Tcl_HashEntry *hPtr;
Tcl_Obj *varNameObj, *searchObj;
ArraySearch *searchPtr, *prevPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "arrayName searchId");
return TCL_ERROR;
}
varNameObj = objv[1];
searchObj = objv[2];
/*
* Locate the array variable.
*/
varPtr = VerifyArray(interp, varNameObj);
if (varPtr == NULL) {
varPtr = TclObjLookupVarEx(interp, varNameObj, NULL, /*flags*/ 0,
/*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
/*
* Special array trace used to keep the env array in sync for array names,
* array get, etc.
*/
if (varPtr && (varPtr->flags & VAR_TRACED_ARRAY)
&& (TclIsVarArray(varPtr) || TclIsVarUndefined(varPtr))) {
if (TclObjCallVarTraces(iPtr, arrayPtr, varPtr, varNameObj, NULL,
(TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY|TCL_GLOBAL_ONLY|
TCL_TRACE_ARRAY), /* leaveErrMsg */ 1, -1) == TCL_ERROR) {
return TCL_ERROR;
}
}
/*
* Verify that it is indeed an array variable. This test comes after the
* traces - the variable may actually become an array as an effect of said
* traces.
*/
if ((varPtr == NULL) || !TclIsVarArray(varPtr)
|| TclIsVarUndefined(varPtr)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"\"%s\" isn't an array", TclGetString(varNameObj)));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY",
TclGetString(varNameObj), NULL);
return TCL_ERROR;
}
/*
* Get the search.
*/
|
| ︙ | | |
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
|
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
|
-
|
for (prevPtr=Tcl_GetHashValue(hPtr) ;; prevPtr=prevPtr->nextPtr) {
if (prevPtr->nextPtr == searchPtr) {
prevPtr->nextPtr = searchPtr->nextPtr;
break;
}
}
}
Tcl_DecrRefCount(searchPtr->name);
ckfree(searchPtr);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
|
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
+
+
|
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* SetArraySearchObj --
*
* This function converts the given tcl object into one that has the
* "array search" internal type.
*
* Results:
* TCL_OK if the conversion succeeded, and TCL_ERROR if it failed (when
* an error message will be placed in the interpreter's result.)
*
* Side effects:
* Updates the internal type and representation of the object to make
* this an array-search object. See the tclArraySearchType declaration
* above for details of the internal representation.
*
*----------------------------------------------------------------------
*/
static int
SetArraySearchObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr)
{
const char *string;
char *end; /* Can't be const due to strtoul defn. */
int id;
size_t offset;
/*
* Get the string representation. Make it up-to-date if necessary.
*/
string = TclGetString(objPtr);
/*
* Parse the id into the three parts separated by dashes.
*/
if ((string[0] != 's') || (string[1] != '-')) {
goto syntax;
}
id = strtoul(string+2, &end, 10);
if ((end == (string+2)) || (*end != '-')) {
goto syntax;
}
/*
* Can't perform value check in this context, so place reference to place
* in string to use for the check in the object instead.
*/
end++;
offset = end - string;
TclFreeIntRep(objPtr);
objPtr->typePtr = &tclArraySearchType;
objPtr->internalRep.twoPtrValue.ptr1 = INT2PTR(id);
objPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(offset);
return TCL_OK;
syntax:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"illegal search identifier \"%s\"", string));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", string, NULL);
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* ParseSearchId --
*
* This function translates from a tcl object to a pointer to an active
* array search (if there is one that matches the string).
*
* Results:
* The return value is a pointer to the array search indicated by string,
* or NULL if there isn't one. If NULL is returned, the interp's result
* contains an error message.
*
* Side effects:
* The tcl object might have its internal type and representation
* modified.
*
*----------------------------------------------------------------------
*/
static ArraySearch *
ParseSearchId(
Tcl_Interp *interp, /* Interpreter containing variable. */
const Var *varPtr, /* Array variable search is for. */
Tcl_Obj *varNamePtr, /* Name of array variable that search is
* supposed to be for. */
Tcl_Obj *handleObj) /* Object containing id of search. Must have
* form "search-num-var" where "num" is a
* decimal number and "var" is a variable
* name. */
{
Interp *iPtr = (Interp *) interp;
register const char *string;
register size_t offset;
int id;
ArraySearch *searchPtr;
const char *varName = TclGetString(varNamePtr);
/*
* Parse the id.
*/
if ((handleObj->typePtr != &tclArraySearchType)
&& (SetArraySearchObj(interp, handleObj) != TCL_OK)) {
return NULL;
}
/*
* Extract the information out of the Tcl_Obj.
*/
id = PTR2INT(handleObj->internalRep.twoPtrValue.ptr1);
const char *handle = TclGetString(handleObj);
char *end;
string = TclGetString(handleObj);
offset = PTR2INT(handleObj->internalRep.twoPtrValue.ptr2);
/*
* This test cannot be placed inside the Tcl_Obj machinery, since it is
* dependent on the variable context.
*/
if (strcmp(string+offset, varName) != 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"search identifier \"%s\" isn't for variable \"%s\"",
string, varName));
goto badLookup;
}
/*
* Search through the list of active searches on the interpreter to see if
* the desired one exists.
*
* Note that we cannot store the searchPtr directly in the Tcl_Obj as that
* would run into trouble when DeleteSearches() was called so we must scan
* this list every time.
*/
if (varPtr->flags & VAR_SEARCH_ACTIVE) {
Tcl_HashEntry *hPtr =
Tcl_FindHashEntry(&iPtr->varSearches, varPtr);
/* First look for same (Tcl_Obj *) */
for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL;
searchPtr = searchPtr->nextPtr) {
if (searchPtr->name == handleObj) {
if (searchPtr->id == id) {
return searchPtr;
}
}
/* Fallback: do string compares. */
for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL;
searchPtr = searchPtr->nextPtr) {
if (strcmp(TclGetString(searchPtr->name), handle) == 0) {
return searchPtr;
}
}
}
}
if ((handle[0] != 's') || (handle[1] != '-')
|| (strtoul(handle + 2, &end, 10), end == (handle + 2))
|| (*end != '-')) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"illegal search identifier \"%s\"", handle));
} else if (strcmp(end + 1, TclGetString(varNamePtr)) != 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"search identifier \"%s\" isn't for variable \"%s\"",
handle, TclGetString(varNamePtr)));
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't find search \"%s\"", handle));
"couldn't find search \"%s\"", string));
}
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", handle, NULL);
badLookup:
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAYSEARCH", string, NULL);
return NULL;
}
/*
*----------------------------------------------------------------------
*
* DeleteSearches --
|
| ︙ | | |
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
|
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
|
-
|
Tcl_HashEntry *sPtr;
if (arrayVarPtr->flags & VAR_SEARCH_ACTIVE) {
sPtr = Tcl_FindHashEntry(&iPtr->varSearches, arrayVarPtr);
for (searchPtr = Tcl_GetHashValue(sPtr); searchPtr != NULL;
searchPtr = nextPtr) {
nextPtr = searchPtr->nextPtr;
Tcl_DecrRefCount(searchPtr->name);
ckfree(searchPtr);
}
arrayVarPtr->flags &= ~VAR_SEARCH_ACTIVE;
Tcl_DeleteHashEntry(sPtr);
}
}
|
| ︙ | | |
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
|
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
*----------------------------------------------------------------------
*
* Internal functions for variable name object types --
*
*----------------------------------------------------------------------
*/
/*
* Panic functions that should never be called in normal operation.
*/
static void
PanicOnUpdateVarName(
Tcl_Obj *objPtr)
{
Tcl_Panic("%s of type %s should not be called", "updateStringProc",
objPtr->typePtr->name);
}
static int
PanicOnSetVarName(
Tcl_Interp *interp,
Tcl_Obj *objPtr)
{
Tcl_Panic("%s of type %s should not be called", "setFromAnyProc",
objPtr->typePtr->name);
return TCL_ERROR;
}
/*
* localVarName -
*
* INTERNALREP DEFINITION:
* twoPtrValue.ptr1: pointer to name obj in varFramePtr->localCache
* or NULL if it is this same obj
|
| ︙ | | |
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
|
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
|
-
+
-
+
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
*/
static void
FreeParsedVarName(
Tcl_Obj *objPtr)
{
register Tcl_Obj *arrayPtr = objPtr->internalRep.twoPtrValue.ptr1;
register Tcl_Obj *elem = objPtr->internalRep.twoPtrValue.ptr2;
register char *elem = objPtr->internalRep.twoPtrValue.ptr2;
if (arrayPtr != NULL) {
TclDecrRefCount(arrayPtr);
TclDecrRefCount(elem);
ckfree(elem);
}
objPtr->typePtr = NULL;
}
static void
DupParsedVarName(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
register Tcl_Obj *arrayPtr = srcPtr->internalRep.twoPtrValue.ptr1;
register Tcl_Obj *elem = srcPtr->internalRep.twoPtrValue.ptr2;
register char *elem = srcPtr->internalRep.twoPtrValue.ptr2;
char *elemCopy;
unsigned elemLen;
if (arrayPtr != NULL) {
Tcl_IncrRefCount(arrayPtr);
Tcl_IncrRefCount(elem);
elemLen = strlen(elem);
elemCopy = ckalloc(elemLen + 1);
memcpy(elemCopy, elem, elemLen);
*(elemCopy + elemLen) = '\0';
elem = elemCopy;
}
dupPtr->internalRep.twoPtrValue.ptr1 = arrayPtr;
dupPtr->internalRep.twoPtrValue.ptr2 = elem;
dupPtr->typePtr = &tclParsedVarNameType;
}
static void
UpdateParsedVarName(
Tcl_Obj *objPtr)
{
Tcl_Obj *arrayPtr = objPtr->internalRep.twoPtrValue.ptr1;
char *part2 = objPtr->internalRep.twoPtrValue.ptr2;
const char *part1;
char *p;
int len1, len2, totalLen;
if (arrayPtr == NULL) {
/*
* This is a parsed scalar name: what is it doing here?
*/
Tcl_Panic("scalar parsedVarName without a string rep");
}
part1 = TclGetStringFromObj(arrayPtr, &len1);
len2 = strlen(part2);
totalLen = len1 + len2 + 2;
p = ckalloc(totalLen + 1);
objPtr->bytes = p;
objPtr->length = totalLen;
memcpy(p, part1, (unsigned) len1);
p += len1;
*p++ = '(';
memcpy(p, part2, (unsigned) len2);
p += len2;
*p++ = ')';
*p = '\0';
}
/*
*----------------------------------------------------------------------
*
* Tcl_FindNamespaceVar -- MOVED OVER from tclNamesp.c
*
* Searches for a namespace variable, a variable not local to a
|
| ︙ | | |
Changes to generic/tclZlib.c.
| ︙ | | |
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
-
+
|
/*
* Catch-all. Should be unreachable because all cases are already
* listed above.
*/
default:
TclNewLiteralStringObj(objv[2], "UNKNOWN");
TclNewLongObj(objv[3], code);
TclNewIntObj(objv[3], code);
return Tcl_NewListObj(4, objv);
}
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | | |
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
|
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
|
-
+
-
+
|
if (latin1enc == NULL) {
Tcl_Panic("no latin-1 encoding");
}
if (GetValue(interp, dictObj, "comment", &value) != TCL_OK) {
goto error;
} else if (value != NULL) {
valueStr = TclGetStringFromObj(value, &len);
valueStr = Tcl_GetStringFromObj(value, &len);
Tcl_UtfToExternal(NULL, latin1enc, valueStr, len, 0, NULL,
headerPtr->nativeCommentBuf, MAX_COMMENT_LEN-1, NULL, &len,
NULL);
headerPtr->nativeCommentBuf[len] = '\0';
headerPtr->header.comment = (Bytef *) headerPtr->nativeCommentBuf;
if (extraSizePtr != NULL) {
*extraSizePtr += len;
}
}
if (GetValue(interp, dictObj, "crc", &value) != TCL_OK) {
goto error;
} else if (value != NULL &&
Tcl_GetBooleanFromObj(interp, value, &headerPtr->header.hcrc)) {
goto error;
}
if (GetValue(interp, dictObj, "filename", &value) != TCL_OK) {
goto error;
} else if (value != NULL) {
valueStr = TclGetStringFromObj(value, &len);
valueStr = Tcl_GetStringFromObj(value, &len);
Tcl_UtfToExternal(NULL, latin1enc, valueStr, len, 0, NULL,
headerPtr->nativeFilenameBuf, MAXPATHLEN-1, NULL, &len, NULL);
headerPtr->nativeFilenameBuf[len] = '\0';
headerPtr->header.name = (Bytef *) headerPtr->nativeFilenameBuf;
if (extraSizePtr != NULL) {
*extraSizePtr += len;
}
|
| ︙ | | |
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
|
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
|
-
+
-
+
|
}
if (zshPtr->mode == TCL_ZLIB_STREAM_DEFLATE) {
zshPtr->stream.next_in = Tcl_GetByteArrayFromObj(data, &size);
zshPtr->stream.avail_in = size;
/*
* Must not do a zero-length compress. [Bug 25842c161]
* Must not do a zero-length compress unless finalizing. [Bug 25842c161]
*/
if (size == 0) {
if (size == 0 && flush != Z_FINISH) {
return TCL_OK;
}
if (HaveDictToSet(zshPtr)) {
e = SetDeflateDictionary(&zshPtr->stream, zshPtr->compDictObj);
if (e != Z_OK) {
ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
|
| ︙ | | |
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
|
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
|
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
|
int e, produced;
Tcl_Obj *errObj;
if (cd->mode == TCL_ZLIB_STREAM_INFLATE) {
return outProc(Tcl_GetChannelInstanceData(cd->parent), buf, toWrite,
errorCodePtr);
}
/*
* No zero-length writes. Flushes must be explicit.
*/
if (toWrite == 0) {
return 0;
}
cd->outStream.next_in = (Bytef *) buf;
cd->outStream.avail_in = toWrite;
do {
while (cd->outStream.avail_in > 0) {
e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated,
Z_NO_FLUSH, &produced);
if (e != Z_OK || produced == 0) {
if ((e == Z_OK && produced > 0) || e == Z_BUF_ERROR) {
/*
* deflate() indicates that it is out of space by returning
* Z_BUF_ERROR *or* by simply returning Z_OK with no remaining
* space; in either case, we must write the whole buffer out and
* retry to compress what is left.
break;
*/
}
if (e == Z_BUF_ERROR) {
produced = cd->outAllocated;
e = Z_OK;
}
if (Tcl_WriteRaw(cd->parent, cd->outBuffer, produced) < 0) {
*errorCodePtr = Tcl_GetErrno();
return -1;
}
}
if (Tcl_WriteRaw(cd->parent, cd->outBuffer, produced) < 0) {
*errorCodePtr = Tcl_GetErrno();
return -1;
}
}
} while (e == Z_OK && produced > 0 && cd->outStream.avail_in > 0);
if (e == Z_OK) {
return toWrite - cd->outStream.avail_in;
}
errObj = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(NULL, errObj, Tcl_NewStringObj("-errorcode",-1));
|
| ︙ | | |
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
|
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
|
-
+
|
Tcl_GetString(cd->compDictObj));
} else {
Tcl_DStringAppendElement(dsPtr, "");
}
} else {
if (cd->compDictObj) {
int len;
const char *str = TclGetStringFromObj(cd->compDictObj, &len);
const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len);
Tcl_DStringAppend(dsPtr, str, len);
}
return TCL_OK;
}
}
|
| ︙ | | |
Changes to library/clock.tcl.
| ︙ | | |
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
|
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
|
-
+
|
return -code error \
-errorcode [list CLOCK wrongNumArgs] \
"wrong \# args: should be\
\"$cmdName clockval ?number units?...\
?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE?\""
}
if { [catch { expr {wide($clockval)} } result] } {
return -code error "expected integer but got \"$clockval\""
return -code error $result
}
set offsets {}
set gmt 0
set locale c
set timezone [GetSystemTimeZone]
|
| ︙ | | |
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
|
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
|
+
+
+
|
# Check options for validity
if { [info exists saw(-gmt)] && [info exists saw(-timezone)] } {
return -code error \
-errorcode [list CLOCK gmtWithTimezone] \
"cannot use -gmt and -timezone in same call"
}
if { [catch { expr { wide($clockval) } } result] } {
return -code error "expected integer but got \"$clockval\""
}
if { ![string is boolean -strict $gmt] } {
return -code error "expected boolean value but got \"$gmt\""
} elseif { $gmt } {
set timezone :GMT
}
EnterLocale $locale
|
| ︙ | | |
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
|
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
|
-
-
-
-
-
|
$clockval $timezone $changeover]
}
days - day {
set clockval [AddDays $quantity $clockval $timezone \
$changeover]
}
weekdays - weekday {
set clockval [AddWeekDays $quantity $clockval $timezone \
$changeover]
}
hours - hour {
set clockval [expr { 3600 * $quantity + $clockval }]
}
minutes - minute {
set clockval [expr { 60 * $quantity + $clockval }]
}
seconds - second {
|
| ︙ | | |
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
|
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
set date [ConvertLocalToUTC $date[set date {}] $TZData($timezone) \
$changeover]
return [dict get $date seconds]
}
#----------------------------------------------------------------------
#
# AddWeekDays --
#
# Add a given number of week days (skipping Saturdays and Sundays)
# to a given clock value in a given time zone.
#
# Parameters:
# days - Number of days to add (may be negative)
# clockval - Seconds since the epoch before the operation
# timezone - Time zone in which the operation is to be performed
# changeover - Julian Day on which the Gregorian calendar was adopted
# in the target locale.
#
# Results:
# Returns the new clock value as a number of seconds since the epoch.
#
# Side effects:
# None.
#
#----------------------------------------------------------------------
proc ::tcl::clock::AddWeekDays { days clockval timezone changeover } {
if {$days == 0} {
return $clockval
}
set day [format $clockval -format %u]
set weeks [expr {$days / 5}]
set rdays [expr {$days % 5}]
set toAdd [expr {7 * $weeks + $rdays}]
set resDay [expr {$day + ($toAdd % 7)}]
# Adjust if we start from a weekend
if {$day > 5} {
set adj [expr {5 - $day}]
incr toAdd $adj
incr resDay $adj
}
# Adjust if we end up on a weekend
if {$resDay > 5} {
incr toAdd 2
}
AddDays $toAdd $clockval $timezone $changeover
}
#----------------------------------------------------------------------
#
# AddDays --
#
# Add a given number of days to a given clock value in a given time
# zone.
#
|
| ︙ | | |
Changes to library/http/http.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
|
# http.tcl --
#
# Client-side HTTP for GET, POST, and HEAD commands. These routines can
# be used in untrusted code that uses the Safesock security policy.
# These procedures use a callback interface to avoid using vwait, which
# is not defined in the safe base.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
package require Tcl 8.6-
# Keep this in sync with pkgIndex.tcl and with the install directories in
# Makefiles
package provide http 2.8.10
package provide http 2.8.11
namespace eval http {
# Allow resourcing to not clobber existing data
variable http
if {![info exists http]} {
array set http {
-accept */*
-proxyhost {}
-proxyport {}
-proxyfilter http::ProxyRequired
-urlencoding utf-8
}
# We need a useragent string of this style or various servers will refuse to
# send us compressed content even when we ask for it. This follows the
# de-facto layout of user-agent strings in current browsers.
# Safe interpreters do not have ::tcl_platform(os) or
# ::tcl_platform(osVersion).
if {[interp issafe]} {
set http(-useragent) "Mozilla/5.0\
([string totitle $::tcl_platform(platform)]; U;\
$::tcl_platform(os) $::tcl_platform(osVersion))\
http/[package provide http] Tcl/[package provide Tcl]"
set http(-useragent) "Mozilla/5.0\
(Windows; U;\
Windows NT 10.0)\
http/[package provide http] Tcl/[package provide Tcl]"
} else {
set http(-useragent) "Mozilla/5.0\
([string totitle $::tcl_platform(platform)]; U;\
$::tcl_platform(os) $::tcl_platform(osVersion))\
http/[package provide http] Tcl/[package provide Tcl]"
}
}
proc init {} {
# Set up the map for quoting chars. RFC3986 Section 2.3 say percent
# encode all except: "... percent-encoded octets in the ranges of
# ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period
# (%2E), underscore (%5F), or tilde (%7E) should not be created by URI
|
| ︙ | | |
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
-
-
-
+
+
+
+
|
variable $token
upvar 0 $token state
global errorInfo errorCode
if {$errormsg ne ""} {
set state(error) [list $errormsg $errorInfo $errorCode]
set state(status) "error"
}
if {
($state(status) eq "timeout") || ($state(status) eq "error") ||
([info exists state(connection)] && ($state(connection) eq "close"))
if { ($state(status) eq "timeout")
|| ($state(status) eq "error")
|| ([info exists state(-keepalive)] && !$state(-keepalive))
|| ([info exists state(connection)] && ($state(connection) eq "close"))
} {
CloseSocket $state(sock) $token
}
if {[info exists state(after)]} {
after cancel $state(after)
}
if {[info exists state(-command)] && !$skipCB
|
| ︙ | | |
Changes to library/http/pkgIndex.tcl.
1
2
|
1
2
|
-
+
|
if {![package vsatisfies [package provide Tcl] 8.6-]} {return}
package ifneeded http 2.8.10 [list tclPkgSetup $dir http 2.8.10 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}]
package ifneeded http 2.8.11 [list tclPkgSetup $dir http 2.8.11 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}]
|
Changes to library/init.tcl.
| ︙ | | |
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
-
+
|
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# This test intentionally written in pre-7.5 Tcl
if {[info commands package] == ""} {
error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]"
}
package require -exact Tcl 8.7a0
package require -exact Tcl 8.6.6
# Compute the auto path to use in this interpreter.
# The values on the path come from several locations:
#
# The environment variable TCLLIBPATH
#
# tcl_library, which is the directory containing this init.tcl script.
|
| ︙ | | |
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
-
-
-
-
-
-
-
+
-
+
+
|
package unknown {::tcl::tm::UnknownHandler ::tclPkgUnknown}
}
# Set up the 'clock' ensemble
namespace eval ::tcl::clock [list variable TclLibDir $::tcl_library]
proc clock args {
namespace eval ::tcl::clock [list namespace ensemble create -command \
[uplevel 1 [list namespace origin [lindex [info level 0] 0]]] \
-subcommands {
add clicks format microseconds milliseconds scan seconds
}]
proc ::tcl::initClock {} {
# Auto-loading stubs for 'clock.tcl'
foreach cmd {add format scan} {
proc ::tcl::clock::$cmd args {
variable TclLibDir
source -encoding utf-8 [file join $TclLibDir clock.tcl]
return [uplevel 1 [info level 0]]
}
}
return [uplevel 1 [info level 0]]
rename ::tcl::initClock {}
}
::tcl::initClock
}
# Conditionalize for presence of exec.
if {[namespace which -command exec] eq ""} {
# Some machines do not have exec. Also, on all
|
| ︙ | | |
Changes to library/tzdata/Africa/Accra.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Accra) {
{-9223372036854775808 -52 0 LMT}
{-1640995148 0 0 GMT}
{-1556841600 1200 1 GHST}
{-1546388400 0 0 GMT}
{-1525305600 1200 1 GHST}
{-1514852400 0 0 GMT}
{-1493769600 1200 1 GHST}
{-1483316400 0 0 GMT}
{-1462233600 1200 1 GHST}
{-1451780400 0 0 GMT}
{-1430611200 1200 1 GHST}
{-1420158000 0 0 GMT}
{-1399075200 1200 1 GHST}
{-1388622000 0 0 GMT}
{-1367539200 1200 1 GHST}
{-1357086000 0 0 GMT}
{-1336003200 1200 1 GHST}
{-1325550000 0 0 GMT}
{-1304380800 1200 1 GHST}
{-1293927600 0 0 GMT}
{-1272844800 1200 1 GHST}
{-1262391600 0 0 GMT}
{-1241308800 1200 1 GHST}
{-1230855600 0 0 GMT}
{-1209772800 1200 1 GHST}
{-1199319600 0 0 GMT}
{-1178150400 1200 1 GHST}
{-1167697200 0 0 GMT}
{-1146614400 1200 1 GHST}
{-1136161200 0 0 GMT}
{-1115078400 1200 1 GHST}
{-1104625200 0 0 GMT}
{-1083542400 1200 1 GHST}
{-1073089200 0 0 GMT}
{-1051920000 1200 1 GHST}
{-1041466800 0 0 GMT}
{-1020384000 1200 1 GHST}
{-1009930800 0 0 GMT}
{-988848000 1200 1 GHST}
{-978394800 0 0 GMT}
{-957312000 1200 1 GHST}
{-946858800 0 0 GMT}
{-925689600 1200 1 GHST}
{-915236400 0 0 GMT}
{-894153600 1200 1 GHST}
{-883700400 0 0 GMT}
{-862617600 1200 1 GHST}
{-852164400 0 0 GMT}
{-1640995148 0 0 +0020}
{-1556841600 1200 1 +0020}
{-1546388400 0 0 +0020}
{-1525305600 1200 1 +0020}
{-1514852400 0 0 +0020}
{-1493769600 1200 1 +0020}
{-1483316400 0 0 +0020}
{-1462233600 1200 1 +0020}
{-1451780400 0 0 +0020}
{-1430611200 1200 1 +0020}
{-1420158000 0 0 +0020}
{-1399075200 1200 1 +0020}
{-1388622000 0 0 +0020}
{-1367539200 1200 1 +0020}
{-1357086000 0 0 +0020}
{-1336003200 1200 1 +0020}
{-1325550000 0 0 +0020}
{-1304380800 1200 1 +0020}
{-1293927600 0 0 +0020}
{-1272844800 1200 1 +0020}
{-1262391600 0 0 +0020}
{-1241308800 1200 1 +0020}
{-1230855600 0 0 +0020}
{-1209772800 1200 1 +0020}
{-1199319600 0 0 +0020}
{-1178150400 1200 1 +0020}
{-1167697200 0 0 +0020}
{-1146614400 1200 1 +0020}
{-1136161200 0 0 +0020}
{-1115078400 1200 1 +0020}
{-1104625200 0 0 +0020}
{-1083542400 1200 1 +0020}
{-1073089200 0 0 +0020}
{-1051920000 1200 1 +0020}
{-1041466800 0 0 +0020}
{-1020384000 1200 1 +0020}
{-1009930800 0 0 +0020}
{-988848000 1200 1 +0020}
{-978394800 0 0 +0020}
{-957312000 1200 1 +0020}
{-946858800 0 0 +0020}
{-925689600 1200 1 +0020}
{-915236400 0 0 +0020}
{-894153600 1200 1 +0020}
{-883700400 0 0 +0020}
{-862617600 1200 1 +0020}
{-852164400 0 0 +0020}
}
|
Changes to library/tzdata/Africa/Bissau.
1
2
3
4
5
6
7
|
1
2
3
4
5
6
7
|
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Bissau) {
{-9223372036854775808 -3740 0 LMT}
{-1830380260 -3600 0 WAT}
{-1830380260 -3600 0 -01}
{157770000 0 0 GMT}
}
|
Changes to library/tzdata/Africa/Ceuta.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
-
+
-
+
-
+
-
-
-
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Ceuta) {
{-9223372036854775808 -1276 0 LMT}
{-2177451524 0 0 WET}
{-2177452800 0 0 WET}
{-1630112400 3600 1 WEST}
{-1616810400 0 0 WET}
{-1451692800 0 0 WET}
{-1442451600 3600 1 WEST}
{-1427677200 0 0 WET}
{-1427673600 0 0 WET}
{-1379293200 3600 1 WEST}
{-1364778000 0 0 WET}
{-1364774400 0 0 WET}
{-1348448400 3600 1 WEST}
{-1333328400 0 0 WET}
{-1316394000 3600 1 WEST}
{-1301274000 0 0 WET}
{-1333324800 0 0 WET}
{-1316390400 3600 1 WEST}
{-1301270400 0 0 WET}
{-1293840000 0 0 WET}
{-81432000 3600 1 WEST}
{-71110800 0 0 WET}
{141264000 3600 1 WEST}
{147222000 0 0 WET}
{199756800 3600 1 WEST}
{207702000 0 0 WET}
|
| ︙ | | |
Changes to library/tzdata/Africa/El_Aaiun.
1
2
3
4
5
6
7
8
9
10
11
12
|
1
2
3
4
5
6
7
8
9
10
11
12
|
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/El_Aaiun) {
{-9223372036854775808 -3168 0 LMT}
{-1136070432 -3600 0 WAT}
{-1136070432 -3600 0 -01}
{198291600 0 0 WET}
{199756800 3600 1 WEST}
{207702000 0 0 WET}
{231292800 3600 1 WEST}
{244249200 0 0 WET}
{265507200 3600 1 WEST}
{271033200 0 0 WET}
|
| ︙ | | |
Changes to library/tzdata/Africa/Monrovia.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
-
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Monrovia) {
{-9223372036854775808 -2588 0 LMT}
{-2776979812 -2588 0 MMT}
{-1604359012 -2670 0 LRT}
{73529070 0 0 GMT}
{-1604359012 -2670 0 MMT}
{63593070 0 0 GMT}
}
|
Changes to library/tzdata/Africa/Nairobi.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
-
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Nairobi) {
{-9223372036854775808 8836 0 LMT}
{-1309746436 10800 0 EAT}
{-1262314800 9000 0 BEAT}
{-946780200 9900 0 BEAUT}
{-1262314800 9000 0 +0230}
{-946780200 9900 0 +0245}
{-315629100 10800 0 EAT}
}
|
Changes to library/tzdata/Africa/Windhoek.
1
2
3
4
5
6
7
8
9
10
11
12
|
1
2
3
4
5
6
7
8
9
10
11
12
|
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Windhoek) {
{-9223372036854775808 4104 0 LMT}
{-2458170504 5400 0 SWAT}
{-2458170504 5400 0 +0130}
{-2109288600 7200 0 SAST}
{-860976000 10800 1 SAST}
{-845254800 7200 0 SAST}
{637970400 7200 0 CAT}
{765324000 3600 0 WAT}
{778640400 7200 1 WAST}
{796780800 3600 0 WAT}
|
| ︙ | | |
Changes to library/tzdata/America/Anchorage.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
-
-
-
-
-
+
+
+
+
+
-
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Anchorage) {
{-9223372036854775808 50424 0 LMT}
{-3225362424 -35976 0 LMT}
{-2188951224 -36000 0 CAT}
{-883576800 -36000 0 CAWT}
{-880200000 -32400 1 CAWT}
{-769395600 -32400 0 CAPT}
{-765378000 -36000 0 CAPT}
{-2188951224 -36000 0 AST}
{-883576800 -36000 0 AST}
{-880200000 -32400 1 AWT}
{-769395600 -32400 1 APT}
{-765378000 -36000 0 AST}
{-757346400 -36000 0 CAT}
{-86882400 -36000 0 AHST}
{-31500000 -36000 0 AHST}
{-21470400 -32400 1 AHDT}
{-5749200 -36000 0 AHST}
{9979200 -32400 1 AHDT}
{25700400 -36000 0 AHST}
{41428800 -32400 1 AHDT}
|
| ︙ | | |
Changes to library/tzdata/America/Araguaina.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Araguaina) {
{-9223372036854775808 -11568 0 LMT}
{-1767214032 -10800 0 BRT}
{-1206957600 -7200 1 BRST}
{-1191362400 -10800 0 BRT}
{-1175374800 -7200 1 BRST}
{-1159826400 -10800 0 BRT}
{-633819600 -7200 1 BRST}
{-622069200 -10800 0 BRT}
{-602283600 -7200 1 BRST}
{-591832800 -10800 0 BRT}
{-570747600 -7200 1 BRST}
{-560210400 -10800 0 BRT}
{-539125200 -7200 1 BRST}
{-531352800 -10800 0 BRT}
{-191365200 -7200 1 BRST}
{-184197600 -10800 0 BRT}
{-155163600 -7200 1 BRST}
{-150069600 -10800 0 BRT}
{-128898000 -7200 1 BRST}
{-121125600 -10800 0 BRT}
{-99954000 -7200 1 BRST}
{-89589600 -10800 0 BRT}
{-68418000 -7200 1 BRST}
{-57967200 -10800 0 BRT}
{499748400 -7200 1 BRST}
{511236000 -10800 0 BRT}
{530593200 -7200 1 BRST}
{540266400 -10800 0 BRT}
{562129200 -7200 1 BRST}
{571197600 -10800 0 BRT}
{592974000 -7200 1 BRST}
{602042400 -10800 0 BRT}
{624423600 -7200 1 BRST}
{634701600 -10800 0 BRT}
{653536800 -10800 0 BRT}
{811047600 -10800 0 BRT}
{813726000 -7200 1 BRST}
{824004000 -10800 0 BRT}
{844570800 -7200 1 BRST}
{856058400 -10800 0 BRT}
{876106800 -7200 1 BRST}
{888717600 -10800 0 BRT}
{908074800 -7200 1 BRST}
{919562400 -10800 0 BRT}
{938919600 -7200 1 BRST}
{951616800 -10800 0 BRT}
{970974000 -7200 1 BRST}
{982461600 -10800 0 BRT}
{1003028400 -7200 1 BRST}
{1013911200 -10800 0 BRT}
{1036292400 -7200 1 BRST}
{1045360800 -10800 0 BRT}
{1064368800 -10800 0 BRT}
{1350788400 -7200 0 BRST}
{1361066400 -10800 0 BRT}
{1378000800 -10800 0 BRT}
{-1767214032 -10800 0 -03}
{-1206957600 -7200 1 -02}
{-1191362400 -10800 0 -03}
{-1175374800 -7200 1 -02}
{-1159826400 -10800 0 -03}
{-633819600 -7200 1 -02}
{-622069200 -10800 0 -03}
{-602283600 -7200 1 -02}
{-591832800 -10800 0 -03}
{-570747600 -7200 1 -02}
{-560210400 -10800 0 -03}
{-539125200 -7200 1 -02}
{-531352800 -10800 0 -03}
{-191365200 -7200 1 -02}
{-184197600 -10800 0 -03}
{-155163600 -7200 1 -02}
{-150069600 -10800 0 -03}
{-128898000 -7200 1 -02}
{-121125600 -10800 0 -03}
{-99954000 -7200 1 -02}
{-89589600 -10800 0 -03}
{-68418000 -7200 1 -02}
{-57967200 -10800 0 -03}
{499748400 -7200 1 -02}
{511236000 -10800 0 -03}
{530593200 -7200 1 -02}
{540266400 -10800 0 -03}
{562129200 -7200 1 -02}
{571197600 -10800 0 -03}
{592974000 -7200 1 -02}
{602042400 -10800 0 -03}
{624423600 -7200 1 -02}
{634701600 -10800 0 -03}
{653536800 -10800 0 -03}
{811047600 -10800 0 -03}
{813726000 -7200 1 -02}
{824004000 -10800 0 -03}
{844570800 -7200 1 -02}
{856058400 -10800 0 -03}
{876106800 -7200 1 -02}
{888717600 -10800 0 -03}
{908074800 -7200 1 -02}
{919562400 -10800 0 -03}
{938919600 -7200 1 -02}
{951616800 -10800 0 -03}
{970974000 -7200 1 -02}
{982461600 -10800 0 -03}
{1003028400 -7200 1 -02}
{1013911200 -10800 0 -03}
{1036292400 -7200 1 -02}
{1045360800 -10800 0 -03}
{1064368800 -10800 0 -03}
{1350788400 -7200 0 -02}
{1361066400 -10800 0 -03}
{1378000800 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Buenos_Aires.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Buenos_Aires) {
{-9223372036854775808 -14028 0 LMT}
{-2372097972 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -10800 0 ART}
{687927600 -7200 1 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224385200 -7200 1 ARST}
{1237082400 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -10800 0 -03}
{687927600 -7200 1 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224385200 -7200 1 -02}
{1237082400 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Catamarca.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Catamarca) {
{-9223372036854775808 -15788 0 LMT}
{-2372096212 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -14400 0 WART}
{687931200 -7200 0 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1086058800 -14400 0 WART}
{1087704000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -14400 0 -04}
{687931200 -7200 0 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1086058800 -14400 0 -04}
{1087704000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Cordoba.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Cordoba) {
{-9223372036854775808 -15408 0 LMT}
{-2372096592 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -14400 0 WART}
{687931200 -7200 0 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224385200 -7200 1 ARST}
{1237082400 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -14400 0 -04}
{687931200 -7200 0 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224385200 -7200 1 -02}
{1237082400 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Jujuy.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Jujuy) {
{-9223372036854775808 -15672 0 LMT}
{-2372096328 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -14400 0 WART}
{657086400 -10800 1 WARST}
{669178800 -14400 0 WART}
{686721600 -7200 1 ARST}
{694231200 -7200 0 ART}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -14400 0 -04}
{657086400 -10800 1 -03}
{669178800 -14400 0 -04}
{686721600 -7200 1 -02}
{694231200 -7200 0 -03}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/La_Rioja.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/La_Rioja) {
{-9223372036854775808 -16044 0 LMT}
{-2372095956 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667792800 -14400 0 WART}
{673588800 -10800 0 ART}
{687927600 -7200 1 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1086058800 -14400 0 WART}
{1087704000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667792800 -14400 0 -04}
{673588800 -10800 0 -03}
{687927600 -7200 1 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1086058800 -14400 0 -04}
{1087704000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Mendoza.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Mendoza) {
{-9223372036854775808 -16516 0 LMT}
{-2372095484 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -14400 0 WART}
{655963200 -10800 1 WARST}
{667796400 -14400 0 WART}
{687499200 -10800 1 WARST}
{699418800 -14400 0 WART}
{719380800 -7200 0 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1085281200 -14400 0 WART}
{1096171200 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -14400 0 -04}
{655963200 -10800 1 -03}
{667796400 -14400 0 -04}
{687499200 -10800 1 -03}
{699418800 -14400 0 -04}
{719380800 -7200 0 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1085281200 -14400 0 -04}
{1096171200 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Rio_Gallegos.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Rio_Gallegos) {
{-9223372036854775808 -16612 0 LMT}
{-2372095388 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -10800 0 ART}
{687927600 -7200 1 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1086058800 -14400 0 WART}
{1087704000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -10800 0 -03}
{687927600 -7200 1 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1086058800 -14400 0 -04}
{1087704000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Salta.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Salta) {
{-9223372036854775808 -15700 0 LMT}
{-2372096300 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -14400 0 WART}
{687931200 -7200 0 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -14400 0 -04}
{687931200 -7200 0 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/San_Juan.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/San_Juan) {
{-9223372036854775808 -16444 0 LMT}
{-2372095556 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667792800 -14400 0 WART}
{673588800 -10800 0 ART}
{687927600 -7200 1 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1085972400 -14400 0 WART}
{1090728000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667792800 -14400 0 -04}
{673588800 -10800 0 -03}
{687927600 -7200 1 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1085972400 -14400 0 -04}
{1090728000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/San_Luis.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/San_Luis) {
{-9223372036854775808 -15924 0 LMT}
{-2372096076 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{631159200 -7200 1 ARST}
{637380000 -14400 0 WART}
{655963200 -10800 1 WARST}
{667796400 -14400 0 WART}
{675748800 -10800 0 ART}
{938919600 -10800 1 WARST}
{952052400 -10800 0 ART}
{1085972400 -14400 0 WART}
{1090728000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1200880800 -10800 0 WART}
{1205031600 -14400 0 WART}
{1223784000 -10800 1 WARST}
{1236481200 -14400 0 WART}
{1255233600 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{631159200 -7200 1 -02}
{637380000 -14400 0 -04}
{655963200 -10800 1 -03}
{667796400 -14400 0 -04}
{675748800 -10800 0 -03}
{938919600 -10800 1 -03}
{952052400 -10800 0 -03}
{1085972400 -14400 0 -04}
{1090728000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1200880800 -10800 0 -04}
{1205031600 -14400 0 -04}
{1223784000 -10800 1 -03}
{1236481200 -14400 0 -04}
{1255233600 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Tucuman.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Tucuman) {
{-9223372036854775808 -15652 0 LMT}
{-2372096348 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -14400 0 WART}
{687931200 -7200 0 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1086058800 -14400 0 WART}
{1087099200 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224385200 -7200 1 ARST}
{1237082400 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -14400 0 -04}
{687931200 -7200 0 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1086058800 -14400 0 -04}
{1087099200 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224385200 -7200 1 -02}
{1237082400 -10800 0 -03}
}
|
Changes to library/tzdata/America/Argentina/Ushuaia.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Argentina/Ushuaia) {
{-9223372036854775808 -16392 0 LMT}
{-2372095608 -15408 0 CMT}
{-1567453392 -14400 0 ART}
{-1233432000 -10800 0 ARST}
{-1222981200 -14400 0 ART}
{-1205956800 -10800 1 ARST}
{-1194037200 -14400 0 ART}
{-1172865600 -10800 1 ARST}
{-1162501200 -14400 0 ART}
{-1141329600 -10800 1 ARST}
{-1130965200 -14400 0 ART}
{-1109793600 -10800 1 ARST}
{-1099429200 -14400 0 ART}
{-1078257600 -10800 1 ARST}
{-1067806800 -14400 0 ART}
{-1046635200 -10800 1 ARST}
{-1036270800 -14400 0 ART}
{-1015099200 -10800 1 ARST}
{-1004734800 -14400 0 ART}
{-983563200 -10800 1 ARST}
{-973198800 -14400 0 ART}
{-952027200 -10800 1 ARST}
{-941576400 -14400 0 ART}
{-931032000 -10800 1 ARST}
{-900882000 -14400 0 ART}
{-890337600 -10800 1 ARST}
{-833749200 -14400 0 ART}
{-827265600 -10800 1 ARST}
{-752274000 -14400 0 ART}
{-733780800 -10800 1 ARST}
{-197326800 -14400 0 ART}
{-190843200 -10800 1 ARST}
{-184194000 -14400 0 ART}
{-164491200 -10800 1 ARST}
{-152658000 -14400 0 ART}
{-132955200 -10800 1 ARST}
{-121122000 -14400 0 ART}
{-101419200 -10800 1 ARST}
{-86821200 -14400 0 ART}
{-71092800 -10800 1 ARST}
{-54766800 -14400 0 ART}
{-39038400 -10800 1 ARST}
{-23317200 -14400 0 ART}
{-7588800 -10800 0 ART}
{128142000 -7200 1 ARST}
{136605600 -10800 0 ART}
{596948400 -7200 1 ARST}
{605066400 -10800 0 ART}
{624423600 -7200 1 ARST}
{636516000 -10800 0 ART}
{656478000 -7200 1 ARST}
{667965600 -10800 0 ART}
{687927600 -7200 1 ARST}
{699415200 -10800 0 ART}
{719377200 -7200 1 ARST}
{731469600 -10800 0 ART}
{938916000 -10800 0 ART}
{938919600 -10800 1 ARST}
{952056000 -10800 0 ART}
{1085886000 -14400 0 WART}
{1087704000 -10800 0 ART}
{1198983600 -7200 1 ARST}
{1205632800 -10800 0 ART}
{1224295200 -10800 0 ART}
{-1567453392 -14400 0 -04}
{-1233432000 -10800 0 -03}
{-1222981200 -14400 0 -04}
{-1205956800 -10800 1 -03}
{-1194037200 -14400 0 -04}
{-1172865600 -10800 1 -03}
{-1162501200 -14400 0 -04}
{-1141329600 -10800 1 -03}
{-1130965200 -14400 0 -04}
{-1109793600 -10800 1 -03}
{-1099429200 -14400 0 -04}
{-1078257600 -10800 1 -03}
{-1067806800 -14400 0 -04}
{-1046635200 -10800 1 -03}
{-1036270800 -14400 0 -04}
{-1015099200 -10800 1 -03}
{-1004734800 -14400 0 -04}
{-983563200 -10800 1 -03}
{-973198800 -14400 0 -04}
{-952027200 -10800 1 -03}
{-941576400 -14400 0 -04}
{-931032000 -10800 1 -03}
{-900882000 -14400 0 -04}
{-890337600 -10800 1 -03}
{-833749200 -14400 0 -04}
{-827265600 -10800 1 -03}
{-752274000 -14400 0 -04}
{-733780800 -10800 1 -03}
{-197326800 -14400 0 -04}
{-190843200 -10800 1 -03}
{-184194000 -14400 0 -04}
{-164491200 -10800 1 -03}
{-152658000 -14400 0 -04}
{-132955200 -10800 1 -03}
{-121122000 -14400 0 -04}
{-101419200 -10800 1 -03}
{-86821200 -14400 0 -04}
{-71092800 -10800 1 -03}
{-54766800 -14400 0 -04}
{-39038400 -10800 1 -03}
{-23317200 -14400 0 -04}
{-7588800 -10800 0 -03}
{128142000 -7200 1 -02}
{136605600 -10800 0 -03}
{596948400 -7200 1 -02}
{605066400 -10800 0 -03}
{624423600 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -10800 0 -03}
{687927600 -7200 1 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{731469600 -10800 0 -03}
{938916000 -10800 0 -04}
{938919600 -10800 1 -03}
{952056000 -10800 0 -03}
{1085886000 -14400 0 -04}
{1087704000 -10800 0 -03}
{1198983600 -7200 1 -02}
{1205632800 -10800 0 -03}
{1224295200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Asuncion.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Asuncion) {
{-9223372036854775808 -13840 0 LMT}
{-2524507760 -13840 0 AMT}
{-1206389360 -14400 0 PYT}
{86760000 -10800 0 PYT}
{134017200 -14400 0 PYT}
{162878400 -14400 0 PYT}
{181368000 -10800 1 PYST}
{194497200 -14400 0 PYT}
{212990400 -10800 1 PYST}
{226033200 -14400 0 PYT}
{244526400 -10800 1 PYST}
{257569200 -14400 0 PYT}
{276062400 -10800 1 PYST}
{291783600 -14400 0 PYT}
{307598400 -10800 1 PYST}
{323406000 -14400 0 PYT}
{339220800 -10800 1 PYST}
{354942000 -14400 0 PYT}
{370756800 -10800 1 PYST}
{386478000 -14400 0 PYT}
{402292800 -10800 1 PYST}
{418014000 -14400 0 PYT}
{433828800 -10800 1 PYST}
{449636400 -14400 0 PYT}
{465451200 -10800 1 PYST}
{481172400 -14400 0 PYT}
{496987200 -10800 1 PYST}
{512708400 -14400 0 PYT}
{528523200 -10800 1 PYST}
{544244400 -14400 0 PYT}
{560059200 -10800 1 PYST}
{575866800 -14400 0 PYT}
{591681600 -10800 1 PYST}
{607402800 -14400 0 PYT}
{625032000 -10800 1 PYST}
{638938800 -14400 0 PYT}
{654753600 -10800 1 PYST}
{670474800 -14400 0 PYT}
{686721600 -10800 1 PYST}
{699418800 -14400 0 PYT}
{718257600 -10800 1 PYST}
{733546800 -14400 0 PYT}
{749448000 -10800 1 PYST}
{762318000 -14400 0 PYT}
{780984000 -10800 1 PYST}
{793767600 -14400 0 PYT}
{812520000 -10800 1 PYST}
{825649200 -14400 0 PYT}
{844574400 -10800 1 PYST}
{856666800 -14400 0 PYT}
{876024000 -10800 1 PYST}
{888721200 -14400 0 PYT}
{907473600 -10800 1 PYST}
{920775600 -14400 0 PYT}
{938923200 -10800 1 PYST}
{952225200 -14400 0 PYT}
{970372800 -10800 1 PYST}
{983674800 -14400 0 PYT}
{1002427200 -10800 1 PYST}
{1018148400 -14400 0 PYT}
{1030852800 -10800 1 PYST}
{1049598000 -14400 0 PYT}
{1062907200 -10800 1 PYST}
{1081047600 -14400 0 PYT}
{1097985600 -10800 1 PYST}
{1110682800 -14400 0 PYT}
{1129435200 -10800 1 PYST}
{1142132400 -14400 0 PYT}
{1160884800 -10800 1 PYST}
{1173582000 -14400 0 PYT}
{1192939200 -10800 1 PYST}
{1205031600 -14400 0 PYT}
{1224388800 -10800 1 PYST}
{1236481200 -14400 0 PYT}
{1255838400 -10800 1 PYST}
{1270954800 -14400 0 PYT}
{1286078400 -10800 1 PYST}
{1302404400 -14400 0 PYT}
{1317528000 -10800 1 PYST}
{1333854000 -14400 0 PYT}
{1349582400 -10800 1 PYST}
{1364094000 -14400 0 PYT}
{1381032000 -10800 1 PYST}
{1395543600 -14400 0 PYT}
{1412481600 -10800 1 PYST}
{1426993200 -14400 0 PYT}
{1443931200 -10800 1 PYST}
{1459047600 -14400 0 PYT}
{1475380800 -10800 1 PYST}
{1490497200 -14400 0 PYT}
{1506830400 -10800 1 PYST}
{1521946800 -14400 0 PYT}
{1538884800 -10800 1 PYST}
{1553396400 -14400 0 PYT}
{1570334400 -10800 1 PYST}
{1584846000 -14400 0 PYT}
{1601784000 -10800 1 PYST}
{1616900400 -14400 0 PYT}
{1633233600 -10800 1 PYST}
{1648350000 -14400 0 PYT}
{1664683200 -10800 1 PYST}
{1679799600 -14400 0 PYT}
{1696132800 -10800 1 PYST}
{1711249200 -14400 0 PYT}
{1728187200 -10800 1 PYST}
{1742698800 -14400 0 PYT}
{1759636800 -10800 1 PYST}
{1774148400 -14400 0 PYT}
{1791086400 -10800 1 PYST}
{1806202800 -14400 0 PYT}
{1822536000 -10800 1 PYST}
{1837652400 -14400 0 PYT}
{1853985600 -10800 1 PYST}
{1869102000 -14400 0 PYT}
{1886040000 -10800 1 PYST}
{1900551600 -14400 0 PYT}
{1917489600 -10800 1 PYST}
{1932001200 -14400 0 PYT}
{1948939200 -10800 1 PYST}
{1964055600 -14400 0 PYT}
{1980388800 -10800 1 PYST}
{1995505200 -14400 0 PYT}
{2011838400 -10800 1 PYST}
{2026954800 -14400 0 PYT}
{2043288000 -10800 1 PYST}
{2058404400 -14400 0 PYT}
{2075342400 -10800 1 PYST}
{2089854000 -14400 0 PYT}
{2106792000 -10800 1 PYST}
{2121303600 -14400 0 PYT}
{2138241600 -10800 1 PYST}
{2153358000 -14400 0 PYT}
{2169691200 -10800 1 PYST}
{2184807600 -14400 0 PYT}
{2201140800 -10800 1 PYST}
{2216257200 -14400 0 PYT}
{2233195200 -10800 1 PYST}
{2247706800 -14400 0 PYT}
{2264644800 -10800 1 PYST}
{2279156400 -14400 0 PYT}
{2296094400 -10800 1 PYST}
{2310606000 -14400 0 PYT}
{2327544000 -10800 1 PYST}
{2342660400 -14400 0 PYT}
{2358993600 -10800 1 PYST}
{2374110000 -14400 0 PYT}
{2390443200 -10800 1 PYST}
{2405559600 -14400 0 PYT}
{2422497600 -10800 1 PYST}
{2437009200 -14400 0 PYT}
{2453947200 -10800 1 PYST}
{2468458800 -14400 0 PYT}
{2485396800 -10800 1 PYST}
{2500513200 -14400 0 PYT}
{2516846400 -10800 1 PYST}
{2531962800 -14400 0 PYT}
{2548296000 -10800 1 PYST}
{2563412400 -14400 0 PYT}
{2579745600 -10800 1 PYST}
{2594862000 -14400 0 PYT}
{2611800000 -10800 1 PYST}
{2626311600 -14400 0 PYT}
{2643249600 -10800 1 PYST}
{2657761200 -14400 0 PYT}
{2674699200 -10800 1 PYST}
{2689815600 -14400 0 PYT}
{2706148800 -10800 1 PYST}
{2721265200 -14400 0 PYT}
{2737598400 -10800 1 PYST}
{2752714800 -14400 0 PYT}
{2769652800 -10800 1 PYST}
{2784164400 -14400 0 PYT}
{2801102400 -10800 1 PYST}
{2815614000 -14400 0 PYT}
{2832552000 -10800 1 PYST}
{2847668400 -14400 0 PYT}
{2864001600 -10800 1 PYST}
{2879118000 -14400 0 PYT}
{2895451200 -10800 1 PYST}
{2910567600 -14400 0 PYT}
{2926900800 -10800 1 PYST}
{2942017200 -14400 0 PYT}
{2958955200 -10800 1 PYST}
{2973466800 -14400 0 PYT}
{2990404800 -10800 1 PYST}
{3004916400 -14400 0 PYT}
{3021854400 -10800 1 PYST}
{3036970800 -14400 0 PYT}
{3053304000 -10800 1 PYST}
{3068420400 -14400 0 PYT}
{3084753600 -10800 1 PYST}
{3099870000 -14400 0 PYT}
{3116808000 -10800 1 PYST}
{3131319600 -14400 0 PYT}
{3148257600 -10800 1 PYST}
{3162769200 -14400 0 PYT}
{3179707200 -10800 1 PYST}
{3194218800 -14400 0 PYT}
{3211156800 -10800 1 PYST}
{3226273200 -14400 0 PYT}
{3242606400 -10800 1 PYST}
{3257722800 -14400 0 PYT}
{3274056000 -10800 1 PYST}
{3289172400 -14400 0 PYT}
{3306110400 -10800 1 PYST}
{3320622000 -14400 0 PYT}
{3337560000 -10800 1 PYST}
{3352071600 -14400 0 PYT}
{3369009600 -10800 1 PYST}
{3384126000 -14400 0 PYT}
{3400459200 -10800 1 PYST}
{3415575600 -14400 0 PYT}
{3431908800 -10800 1 PYST}
{3447025200 -14400 0 PYT}
{3463358400 -10800 1 PYST}
{3478474800 -14400 0 PYT}
{3495412800 -10800 1 PYST}
{3509924400 -14400 0 PYT}
{3526862400 -10800 1 PYST}
{3541374000 -14400 0 PYT}
{3558312000 -10800 1 PYST}
{3573428400 -14400 0 PYT}
{3589761600 -10800 1 PYST}
{3604878000 -14400 0 PYT}
{3621211200 -10800 1 PYST}
{3636327600 -14400 0 PYT}
{3653265600 -10800 1 PYST}
{3667777200 -14400 0 PYT}
{3684715200 -10800 1 PYST}
{3699226800 -14400 0 PYT}
{3716164800 -10800 1 PYST}
{3731281200 -14400 0 PYT}
{3747614400 -10800 1 PYST}
{3762730800 -14400 0 PYT}
{3779064000 -10800 1 PYST}
{3794180400 -14400 0 PYT}
{3810513600 -10800 1 PYST}
{3825630000 -14400 0 PYT}
{3842568000 -10800 1 PYST}
{3857079600 -14400 0 PYT}
{3874017600 -10800 1 PYST}
{3888529200 -14400 0 PYT}
{3905467200 -10800 1 PYST}
{3920583600 -14400 0 PYT}
{3936916800 -10800 1 PYST}
{3952033200 -14400 0 PYT}
{3968366400 -10800 1 PYST}
{3983482800 -14400 0 PYT}
{4000420800 -10800 1 PYST}
{4014932400 -14400 0 PYT}
{4031870400 -10800 1 PYST}
{4046382000 -14400 0 PYT}
{4063320000 -10800 1 PYST}
{4077831600 -14400 0 PYT}
{4094769600 -10800 1 PYST}
{-1206389360 -14400 0 -04}
{86760000 -10800 0 -03}
{134017200 -14400 0 -04}
{162878400 -14400 0 -04}
{181368000 -10800 1 -03}
{194497200 -14400 0 -04}
{212990400 -10800 1 -03}
{226033200 -14400 0 -04}
{244526400 -10800 1 -03}
{257569200 -14400 0 -04}
{276062400 -10800 1 -03}
{291783600 -14400 0 -04}
{307598400 -10800 1 -03}
{323406000 -14400 0 -04}
{339220800 -10800 1 -03}
{354942000 -14400 0 -04}
{370756800 -10800 1 -03}
{386478000 -14400 0 -04}
{402292800 -10800 1 -03}
{418014000 -14400 0 -04}
{433828800 -10800 1 -03}
{449636400 -14400 0 -04}
{465451200 -10800 1 -03}
{481172400 -14400 0 -04}
{496987200 -10800 1 -03}
{512708400 -14400 0 -04}
{528523200 -10800 1 -03}
{544244400 -14400 0 -04}
{560059200 -10800 1 -03}
{575866800 -14400 0 -04}
{591681600 -10800 1 -03}
{607402800 -14400 0 -04}
{625032000 -10800 1 -03}
{638938800 -14400 0 -04}
{654753600 -10800 1 -03}
{670474800 -14400 0 -04}
{686721600 -10800 1 -03}
{699418800 -14400 0 -04}
{718257600 -10800 1 -03}
{733546800 -14400 0 -04}
{749448000 -10800 1 -03}
{762318000 -14400 0 -04}
{780984000 -10800 1 -03}
{793767600 -14400 0 -04}
{812520000 -10800 1 -03}
{825649200 -14400 0 -04}
{844574400 -10800 1 -03}
{856666800 -14400 0 -04}
{876024000 -10800 1 -03}
{888721200 -14400 0 -04}
{907473600 -10800 1 -03}
{920775600 -14400 0 -04}
{938923200 -10800 1 -03}
{952225200 -14400 0 -04}
{970372800 -10800 1 -03}
{983674800 -14400 0 -04}
{1002427200 -10800 1 -03}
{1018148400 -14400 0 -04}
{1030852800 -10800 1 -03}
{1049598000 -14400 0 -04}
{1062907200 -10800 1 -03}
{1081047600 -14400 0 -04}
{1097985600 -10800 1 -03}
{1110682800 -14400 0 -04}
{1129435200 -10800 1 -03}
{1142132400 -14400 0 -04}
{1160884800 -10800 1 -03}
{1173582000 -14400 0 -04}
{1192939200 -10800 1 -03}
{1205031600 -14400 0 -04}
{1224388800 -10800 1 -03}
{1236481200 -14400 0 -04}
{1255838400 -10800 1 -03}
{1270954800 -14400 0 -04}
{1286078400 -10800 1 -03}
{1302404400 -14400 0 -04}
{1317528000 -10800 1 -03}
{1333854000 -14400 0 -04}
{1349582400 -10800 1 -03}
{1364094000 -14400 0 -04}
{1381032000 -10800 1 -03}
{1395543600 -14400 0 -04}
{1412481600 -10800 1 -03}
{1426993200 -14400 0 -04}
{1443931200 -10800 1 -03}
{1459047600 -14400 0 -04}
{1475380800 -10800 1 -03}
{1490497200 -14400 0 -04}
{1506830400 -10800 1 -03}
{1521946800 -14400 0 -04}
{1538884800 -10800 1 -03}
{1553396400 -14400 0 -04}
{1570334400 -10800 1 -03}
{1584846000 -14400 0 -04}
{1601784000 -10800 1 -03}
{1616900400 -14400 0 -04}
{1633233600 -10800 1 -03}
{1648350000 -14400 0 -04}
{1664683200 -10800 1 -03}
{1679799600 -14400 0 -04}
{1696132800 -10800 1 -03}
{1711249200 -14400 0 -04}
{1728187200 -10800 1 -03}
{1742698800 -14400 0 -04}
{1759636800 -10800 1 -03}
{1774148400 -14400 0 -04}
{1791086400 -10800 1 -03}
{1806202800 -14400 0 -04}
{1822536000 -10800 1 -03}
{1837652400 -14400 0 -04}
{1853985600 -10800 1 -03}
{1869102000 -14400 0 -04}
{1886040000 -10800 1 -03}
{1900551600 -14400 0 -04}
{1917489600 -10800 1 -03}
{1932001200 -14400 0 -04}
{1948939200 -10800 1 -03}
{1964055600 -14400 0 -04}
{1980388800 -10800 1 -03}
{1995505200 -14400 0 -04}
{2011838400 -10800 1 -03}
{2026954800 -14400 0 -04}
{2043288000 -10800 1 -03}
{2058404400 -14400 0 -04}
{2075342400 -10800 1 -03}
{2089854000 -14400 0 -04}
{2106792000 -10800 1 -03}
{2121303600 -14400 0 -04}
{2138241600 -10800 1 -03}
{2153358000 -14400 0 -04}
{2169691200 -10800 1 -03}
{2184807600 -14400 0 -04}
{2201140800 -10800 1 -03}
{2216257200 -14400 0 -04}
{2233195200 -10800 1 -03}
{2247706800 -14400 0 -04}
{2264644800 -10800 1 -03}
{2279156400 -14400 0 -04}
{2296094400 -10800 1 -03}
{2310606000 -14400 0 -04}
{2327544000 -10800 1 -03}
{2342660400 -14400 0 -04}
{2358993600 -10800 1 -03}
{2374110000 -14400 0 -04}
{2390443200 -10800 1 -03}
{2405559600 -14400 0 -04}
{2422497600 -10800 1 -03}
{2437009200 -14400 0 -04}
{2453947200 -10800 1 -03}
{2468458800 -14400 0 -04}
{2485396800 -10800 1 -03}
{2500513200 -14400 0 -04}
{2516846400 -10800 1 -03}
{2531962800 -14400 0 -04}
{2548296000 -10800 1 -03}
{2563412400 -14400 0 -04}
{2579745600 -10800 1 -03}
{2594862000 -14400 0 -04}
{2611800000 -10800 1 -03}
{2626311600 -14400 0 -04}
{2643249600 -10800 1 -03}
{2657761200 -14400 0 -04}
{2674699200 -10800 1 -03}
{2689815600 -14400 0 -04}
{2706148800 -10800 1 -03}
{2721265200 -14400 0 -04}
{2737598400 -10800 1 -03}
{2752714800 -14400 0 -04}
{2769652800 -10800 1 -03}
{2784164400 -14400 0 -04}
{2801102400 -10800 1 -03}
{2815614000 -14400 0 -04}
{2832552000 -10800 1 -03}
{2847668400 -14400 0 -04}
{2864001600 -10800 1 -03}
{2879118000 -14400 0 -04}
{2895451200 -10800 1 -03}
{2910567600 -14400 0 -04}
{2926900800 -10800 1 -03}
{2942017200 -14400 0 -04}
{2958955200 -10800 1 -03}
{2973466800 -14400 0 -04}
{2990404800 -10800 1 -03}
{3004916400 -14400 0 -04}
{3021854400 -10800 1 -03}
{3036970800 -14400 0 -04}
{3053304000 -10800 1 -03}
{3068420400 -14400 0 -04}
{3084753600 -10800 1 -03}
{3099870000 -14400 0 -04}
{3116808000 -10800 1 -03}
{3131319600 -14400 0 -04}
{3148257600 -10800 1 -03}
{3162769200 -14400 0 -04}
{3179707200 -10800 1 -03}
{3194218800 -14400 0 -04}
{3211156800 -10800 1 -03}
{3226273200 -14400 0 -04}
{3242606400 -10800 1 -03}
{3257722800 -14400 0 -04}
{3274056000 -10800 1 -03}
{3289172400 -14400 0 -04}
{3306110400 -10800 1 -03}
{3320622000 -14400 0 -04}
{3337560000 -10800 1 -03}
{3352071600 -14400 0 -04}
{3369009600 -10800 1 -03}
{3384126000 -14400 0 -04}
{3400459200 -10800 1 -03}
{3415575600 -14400 0 -04}
{3431908800 -10800 1 -03}
{3447025200 -14400 0 -04}
{3463358400 -10800 1 -03}
{3478474800 -14400 0 -04}
{3495412800 -10800 1 -03}
{3509924400 -14400 0 -04}
{3526862400 -10800 1 -03}
{3541374000 -14400 0 -04}
{3558312000 -10800 1 -03}
{3573428400 -14400 0 -04}
{3589761600 -10800 1 -03}
{3604878000 -14400 0 -04}
{3621211200 -10800 1 -03}
{3636327600 -14400 0 -04}
{3653265600 -10800 1 -03}
{3667777200 -14400 0 -04}
{3684715200 -10800 1 -03}
{3699226800 -14400 0 -04}
{3716164800 -10800 1 -03}
{3731281200 -14400 0 -04}
{3747614400 -10800 1 -03}
{3762730800 -14400 0 -04}
{3779064000 -10800 1 -03}
{3794180400 -14400 0 -04}
{3810513600 -10800 1 -03}
{3825630000 -14400 0 -04}
{3842568000 -10800 1 -03}
{3857079600 -14400 0 -04}
{3874017600 -10800 1 -03}
{3888529200 -14400 0 -04}
{3905467200 -10800 1 -03}
{3920583600 -14400 0 -04}
{3936916800 -10800 1 -03}
{3952033200 -14400 0 -04}
{3968366400 -10800 1 -03}
{3983482800 -14400 0 -04}
{4000420800 -10800 1 -03}
{4014932400 -14400 0 -04}
{4031870400 -10800 1 -03}
{4046382000 -14400 0 -04}
{4063320000 -10800 1 -03}
{4077831600 -14400 0 -04}
{4094769600 -10800 1 -03}
}
|
Changes to library/tzdata/America/Bahia.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Bahia) {
{-9223372036854775808 -9244 0 LMT}
{-1767216356 -10800 0 BRT}
{-1206957600 -7200 1 BRST}
{-1191362400 -10800 0 BRT}
{-1175374800 -7200 1 BRST}
{-1159826400 -10800 0 BRT}
{-633819600 -7200 1 BRST}
{-622069200 -10800 0 BRT}
{-602283600 -7200 1 BRST}
{-591832800 -10800 0 BRT}
{-570747600 -7200 1 BRST}
{-560210400 -10800 0 BRT}
{-539125200 -7200 1 BRST}
{-531352800 -10800 0 BRT}
{-191365200 -7200 1 BRST}
{-184197600 -10800 0 BRT}
{-155163600 -7200 1 BRST}
{-150069600 -10800 0 BRT}
{-128898000 -7200 1 BRST}
{-121125600 -10800 0 BRT}
{-99954000 -7200 1 BRST}
{-89589600 -10800 0 BRT}
{-68418000 -7200 1 BRST}
{-57967200 -10800 0 BRT}
{499748400 -7200 1 BRST}
{511236000 -10800 0 BRT}
{530593200 -7200 1 BRST}
{540266400 -10800 0 BRT}
{562129200 -7200 1 BRST}
{571197600 -10800 0 BRT}
{592974000 -7200 1 BRST}
{602042400 -10800 0 BRT}
{624423600 -7200 1 BRST}
{634701600 -10800 0 BRT}
{656478000 -7200 1 BRST}
{666756000 -10800 0 BRT}
{687927600 -7200 1 BRST}
{697600800 -10800 0 BRT}
{719982000 -7200 1 BRST}
{728445600 -10800 0 BRT}
{750826800 -7200 1 BRST}
{761709600 -10800 0 BRT}
{782276400 -7200 1 BRST}
{793159200 -10800 0 BRT}
{813726000 -7200 1 BRST}
{824004000 -10800 0 BRT}
{844570800 -7200 1 BRST}
{856058400 -10800 0 BRT}
{876106800 -7200 1 BRST}
{888717600 -10800 0 BRT}
{908074800 -7200 1 BRST}
{919562400 -10800 0 BRT}
{938919600 -7200 1 BRST}
{951616800 -10800 0 BRT}
{970974000 -7200 1 BRST}
{982461600 -10800 0 BRT}
{1003028400 -7200 1 BRST}
{1013911200 -10800 0 BRT}
{1036292400 -7200 1 BRST}
{1045360800 -10800 0 BRT}
{1064368800 -10800 0 BRT}
{1318734000 -7200 0 BRST}
{1330221600 -10800 0 BRT}
{1350784800 -10800 0 BRT}
{-1767216356 -10800 0 -03}
{-1206957600 -7200 1 -02}
{-1191362400 -10800 0 -03}
{-1175374800 -7200 1 -02}
{-1159826400 -10800 0 -03}
{-633819600 -7200 1 -02}
{-622069200 -10800 0 -03}
{-602283600 -7200 1 -02}
{-591832800 -10800 0 -03}
{-570747600 -7200 1 -02}
{-560210400 -10800 0 -03}
{-539125200 -7200 1 -02}
{-531352800 -10800 0 -03}
{-191365200 -7200 1 -02}
{-184197600 -10800 0 -03}
{-155163600 -7200 1 -02}
{-150069600 -10800 0 -03}
{-128898000 -7200 1 -02}
{-121125600 -10800 0 -03}
{-99954000 -7200 1 -02}
{-89589600 -10800 0 -03}
{-68418000 -7200 1 -02}
{-57967200 -10800 0 -03}
{499748400 -7200 1 -02}
{511236000 -10800 0 -03}
{530593200 -7200 1 -02}
{540266400 -10800 0 -03}
{562129200 -7200 1 -02}
{571197600 -10800 0 -03}
{592974000 -7200 1 -02}
{602042400 -10800 0 -03}
{624423600 -7200 1 -02}
{634701600 -10800 0 -03}
{656478000 -7200 1 -02}
{666756000 -10800 0 -03}
{687927600 -7200 1 -02}
{697600800 -10800 0 -03}
{719982000 -7200 1 -02}
{728445600 -10800 0 -03}
{750826800 -7200 1 -02}
{761709600 -10800 0 -03}
{782276400 -7200 1 -02}
{793159200 -10800 0 -03}
{813726000 -7200 1 -02}
{824004000 -10800 0 -03}
{844570800 -7200 1 -02}
{856058400 -10800 0 -03}
{876106800 -7200 1 -02}
{888717600 -10800 0 -03}
{908074800 -7200 1 -02}
{919562400 -10800 0 -03}
{938919600 -7200 1 -02}
{951616800 -10800 0 -03}
{970974000 -7200 1 -02}
{982461600 -10800 0 -03}
{1003028400 -7200 1 -02}
{1013911200 -10800 0 -03}
{1036292400 -7200 1 -02}
{1045360800 -10800 0 -03}
{1064368800 -10800 0 -03}
{1318734000 -7200 0 -02}
{1330221600 -10800 0 -03}
{1350784800 -10800 0 -03}
}
|
Changes to library/tzdata/America/Belem.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Belem) {
{-9223372036854775808 -11636 0 LMT}
{-1767213964 -10800 0 BRT}
{-1206957600 -7200 1 BRST}
{-1191362400 -10800 0 BRT}
{-1175374800 -7200 1 BRST}
{-1159826400 -10800 0 BRT}
{-633819600 -7200 1 BRST}
{-622069200 -10800 0 BRT}
{-602283600 -7200 1 BRST}
{-591832800 -10800 0 BRT}
{-570747600 -7200 1 BRST}
{-560210400 -10800 0 BRT}
{-539125200 -7200 1 BRST}
{-531352800 -10800 0 BRT}
{-191365200 -7200 1 BRST}
{-184197600 -10800 0 BRT}
{-155163600 -7200 1 BRST}
{-150069600 -10800 0 BRT}
{-128898000 -7200 1 BRST}
{-121125600 -10800 0 BRT}
{-99954000 -7200 1 BRST}
{-89589600 -10800 0 BRT}
{-68418000 -7200 1 BRST}
{-57967200 -10800 0 BRT}
{499748400 -7200 1 BRST}
{511236000 -10800 0 BRT}
{530593200 -7200 1 BRST}
{540266400 -10800 0 BRT}
{562129200 -7200 1 BRST}
{571197600 -10800 0 BRT}
{590032800 -10800 0 BRT}
{-1767213964 -10800 0 -03}
{-1206957600 -7200 1 -02}
{-1191362400 -10800 0 -03}
{-1175374800 -7200 1 -02}
{-1159826400 -10800 0 -03}
{-633819600 -7200 1 -02}
{-622069200 -10800 0 -03}
{-602283600 -7200 1 -02}
{-591832800 -10800 0 -03}
{-570747600 -7200 1 -02}
{-560210400 -10800 0 -03}
{-539125200 -7200 1 -02}
{-531352800 -10800 0 -03}
{-191365200 -7200 1 -02}
{-184197600 -10800 0 -03}
{-155163600 -7200 1 -02}
{-150069600 -10800 0 -03}
{-128898000 -7200 1 -02}
{-121125600 -10800 0 -03}
{-99954000 -7200 1 -02}
{-89589600 -10800 0 -03}
{-68418000 -7200 1 -02}
{-57967200 -10800 0 -03}
{499748400 -7200 1 -02}
{511236000 -10800 0 -03}
{530593200 -7200 1 -02}
{540266400 -10800 0 -03}
{562129200 -7200 1 -02}
{571197600 -10800 0 -03}
{590032800 -10800 0 -03}
}
|
Changes to library/tzdata/America/Belize.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Belize) {
{-9223372036854775808 -21168 0 LMT}
{-1822500432 -21600 0 CST}
{-1616954400 -19800 1 CHDT}
{-1616954400 -19800 1 -0530}
{-1606069800 -21600 0 CST}
{-1585504800 -19800 1 CHDT}
{-1585504800 -19800 1 -0530}
{-1574015400 -21600 0 CST}
{-1554055200 -19800 1 CHDT}
{-1554055200 -19800 1 -0530}
{-1542565800 -21600 0 CST}
{-1522605600 -19800 1 CHDT}
{-1522605600 -19800 1 -0530}
{-1511116200 -21600 0 CST}
{-1490551200 -19800 1 CHDT}
{-1490551200 -19800 1 -0530}
{-1479666600 -21600 0 CST}
{-1459101600 -19800 1 CHDT}
{-1459101600 -19800 1 -0530}
{-1448217000 -21600 0 CST}
{-1427652000 -19800 1 CHDT}
{-1427652000 -19800 1 -0530}
{-1416162600 -21600 0 CST}
{-1396202400 -19800 1 CHDT}
{-1396202400 -19800 1 -0530}
{-1384713000 -21600 0 CST}
{-1364752800 -19800 1 CHDT}
{-1364752800 -19800 1 -0530}
{-1353263400 -21600 0 CST}
{-1333303200 -19800 1 CHDT}
{-1333303200 -19800 1 -0530}
{-1321813800 -21600 0 CST}
{-1301248800 -19800 1 CHDT}
{-1301248800 -19800 1 -0530}
{-1290364200 -21600 0 CST}
{-1269799200 -19800 1 CHDT}
{-1269799200 -19800 1 -0530}
{-1258914600 -21600 0 CST}
{-1238349600 -19800 1 CHDT}
{-1238349600 -19800 1 -0530}
{-1226860200 -21600 0 CST}
{-1206900000 -19800 1 CHDT}
{-1206900000 -19800 1 -0530}
{-1195410600 -21600 0 CST}
{-1175450400 -19800 1 CHDT}
{-1175450400 -19800 1 -0530}
{-1163961000 -21600 0 CST}
{-1143396000 -19800 1 CHDT}
{-1143396000 -19800 1 -0530}
{-1132511400 -21600 0 CST}
{-1111946400 -19800 1 CHDT}
{-1111946400 -19800 1 -0530}
{-1101061800 -21600 0 CST}
{-1080496800 -19800 1 CHDT}
{-1080496800 -19800 1 -0530}
{-1069612200 -21600 0 CST}
{-1049047200 -19800 1 CHDT}
{-1049047200 -19800 1 -0530}
{-1037557800 -21600 0 CST}
{-1017597600 -19800 1 CHDT}
{-1017597600 -19800 1 -0530}
{-1006108200 -21600 0 CST}
{-986148000 -19800 1 CHDT}
{-986148000 -19800 1 -0530}
{-974658600 -21600 0 CST}
{-954093600 -19800 1 CHDT}
{-954093600 -19800 1 -0530}
{-943209000 -21600 0 CST}
{-922644000 -19800 1 CHDT}
{-922644000 -19800 1 -0530}
{-911759400 -21600 0 CST}
{-891194400 -19800 1 CHDT}
{-891194400 -19800 1 -0530}
{-879705000 -21600 0 CST}
{-859744800 -19800 1 CHDT}
{-859744800 -19800 1 -0530}
{-848255400 -21600 0 CST}
{123919200 -18000 1 CDT}
{129618000 -21600 0 CST}
{409039200 -18000 1 CDT}
{413874000 -21600 0 CST}
}
|
Changes to library/tzdata/America/Boa_Vista.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Boa_Vista) {
{-9223372036854775808 -14560 0 LMT}
{-1767211040 -14400 0 AMT}
{-1206954000 -10800 1 AMST}
{-1191358800 -14400 0 AMT}
{-1175371200 -10800 1 AMST}
{-1159822800 -14400 0 AMT}
{-633816000 -10800 1 AMST}
{-622065600 -14400 0 AMT}
{-602280000 -10800 1 AMST}
{-591829200 -14400 0 AMT}
{-570744000 -10800 1 AMST}
{-560206800 -14400 0 AMT}
{-539121600 -10800 1 AMST}
{-531349200 -14400 0 AMT}
{-191361600 -10800 1 AMST}
{-184194000 -14400 0 AMT}
{-155160000 -10800 1 AMST}
{-150066000 -14400 0 AMT}
{-128894400 -10800 1 AMST}
{-121122000 -14400 0 AMT}
{-99950400 -10800 1 AMST}
{-89586000 -14400 0 AMT}
{-68414400 -10800 1 AMST}
{-57963600 -14400 0 AMT}
{499752000 -10800 1 AMST}
{511239600 -14400 0 AMT}
{530596800 -10800 1 AMST}
{540270000 -14400 0 AMT}
{562132800 -10800 1 AMST}
{571201200 -14400 0 AMT}
{590036400 -14400 0 AMT}
{938664000 -14400 0 AMT}
{938923200 -10800 1 AMST}
{951620400 -14400 0 AMT}
{970977600 -10800 1 AMST}
{971578800 -14400 0 AMT}
{-1767211040 -14400 0 -04}
{-1206954000 -10800 1 -03}
{-1191358800 -14400 0 -04}
{-1175371200 -10800 1 -03}
{-1159822800 -14400 0 -04}
{-633816000 -10800 1 -03}
{-622065600 -14400 0 -04}
{-602280000 -10800 1 -03}
{-591829200 -14400 0 -04}
{-570744000 -10800 1 -03}
{-560206800 -14400 0 -04}
{-539121600 -10800 1 -03}
{-531349200 -14400 0 -04}
{-191361600 -10800 1 -03}
{-184194000 -14400 0 -04}
{-155160000 -10800 1 -03}
{-150066000 -14400 0 -04}
{-128894400 -10800 1 -03}
{-121122000 -14400 0 -04}
{-99950400 -10800 1 -03}
{-89586000 -14400 0 -04}
{-68414400 -10800 1 -03}
{-57963600 -14400 0 -04}
{499752000 -10800 1 -03}
{511239600 -14400 0 -04}
{530596800 -10800 1 -03}
{540270000 -14400 0 -04}
{562132800 -10800 1 -03}
{571201200 -14400 0 -04}
{590036400 -14400 0 -04}
{938664000 -14400 0 -04}
{938923200 -10800 1 -03}
{951620400 -14400 0 -04}
{970977600 -10800 1 -03}
{971578800 -14400 0 -04}
}
|
Changes to library/tzdata/America/Bogota.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
|
-
-
-
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Bogota) {
{-9223372036854775808 -17776 0 LMT}
{-2707671824 -17776 0 BMT}
{-1739041424 -18000 0 COT}
{704869200 -14400 1 COST}
{733896000 -18000 0 COT}
{-1739041424 -18000 0 -05}
{704869200 -14400 1 -04}
{733896000 -18000 0 -05}
}
|
Changes to library/tzdata/America/Campo_Grande.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Campo_Grande) {
{-9223372036854775808 -13108 0 LMT}
{-1767212492 -14400 0 AMT}
{-1206954000 -10800 1 AMST}
{-1191358800 -14400 0 AMT}
{-1175371200 -10800 1 AMST}
{-1159822800 -14400 0 AMT}
{-633816000 -10800 1 AMST}
{-622065600 -14400 0 AMT}
{-602280000 -10800 1 AMST}
{-591829200 -14400 0 AMT}
{-570744000 -10800 1 AMST}
{-560206800 -14400 0 AMT}
{-539121600 -10800 1 AMST}
{-531349200 -14400 0 AMT}
{-191361600 -10800 1 AMST}
{-184194000 -14400 0 AMT}
{-155160000 -10800 1 AMST}
{-150066000 -14400 0 AMT}
{-128894400 -10800 1 AMST}
{-121122000 -14400 0 AMT}
{-99950400 -10800 1 AMST}
{-89586000 -14400 0 AMT}
{-68414400 -10800 1 AMST}
{-57963600 -14400 0 AMT}
{499752000 -10800 1 AMST}
{511239600 -14400 0 AMT}
{530596800 -10800 1 AMST}
{540270000 -14400 0 AMT}
{562132800 -10800 1 AMST}
{571201200 -14400 0 AMT}
{592977600 -10800 1 AMST}
{602046000 -14400 0 AMT}
{624427200 -10800 1 AMST}
{634705200 -14400 0 AMT}
{656481600 -10800 1 AMST}
{666759600 -14400 0 AMT}
{687931200 -10800 1 AMST}
{697604400 -14400 0 AMT}
{719985600 -10800 1 AMST}
{728449200 -14400 0 AMT}
{750830400 -10800 1 AMST}
{761713200 -14400 0 AMT}
{782280000 -10800 1 AMST}
{793162800 -14400 0 AMT}
{813729600 -10800 1 AMST}
{824007600 -14400 0 AMT}
{844574400 -10800 1 AMST}
{856062000 -14400 0 AMT}
{876110400 -10800 1 AMST}
{888721200 -14400 0 AMT}
{908078400 -10800 1 AMST}
{919566000 -14400 0 AMT}
{938923200 -10800 1 AMST}
{951620400 -14400 0 AMT}
{970977600 -10800 1 AMST}
{982465200 -14400 0 AMT}
{1003032000 -10800 1 AMST}
{1013914800 -14400 0 AMT}
{1036296000 -10800 1 AMST}
{1045364400 -14400 0 AMT}
{1066536000 -10800 1 AMST}
{1076814000 -14400 0 AMT}
{1099368000 -10800 1 AMST}
{1108868400 -14400 0 AMT}
{1129435200 -10800 1 AMST}
{1140318000 -14400 0 AMT}
{1162699200 -10800 1 AMST}
{1172372400 -14400 0 AMT}
{1192334400 -10800 1 AMST}
{1203217200 -14400 0 AMT}
{1224388800 -10800 1 AMST}
{1234666800 -14400 0 AMT}
{1255838400 -10800 1 AMST}
{1266721200 -14400 0 AMT}
{1287288000 -10800 1 AMST}
{1298170800 -14400 0 AMT}
{1318737600 -10800 1 AMST}
{1330225200 -14400 0 AMT}
{1350792000 -10800 1 AMST}
{1361070000 -14400 0 AMT}
{1382241600 -10800 1 AMST}
{1392519600 -14400 0 AMT}
{1413691200 -10800 1 AMST}
{1424574000 -14400 0 AMT}
{1445140800 -10800 1 AMST}
{1456023600 -14400 0 AMT}
{1476590400 -10800 1 AMST}
{1487473200 -14400 0 AMT}
{1508040000 -10800 1 AMST}
{1518922800 -14400 0 AMT}
{1540094400 -10800 1 AMST}
{1550372400 -14400 0 AMT}
{1571544000 -10800 1 AMST}
{1581822000 -14400 0 AMT}
{1602993600 -10800 1 AMST}
{1613876400 -14400 0 AMT}
{1634443200 -10800 1 AMST}
{1645326000 -14400 0 AMT}
{1665892800 -10800 1 AMST}
{1677380400 -14400 0 AMT}
{1697342400 -10800 1 AMST}
{1708225200 -14400 0 AMT}
{1729396800 -10800 1 AMST}
{1739674800 -14400 0 AMT}
{1760846400 -10800 1 AMST}
{1771729200 -14400 0 AMT}
{1792296000 -10800 1 AMST}
{1803178800 -14400 0 AMT}
{1823745600 -10800 1 AMST}
{1834628400 -14400 0 AMT}
{1855195200 -10800 1 AMST}
{1866078000 -14400 0 AMT}
{1887249600 -10800 1 AMST}
{1897527600 -14400 0 AMT}
{1918699200 -10800 1 AMST}
{1928977200 -14400 0 AMT}
{1950148800 -10800 1 AMST}
{1960426800 -14400 0 AMT}
{1981598400 -10800 1 AMST}
{1992481200 -14400 0 AMT}
{2013048000 -10800 1 AMST}
{2024535600 -14400 0 AMT}
{2044497600 -10800 1 AMST}
{2055380400 -14400 0 AMT}
{2076552000 -10800 1 AMST}
{2086830000 -14400 0 AMT}
{2108001600 -10800 1 AMST}
{2118884400 -14400 0 AMT}
{2139451200 -10800 1 AMST}
{2150334000 -14400 0 AMT}
{2170900800 -10800 1 AMST}
{2181783600 -14400 0 AMT}
{2202350400 -10800 1 AMST}
{2213233200 -14400 0 AMT}
{2234404800 -10800 1 AMST}
{2244682800 -14400 0 AMT}
{2265854400 -10800 1 AMST}
{2276132400 -14400 0 AMT}
{2297304000 -10800 1 AMST}
{2307582000 -14400 0 AMT}
{2328753600 -10800 1 AMST}
{2339636400 -14400 0 AMT}
{2360203200 -10800 1 AMST}
{2371086000 -14400 0 AMT}
{2391652800 -10800 1 AMST}
{2402535600 -14400 0 AMT}
{2423707200 -10800 1 AMST}
{2433985200 -14400 0 AMT}
{2455156800 -10800 1 AMST}
{2465434800 -14400 0 AMT}
{2486606400 -10800 1 AMST}
{2497489200 -14400 0 AMT}
{2518056000 -10800 1 AMST}
{2528938800 -14400 0 AMT}
{2549505600 -10800 1 AMST}
{2560388400 -14400 0 AMT}
{2580955200 -10800 1 AMST}
{2591838000 -14400 0 AMT}
{2613009600 -10800 1 AMST}
{2623287600 -14400 0 AMT}
{2644459200 -10800 1 AMST}
{2654737200 -14400 0 AMT}
{2675908800 -10800 1 AMST}
{2686791600 -14400 0 AMT}
{2707358400 -10800 1 AMST}
{2718241200 -14400 0 AMT}
{2738808000 -10800 1 AMST}
{2749690800 -14400 0 AMT}
{2770862400 -10800 1 AMST}
{2781140400 -14400 0 AMT}
{2802312000 -10800 1 AMST}
{2812590000 -14400 0 AMT}
{2833761600 -10800 1 AMST}
{2844039600 -14400 0 AMT}
{2865211200 -10800 1 AMST}
{2876094000 -14400 0 AMT}
{2896660800 -10800 1 AMST}
{2907543600 -14400 0 AMT}
{2928110400 -10800 1 AMST}
{2938993200 -14400 0 AMT}
{2960164800 -10800 1 AMST}
{2970442800 -14400 0 AMT}
{2991614400 -10800 1 AMST}
{3001892400 -14400 0 AMT}
{3023064000 -10800 1 AMST}
{3033946800 -14400 0 AMT}
{3054513600 -10800 1 AMST}
{3065396400 -14400 0 AMT}
{3085963200 -10800 1 AMST}
{3096846000 -14400 0 AMT}
{3118017600 -10800 1 AMST}
{3128295600 -14400 0 AMT}
{3149467200 -10800 1 AMST}
{3159745200 -14400 0 AMT}
{3180916800 -10800 1 AMST}
{3191194800 -14400 0 AMT}
{3212366400 -10800 1 AMST}
{3223249200 -14400 0 AMT}
{3243816000 -10800 1 AMST}
{3254698800 -14400 0 AMT}
{3275265600 -10800 1 AMST}
{3286148400 -14400 0 AMT}
{3307320000 -10800 1 AMST}
{3317598000 -14400 0 AMT}
{3338769600 -10800 1 AMST}
{3349047600 -14400 0 AMT}
{3370219200 -10800 1 AMST}
{3381102000 -14400 0 AMT}
{3401668800 -10800 1 AMST}
{3412551600 -14400 0 AMT}
{3433118400 -10800 1 AMST}
{3444001200 -14400 0 AMT}
{3464568000 -10800 1 AMST}
{3475450800 -14400 0 AMT}
{3496622400 -10800 1 AMST}
{3506900400 -14400 0 AMT}
{3528072000 -10800 1 AMST}
{3538350000 -14400 0 AMT}
{3559521600 -10800 1 AMST}
{3570404400 -14400 0 AMT}
{3590971200 -10800 1 AMST}
{3601854000 -14400 0 AMT}
{3622420800 -10800 1 AMST}
{3633303600 -14400 0 AMT}
{3654475200 -10800 1 AMST}
{3664753200 -14400 0 AMT}
{3685924800 -10800 1 AMST}
{3696202800 -14400 0 AMT}
{3717374400 -10800 1 AMST}
{3727652400 -14400 0 AMT}
{3748824000 -10800 1 AMST}
{3759706800 -14400 0 AMT}
{3780273600 -10800 1 AMST}
{3791156400 -14400 0 AMT}
{3811723200 -10800 1 AMST}
{3822606000 -14400 0 AMT}
{3843777600 -10800 1 AMST}
{3854055600 -14400 0 AMT}
{3875227200 -10800 1 AMST}
{3885505200 -14400 0 AMT}
{3906676800 -10800 1 AMST}
{3917559600 -14400 0 AMT}
{3938126400 -10800 1 AMST}
{3949009200 -14400 0 AMT}
{3969576000 -10800 1 AMST}
{3980458800 -14400 0 AMT}
{4001630400 -10800 1 AMST}
{4011908400 -14400 0 AMT}
{4033080000 -10800 1 AMST}
{4043358000 -14400 0 AMT}
{4064529600 -10800 1 AMST}
{4074807600 -14400 0 AMT}
{4095979200 -10800 1 AMST}
{-1767212492 -14400 0 -04}
{-1206954000 -10800 1 -03}
{-1191358800 -14400 0 -04}
{-1175371200 -10800 1 -03}
{-1159822800 -14400 0 -04}
{-633816000 -10800 1 -03}
{-622065600 -14400 0 -04}
{-602280000 -10800 1 -03}
{-591829200 -14400 0 -04}
{-570744000 -10800 1 -03}
{-560206800 -14400 0 -04}
{-539121600 -10800 1 -03}
{-531349200 -14400 0 -04}
{-191361600 -10800 1 -03}
{-184194000 -14400 0 -04}
{-155160000 -10800 1 -03}
{-150066000 -14400 0 -04}
{-128894400 -10800 1 -03}
{-121122000 -14400 0 -04}
{-99950400 -10800 1 -03}
{-89586000 -14400 0 -04}
{-68414400 -10800 1 -03}
{-57963600 -14400 0 -04}
{499752000 -10800 1 -03}
{511239600 -14400 0 -04}
{530596800 -10800 1 -03}
{540270000 -14400 0 -04}
{562132800 -10800 1 -03}
{571201200 -14400 0 -04}
{592977600 -10800 1 -03}
{602046000 -14400 0 -04}
{624427200 -10800 1 -03}
{634705200 -14400 0 -04}
{656481600 -10800 1 -03}
{666759600 -14400 0 -04}
{687931200 -10800 1 -03}
{697604400 -14400 0 -04}
{719985600 -10800 1 -03}
{728449200 -14400 0 -04}
{750830400 -10800 1 -03}
{761713200 -14400 0 -04}
{782280000 -10800 1 -03}
{793162800 -14400 0 -04}
{813729600 -10800 1 -03}
{824007600 -14400 0 -04}
{844574400 -10800 1 -03}
{856062000 -14400 0 -04}
{876110400 -10800 1 -03}
{888721200 -14400 0 -04}
{908078400 -10800 1 -03}
{919566000 -14400 0 -04}
{938923200 -10800 1 -03}
{951620400 -14400 0 -04}
{970977600 -10800 1 -03}
{982465200 -14400 0 -04}
{1003032000 -10800 1 -03}
{1013914800 -14400 0 -04}
{1036296000 -10800 1 -03}
{1045364400 -14400 0 -04}
{1066536000 -10800 1 -03}
{1076814000 -14400 0 -04}
{1099368000 -10800 1 -03}
{1108868400 -14400 0 -04}
{1129435200 -10800 1 -03}
{1140318000 -14400 0 -04}
{1162699200 -10800 1 -03}
{1172372400 -14400 0 -04}
{1192334400 -10800 1 -03}
{1203217200 -14400 0 -04}
{1224388800 -10800 1 -03}
{1234666800 -14400 0 -04}
{1255838400 -10800 1 -03}
{1266721200 -14400 0 -04}
{1287288000 -10800 1 -03}
{1298170800 -14400 0 -04}
{1318737600 -10800 1 -03}
{1330225200 -14400 0 -04}
{1350792000 -10800 1 -03}
{1361070000 -14400 0 -04}
{1382241600 -10800 1 -03}
{1392519600 -14400 0 -04}
{1413691200 -10800 1 -03}
{1424574000 -14400 0 -04}
{1445140800 -10800 1 -03}
{1456023600 -14400 0 -04}
{1476590400 -10800 1 -03}
{1487473200 -14400 0 -04}
{1508040000 -10800 1 -03}
{1518922800 -14400 0 -04}
{1540094400 -10800 1 -03}
{1550372400 -14400 0 -04}
{1571544000 -10800 1 -03}
{1581822000 -14400 0 -04}
{1602993600 -10800 1 -03}
{1613876400 -14400 0 -04}
{1634443200 -10800 1 -03}
{1645326000 -14400 0 -04}
{1665892800 -10800 1 -03}
{1677380400 -14400 0 -04}
{1697342400 -10800 1 -03}
{1708225200 -14400 0 -04}
{1729396800 -10800 1 -03}
{1739674800 -14400 0 -04}
{1760846400 -10800 1 -03}
{1771729200 -14400 0 -04}
{1792296000 -10800 1 -03}
{1803178800 -14400 0 -04}
{1823745600 -10800 1 -03}
{1834628400 -14400 0 -04}
{1855195200 -10800 1 -03}
{1866078000 -14400 0 -04}
{1887249600 -10800 1 -03}
{1897527600 -14400 0 -04}
{1918699200 -10800 1 -03}
{1928977200 -14400 0 -04}
{1950148800 -10800 1 -03}
{1960426800 -14400 0 -04}
{1981598400 -10800 1 -03}
{1992481200 -14400 0 -04}
{2013048000 -10800 1 -03}
{2024535600 -14400 0 -04}
{2044497600 -10800 1 -03}
{2055380400 -14400 0 -04}
{2076552000 -10800 1 -03}
{2086830000 -14400 0 -04}
{2108001600 -10800 1 -03}
{2118884400 -14400 0 -04}
{2139451200 -10800 1 -03}
{2150334000 -14400 0 -04}
{2170900800 -10800 1 -03}
{2181783600 -14400 0 -04}
{2202350400 -10800 1 -03}
{2213233200 -14400 0 -04}
{2234404800 -10800 1 -03}
{2244682800 -14400 0 -04}
{2265854400 -10800 1 -03}
{2276132400 -14400 0 -04}
{2297304000 -10800 1 -03}
{2307582000 -14400 0 -04}
{2328753600 -10800 1 -03}
{2339636400 -14400 0 -04}
{2360203200 -10800 1 -03}
{2371086000 -14400 0 -04}
{2391652800 -10800 1 -03}
{2402535600 -14400 0 -04}
{2423707200 -10800 1 -03}
{2433985200 -14400 0 -04}
{2455156800 -10800 1 -03}
{2465434800 -14400 0 -04}
{2486606400 -10800 1 -03}
{2497489200 -14400 0 -04}
{2518056000 -10800 1 -03}
{2528938800 -14400 0 -04}
{2549505600 -10800 1 -03}
{2560388400 -14400 0 -04}
{2580955200 -10800 1 -03}
{2591838000 -14400 0 -04}
{2613009600 -10800 1 -03}
{2623287600 -14400 0 -04}
{2644459200 -10800 1 -03}
{2654737200 -14400 0 -04}
{2675908800 -10800 1 -03}
{2686791600 -14400 0 -04}
{2707358400 -10800 1 -03}
{2718241200 -14400 0 -04}
{2738808000 -10800 1 -03}
{2749690800 -14400 0 -04}
{2770862400 -10800 1 -03}
{2781140400 -14400 0 -04}
{2802312000 -10800 1 -03}
{2812590000 -14400 0 -04}
{2833761600 -10800 1 -03}
{2844039600 -14400 0 -04}
{2865211200 -10800 1 -03}
{2876094000 -14400 0 -04}
{2896660800 -10800 1 -03}
{2907543600 -14400 0 -04}
{2928110400 -10800 1 -03}
{2938993200 -14400 0 -04}
{2960164800 -10800 1 -03}
{2970442800 -14400 0 -04}
{2991614400 -10800 1 -03}
{3001892400 -14400 0 -04}
{3023064000 -10800 1 -03}
{3033946800 -14400 0 -04}
{3054513600 -10800 1 -03}
{3065396400 -14400 0 -04}
{3085963200 -10800 1 -03}
{3096846000 -14400 0 -04}
{3118017600 -10800 1 -03}
{3128295600 -14400 0 -04}
{3149467200 -10800 1 -03}
{3159745200 -14400 0 -04}
{3180916800 -10800 1 -03}
{3191194800 -14400 0 -04}
{3212366400 -10800 1 -03}
{3223249200 -14400 0 -04}
{3243816000 -10800 1 -03}
{3254698800 -14400 0 -04}
{3275265600 -10800 1 -03}
{3286148400 -14400 0 -04}
{3307320000 -10800 1 -03}
{3317598000 -14400 0 -04}
{3338769600 -10800 1 -03}
{3349047600 -14400 0 -04}
{3370219200 -10800 1 -03}
{3381102000 -14400 0 -04}
{3401668800 -10800 1 -03}
{3412551600 -14400 0 -04}
{3433118400 -10800 1 -03}
{3444001200 -14400 0 -04}
{3464568000 -10800 1 -03}
{3475450800 -14400 0 -04}
{3496622400 -10800 1 -03}
{3506900400 -14400 0 -04}
{3528072000 -10800 1 -03}
{3538350000 -14400 0 -04}
{3559521600 -10800 1 -03}
{3570404400 -14400 0 -04}
{3590971200 -10800 1 -03}
{3601854000 -14400 0 -04}
{3622420800 -10800 1 -03}
{3633303600 -14400 0 -04}
{3654475200 -10800 1 -03}
{3664753200 -14400 0 -04}
{3685924800 -10800 1 -03}
{3696202800 -14400 0 -04}
{3717374400 -10800 1 -03}
{3727652400 -14400 0 -04}
{3748824000 -10800 1 -03}
{3759706800 -14400 0 -04}
{3780273600 -10800 1 -03}
{3791156400 -14400 0 -04}
{3811723200 -10800 1 -03}
{3822606000 -14400 0 -04}
{3843777600 -10800 1 -03}
{3854055600 -14400 0 -04}
{3875227200 -10800 1 -03}
{3885505200 -14400 0 -04}
{3906676800 -10800 1 -03}
{3917559600 -14400 0 -04}
{3938126400 -10800 1 -03}
{3949009200 -14400 0 -04}
{3969576000 -10800 1 -03}
{3980458800 -14400 0 -04}
{4001630400 -10800 1 -03}
{4011908400 -14400 0 -04}
{4033080000 -10800 1 -03}
{4043358000 -14400 0 -04}
{4064529600 -10800 1 -03}
{4074807600 -14400 0 -04}
{4095979200 -10800 1 -03}
}
|
Changes to library/tzdata/America/Caracas.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
-
-
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Caracas) {
{-9223372036854775808 -16064 0 LMT}
{-2524505536 -16060 0 CMT}
{-1826739140 -16200 0 VET}
{-157750200 -14400 0 VET}
{1197183600 -16200 0 VET}
{1462086000 -14400 0 VET}
{-1826739140 -16200 0 -0430}
{-157750200 -14400 0 -04}
{1197183600 -16200 0 -0430}
{1462086000 -14400 0 -04}
}
|
Changes to library/tzdata/America/Cayenne.
1
2
3
4
5
6
7
|
1
2
3
4
5
6
7
|
-
-
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Cayenne) {
{-9223372036854775808 -12560 0 LMT}
{-1846269040 -14400 0 GFT}
{-71092800 -10800 0 GFT}
{-1846269040 -14400 0 -04}
{-71092800 -10800 0 -03}
}
|
Changes to library/tzdata/America/Cuiaba.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Cuiaba) {
{-9223372036854775808 -13460 0 LMT}
{-1767212140 -14400 0 AMT}
{-1206954000 -10800 1 AMST}
{-1191358800 -14400 0 AMT}
{-1175371200 -10800 1 AMST}
{-1159822800 -14400 0 AMT}
{-633816000 -10800 1 AMST}
{-622065600 -14400 0 AMT}
{-602280000 -10800 1 AMST}
{-591829200 -14400 0 AMT}
{-570744000 -10800 1 AMST}
{-560206800 -14400 0 AMT}
{-539121600 -10800 1 AMST}
{-531349200 -14400 0 AMT}
{-191361600 -10800 1 AMST}
{-184194000 -14400 0 AMT}
{-155160000 -10800 1 AMST}
{-150066000 -14400 0 AMT}
{-128894400 -10800 1 AMST}
{-121122000 -14400 0 AMT}
{-99950400 -10800 1 AMST}
{-89586000 -14400 0 AMT}
{-68414400 -10800 1 AMST}
{-57963600 -14400 0 AMT}
{499752000 -10800 1 AMST}
{511239600 -14400 0 AMT}
{530596800 -10800 1 AMST}
{540270000 -14400 0 AMT}
{562132800 -10800 1 AMST}
{571201200 -14400 0 AMT}
{592977600 -10800 1 AMST}
{602046000 -14400 0 AMT}
{624427200 -10800 1 AMST}
{634705200 -14400 0 AMT}
{656481600 -10800 1 AMST}
{666759600 -14400 0 AMT}
{687931200 -10800 1 AMST}
{697604400 -14400 0 AMT}
{719985600 -10800 1 AMST}
{728449200 -14400 0 AMT}
{750830400 -10800 1 AMST}
{761713200 -14400 0 AMT}
{782280000 -10800 1 AMST}
{793162800 -14400 0 AMT}
{813729600 -10800 1 AMST}
{824007600 -14400 0 AMT}
{844574400 -10800 1 AMST}
{856062000 -14400 0 AMT}
{876110400 -10800 1 AMST}
{888721200 -14400 0 AMT}
{908078400 -10800 1 AMST}
{919566000 -14400 0 AMT}
{938923200 -10800 1 AMST}
{951620400 -14400 0 AMT}
{970977600 -10800 1 AMST}
{982465200 -14400 0 AMT}
{1003032000 -10800 1 AMST}
{1013914800 -14400 0 AMT}
{1036296000 -10800 1 AMST}
{1045364400 -14400 0 AMT}
{1064372400 -14400 0 AMT}
{1096603200 -14400 0 AMT}
{1099368000 -10800 1 AMST}
{1108868400 -14400 0 AMT}
{1129435200 -10800 1 AMST}
{1140318000 -14400 0 AMT}
{1162699200 -10800 1 AMST}
{1172372400 -14400 0 AMT}
{1192334400 -10800 1 AMST}
{1203217200 -14400 0 AMT}
{1224388800 -10800 1 AMST}
{1234666800 -14400 0 AMT}
{1255838400 -10800 1 AMST}
{1266721200 -14400 0 AMT}
{1287288000 -10800 1 AMST}
{1298170800 -14400 0 AMT}
{1318737600 -10800 1 AMST}
{1330225200 -14400 0 AMT}
{1350792000 -10800 1 AMST}
{1361070000 -14400 0 AMT}
{1382241600 -10800 1 AMST}
{1392519600 -14400 0 AMT}
{1413691200 -10800 1 AMST}
{1424574000 -14400 0 AMT}
{1445140800 -10800 1 AMST}
{1456023600 -14400 0 AMT}
{1476590400 -10800 1 AMST}
{1487473200 -14400 0 AMT}
{1508040000 -10800 1 AMST}
{1518922800 -14400 0 AMT}
{1540094400 -10800 1 AMST}
{1550372400 -14400 0 AMT}
{1571544000 -10800 1 AMST}
{1581822000 -14400 0 AMT}
{1602993600 -10800 1 AMST}
{1613876400 -14400 0 AMT}
{1634443200 -10800 1 AMST}
{1645326000 -14400 0 AMT}
{1665892800 -10800 1 AMST}
{1677380400 -14400 0 AMT}
{1697342400 -10800 1 AMST}
{1708225200 -14400 0 AMT}
{1729396800 -10800 1 AMST}
{1739674800 -14400 0 AMT}
{1760846400 -10800 1 AMST}
{1771729200 -14400 0 AMT}
{1792296000 -10800 1 AMST}
{1803178800 -14400 0 AMT}
{1823745600 -10800 1 AMST}
{1834628400 -14400 0 AMT}
{1855195200 -10800 1 AMST}
{1866078000 -14400 0 AMT}
{1887249600 -10800 1 AMST}
{1897527600 -14400 0 AMT}
{1918699200 -10800 1 AMST}
{1928977200 -14400 0 AMT}
{1950148800 -10800 1 AMST}
{1960426800 -14400 0 AMT}
{1981598400 -10800 1 AMST}
{1992481200 -14400 0 AMT}
{2013048000 -10800 1 AMST}
{2024535600 -14400 0 AMT}
{2044497600 -10800 1 AMST}
{2055380400 -14400 0 AMT}
{2076552000 -10800 1 AMST}
{2086830000 -14400 0 AMT}
{2108001600 -10800 1 AMST}
{2118884400 -14400 0 AMT}
{2139451200 -10800 1 AMST}
{2150334000 -14400 0 AMT}
{2170900800 -10800 1 AMST}
{2181783600 -14400 0 AMT}
{2202350400 -10800 1 AMST}
{2213233200 -14400 0 AMT}
{2234404800 -10800 1 AMST}
{2244682800 -14400 0 AMT}
{2265854400 -10800 1 AMST}
{2276132400 -14400 0 AMT}
{2297304000 -10800 1 AMST}
{2307582000 -14400 0 AMT}
{2328753600 -10800 1 AMST}
{2339636400 -14400 0 AMT}
{2360203200 -10800 1 AMST}
{2371086000 -14400 0 AMT}
{2391652800 -10800 1 AMST}
{2402535600 -14400 0 AMT}
{2423707200 -10800 1 AMST}
{2433985200 -14400 0 AMT}
{2455156800 -10800 1 AMST}
{2465434800 -14400 0 AMT}
{2486606400 -10800 1 AMST}
{2497489200 -14400 0 AMT}
{2518056000 -10800 1 AMST}
{2528938800 -14400 0 AMT}
{2549505600 -10800 1 AMST}
{2560388400 -14400 0 AMT}
{2580955200 -10800 1 AMST}
{2591838000 -14400 0 AMT}
{2613009600 -10800 1 AMST}
{2623287600 -14400 0 AMT}
{2644459200 -10800 1 AMST}
{2654737200 -14400 0 AMT}
{2675908800 -10800 1 AMST}
{2686791600 -14400 0 AMT}
{2707358400 -10800 1 AMST}
{2718241200 -14400 0 AMT}
{2738808000 -10800 1 AMST}
{2749690800 -14400 0 AMT}
{2770862400 -10800 1 AMST}
{2781140400 -14400 0 AMT}
{2802312000 -10800 1 AMST}
{2812590000 -14400 0 AMT}
{2833761600 -10800 1 AMST}
{2844039600 -14400 0 AMT}
{2865211200 -10800 1 AMST}
{2876094000 -14400 0 AMT}
{2896660800 -10800 1 AMST}
{2907543600 -14400 0 AMT}
{2928110400 -10800 1 AMST}
{2938993200 -14400 0 AMT}
{2960164800 -10800 1 AMST}
{2970442800 -14400 0 AMT}
{2991614400 -10800 1 AMST}
{3001892400 -14400 0 AMT}
{3023064000 -10800 1 AMST}
{3033946800 -14400 0 AMT}
{3054513600 -10800 1 AMST}
{3065396400 -14400 0 AMT}
{3085963200 -10800 1 AMST}
{3096846000 -14400 0 AMT}
{3118017600 -10800 1 AMST}
{3128295600 -14400 0 AMT}
{3149467200 -10800 1 AMST}
{3159745200 -14400 0 AMT}
{3180916800 -10800 1 AMST}
{3191194800 -14400 0 AMT}
{3212366400 -10800 1 AMST}
{3223249200 -14400 0 AMT}
{3243816000 -10800 1 AMST}
{3254698800 -14400 0 AMT}
{3275265600 -10800 1 AMST}
{3286148400 -14400 0 AMT}
{3307320000 -10800 1 AMST}
{3317598000 -14400 0 AMT}
{3338769600 -10800 1 AMST}
{3349047600 -14400 0 AMT}
{3370219200 -10800 1 AMST}
{3381102000 -14400 0 AMT}
{3401668800 -10800 1 AMST}
{3412551600 -14400 0 AMT}
{3433118400 -10800 1 AMST}
{3444001200 -14400 0 AMT}
{3464568000 -10800 1 AMST}
{3475450800 -14400 0 AMT}
{3496622400 -10800 1 AMST}
{3506900400 -14400 0 AMT}
{3528072000 -10800 1 AMST}
{3538350000 -14400 0 AMT}
{3559521600 -10800 1 AMST}
{3570404400 -14400 0 AMT}
{3590971200 -10800 1 AMST}
{3601854000 -14400 0 AMT}
{3622420800 -10800 1 AMST}
{3633303600 -14400 0 AMT}
{3654475200 -10800 1 AMST}
{3664753200 -14400 0 AMT}
{3685924800 -10800 1 AMST}
{3696202800 -14400 0 AMT}
{3717374400 -10800 1 AMST}
{3727652400 -14400 0 AMT}
{3748824000 -10800 1 AMST}
{3759706800 -14400 0 AMT}
{3780273600 -10800 1 AMST}
{3791156400 -14400 0 AMT}
{3811723200 -10800 1 AMST}
{3822606000 -14400 0 AMT}
{3843777600 -10800 1 AMST}
{3854055600 -14400 0 AMT}
{3875227200 -10800 1 AMST}
{3885505200 -14400 0 AMT}
{3906676800 -10800 1 AMST}
{3917559600 -14400 0 AMT}
{3938126400 -10800 1 AMST}
{3949009200 -14400 0 AMT}
{3969576000 -10800 1 AMST}
{3980458800 -14400 0 AMT}
{4001630400 -10800 1 AMST}
{4011908400 -14400 0 AMT}
{4033080000 -10800 1 AMST}
{4043358000 -14400 0 AMT}
{4064529600 -10800 1 AMST}
{4074807600 -14400 0 AMT}
{4095979200 -10800 1 AMST}
{-1767212140 -14400 0 -04}
{-1206954000 -10800 1 -03}
{-1191358800 -14400 0 -04}
{-1175371200 -10800 1 -03}
{-1159822800 -14400 0 -04}
{-633816000 -10800 1 -03}
{-622065600 -14400 0 -04}
{-602280000 -10800 1 -03}
{-591829200 -14400 0 -04}
{-570744000 -10800 1 -03}
{-560206800 -14400 0 -04}
{-539121600 -10800 1 -03}
{-531349200 -14400 0 -04}
{-191361600 -10800 1 -03}
{-184194000 -14400 0 -04}
{-155160000 -10800 1 -03}
{-150066000 -14400 0 -04}
{-128894400 -10800 1 -03}
{-121122000 -14400 0 -04}
{-99950400 -10800 1 -03}
{-89586000 -14400 0 -04}
{-68414400 -10800 1 -03}
{-57963600 -14400 0 -04}
{499752000 -10800 1 -03}
{511239600 -14400 0 -04}
{530596800 -10800 1 -03}
{540270000 -14400 0 -04}
{562132800 -10800 1 -03}
{571201200 -14400 0 -04}
{592977600 -10800 1 -03}
{602046000 -14400 0 -04}
{624427200 -10800 1 -03}
{634705200 -14400 0 -04}
{656481600 -10800 1 -03}
{666759600 -14400 0 -04}
{687931200 -10800 1 -03}
{697604400 -14400 0 -04}
{719985600 -10800 1 -03}
{728449200 -14400 0 -04}
{750830400 -10800 1 -03}
{761713200 -14400 0 -04}
{782280000 -10800 1 -03}
{793162800 -14400 0 -04}
{813729600 -10800 1 -03}
{824007600 -14400 0 -04}
{844574400 -10800 1 -03}
{856062000 -14400 0 -04}
{876110400 -10800 1 -03}
{888721200 -14400 0 -04}
{908078400 -10800 1 -03}
{919566000 -14400 0 -04}
{938923200 -10800 1 -03}
{951620400 -14400 0 -04}
{970977600 -10800 1 -03}
{982465200 -14400 0 -04}
{1003032000 -10800 1 -03}
{1013914800 -14400 0 -04}
{1036296000 -10800 1 -03}
{1045364400 -14400 0 -04}
{1064372400 -14400 0 -04}
{1096603200 -14400 0 -04}
{1099368000 -10800 1 -03}
{1108868400 -14400 0 -04}
{1129435200 -10800 1 -03}
{1140318000 -14400 0 -04}
{1162699200 -10800 1 -03}
{1172372400 -14400 0 -04}
{1192334400 -10800 1 -03}
{1203217200 -14400 0 -04}
{1224388800 -10800 1 -03}
{1234666800 -14400 0 -04}
{1255838400 -10800 1 -03}
{1266721200 -14400 0 -04}
{1287288000 -10800 1 -03}
{1298170800 -14400 0 -04}
{1318737600 -10800 1 -03}
{1330225200 -14400 0 -04}
{1350792000 -10800 1 -03}
{1361070000 -14400 0 -04}
{1382241600 -10800 1 -03}
{1392519600 -14400 0 -04}
{1413691200 -10800 1 -03}
{1424574000 -14400 0 -04}
{1445140800 -10800 1 -03}
{1456023600 -14400 0 -04}
{1476590400 -10800 1 -03}
{1487473200 -14400 0 -04}
{1508040000 -10800 1 -03}
{1518922800 -14400 0 -04}
{1540094400 -10800 1 -03}
{1550372400 -14400 0 -04}
{1571544000 -10800 1 -03}
{1581822000 -14400 0 -04}
{1602993600 -10800 1 -03}
{1613876400 -14400 0 -04}
{1634443200 -10800 1 -03}
{1645326000 -14400 0 -04}
{1665892800 -10800 1 -03}
{1677380400 -14400 0 -04}
{1697342400 -10800 1 -03}
{1708225200 -14400 0 -04}
{1729396800 -10800 1 -03}
{1739674800 -14400 0 -04}
{1760846400 -10800 1 -03}
{1771729200 -14400 0 -04}
{1792296000 -10800 1 -03}
{1803178800 -14400 0 -04}
{1823745600 -10800 1 -03}
{1834628400 -14400 0 -04}
{1855195200 -10800 1 -03}
{1866078000 -14400 0 -04}
{1887249600 -10800 1 -03}
{1897527600 -14400 0 -04}
{1918699200 -10800 1 -03}
{1928977200 -14400 0 -04}
{1950148800 -10800 1 -03}
{1960426800 -14400 0 -04}
{1981598400 -10800 1 -03}
{1992481200 -14400 0 -04}
{2013048000 -10800 1 -03}
{2024535600 -14400 0 -04}
{2044497600 -10800 1 -03}
{2055380400 -14400 0 -04}
{2076552000 -10800 1 -03}
{2086830000 -14400 0 -04}
{2108001600 -10800 1 -03}
{2118884400 -14400 0 -04}
{2139451200 -10800 1 -03}
{2150334000 -14400 0 -04}
{2170900800 -10800 1 -03}
{2181783600 -14400 0 -04}
{2202350400 -10800 1 -03}
{2213233200 -14400 0 -04}
{2234404800 -10800 1 -03}
{2244682800 -14400 0 -04}
{2265854400 -10800 1 -03}
{2276132400 -14400 0 -04}
{2297304000 -10800 1 -03}
{2307582000 -14400 0 -04}
{2328753600 -10800 1 -03}
{2339636400 -14400 0 -04}
{2360203200 -10800 1 -03}
{2371086000 -14400 0 -04}
{2391652800 -10800 1 -03}
{2402535600 -14400 0 -04}
{2423707200 -10800 1 -03}
{2433985200 -14400 0 -04}
{2455156800 -10800 1 -03}
{2465434800 -14400 0 -04}
{2486606400 -10800 1 -03}
{2497489200 -14400 0 -04}
{2518056000 -10800 1 -03}
{2528938800 -14400 0 -04}
{2549505600 -10800 1 -03}
{2560388400 -14400 0 -04}
{2580955200 -10800 1 -03}
{2591838000 -14400 0 -04}
{2613009600 -10800 1 -03}
{2623287600 -14400 0 -04}
{2644459200 -10800 1 -03}
{2654737200 -14400 0 -04}
{2675908800 -10800 1 -03}
{2686791600 -14400 0 -04}
{2707358400 -10800 1 -03}
{2718241200 -14400 0 -04}
{2738808000 -10800 1 -03}
{2749690800 -14400 0 -04}
{2770862400 -10800 1 -03}
{2781140400 -14400 0 -04}
{2802312000 -10800 1 -03}
{2812590000 -14400 0 -04}
{2833761600 -10800 1 -03}
{2844039600 -14400 0 -04}
{2865211200 -10800 1 -03}
{2876094000 -14400 0 -04}
{2896660800 -10800 1 -03}
{2907543600 -14400 0 -04}
{2928110400 -10800 1 -03}
{2938993200 -14400 0 -04}
{2960164800 -10800 1 -03}
{2970442800 -14400 0 -04}
{2991614400 -10800 1 -03}
{3001892400 -14400 0 -04}
{3023064000 -10800 1 -03}
{3033946800 -14400 0 -04}
{3054513600 -10800 1 -03}
{3065396400 -14400 0 -04}
{3085963200 -10800 1 -03}
{3096846000 -14400 0 -04}
{3118017600 -10800 1 -03}
{3128295600 -14400 0 -04}
{3149467200 -10800 1 -03}
{3159745200 -14400 0 -04}
{3180916800 -10800 1 -03}
{3191194800 -14400 0 -04}
{3212366400 -10800 1 -03}
{3223249200 -14400 0 -04}
{3243816000 -10800 1 -03}
{3254698800 -14400 0 -04}
{3275265600 -10800 1 -03}
{3286148400 -14400 0 -04}
{3307320000 -10800 1 -03}
{3317598000 -14400 0 -04}
{3338769600 -10800 1 -03}
{3349047600 -14400 0 -04}
{3370219200 -10800 1 -03}
{3381102000 -14400 0 -04}
{3401668800 -10800 1 -03}
{3412551600 -14400 0 -04}
{3433118400 -10800 1 -03}
{3444001200 -14400 0 -04}
{3464568000 -10800 1 -03}
{3475450800 -14400 0 -04}
{3496622400 -10800 1 -03}
{3506900400 -14400 0 -04}
{3528072000 -10800 1 -03}
{3538350000 -14400 0 -04}
{3559521600 -10800 1 -03}
{3570404400 -14400 0 -04}
{3590971200 -10800 1 -03}
{3601854000 -14400 0 -04}
{3622420800 -10800 1 -03}
{3633303600 -14400 0 -04}
{3654475200 -10800 1 -03}
{3664753200 -14400 0 -04}
{3685924800 -10800 1 -03}
{3696202800 -14400 0 -04}
{3717374400 -10800 1 -03}
{3727652400 -14400 0 -04}
{3748824000 -10800 1 -03}
{3759706800 -14400 0 -04}
{3780273600 -10800 1 -03}
{3791156400 -14400 0 -04}
{3811723200 -10800 1 -03}
{3822606000 -14400 0 -04}
{3843777600 -10800 1 -03}
{3854055600 -14400 0 -04}
{3875227200 -10800 1 -03}
{3885505200 -14400 0 -04}
{3906676800 -10800 1 -03}
{3917559600 -14400 0 -04}
{3938126400 -10800 1 -03}
{3949009200 -14400 0 -04}
{3969576000 -10800 1 -03}
{3980458800 -14400 0 -04}
{4001630400 -10800 1 -03}
{4011908400 -14400 0 -04}
{4033080000 -10800 1 -03}
{4043358000 -14400 0 -04}
{4064529600 -10800 1 -03}
{4074807600 -14400 0 -04}
{4095979200 -10800 1 -03}
}
|
Changes to library/tzdata/America/Curacao.
1
2
3
4
5
6
7
|
1
2
3
4
5
6
7
|
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Curacao) {
{-9223372036854775808 -16547 0 LMT}
{-1826738653 -16200 0 ANT}
{-1826738653 -16200 0 -0430}
{-157750200 -14400 0 AST}
}
|
Changes to library/tzdata/America/Danmarkshavn.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Danmarkshavn) {
{-9223372036854775808 -4480 0 LMT}
{-1686091520 -10800 0 WGT}
{323845200 -7200 0 WGST}
{338950800 -10800 0 WGT}
{354675600 -7200 1 WGST}
{370400400 -10800 0 WGT}
{386125200 -7200 1 WGST}
{401850000 -10800 0 WGT}
{417574800 -7200 1 WGST}
{433299600 -10800 0 WGT}
{449024400 -7200 1 WGST}
{465354000 -10800 0 WGT}
{481078800 -7200 1 WGST}
{496803600 -10800 0 WGT}
{512528400 -7200 1 WGST}
{528253200 -10800 0 WGT}
{543978000 -7200 1 WGST}
{559702800 -10800 0 WGT}
{575427600 -7200 1 WGST}
{591152400 -10800 0 WGT}
{606877200 -7200 1 WGST}
{622602000 -10800 0 WGT}
{638326800 -7200 1 WGST}
{654656400 -10800 0 WGT}
{670381200 -7200 1 WGST}
{686106000 -10800 0 WGT}
{701830800 -7200 1 WGST}
{717555600 -10800 0 WGT}
{733280400 -7200 1 WGST}
{749005200 -10800 0 WGT}
{764730000 -7200 1 WGST}
{780454800 -10800 0 WGT}
{796179600 -7200 1 WGST}
{811904400 -10800 0 WGT}
{-1686091520 -10800 0 -03}
{323845200 -7200 0 -02}
{338950800 -10800 0 -03}
{354675600 -7200 1 -02}
{370400400 -10800 0 -03}
{386125200 -7200 1 -02}
{401850000 -10800 0 -03}
{417574800 -7200 1 -02}
{433299600 -10800 0 -03}
{449024400 -7200 1 -02}
{465354000 -10800 0 -03}
{481078800 -7200 1 -02}
{496803600 -10800 0 -03}
{512528400 -7200 1 -02}
{528253200 -10800 0 -03}
{543978000 -7200 1 -02}
{559702800 -10800 0 -03}
{575427600 -7200 1 -02}
{591152400 -10800 0 -03}
{606877200 -7200 1 -02}
{622602000 -10800 0 -03}
{638326800 -7200 1 -02}
{654656400 -10800 0 -03}
{670381200 -7200 1 -02}
{686106000 -10800 0 -03}
{701830800 -7200 1 -02}
{717555600 -10800 0 -03}
{733280400 -7200 1 -02}
{749005200 -10800 0 -03}
{764730000 -7200 1 -02}
{780454800 -10800 0 -03}
{796179600 -7200 1 -02}
{811904400 -10800 0 -03}
{820465200 0 0 GMT}
}
|
Changes to library/tzdata/America/Eirunepe.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Eirunepe) {
{-9223372036854775808 -16768 0 LMT}
{-1767208832 -18000 0 ACT}
{-1206950400 -14400 1 ACST}
{-1191355200 -18000 0 ACT}
{-1175367600 -14400 1 ACST}
{-1159819200 -18000 0 ACT}
{-633812400 -14400 1 ACST}
{-622062000 -18000 0 ACT}
{-602276400 -14400 1 ACST}
{-591825600 -18000 0 ACT}
{-570740400 -14400 1 ACST}
{-560203200 -18000 0 ACT}
{-539118000 -14400 1 ACST}
{-531345600 -18000 0 ACT}
{-191358000 -14400 1 ACST}
{-184190400 -18000 0 ACT}
{-155156400 -14400 1 ACST}
{-150062400 -18000 0 ACT}
{-128890800 -14400 1 ACST}
{-121118400 -18000 0 ACT}
{-99946800 -14400 1 ACST}
{-89582400 -18000 0 ACT}
{-68410800 -14400 1 ACST}
{-57960000 -18000 0 ACT}
{499755600 -14400 1 ACST}
{511243200 -18000 0 ACT}
{530600400 -14400 1 ACST}
{540273600 -18000 0 ACT}
{562136400 -14400 1 ACST}
{571204800 -18000 0 ACT}
{590040000 -18000 0 ACT}
{749192400 -18000 0 ACT}
{750834000 -14400 1 ACST}
{761716800 -18000 0 ACT}
{780206400 -18000 0 ACT}
{1214283600 -14400 0 AMT}
{1384056000 -18000 0 ACT}
{-1767208832 -18000 0 -05}
{-1206950400 -14400 1 -04}
{-1191355200 -18000 0 -05}
{-1175367600 -14400 1 -04}
{-1159819200 -18000 0 -05}
{-633812400 -14400 1 -04}
{-622062000 -18000 0 -05}
{-602276400 -14400 1 -04}
{-591825600 -18000 0 -05}
{-570740400 -14400 1 -04}
{-560203200 -18000 0 -05}
{-539118000 -14400 1 -04}
{-531345600 -18000 0 -05}
{-191358000 -14400 1 -04}
{-184190400 -18000 0 -05}
{-155156400 -14400 1 -04}
{-150062400 -18000 0 -05}
{-128890800 -14400 1 -04}
{-121118400 -18000 0 -05}
{-99946800 -14400 1 -04}
{-89582400 -18000 0 -05}
{-68410800 -14400 1 -04}
{-57960000 -18000 0 -05}
{499755600 -14400 1 -04}
{511243200 -18000 0 -05}
{530600400 -14400 1 -04}
{540273600 -18000 0 -05}
{562136400 -14400 1 -04}
{571204800 -18000 0 -05}
{590040000 -18000 0 -05}
{749192400 -18000 0 -05}
{750834000 -14400 1 -04}
{761716800 -18000 0 -05}
{780206400 -18000 0 -05}
{1214283600 -14400 0 -04}
{1384056000 -18000 0 -05}
}
|
Changes to library/tzdata/America/Fortaleza.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Fortaleza) {
{-9223372036854775808 -9240 0 LMT}
{-1767216360 -10800 0 BRT}
{-1206957600 -7200 1 BRST}
{-1191362400 -10800 0 BRT}
{-1175374800 -7200 1 BRST}
{-1159826400 -10800 0 BRT}
{-633819600 -7200 1 BRST}
{-622069200 -10800 0 BRT}
{-602283600 -7200 1 BRST}
{-591832800 -10800 0 BRT}
{-570747600 -7200 1 BRST}
{-560210400 -10800 0 BRT}
{-539125200 -7200 1 BRST}
{-531352800 -10800 0 BRT}
{-191365200 -7200 1 BRST}
{-184197600 -10800 0 BRT}
{-155163600 -7200 1 BRST}
{-150069600 -10800 0 BRT}
{-128898000 -7200 1 BRST}
{-121125600 -10800 0 BRT}
{-99954000 -7200 1 BRST}
{-89589600 -10800 0 BRT}
{-68418000 -7200 1 BRST}
{-57967200 -10800 0 BRT}
{499748400 -7200 1 BRST}
{511236000 -10800 0 BRT}
{530593200 -7200 1 BRST}
{540266400 -10800 0 BRT}
{562129200 -7200 1 BRST}
{571197600 -10800 0 BRT}
{592974000 -7200 1 BRST}
{602042400 -10800 0 BRT}
{624423600 -7200 1 BRST}
{634701600 -10800 0 BRT}
{653536800 -10800 0 BRT}
{938660400 -10800 0 BRT}
{938919600 -7200 1 BRST}
{951616800 -10800 0 BRT}
{970974000 -7200 1 BRST}
{972180000 -10800 0 BRT}
{1000350000 -10800 0 BRT}
{1003028400 -7200 1 BRST}
{1013911200 -10800 0 BRT}
{1033437600 -10800 0 BRT}
{-1767216360 -10800 0 -03}
{-1206957600 -7200 1 -02}
{-1191362400 -10800 0 -03}
{-1175374800 -7200 1 -02}
{-1159826400 -10800 0 -03}
{-633819600 -7200 1 -02}
{-622069200 -10800 0 -03}
{-602283600 -7200 1 -02}
{-591832800 -10800 0 -03}
{-570747600 -7200 1 -02}
{-560210400 -10800 0 -03}
{-539125200 -7200 1 -02}
{-531352800 -10800 0 -03}
{-191365200 -7200 1 -02}
{-184197600 -10800 0 -03}
{-155163600 -7200 1 -02}
{-150069600 -10800 0 -03}
{-128898000 -7200 1 -02}
{-121125600 -10800 0 -03}
{-99954000 -7200 1 -02}
{-89589600 -10800 0 -03}
{-68418000 -7200 1 -02}
{-57967200 -10800 0 -03}
{499748400 -7200 1 -02}
{511236000 -10800 0 -03}
{530593200 -7200 1 -02}
{540266400 -10800 0 -03}
{562129200 -7200 1 -02}
{571197600 -10800 0 -03}
{592974000 -7200 1 -02}
{602042400 -10800 0 -03}
{624423600 -7200 1 -02}
{634701600 -10800 0 -03}
{653536800 -10800 0 -03}
{938660400 -10800 0 -03}
{938919600 -7200 1 -02}
{951616800 -10800 0 -03}
{970974000 -7200 1 -02}
{972180000 -10800 0 -03}
{1000350000 -10800 0 -03}
{1003028400 -7200 1 -02}
{1013911200 -10800 0 -03}
{1033437600 -10800 0 -03}
}
|
Changes to library/tzdata/America/Godthab.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Godthab) {
{-9223372036854775808 -12416 0 LMT}
{-1686083584 -10800 0 WGT}
{323845200 -7200 0 WGST}
{338950800 -10800 0 WGT}
{354675600 -7200 1 WGST}
{370400400 -10800 0 WGT}
{386125200 -7200 1 WGST}
{401850000 -10800 0 WGT}
{417574800 -7200 1 WGST}
{433299600 -10800 0 WGT}
{449024400 -7200 1 WGST}
{465354000 -10800 0 WGT}
{481078800 -7200 1 WGST}
{496803600 -10800 0 WGT}
{512528400 -7200 1 WGST}
{528253200 -10800 0 WGT}
{543978000 -7200 1 WGST}
{559702800 -10800 0 WGT}
{575427600 -7200 1 WGST}
{591152400 -10800 0 WGT}
{606877200 -7200 1 WGST}
{622602000 -10800 0 WGT}
{638326800 -7200 1 WGST}
{654656400 -10800 0 WGT}
{670381200 -7200 1 WGST}
{686106000 -10800 0 WGT}
{701830800 -7200 1 WGST}
{717555600 -10800 0 WGT}
{733280400 -7200 1 WGST}
{749005200 -10800 0 WGT}
{764730000 -7200 1 WGST}
{780454800 -10800 0 WGT}
{796179600 -7200 1 WGST}
{811904400 -10800 0 WGT}
{828234000 -7200 1 WGST}
{846378000 -10800 0 WGT}
{859683600 -7200 1 WGST}
{877827600 -10800 0 WGT}
{891133200 -7200 1 WGST}
{909277200 -10800 0 WGT}
{922582800 -7200 1 WGST}
{941331600 -10800 0 WGT}
{954032400 -7200 1 WGST}
{972781200 -10800 0 WGT}
{985482000 -7200 1 WGST}
{1004230800 -10800 0 WGT}
{1017536400 -7200 1 WGST}
{1035680400 -10800 0 WGT}
{1048986000 -7200 1 WGST}
{1067130000 -10800 0 WGT}
{1080435600 -7200 1 WGST}
{1099184400 -10800 0 WGT}
{1111885200 -7200 1 WGST}
{1130634000 -10800 0 WGT}
{1143334800 -7200 1 WGST}
{1162083600 -10800 0 WGT}
{1174784400 -7200 1 WGST}
{1193533200 -10800 0 WGT}
{1206838800 -7200 1 WGST}
{1224982800 -10800 0 WGT}
{1238288400 -7200 1 WGST}
{1256432400 -10800 0 WGT}
{1269738000 -7200 1 WGST}
{1288486800 -10800 0 WGT}
{1301187600 -7200 1 WGST}
{1319936400 -10800 0 WGT}
{1332637200 -7200 1 WGST}
{1351386000 -10800 0 WGT}
{1364691600 -7200 1 WGST}
{1382835600 -10800 0 WGT}
{1396141200 -7200 1 WGST}
{1414285200 -10800 0 WGT}
{1427590800 -7200 1 WGST}
{1445734800 -10800 0 WGT}
{1459040400 -7200 1 WGST}
{1477789200 -10800 0 WGT}
{1490490000 -7200 1 WGST}
{1509238800 -10800 0 WGT}
{1521939600 -7200 1 WGST}
{1540688400 -10800 0 WGT}
{1553994000 -7200 1 WGST}
{1572138000 -10800 0 WGT}
{1585443600 -7200 1 WGST}
{1603587600 -10800 0 WGT}
{1616893200 -7200 1 WGST}
{1635642000 -10800 0 WGT}
{1648342800 -7200 1 WGST}
{1667091600 -10800 0 WGT}
{1679792400 -7200 1 WGST}
{1698541200 -10800 0 WGT}
{1711846800 -7200 1 WGST}
{1729990800 -10800 0 WGT}
{1743296400 -7200 1 WGST}
{1761440400 -10800 0 WGT}
{1774746000 -7200 1 WGST}
{1792890000 -10800 0 WGT}
{1806195600 -7200 1 WGST}
{1824944400 -10800 0 WGT}
{1837645200 -7200 1 WGST}
{1856394000 -10800 0 WGT}
{1869094800 -7200 1 WGST}
{1887843600 -10800 0 WGT}
{1901149200 -7200 1 WGST}
{1919293200 -10800 0 WGT}
{1932598800 -7200 1 WGST}
{1950742800 -10800 0 WGT}
{1964048400 -7200 1 WGST}
{1982797200 -10800 0 WGT}
{1995498000 -7200 1 WGST}
{2014246800 -10800 0 WGT}
{2026947600 -7200 1 WGST}
{2045696400 -10800 0 WGT}
{2058397200 -7200 1 WGST}
{2077146000 -10800 0 WGT}
{2090451600 -7200 1 WGST}
{2108595600 -10800 0 WGT}
{2121901200 -7200 1 WGST}
{2140045200 -10800 0 WGT}
{2153350800 -7200 1 WGST}
{2172099600 -10800 0 WGT}
{2184800400 -7200 1 WGST}
{2203549200 -10800 0 WGT}
{2216250000 -7200 1 WGST}
{2234998800 -10800 0 WGT}
{2248304400 -7200 1 WGST}
{2266448400 -10800 0 WGT}
{2279754000 -7200 1 WGST}
{2297898000 -10800 0 WGT}
{2311203600 -7200 1 WGST}
{2329347600 -10800 0 WGT}
{2342653200 -7200 1 WGST}
{2361402000 -10800 0 WGT}
{2374102800 -7200 1 WGST}
{2392851600 -10800 0 WGT}
{2405552400 -7200 1 WGST}
{2424301200 -10800 0 WGT}
{2437606800 -7200 1 WGST}
{2455750800 -10800 0 WGT}
{2469056400 -7200 1 WGST}
{2487200400 -10800 0 WGT}
{2500506000 -7200 1 WGST}
{2519254800 -10800 0 WGT}
{2531955600 -7200 1 WGST}
{2550704400 -10800 0 WGT}
{2563405200 -7200 1 WGST}
{2582154000 -10800 0 WGT}
{2595459600 -7200 1 WGST}
{2613603600 -10800 0 WGT}
{2626909200 -7200 1 WGST}
{2645053200 -10800 0 WGT}
{2658358800 -7200 1 WGST}
{2676502800 -10800 0 WGT}
{2689808400 -7200 1 WGST}
{2708557200 -10800 0 WGT}
{2721258000 -7200 1 WGST}
{2740006800 -10800 0 WGT}
{2752707600 -7200 1 WGST}
{2771456400 -10800 0 WGT}
{2784762000 -7200 1 WGST}
{2802906000 -10800 0 WGT}
{2816211600 -7200 1 WGST}
{2834355600 -10800 0 WGT}
{2847661200 -7200 1 WGST}
{2866410000 -10800 0 WGT}
{2879110800 -7200 1 WGST}
{2897859600 -10800 0 WGT}
{2910560400 -7200 1 WGST}
{2929309200 -10800 0 WGT}
{2942010000 -7200 1 WGST}
{2960758800 -10800 0 WGT}
{2974064400 -7200 1 WGST}
{2992208400 -10800 0 WGT}
{3005514000 -7200 1 WGST}
{3023658000 -10800 0 WGT}
{3036963600 -7200 1 WGST}
{3055712400 -10800 0 WGT}
{3068413200 -7200 1 WGST}
{3087162000 -10800 0 WGT}
{3099862800 -7200 1 WGST}
{3118611600 -10800 0 WGT}
{3131917200 -7200 1 WGST}
{3150061200 -10800 0 WGT}
{3163366800 -7200 1 WGST}
{3181510800 -10800 0 WGT}
{3194816400 -7200 1 WGST}
{3212960400 -10800 0 WGT}
{3226266000 -7200 1 WGST}
{3245014800 -10800 0 WGT}
{3257715600 -7200 1 WGST}
{3276464400 -10800 0 WGT}
{3289165200 -7200 1 WGST}
{3307914000 -10800 0 WGT}
{3321219600 -7200 1 WGST}
{3339363600 -10800 0 WGT}
{3352669200 -7200 1 WGST}
{3370813200 -10800 0 WGT}
{3384118800 -7200 1 WGST}
{3402867600 -10800 0 WGT}
{3415568400 -7200 1 WGST}
{3434317200 -10800 0 WGT}
{3447018000 -7200 1 WGST}
{3465766800 -10800 0 WGT}
{3479072400 -7200 1 WGST}
{3497216400 -10800 0 WGT}
{3510522000 -7200 1 WGST}
{3528666000 -10800 0 WGT}
{3541971600 -7200 1 WGST}
{3560115600 -10800 0 WGT}
{3573421200 -7200 1 WGST}
{3592170000 -10800 0 WGT}
{3604870800 -7200 1 WGST}
{3623619600 -10800 0 WGT}
{3636320400 -7200 1 WGST}
{3655069200 -10800 0 WGT}
{3668374800 -7200 1 WGST}
{3686518800 -10800 0 WGT}
{3699824400 -7200 1 WGST}
{3717968400 -10800 0 WGT}
{3731274000 -7200 1 WGST}
{3750022800 -10800 0 WGT}
{3762723600 -7200 1 WGST}
{3781472400 -10800 0 WGT}
{3794173200 -7200 1 WGST}
{3812922000 -10800 0 WGT}
{3825622800 -7200 1 WGST}
{3844371600 -10800 0 WGT}
{3857677200 -7200 1 WGST}
{3875821200 -10800 0 WGT}
{3889126800 -7200 1 WGST}
{3907270800 -10800 0 WGT}
{3920576400 -7200 1 WGST}
{3939325200 -10800 0 WGT}
{3952026000 -7200 1 WGST}
{3970774800 -10800 0 WGT}
{3983475600 -7200 1 WGST}
{4002224400 -10800 0 WGT}
{4015530000 -7200 1 WGST}
{4033674000 -10800 0 WGT}
{4046979600 -7200 1 WGST}
{4065123600 -10800 0 WGT}
{4078429200 -7200 1 WGST}
{4096573200 -10800 0 WGT}
{-1686083584 -10800 0 -03}
{323845200 -7200 0 -02}
{338950800 -10800 0 -03}
{354675600 -7200 1 -02}
{370400400 -10800 0 -03}
{386125200 -7200 1 -02}
{401850000 -10800 0 -03}
{417574800 -7200 1 -02}
{433299600 -10800 0 -03}
{449024400 -7200 1 -02}
{465354000 -10800 0 -03}
{481078800 -7200 1 -02}
{496803600 -10800 0 -03}
{512528400 -7200 1 -02}
{528253200 -10800 0 -03}
{543978000 -7200 1 -02}
{559702800 -10800 0 -03}
{575427600 -7200 1 -02}
{591152400 -10800 0 -03}
{606877200 -7200 1 -02}
{622602000 -10800 0 -03}
{638326800 -7200 1 -02}
{654656400 -10800 0 -03}
{670381200 -7200 1 -02}
{686106000 -10800 0 -03}
{701830800 -7200 1 -02}
{717555600 -10800 0 -03}
{733280400 -7200 1 -02}
{749005200 -10800 0 -03}
{764730000 -7200 1 -02}
{780454800 -10800 0 -03}
{796179600 -7200 1 -02}
{811904400 -10800 0 -03}
{828234000 -7200 1 -02}
{846378000 -10800 0 -03}
{859683600 -7200 1 -02}
{877827600 -10800 0 -03}
{891133200 -7200 1 -02}
{909277200 -10800 0 -03}
{922582800 -7200 1 -02}
{941331600 -10800 0 -03}
{954032400 -7200 1 -02}
{972781200 -10800 0 -03}
{985482000 -7200 1 -02}
{1004230800 -10800 0 -03}
{1017536400 -7200 1 -02}
{1035680400 -10800 0 -03}
{1048986000 -7200 1 -02}
{1067130000 -10800 0 -03}
{1080435600 -7200 1 -02}
{1099184400 -10800 0 -03}
{1111885200 -7200 1 -02}
{1130634000 -10800 0 -03}
{1143334800 -7200 1 -02}
{1162083600 -10800 0 -03}
{1174784400 -7200 1 -02}
{1193533200 -10800 0 -03}
{1206838800 -7200 1 -02}
{1224982800 -10800 0 -03}
{1238288400 -7200 1 -02}
{1256432400 -10800 0 -03}
{1269738000 -7200 1 -02}
{1288486800 -10800 0 -03}
{1301187600 -7200 1 -02}
{1319936400 -10800 0 -03}
{1332637200 -7200 1 -02}
{1351386000 -10800 0 -03}
{1364691600 -7200 1 -02}
{1382835600 -10800 0 -03}
{1396141200 -7200 1 -02}
{1414285200 -10800 0 -03}
{1427590800 -7200 1 -02}
{1445734800 -10800 0 -03}
{1459040400 -7200 1 -02}
{1477789200 -10800 0 -03}
{1490490000 -7200 1 -02}
{1509238800 -10800 0 -03}
{1521939600 -7200 1 -02}
{1540688400 -10800 0 -03}
{1553994000 -7200 1 -02}
{1572138000 -10800 0 -03}
{1585443600 -7200 1 -02}
{1603587600 -10800 0 -03}
{1616893200 -7200 1 -02}
{1635642000 -10800 0 -03}
{1648342800 -7200 1 -02}
{1667091600 -10800 0 -03}
{1679792400 -7200 1 -02}
{1698541200 -10800 0 -03}
{1711846800 -7200 1 -02}
{1729990800 -10800 0 -03}
{1743296400 -7200 1 -02}
{1761440400 -10800 0 -03}
{1774746000 -7200 1 -02}
{1792890000 -10800 0 -03}
{1806195600 -7200 1 -02}
{1824944400 -10800 0 -03}
{1837645200 -7200 1 -02}
{1856394000 -10800 0 -03}
{1869094800 -7200 1 -02}
{1887843600 -10800 0 -03}
{1901149200 -7200 1 -02}
{1919293200 -10800 0 -03}
{1932598800 -7200 1 -02}
{1950742800 -10800 0 -03}
{1964048400 -7200 1 -02}
{1982797200 -10800 0 -03}
{1995498000 -7200 1 -02}
{2014246800 -10800 0 -03}
{2026947600 -7200 1 -02}
{2045696400 -10800 0 -03}
{2058397200 -7200 1 -02}
{2077146000 -10800 0 -03}
{2090451600 -7200 1 -02}
{2108595600 -10800 0 -03}
{2121901200 -7200 1 -02}
{2140045200 -10800 0 -03}
{2153350800 -7200 1 -02}
{2172099600 -10800 0 -03}
{2184800400 -7200 1 -02}
{2203549200 -10800 0 -03}
{2216250000 -7200 1 -02}
{2234998800 -10800 0 -03}
{2248304400 -7200 1 -02}
{2266448400 -10800 0 -03}
{2279754000 -7200 1 -02}
{2297898000 -10800 0 -03}
{2311203600 -7200 1 -02}
{2329347600 -10800 0 -03}
{2342653200 -7200 1 -02}
{2361402000 -10800 0 -03}
{2374102800 -7200 1 -02}
{2392851600 -10800 0 -03}
{2405552400 -7200 1 -02}
{2424301200 -10800 0 -03}
{2437606800 -7200 1 -02}
{2455750800 -10800 0 -03}
{2469056400 -7200 1 -02}
{2487200400 -10800 0 -03}
{2500506000 -7200 1 -02}
{2519254800 -10800 0 -03}
{2531955600 -7200 1 -02}
{2550704400 -10800 0 -03}
{2563405200 -7200 1 -02}
{2582154000 -10800 0 -03}
{2595459600 -7200 1 -02}
{2613603600 -10800 0 -03}
{2626909200 -7200 1 -02}
{2645053200 -10800 0 -03}
{2658358800 -7200 1 -02}
{2676502800 -10800 0 -03}
{2689808400 -7200 1 -02}
{2708557200 -10800 0 -03}
{2721258000 -7200 1 -02}
{2740006800 -10800 0 -03}
{2752707600 -7200 1 -02}
{2771456400 -10800 0 -03}
{2784762000 -7200 1 -02}
{2802906000 -10800 0 -03}
{2816211600 -7200 1 -02}
{2834355600 -10800 0 -03}
{2847661200 -7200 1 -02}
{2866410000 -10800 0 -03}
{2879110800 -7200 1 -02}
{2897859600 -10800 0 -03}
{2910560400 -7200 1 -02}
{2929309200 -10800 0 -03}
{2942010000 -7200 1 -02}
{2960758800 -10800 0 -03}
{2974064400 -7200 1 -02}
{2992208400 -10800 0 -03}
{3005514000 -7200 1 -02}
{3023658000 -10800 0 -03}
{3036963600 -7200 1 -02}
{3055712400 -10800 0 -03}
{3068413200 -7200 1 -02}
{3087162000 -10800 0 -03}
{3099862800 -7200 1 -02}
{3118611600 -10800 0 -03}
{3131917200 -7200 1 -02}
{3150061200 -10800 0 -03}
{3163366800 -7200 1 -02}
{3181510800 -10800 0 -03}
{3194816400 -7200 1 -02}
{3212960400 -10800 0 -03}
{3226266000 -7200 1 -02}
{3245014800 -10800 0 -03}
{3257715600 -7200 1 -02}
{3276464400 -10800 0 -03}
{3289165200 -7200 1 -02}
{3307914000 -10800 0 -03}
{3321219600 -7200 1 -02}
{3339363600 -10800 0 -03}
{3352669200 -7200 1 -02}
{3370813200 -10800 0 -03}
{3384118800 -7200 1 -02}
{3402867600 -10800 0 -03}
{3415568400 -7200 1 -02}
{3434317200 -10800 0 -03}
{3447018000 -7200 1 -02}
{3465766800 -10800 0 -03}
{3479072400 -7200 1 -02}
{3497216400 -10800 0 -03}
{3510522000 -7200 1 -02}
{3528666000 -10800 0 -03}
{3541971600 -7200 1 -02}
{3560115600 -10800 0 -03}
{3573421200 -7200 1 -02}
{3592170000 -10800 0 -03}
{3604870800 -7200 1 -02}
{3623619600 -10800 0 -03}
{3636320400 -7200 1 -02}
{3655069200 -10800 0 -03}
{3668374800 -7200 1 -02}
{3686518800 -10800 0 -03}
{3699824400 -7200 1 -02}
{3717968400 -10800 0 -03}
{3731274000 -7200 1 -02}
{3750022800 -10800 0 -03}
{3762723600 -7200 1 -02}
{3781472400 -10800 0 -03}
{3794173200 -7200 1 -02}
{3812922000 -10800 0 -03}
{3825622800 -7200 1 -02}
{3844371600 -10800 0 -03}
{3857677200 -7200 1 -02}
{3875821200 -10800 0 -03}
{3889126800 -7200 1 -02}
{3907270800 -10800 0 -03}
{3920576400 -7200 1 -02}
{3939325200 -10800 0 -03}
{3952026000 -7200 1 -02}
{3970774800 -10800 0 -03}
{3983475600 -7200 1 -02}
{4002224400 -10800 0 -03}
{4015530000 -7200 1 -02}
{4033674000 -10800 0 -03}
{4046979600 -7200 1 -02}
{4065123600 -10800 0 -03}
{4078429200 -7200 1 -02}
{4096573200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Guayaquil.
1
2
3
4
5
6
7
|
1
2
3
4
5
6
7
8
9
|
-
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Guayaquil) {
{-9223372036854775808 -19160 0 LMT}
{-2524502440 -18840 0 QMT}
{-1230749160 -18000 0 ECT}
{-1230749160 -18000 0 -05}
{722926800 -14400 1 -04}
{728884800 -18000 0 -05}
}
|
Changes to library/tzdata/America/Guyana.
1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
|
-
+
-
-
-
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Guyana) {
{-9223372036854775808 -13960 0 LMT}
{-1730578040 -13500 0 GBGT}
{-1730578040 -13500 0 -0345}
{-113688900 -13500 0 GYT}
{176010300 -10800 0 GYT}
{662698800 -14400 0 GYT}
{176010300 -10800 0 -03}
{662698800 -14400 0 -04}
}
|
Changes to library/tzdata/America/La_Paz.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/La_Paz) {
{-9223372036854775808 -16356 0 LMT}
{-2524505244 -16356 0 CMT}
{-1205954844 -12756 1 BOST}
{-1192307244 -14400 0 BOT}
{-1192307244 -14400 0 -04}
}
|
Changes to library/tzdata/America/Lima.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Lima) {
{-9223372036854775808 -18492 0 LMT}
{-2524503108 -18516 0 LMT}
{-1938538284 -14400 0 PEST}
{-1002052800 -18000 0 PET}
{-986756400 -14400 1 PEST}
{-971035200 -18000 0 PET}
{-955306800 -14400 1 PEST}
{-939585600 -18000 0 PET}
{512712000 -18000 0 PET}
{544248000 -18000 0 PET}
{638942400 -18000 0 PET}
{765172800 -18000 0 PET}
{-1938538284 -14400 0 -04}
{-1002052800 -18000 0 -05}
{-986756400 -14400 1 -04}
{-971035200 -18000 0 -05}
{-955306800 -14400 1 -04}
{-939585600 -18000 0 -05}
{512712000 -18000 0 -05}
{544248000 -18000 0 -05}
{638942400 -18000 0 -05}
{765172800 -18000 0 -05}
}
|
Changes to library/tzdata/America/Maceio.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Maceio) {
{-9223372036854775808 -8572 0 LMT}
{-1767217028 -10800 0 BRT}
{-1206957600 -7200 1 BRST}
{-1191362400 -10800 0 BRT}
{-1175374800 -7200 1 BRST}
{-1159826400 -10800 0 BRT}
{-633819600 -7200 1 BRST}
{-622069200 -10800 0 BRT}
{-602283600 -7200 1 BRST}
{-591832800 -10800 0 BRT}
{-570747600 -7200 1 BRST}
{-560210400 -10800 0 BRT}
{-539125200 -7200 1 BRST}
{-531352800 -10800 0 BRT}
{-191365200 -7200 1 BRST}
{-184197600 -10800 0 BRT}
{-155163600 -7200 1 BRST}
{-150069600 -10800 0 BRT}
{-128898000 -7200 1 BRST}
{-121125600 -10800 0 BRT}
{-99954000 -7200 1 BRST}
{-89589600 -10800 0 BRT}
{-68418000 -7200 1 BRST}
{-57967200 -10800 0 BRT}
{499748400 -7200 1 BRST}
{511236000 -10800 0 BRT}
{530593200 -7200 1 BRST}
{540266400 -10800 0 BRT}
{562129200 -7200 1 BRST}
{571197600 -10800 0 BRT}
{592974000 -7200 1 BRST}
{602042400 -10800 0 BRT}
{624423600 -7200 1 BRST}
{634701600 -10800 0 BRT}
{653536800 -10800 0 BRT}
{813553200 -10800 0 BRT}
{813726000 -7200 1 BRST}
{824004000 -10800 0 BRT}
{841802400 -10800 0 BRT}
{938660400 -10800 0 BRT}
{938919600 -7200 1 BRST}
{951616800 -10800 0 BRT}
{970974000 -7200 1 BRST}
{972180000 -10800 0 BRT}
{1000350000 -10800 0 BRT}
{1003028400 -7200 1 BRST}
{1013911200 -10800 0 BRT}
{1033437600 -10800 0 BRT}
{-1767217028 -10800 0 -03}
{-1206957600 -7200 1 -02}
{-1191362400 -10800 0 -03}
{-1175374800 -7200 1 -02}
{-1159826400 -10800 0 -03}
{-633819600 -7200 1 -02}
{-622069200 -10800 0 -03}
{-602283600 -7200 1 -02}
{-591832800 -10800 0 -03}
{-570747600 -7200 1 -02}
{-560210400 -10800 0 -03}
{-539125200 -7200 1 -02}
{-531352800 -10800 0 -03}
{-191365200 -7200 1 -02}
{-184197600 -10800 0 -03}
{-155163600 -7200 1 -02}
{-150069600 -10800 0 -03}
{-128898000 -7200 1 -02}
{-121125600 -10800 0 -03}
{-99954000 -7200 1 -02}
{-89589600 -10800 0 -03}
{-68418000 -7200 1 -02}
{-57967200 -10800 0 -03}
{499748400 -7200 1 -02}
{511236000 -10800 0 -03}
{530593200 -7200 1 -02}
{540266400 -10800 0 -03}
{562129200 -7200 1 -02}
{571197600 -10800 0 -03}
{592974000 -7200 1 -02}
{602042400 -10800 0 -03}
{624423600 -7200 1 -02}
{634701600 -10800 0 -03}
{653536800 -10800 0 -03}
{813553200 -10800 0 -03}
{813726000 -7200 1 -02}
{824004000 -10800 0 -03}
{841802400 -10800 0 -03}
{938660400 -10800 0 -03}
{938919600 -7200 1 -02}
{951616800 -10800 0 -03}
{970974000 -7200 1 -02}
{972180000 -10800 0 -03}
{1000350000 -10800 0 -03}
{1003028400 -7200 1 -02}
{1013911200 -10800 0 -03}
{1033437600 -10800 0 -03}
}
|
Changes to library/tzdata/America/Manaus.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Manaus) {
{-9223372036854775808 -14404 0 LMT}
{-1767211196 -14400 0 AMT}
{-1206954000 -10800 1 AMST}
{-1191358800 -14400 0 AMT}
{-1175371200 -10800 1 AMST}
{-1159822800 -14400 0 AMT}
{-633816000 -10800 1 AMST}
{-622065600 -14400 0 AMT}
{-602280000 -10800 1 AMST}
{-591829200 -14400 0 AMT}
{-570744000 -10800 1 AMST}
{-560206800 -14400 0 AMT}
{-539121600 -10800 1 AMST}
{-531349200 -14400 0 AMT}
{-191361600 -10800 1 AMST}
{-184194000 -14400 0 AMT}
{-155160000 -10800 1 AMST}
{-150066000 -14400 0 AMT}
{-128894400 -10800 1 AMST}
{-121122000 -14400 0 AMT}
{-99950400 -10800 1 AMST}
{-89586000 -14400 0 AMT}
{-68414400 -10800 1 AMST}
{-57963600 -14400 0 AMT}
{499752000 -10800 1 AMST}
{511239600 -14400 0 AMT}
{530596800 -10800 1 AMST}
{540270000 -14400 0 AMT}
{562132800 -10800 1 AMST}
{571201200 -14400 0 AMT}
{590036400 -14400 0 AMT}
{749188800 -14400 0 AMT}
{750830400 -10800 1 AMST}
{761713200 -14400 0 AMT}
{780202800 -14400 0 AMT}
{-1767211196 -14400 0 -04}
{-1206954000 -10800 1 -03}
{-1191358800 -14400 0 -04}
{-1175371200 -10800 1 -03}
{-1159822800 -14400 0 -04}
{-633816000 -10800 1 -03}
{-622065600 -14400 0 -04}
{-602280000 -10800 1 -03}
{-591829200 -14400 0 -04}
{-570744000 -10800 1 -03}
{-560206800 -14400 0 -04}
{-539121600 -10800 1 -03}
{-531349200 -14400 0 -04}
{-191361600 -10800 1 -03}
{-184194000 -14400 0 -04}
{-155160000 -10800 1 -03}
{-150066000 -14400 0 -04}
{-128894400 -10800 1 -03}
{-121122000 -14400 0 -04}
{-99950400 -10800 1 -03}
{-89586000 -14400 0 -04}
{-68414400 -10800 1 -03}
{-57963600 -14400 0 -04}
{499752000 -10800 1 -03}
{511239600 -14400 0 -04}
{530596800 -10800 1 -03}
{540270000 -14400 0 -04}
{562132800 -10800 1 -03}
{571201200 -14400 0 -04}
{590036400 -14400 0 -04}
{749188800 -14400 0 -04}
{750830400 -10800 1 -03}
{761713200 -14400 0 -04}
{780202800 -14400 0 -04}
}
|
Changes to library/tzdata/America/Miquelon.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Miquelon) {
{-9223372036854775808 -13480 0 LMT}
{-1850328920 -14400 0 AST}
{326001600 -10800 0 PMST}
{536468400 -10800 0 PMST}
{544597200 -7200 1 PMDT}
{562132800 -10800 0 PMST}
{576046800 -7200 1 PMDT}
{594187200 -10800 0 PMST}
{607496400 -7200 1 PMDT}
{625636800 -10800 0 PMST}
{638946000 -7200 1 PMDT}
{657086400 -10800 0 PMST}
{671000400 -7200 1 PMDT}
{688536000 -10800 0 PMST}
{702450000 -7200 1 PMDT}
{719985600 -10800 0 PMST}
{733899600 -7200 1 PMDT}
{752040000 -10800 0 PMST}
{765349200 -7200 1 PMDT}
{783489600 -10800 0 PMST}
{796798800 -7200 1 PMDT}
{814939200 -10800 0 PMST}
{828853200 -7200 1 PMDT}
{846388800 -10800 0 PMST}
{860302800 -7200 1 PMDT}
{877838400 -10800 0 PMST}
{891752400 -7200 1 PMDT}
{909288000 -10800 0 PMST}
{923202000 -7200 1 PMDT}
{941342400 -10800 0 PMST}
{954651600 -7200 1 PMDT}
{972792000 -10800 0 PMST}
{986101200 -7200 1 PMDT}
{1004241600 -10800 0 PMST}
{1018155600 -7200 1 PMDT}
{1035691200 -10800 0 PMST}
{1049605200 -7200 1 PMDT}
{1067140800 -10800 0 PMST}
{1081054800 -7200 1 PMDT}
{1099195200 -10800 0 PMST}
{1112504400 -7200 1 PMDT}
{1130644800 -10800 0 PMST}
{1143954000 -7200 1 PMDT}
{1162094400 -10800 0 PMST}
{1173589200 -7200 1 PMDT}
{1194148800 -10800 0 PMST}
{1205038800 -7200 1 PMDT}
{1225598400 -10800 0 PMST}
{1236488400 -7200 1 PMDT}
{1257048000 -10800 0 PMST}
{1268542800 -7200 1 PMDT}
{1289102400 -10800 0 PMST}
{1299992400 -7200 1 PMDT}
{1320552000 -10800 0 PMST}
{1331442000 -7200 1 PMDT}
{1352001600 -10800 0 PMST}
{1362891600 -7200 1 PMDT}
{1383451200 -10800 0 PMST}
{1394341200 -7200 1 PMDT}
{1414900800 -10800 0 PMST}
{1425790800 -7200 1 PMDT}
{1446350400 -10800 0 PMST}
{1457845200 -7200 1 PMDT}
{1478404800 -10800 0 PMST}
{1489294800 -7200 1 PMDT}
{1509854400 -10800 0 PMST}
{1520744400 -7200 1 PMDT}
{1541304000 -10800 0 PMST}
{1552194000 -7200 1 PMDT}
{1572753600 -10800 0 PMST}
{1583643600 -7200 1 PMDT}
{1604203200 -10800 0 PMST}
{1615698000 -7200 1 PMDT}
{1636257600 -10800 0 PMST}
{1647147600 -7200 1 PMDT}
{1667707200 -10800 0 PMST}
{1678597200 -7200 1 PMDT}
{1699156800 -10800 0 PMST}
{1710046800 -7200 1 PMDT}
{1730606400 -10800 0 PMST}
{1741496400 -7200 1 PMDT}
{1762056000 -10800 0 PMST}
{1772946000 -7200 1 PMDT}
{1793505600 -10800 0 PMST}
{1805000400 -7200 1 PMDT}
{1825560000 -10800 0 PMST}
{1836450000 -7200 1 PMDT}
{1857009600 -10800 0 PMST}
{1867899600 -7200 1 PMDT}
{1888459200 -10800 0 PMST}
{1899349200 -7200 1 PMDT}
{1919908800 -10800 0 PMST}
{1930798800 -7200 1 PMDT}
{1951358400 -10800 0 PMST}
{1962853200 -7200 1 PMDT}
{1983412800 -10800 0 PMST}
{1994302800 -7200 1 PMDT}
{2014862400 -10800 0 PMST}
{2025752400 -7200 1 PMDT}
{2046312000 -10800 0 PMST}
{2057202000 -7200 1 PMDT}
{2077761600 -10800 0 PMST}
{2088651600 -7200 1 PMDT}
{2109211200 -10800 0 PMST}
{2120101200 -7200 1 PMDT}
{2140660800 -10800 0 PMST}
{2152155600 -7200 1 PMDT}
{2172715200 -10800 0 PMST}
{2183605200 -7200 1 PMDT}
{2204164800 -10800 0 PMST}
{2215054800 -7200 1 PMDT}
{2235614400 -10800 0 PMST}
{2246504400 -7200 1 PMDT}
{2267064000 -10800 0 PMST}
{2277954000 -7200 1 PMDT}
{2298513600 -10800 0 PMST}
{2309403600 -7200 1 PMDT}
{2329963200 -10800 0 PMST}
{2341458000 -7200 1 PMDT}
{2362017600 -10800 0 PMST}
{2372907600 -7200 1 PMDT}
{2393467200 -10800 0 PMST}
{2404357200 -7200 1 PMDT}
{2424916800 -10800 0 PMST}
{2435806800 -7200 1 PMDT}
{2456366400 -10800 0 PMST}
{2467256400 -7200 1 PMDT}
{2487816000 -10800 0 PMST}
{2499310800 -7200 1 PMDT}
{2519870400 -10800 0 PMST}
{2530760400 -7200 1 PMDT}
{2551320000 -10800 0 PMST}
{2562210000 -7200 1 PMDT}
{2582769600 -10800 0 PMST}
{2593659600 -7200 1 PMDT}
{2614219200 -10800 0 PMST}
{2625109200 -7200 1 PMDT}
{2645668800 -10800 0 PMST}
{2656558800 -7200 1 PMDT}
{2677118400 -10800 0 PMST}
{2688613200 -7200 1 PMDT}
{2709172800 -10800 0 PMST}
{2720062800 -7200 1 PMDT}
{2740622400 -10800 0 PMST}
{2751512400 -7200 1 PMDT}
{2772072000 -10800 0 PMST}
{2782962000 -7200 1 PMDT}
{2803521600 -10800 0 PMST}
{2814411600 -7200 1 PMDT}
{2834971200 -10800 0 PMST}
{2846466000 -7200 1 PMDT}
{2867025600 -10800 0 PMST}
{2877915600 -7200 1 PMDT}
{2898475200 -10800 0 PMST}
{2909365200 -7200 1 PMDT}
{2929924800 -10800 0 PMST}
{2940814800 -7200 1 PMDT}
{2961374400 -10800 0 PMST}
{2972264400 -7200 1 PMDT}
{2992824000 -10800 0 PMST}
{3003714000 -7200 1 PMDT}
{3024273600 -10800 0 PMST}
{3035768400 -7200 1 PMDT}
{3056328000 -10800 0 PMST}
{3067218000 -7200 1 PMDT}
{3087777600 -10800 0 PMST}
{3098667600 -7200 1 PMDT}
{3119227200 -10800 0 PMST}
{3130117200 -7200 1 PMDT}
{3150676800 -10800 0 PMST}
{3161566800 -7200 1 PMDT}
{3182126400 -10800 0 PMST}
{3193016400 -7200 1 PMDT}
{3213576000 -10800 0 PMST}
{3225070800 -7200 1 PMDT}
{3245630400 -10800 0 PMST}
{3256520400 -7200 1 PMDT}
{3277080000 -10800 0 PMST}
{3287970000 -7200 1 PMDT}
{3308529600 -10800 0 PMST}
{3319419600 -7200 1 PMDT}
{3339979200 -10800 0 PMST}
{3350869200 -7200 1 PMDT}
{3371428800 -10800 0 PMST}
{3382923600 -7200 1 PMDT}
{3403483200 -10800 0 PMST}
{3414373200 -7200 1 PMDT}
{3434932800 -10800 0 PMST}
{3445822800 -7200 1 PMDT}
{3466382400 -10800 0 PMST}
{3477272400 -7200 1 PMDT}
{3497832000 -10800 0 PMST}
{3508722000 -7200 1 PMDT}
{3529281600 -10800 0 PMST}
{3540171600 -7200 1 PMDT}
{3560731200 -10800 0 PMST}
{3572226000 -7200 1 PMDT}
{3592785600 -10800 0 PMST}
{3603675600 -7200 1 PMDT}
{3624235200 -10800 0 PMST}
{3635125200 -7200 1 PMDT}
{3655684800 -10800 0 PMST}
{3666574800 -7200 1 PMDT}
{3687134400 -10800 0 PMST}
{3698024400 -7200 1 PMDT}
{3718584000 -10800 0 PMST}
{3730078800 -7200 1 PMDT}
{3750638400 -10800 0 PMST}
{3761528400 -7200 1 PMDT}
{3782088000 -10800 0 PMST}
{3792978000 -7200 1 PMDT}
{3813537600 -10800 0 PMST}
{3824427600 -7200 1 PMDT}
{3844987200 -10800 0 PMST}
{3855877200 -7200 1 PMDT}
{3876436800 -10800 0 PMST}
{3887326800 -7200 1 PMDT}
{3907886400 -10800 0 PMST}
{3919381200 -7200 1 PMDT}
{3939940800 -10800 0 PMST}
{3950830800 -7200 1 PMDT}
{3971390400 -10800 0 PMST}
{3982280400 -7200 1 PMDT}
{4002840000 -10800 0 PMST}
{4013730000 -7200 1 PMDT}
{4034289600 -10800 0 PMST}
{4045179600 -7200 1 PMDT}
{4065739200 -10800 0 PMST}
{4076629200 -7200 1 PMDT}
{4097188800 -10800 0 PMST}
{326001600 -10800 0 -03}
{536468400 -10800 0 -02}
{544597200 -7200 1 -02}
{562132800 -10800 0 -02}
{576046800 -7200 1 -02}
{594187200 -10800 0 -02}
{607496400 -7200 1 -02}
{625636800 -10800 0 -02}
{638946000 -7200 1 -02}
{657086400 -10800 0 -02}
{671000400 -7200 1 -02}
{688536000 -10800 0 -02}
{702450000 -7200 1 -02}
{719985600 -10800 0 -02}
{733899600 -7200 1 -02}
{752040000 -10800 0 -02}
{765349200 -7200 1 -02}
{783489600 -10800 0 -02}
{796798800 -7200 1 -02}
{814939200 -10800 0 -02}
{828853200 -7200 1 -02}
{846388800 -10800 0 -02}
{860302800 -7200 1 -02}
{877838400 -10800 0 -02}
{891752400 -7200 1 -02}
{909288000 -10800 0 -02}
{923202000 -7200 1 -02}
{941342400 -10800 0 -02}
{954651600 -7200 1 -02}
{972792000 -10800 0 -02}
{986101200 -7200 1 -02}
{1004241600 -10800 0 -02}
{1018155600 -7200 1 -02}
{1035691200 -10800 0 -02}
{1049605200 -7200 1 -02}
{1067140800 -10800 0 -02}
{1081054800 -7200 1 -02}
{1099195200 -10800 0 -02}
{1112504400 -7200 1 -02}
{1130644800 -10800 0 -02}
{1143954000 -7200 1 -02}
{1162094400 -10800 0 -02}
{1173589200 -7200 1 -02}
{1194148800 -10800 0 -02}
{1205038800 -7200 1 -02}
{1225598400 -10800 0 -02}
{1236488400 -7200 1 -02}
{1257048000 -10800 0 -02}
{1268542800 -7200 1 -02}
{1289102400 -10800 0 -02}
{1299992400 -7200 1 -02}
{1320552000 -10800 0 -02}
{1331442000 -7200 1 -02}
{1352001600 -10800 0 -02}
{1362891600 -7200 1 -02}
{1383451200 -10800 0 -02}
{1394341200 -7200 1 -02}
{1414900800 -10800 0 -02}
{1425790800 -7200 1 -02}
{1446350400 -10800 0 -02}
{1457845200 -7200 1 -02}
{1478404800 -10800 0 -02}
{1489294800 -7200 1 -02}
{1509854400 -10800 0 -02}
{1520744400 -7200 1 -02}
{1541304000 -10800 0 -02}
{1552194000 -7200 1 -02}
{1572753600 -10800 0 -02}
{1583643600 -7200 1 -02}
{1604203200 -10800 0 -02}
{1615698000 -7200 1 -02}
{1636257600 -10800 0 -02}
{1647147600 -7200 1 -02}
{1667707200 -10800 0 -02}
{1678597200 -7200 1 -02}
{1699156800 -10800 0 -02}
{1710046800 -7200 1 -02}
{1730606400 -10800 0 -02}
{1741496400 -7200 1 -02}
{1762056000 -10800 0 -02}
{1772946000 -7200 1 -02}
{1793505600 -10800 0 -02}
{1805000400 -7200 1 -02}
{1825560000 -10800 0 -02}
{1836450000 -7200 1 -02}
{1857009600 -10800 0 -02}
{1867899600 -7200 1 -02}
{1888459200 -10800 0 -02}
{1899349200 -7200 1 -02}
{1919908800 -10800 0 -02}
{1930798800 -7200 1 -02}
{1951358400 -10800 0 -02}
{1962853200 -7200 1 -02}
{1983412800 -10800 0 -02}
{1994302800 -7200 1 -02}
{2014862400 -10800 0 -02}
{2025752400 -7200 1 -02}
{2046312000 -10800 0 -02}
{2057202000 -7200 1 -02}
{2077761600 -10800 0 -02}
{2088651600 -7200 1 -02}
{2109211200 -10800 0 -02}
{2120101200 -7200 1 -02}
{2140660800 -10800 0 -02}
{2152155600 -7200 1 -02}
{2172715200 -10800 0 -02}
{2183605200 -7200 1 -02}
{2204164800 -10800 0 -02}
{2215054800 -7200 1 -02}
{2235614400 -10800 0 -02}
{2246504400 -7200 1 -02}
{2267064000 -10800 0 -02}
{2277954000 -7200 1 -02}
{2298513600 -10800 0 -02}
{2309403600 -7200 1 -02}
{2329963200 -10800 0 -02}
{2341458000 -7200 1 -02}
{2362017600 -10800 0 -02}
{2372907600 -7200 1 -02}
{2393467200 -10800 0 -02}
{2404357200 -7200 1 -02}
{2424916800 -10800 0 -02}
{2435806800 -7200 1 -02}
{2456366400 -10800 0 -02}
{2467256400 -7200 1 -02}
{2487816000 -10800 0 -02}
{2499310800 -7200 1 -02}
{2519870400 -10800 0 -02}
{2530760400 -7200 1 -02}
{2551320000 -10800 0 -02}
{2562210000 -7200 1 -02}
{2582769600 -10800 0 -02}
{2593659600 -7200 1 -02}
{2614219200 -10800 0 -02}
{2625109200 -7200 1 -02}
{2645668800 -10800 0 -02}
{2656558800 -7200 1 -02}
{2677118400 -10800 0 -02}
{2688613200 -7200 1 -02}
{2709172800 -10800 0 -02}
{2720062800 -7200 1 -02}
{2740622400 -10800 0 -02}
{2751512400 -7200 1 -02}
{2772072000 -10800 0 -02}
{2782962000 -7200 1 -02}
{2803521600 -10800 0 -02}
{2814411600 -7200 1 -02}
{2834971200 -10800 0 -02}
{2846466000 -7200 1 -02}
{2867025600 -10800 0 -02}
{2877915600 -7200 1 -02}
{2898475200 -10800 0 -02}
{2909365200 -7200 1 -02}
{2929924800 -10800 0 -02}
{2940814800 -7200 1 -02}
{2961374400 -10800 0 -02}
{2972264400 -7200 1 -02}
{2992824000 -10800 0 -02}
{3003714000 -7200 1 -02}
{3024273600 -10800 0 -02}
{3035768400 -7200 1 -02}
{3056328000 -10800 0 -02}
{3067218000 -7200 1 -02}
{3087777600 -10800 0 -02}
{3098667600 -7200 1 -02}
{3119227200 -10800 0 -02}
{3130117200 -7200 1 -02}
{3150676800 -10800 0 -02}
{3161566800 -7200 1 -02}
{3182126400 -10800 0 -02}
{3193016400 -7200 1 -02}
{3213576000 -10800 0 -02}
{3225070800 -7200 1 -02}
{3245630400 -10800 0 -02}
{3256520400 -7200 1 -02}
{3277080000 -10800 0 -02}
{3287970000 -7200 1 -02}
{3308529600 -10800 0 -02}
{3319419600 -7200 1 -02}
{3339979200 -10800 0 -02}
{3350869200 -7200 1 -02}
{3371428800 -10800 0 -02}
{3382923600 -7200 1 -02}
{3403483200 -10800 0 -02}
{3414373200 -7200 1 -02}
{3434932800 -10800 0 -02}
{3445822800 -7200 1 -02}
{3466382400 -10800 0 -02}
{3477272400 -7200 1 -02}
{3497832000 -10800 0 -02}
{3508722000 -7200 1 -02}
{3529281600 -10800 0 -02}
{3540171600 -7200 1 -02}
{3560731200 -10800 0 -02}
{3572226000 -7200 1 -02}
{3592785600 -10800 0 -02}
{3603675600 -7200 1 -02}
{3624235200 -10800 0 -02}
{3635125200 -7200 1 -02}
{3655684800 -10800 0 -02}
{3666574800 -7200 1 -02}
{3687134400 -10800 0 -02}
{3698024400 -7200 1 -02}
{3718584000 -10800 0 -02}
{3730078800 -7200 1 -02}
{3750638400 -10800 0 -02}
{3761528400 -7200 1 -02}
{3782088000 -10800 0 -02}
{3792978000 -7200 1 -02}
{3813537600 -10800 0 -02}
{3824427600 -7200 1 -02}
{3844987200 -10800 0 -02}
{3855877200 -7200 1 -02}
{3876436800 -10800 0 -02}
{3887326800 -7200 1 -02}
{3907886400 -10800 0 -02}
{3919381200 -7200 1 -02}
{3939940800 -10800 0 -02}
{3950830800 -7200 1 -02}
{3971390400 -10800 0 -02}
{3982280400 -7200 1 -02}
{4002840000 -10800 0 -02}
{4013730000 -7200 1 -02}
{4034289600 -10800 0 -02}
{4045179600 -7200 1 -02}
{4065739200 -10800 0 -02}
{4076629200 -7200 1 -02}
{4097188800 -10800 0 -02}
}
|
Changes to library/tzdata/America/Montevideo.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Montevideo) {
{-9223372036854775808 -13484 0 LMT}
{-2256668116 -13484 0 MMT}
{-1567455316 -12600 0 UYT}
{-1459542600 -10800 1 UYHST}
{-1443819600 -12600 0 UYT}
{-1428006600 -10800 1 UYHST}
{-1412283600 -12600 0 UYT}
{-1396470600 -10800 1 UYHST}
{-1380747600 -12600 0 UYT}
{-1141590600 -10800 1 UYHST}
{-1128286800 -12600 0 UYT}
{-1110141000 -10800 1 UYHST}
{-1096837200 -12600 0 UYT}
{-1078691400 -10800 1 UYHST}
{-1065387600 -12600 0 UYT}
{-1046637000 -10800 1 UYHST}
{-1033938000 -12600 0 UYT}
{-1015187400 -10800 1 UYHST}
{-1002488400 -12600 0 UYT}
{-983737800 -10800 1 UYHST}
{-971038800 -12600 0 UYT}
{-952288200 -10800 1 UYHST}
{-938984400 -12600 0 UYT}
{-920838600 -10800 1 UYHST}
{-907534800 -12600 0 UYT}
{-896819400 -10800 1 UYHST}
{-853623000 -10800 0 UYT}
{-853621200 -7200 1 UYST}
{-845848800 -10800 0 UYT}
{-334789200 -7200 1 UYST}
{-319672800 -10800 0 UYT}
{-314226000 -7200 1 UYST}
{-309996000 -10800 0 UYT}
{-149720400 -7200 1 UYST}
{-134604000 -10800 0 UYT}
{-118270800 -7200 1 UYST}
{-100044000 -10800 0 UYT}
{-86821200 -7200 1 UYST}
{-68508000 -10800 0 UYT}
{-50446800 -9000 1 UYHST}
{-34119000 -10800 0 UYT}
{-18910800 -9000 1 UYHST}
{-2583000 -10800 0 UYT}
{12625200 -9000 1 UYHST}
{28953000 -10800 0 UYT}
{72932400 -7200 1 UYST}
{82692000 -10800 0 UYT}
{132116400 -9000 1 UYHST}
{156911400 -7200 1 UYST}
{212983200 -10800 0 UYT}
{250052400 -7200 1 UYST}
{260244000 -10800 0 UYT}
{307594800 -7200 1 UYST}
{325994400 -10800 0 UYT}
{566449200 -7200 1 UYST}
{574308000 -10800 0 UYT}
{597812400 -7200 1 UYST}
{605671200 -10800 0 UYT}
{625633200 -7200 1 UYST}
{636516000 -10800 0 UYT}
{656478000 -7200 1 UYST}
{667965600 -10800 0 UYT}
{688532400 -7200 1 UYST}
{699415200 -10800 0 UYT}
{719377200 -7200 1 UYST}
{730864800 -10800 0 UYT}
{1095562800 -7200 1 UYST}
{1111896000 -10800 0 UYT}
{1128834000 -7200 1 UYST}
{1142136000 -10800 0 UYT}
{1159678800 -7200 1 UYST}
{1173585600 -10800 0 UYT}
{1191733200 -7200 1 UYST}
{1205035200 -10800 0 UYT}
{1223182800 -7200 1 UYST}
{1236484800 -10800 0 UYT}
{1254632400 -7200 1 UYST}
{1268539200 -10800 0 UYT}
{1286082000 -7200 1 UYST}
{1299988800 -10800 0 UYT}
{1317531600 -7200 1 UYST}
{1331438400 -10800 0 UYT}
{1349586000 -7200 1 UYST}
{1362888000 -10800 0 UYT}
{1381035600 -7200 1 UYST}
{1394337600 -10800 0 UYT}
{1412485200 -7200 1 UYST}
{1425787200 -10800 0 UYT}
{-1567455316 -12600 0 -0330}
{-1459542600 -10800 1 -03}
{-1443819600 -12600 0 -0330}
{-1428006600 -10800 1 -03}
{-1412283600 -12600 0 -0330}
{-1396470600 -10800 1 -03}
{-1380747600 -12600 0 -0330}
{-1141590600 -10800 1 -03}
{-1128286800 -12600 0 -0330}
{-1110141000 -10800 1 -03}
{-1096837200 -12600 0 -0330}
{-1078691400 -10800 1 -03}
{-1065387600 -12600 0 -0330}
{-1046637000 -10800 1 -03}
{-1033938000 -12600 0 -0330}
{-1015187400 -10800 1 -03}
{-1002488400 -12600 0 -0330}
{-983737800 -10800 1 -03}
{-971038800 -12600 0 -0330}
{-952288200 -10800 1 -03}
{-938984400 -12600 0 -0330}
{-920838600 -10800 1 -03}
{-907534800 -12600 0 -0330}
{-896819400 -10800 1 -03}
{-853623000 -10800 0 -03}
{-853621200 -7200 1 -02}
{-845848800 -10800 0 -03}
{-334789200 -7200 1 -02}
{-319672800 -10800 0 -03}
{-314226000 -7200 1 -02}
{-309996000 -10800 0 -03}
{-149720400 -7200 1 -02}
{-134604000 -10800 0 -03}
{-118270800 -7200 1 -02}
{-100044000 -10800 0 -03}
{-86821200 -7200 1 -02}
{-68508000 -10800 0 -03}
{-63147600 -10800 0 -03}
{-50446800 -9000 1 -0230}
{-34119000 -10800 0 -03}
{-18910800 -9000 1 -0230}
{-2583000 -10800 0 -03}
{12625200 -9000 1 -0230}
{28953000 -10800 0 -03}
{31546800 -10800 0 -03}
{72932400 -7200 1 -02}
{82692000 -10800 0 -03}
{126241200 -10800 0 -03}
{132116400 -9000 1 -0230}
{156909600 -9000 0 -02}
{156911400 -7200 1 -02}
{212983200 -10800 0 -03}
{250052400 -7200 1 -02}
{260244000 -10800 0 -03}
{307594800 -7200 1 -02}
{325994400 -10800 0 -03}
{566449200 -7200 1 -02}
{574308000 -10800 0 -03}
{597812400 -7200 1 -02}
{605671200 -10800 0 -03}
{625633200 -7200 1 -02}
{636516000 -10800 0 -03}
{656478000 -7200 1 -02}
{667965600 -10800 0 -03}
{688532400 -7200 1 -02}
{699415200 -10800 0 -03}
{719377200 -7200 1 -02}
{730864800 -10800 0 -03}
{1095562800 -7200 1 -02}
{1111896000 -10800 0 -03}
{1128834000 -7200 1 -02}
{1142136000 -10800 0 -03}
{1159678800 -7200 1 -02}
{1173585600 -10800 0 -03}
{1191733200 -7200 1 -02}
{1205035200 -10800 0 -03}
{1223182800 -7200 1 -02}
{1236484800 -10800 0 -03}
{1254632400 -7200 1 -02}
{1268539200 -10800 0 -03}
{1286082000 -7200 1 -02}
{1299988800 -10800 0 -03}
{1317531600 -7200 1 -02}
{1331438400 -10800 0 -03}
{1349586000 -7200 1 -02}
{1362888000 -10800 0 -03}
{1381035600 -7200 1 -02}
{1394337600 -10800 0 -03}
{1412485200 -7200 1 -02}
{1425787200 -10800 0 -03}
}
|
Changes to library/tzdata/America/Noronha.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Noronha) {
{-9223372036854775808 -7780 0 LMT}
{-1767217820 -7200 0 FNT}
{-1206961200 -3600 1 FNST}
{-1191366000 -7200 0 FNT}
{-1175378400 -3600 1 FNST}
{-1159830000 -7200 0 FNT}
{-633823200 -3600 1 FNST}
{-622072800 -7200 0 FNT}
{-602287200 -3600 1 FNST}
{-591836400 -7200 0 FNT}
{-570751200 -3600 1 FNST}
{-560214000 -7200 0 FNT}
{-539128800 -3600 1 FNST}
{-531356400 -7200 0 FNT}
{-191368800 -3600 1 FNST}
{-184201200 -7200 0 FNT}
{-155167200 -3600 1 FNST}
{-150073200 -7200 0 FNT}
{-128901600 -3600 1 FNST}
{-121129200 -7200 0 FNT}
{-99957600 -3600 1 FNST}
{-89593200 -7200 0 FNT}
{-68421600 -3600 1 FNST}
{-57970800 -7200 0 FNT}
{499744800 -3600 1 FNST}
{511232400 -7200 0 FNT}
{530589600 -3600 1 FNST}
{540262800 -7200 0 FNT}
{562125600 -3600 1 FNST}
{571194000 -7200 0 FNT}
{592970400 -3600 1 FNST}
{602038800 -7200 0 FNT}
{624420000 -3600 1 FNST}
{634698000 -7200 0 FNT}
{653533200 -7200 0 FNT}
{938656800 -7200 0 FNT}
{938916000 -3600 1 FNST}
{951613200 -7200 0 FNT}
{970970400 -3600 1 FNST}
{971571600 -7200 0 FNT}
{1000346400 -7200 0 FNT}
{1003024800 -3600 1 FNST}
{1013907600 -7200 0 FNT}
{1033434000 -7200 0 FNT}
{-1767217820 -7200 0 -02}
{-1206961200 -3600 1 -01}
{-1191366000 -7200 0 -02}
{-1175378400 -3600 1 -01}
{-1159830000 -7200 0 -02}
{-633823200 -3600 1 -01}
{-622072800 -7200 0 -02}
{-602287200 -3600 1 -01}
{-591836400 -7200 0 -02}
{-570751200 -3600 1 -01}
{-560214000 -7200 0 -02}
{-539128800 -3600 1 -01}
{-531356400 -7200 0 -02}
{-191368800 -3600 1 -01}
{-184201200 -7200 0 -02}
{-155167200 -3600 1 -01}
{-150073200 -7200 0 -02}
{-128901600 -3600 1 -01}
{-121129200 -7200 0 -02}
{-99957600 -3600 1 -01}
{-89593200 -7200 0 -02}
{-68421600 -3600 1 -01}
{-57970800 -7200 0 -02}
{499744800 -3600 1 -01}
{511232400 -7200 0 -02}
{530589600 -3600 1 -01}
{540262800 -7200 0 -02}
{562125600 -3600 1 -01}
{571194000 -7200 0 -02}
{592970400 -3600 1 -01}
{602038800 -7200 0 -02}
{624420000 -3600 1 -01}
{634698000 -7200 0 -02}
{653533200 -7200 0 -02}
{938656800 -7200 0 -02}
{938916000 -3600 1 -01}
{951613200 -7200 0 -02}
{970970400 -3600 1 -01}
{971571600 -7200 0 -02}
{1000346400 -7200 0 -02}
{1003024800 -3600 1 -01}
{1013907600 -7200 0 -02}
{1033434000 -7200 0 -02}
}
|
Changes to library/tzdata/America/Paramaribo.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
|
-
+
-
-
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Paramaribo) {
{-9223372036854775808 -13240 0 LMT}
{-1861906760 -13252 0 PMT}
{-1104524348 -13236 0 PMT}
{-765317964 -12600 0 NEGT}
{-765317964 -12600 0 -0330}
{185686200 -12600 0 SRT}
{465449400 -10800 0 SRT}
{465449400 -10800 0 -03}
}
|
Changes to library/tzdata/America/Port-au-Prince.
| ︙ | | |
42
43
44
45
46
47
48
49
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
{1352008800 -18000 0 EST}
{1362898800 -14400 1 EDT}
{1383458400 -18000 0 EST}
{1394348400 -14400 1 EDT}
{1414908000 -18000 0 EST}
{1425798000 -14400 1 EDT}
{1446357600 -18000 0 EST}
{1489302000 -14400 1 EDT}
{1509861600 -18000 0 EST}
{1520751600 -14400 1 EDT}
{1541311200 -18000 0 EST}
{1552201200 -14400 1 EDT}
{1572760800 -18000 0 EST}
{1583650800 -14400 1 EDT}
{1604210400 -18000 0 EST}
{1615705200 -14400 1 EDT}
{1636264800 -18000 0 EST}
{1647154800 -14400 1 EDT}
{1667714400 -18000 0 EST}
{1678604400 -14400 1 EDT}
{1699164000 -18000 0 EST}
{1710054000 -14400 1 EDT}
{1730613600 -18000 0 EST}
{1741503600 -14400 1 EDT}
{1762063200 -18000 0 EST}
{1772953200 -14400 1 EDT}
{1793512800 -18000 0 EST}
{1805007600 -14400 1 EDT}
{1825567200 -18000 0 EST}
{1836457200 -14400 1 EDT}
{1857016800 -18000 0 EST}
{1867906800 -14400 1 EDT}
{1888466400 -18000 0 EST}
{1899356400 -14400 1 EDT}
{1919916000 -18000 0 EST}
{1930806000 -14400 1 EDT}
{1951365600 -18000 0 EST}
{1962860400 -14400 1 EDT}
{1983420000 -18000 0 EST}
{1994310000 -14400 1 EDT}
{2014869600 -18000 0 EST}
{2025759600 -14400 1 EDT}
{2046319200 -18000 0 EST}
{2057209200 -14400 1 EDT}
{2077768800 -18000 0 EST}
{2088658800 -14400 1 EDT}
{2109218400 -18000 0 EST}
{2120108400 -14400 1 EDT}
{2140668000 -18000 0 EST}
{2152162800 -14400 1 EDT}
{2172722400 -18000 0 EST}
{2183612400 -14400 1 EDT}
{2204172000 -18000 0 EST}
{2215062000 -14400 1 EDT}
{2235621600 -18000 0 EST}
{2246511600 -14400 1 EDT}
{2267071200 -18000 0 EST}
{2277961200 -14400 1 EDT}
{2298520800 -18000 0 EST}
{2309410800 -14400 1 EDT}
{2329970400 -18000 0 EST}
{2341465200 -14400 1 EDT}
{2362024800 -18000 0 EST}
{2372914800 -14400 1 EDT}
{2393474400 -18000 0 EST}
{2404364400 -14400 1 EDT}
{2424924000 -18000 0 EST}
{2435814000 -14400 1 EDT}
{2456373600 -18000 0 EST}
{2467263600 -14400 1 EDT}
{2487823200 -18000 0 EST}
{2499318000 -14400 1 EDT}
{2519877600 -18000 0 EST}
{2530767600 -14400 1 EDT}
{2551327200 -18000 0 EST}
{2562217200 -14400 1 EDT}
{2582776800 -18000 0 EST}
{2593666800 -14400 1 EDT}
{2614226400 -18000 0 EST}
{2625116400 -14400 1 EDT}
{2645676000 -18000 0 EST}
{2656566000 -14400 1 EDT}
{2677125600 -18000 0 EST}
{2688620400 -14400 1 EDT}
{2709180000 -18000 0 EST}
{2720070000 -14400 1 EDT}
{2740629600 -18000 0 EST}
{2751519600 -14400 1 EDT}
{2772079200 -18000 0 EST}
{2782969200 -14400 1 EDT}
{2803528800 -18000 0 EST}
{2814418800 -14400 1 EDT}
{2834978400 -18000 0 EST}
{2846473200 -14400 1 EDT}
{2867032800 -18000 0 EST}
{2877922800 -14400 1 EDT}
{2898482400 -18000 0 EST}
{2909372400 -14400 1 EDT}
{2929932000 -18000 0 EST}
{2940822000 -14400 1 EDT}
{2961381600 -18000 0 EST}
{2972271600 -14400 1 EDT}
{2992831200 -18000 0 EST}
{3003721200 -14400 1 EDT}
{3024280800 -18000 0 EST}
{3035775600 -14400 1 EDT}
{3056335200 -18000 0 EST}
{3067225200 -14400 1 EDT}
{3087784800 -18000 0 EST}
{3098674800 -14400 1 EDT}
{3119234400 -18000 0 EST}
{3130124400 -14400 1 EDT}
{3150684000 -18000 0 EST}
{3161574000 -14400 1 EDT}
{3182133600 -18000 0 EST}
{3193023600 -14400 1 EDT}
{3213583200 -18000 0 EST}
{3225078000 -14400 1 EDT}
{3245637600 -18000 0 EST}
{3256527600 -14400 1 EDT}
{3277087200 -18000 0 EST}
{3287977200 -14400 1 EDT}
{3308536800 -18000 0 EST}
{3319426800 -14400 1 EDT}
{3339986400 -18000 0 EST}
{3350876400 -14400 1 EDT}
{3371436000 -18000 0 EST}
{3382930800 -14400 1 EDT}
{3403490400 -18000 0 EST}
{3414380400 -14400 1 EDT}
{3434940000 -18000 0 EST}
{3445830000 -14400 1 EDT}
{3466389600 -18000 0 EST}
{3477279600 -14400 1 EDT}
{3497839200 -18000 0 EST}
{3508729200 -14400 1 EDT}
{3529288800 -18000 0 EST}
{3540178800 -14400 1 EDT}
{3560738400 -18000 0 EST}
{3572233200 -14400 1 EDT}
{3592792800 -18000 0 EST}
{3603682800 -14400 1 EDT}
{3624242400 -18000 0 EST}
{3635132400 -14400 1 EDT}
{3655692000 -18000 0 EST}
{3666582000 -14400 1 EDT}
{3687141600 -18000 0 EST}
{3698031600 -14400 1 EDT}
{3718591200 -18000 0 EST}
{3730086000 -14400 1 EDT}
{3750645600 -18000 0 EST}
{3761535600 -14400 1 EDT}
{3782095200 -18000 0 EST}
{3792985200 -14400 1 EDT}
{3813544800 -18000 0 EST}
{3824434800 -14400 1 EDT}
{3844994400 -18000 0 EST}
{3855884400 -14400 1 EDT}
{3876444000 -18000 0 EST}
{3887334000 -14400 1 EDT}
{3907893600 -18000 0 EST}
{3919388400 -14400 1 EDT}
{3939948000 -18000 0 EST}
{3950838000 -14400 1 EDT}
{3971397600 -18000 0 EST}
{3982287600 -14400 1 EDT}
{4002847200 -18000 0 EST}
{4013737200 -14400 1 EDT}
{4034296800 -18000 0 EST}
{4045186800 -14400 1 EDT}
{4065746400 -18000 0 EST}
{4076636400 -14400 1 EDT}
{4097196000 -18000 0 EST}
}
|
Changes to library/tzdata/America/Porto_Velho.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Porto_Velho) {
{-9223372036854775808 -15336 0 LMT}
{-1767210264 -14400 0 AMT}
{-1206954000 -10800 1 AMST}
{-1191358800 -14400 0 AMT}
{-1175371200 -10800 1 AMST}
{-1159822800 -14400 0 AMT}
{-633816000 -10800 1 AMST}
{-622065600 -14400 0 AMT}
{-602280000 -10800 1 AMST}
{-591829200 -14400 0 AMT}
{-570744000 -10800 1 AMST}
{-560206800 -14400 0 AMT}
{-539121600 -10800 1 AMST}
{-531349200 -14400 0 AMT}
{-191361600 -10800 1 AMST}
{-184194000 -14400 0 AMT}
{-155160000 -10800 1 AMST}
{-150066000 -14400 0 AMT}
{-128894400 -10800 1 AMST}
{-121122000 -14400 0 AMT}
{-99950400 -10800 1 AMST}
{-89586000 -14400 0 AMT}
{-68414400 -10800 1 AMST}
{-57963600 -14400 0 AMT}
{499752000 -10800 1 AMST}
{511239600 -14400 0 AMT}
{530596800 -10800 1 AMST}
{540270000 -14400 0 AMT}
{562132800 -10800 1 AMST}
{571201200 -14400 0 AMT}
{590036400 -14400 0 AMT}
{-1767210264 -14400 0 -04}
{-1206954000 -10800 1 -03}
{-1191358800 -14400 0 -04}
{-1175371200 -10800 1 -03}
{-1159822800 -14400 0 -04}
{-633816000 -10800 1 -03}
{-622065600 -14400 0 -04}
{-602280000 -10800 1 -03}
{-591829200 -14400 0 -04}
{-570744000 -10800 1 -03}
{-560206800 -14400 0 -04}
{-539121600 -10800 1 -03}
{-531349200 -14400 0 -04}
{-191361600 -10800 1 -03}
{-184194000 -14400 0 -04}
{-155160000 -10800 1 -03}
{-150066000 -14400 0 -04}
{-128894400 -10800 1 -03}
{-121122000 -14400 0 -04}
{-99950400 -10800 1 -03}
{-89586000 -14400 0 -04}
{-68414400 -10800 1 -03}
{-57963600 -14400 0 -04}
{499752000 -10800 1 -03}
{511239600 -14400 0 -04}
{530596800 -10800 1 -03}
{540270000 -14400 0 -04}
{562132800 -10800 1 -03}
{571201200 -14400 0 -04}
{590036400 -14400 0 -04}
}
|
Added library/tzdata/America/Punta_Arenas.