Compare commits
135
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
440325f1fa | ||
|
|
44d36b0777 | ||
|
|
b6e44cf97f | ||
|
|
15eff3a60b | ||
|
|
244a3018c5 | ||
|
|
69d77fc137 | ||
|
|
0ac369da08 | ||
|
|
5c69fce733 | ||
|
|
b032f6d67b | ||
|
|
777a642667 | ||
|
|
eaaa675e99 | ||
|
|
bd11687207 | ||
|
|
4b7f867f90 | ||
|
|
a4c8e24f4c | ||
|
|
309510e33e | ||
|
|
58c45c0f97 | ||
|
|
97bf1ced2b | ||
|
|
28f17c0d70 | ||
|
|
4d25168772 | ||
|
|
912f1a8816 | ||
|
|
24829b80ac | ||
|
|
12c3fbcb0c | ||
|
|
9740bc1662 | ||
|
|
8751d32304 | ||
|
|
ac198c7f44 | ||
|
|
d17af2c703 | ||
|
|
595cb86379 | ||
|
|
334b8029ed | ||
|
|
be26adf83b | ||
|
|
c1ee80eccf | ||
|
|
6420ec98e8 | ||
|
|
1cab268c94 | ||
|
|
774c2050f1 | ||
|
|
7a1b66b00d | ||
|
|
4e994192a1 | ||
|
|
c70641a878 | ||
|
|
ffdd95d4a3 | ||
|
|
cb9018a721 | ||
|
|
3ab1f672a4 | ||
|
|
57c23073f7 | ||
|
|
245ed0c3c3 | ||
|
|
543703d4ee | ||
|
|
2865a8da13 | ||
|
|
ccc592df50 | ||
|
|
8094d33e43 | ||
|
|
95d2a7f7c0 | ||
|
|
f218c1f1eb | ||
|
|
4909a5cc24 | ||
|
|
5ee08fdf00 | ||
|
|
1e9a4512c7 | ||
|
|
0cced28f38 | ||
|
|
f720f4cad5 | ||
|
|
6fb4854406 | ||
|
|
f2c8c6c408 | ||
|
|
1749b4cc87 | ||
|
|
01dccf28f9 | ||
|
|
89fee22341 | ||
|
|
230de714e7 | ||
|
|
f080055506 | ||
|
|
2c246b85fa | ||
|
|
d164d828d7 | ||
|
|
2d4e87b986 | ||
|
|
bc27eb2430 | ||
|
|
2e2fdf481a | ||
|
|
1568393cf3 | ||
|
|
6d9266494b | ||
|
|
b424e06193 | ||
|
|
00f20c7d65 | ||
|
|
e50b8ab068 | ||
|
|
18c4dc903a | ||
|
|
ecc6d3264b | ||
|
|
a548454c57 | ||
|
|
809bbc79fb | ||
|
|
82c3e7df6d | ||
|
|
6806ca9630 | ||
|
|
963cceee57 | ||
|
|
5add43aac8 | ||
|
|
2d41d8b6e2 | ||
|
|
f7183b361e | ||
|
|
e0587d1564 | ||
|
|
6a355b11a6 | ||
|
|
1890d482a7 | ||
|
|
9a62e42dd6 | ||
|
|
1dec12d618 | ||
|
|
523ea309ce | ||
|
|
b4745088b1 | ||
|
|
e0908c3226 | ||
|
|
13ae5915d6 | ||
|
|
ae279a393f | ||
|
|
84425899dd | ||
|
|
12f94f7a7a | ||
|
|
4b795b56c8 | ||
|
|
e4f3ce78e3 | ||
|
|
dccc93bfb8 | ||
|
|
a89cd349f1 | ||
|
|
e02fb5a67b | ||
|
|
8c233c93c1 | ||
|
|
0e5ff41021 | ||
|
|
23102369d1 | ||
|
|
1aa5869ece | ||
|
|
18b503297b | ||
|
|
44fd5b0f83 | ||
|
|
0f4e877214 | ||
|
|
4df4dafad6 | ||
|
|
83ec300abd | ||
|
|
ddae61a859 | ||
|
|
75399e97a8 | ||
|
|
5471354571 | ||
|
|
b3dceb5360 | ||
|
|
434a115a3c | ||
|
|
74707353e8 | ||
|
|
22a5d73ebf | ||
|
|
030a749dc8 | ||
|
|
2f4c1aecdb | ||
|
|
1337738c22 | ||
|
|
96b9e6e871 | ||
|
|
52c009322f | ||
|
|
97ed5b117d | ||
|
|
fbc8feeb40 | ||
|
|
fef802ea7a | ||
|
|
d7a697aa50 | ||
|
|
9654f8c692 | ||
|
|
c69ccc749e | ||
|
|
983b95bdbd | ||
|
|
c201290179 | ||
|
|
0c78f5bbad | ||
|
|
2e0a0b5305 | ||
|
|
1caba8a761 | ||
|
|
6efd8f71f2 | ||
|
|
e5cf3448bd | ||
|
|
ea29292705 | ||
|
|
d32d625787 | ||
|
|
e0209e39ea | ||
|
|
ccbd8395f4 | ||
|
|
05d83f7b1a |
+188
@@ -0,0 +1,188 @@
|
||||
sudo: false
|
||||
language: c
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# Testing on Linux with various compilers
|
||||
- name: "Linux/Clang/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/Clang/Static"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: clang
|
||||
env:
|
||||
- CFGOPT=--disable-shared
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Static"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc
|
||||
env:
|
||||
- CFGOPT=--disable-shared
|
||||
- BUILD_DIR=unix
|
||||
# Older versions of GCC...
|
||||
- name: "Linux/GCC 7/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc-7
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-7
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 6/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc-6
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-6
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 5/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc-5
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 4.9/Shared"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: gcc-4.9
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.9
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Xcode 11/Shared/Unix-like"
|
||||
os: osx
|
||||
osx_image: xcode11
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "macOS/Xcode 11/Shared/Mac-like"
|
||||
os: osx
|
||||
osx_image: xcode11
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: &mactest
|
||||
- make all
|
||||
# The styles=develop avoids some weird problems on OSX
|
||||
- make test styles=develop
|
||||
- name: "macOS/Xcode 10/Shared/Mac-like"
|
||||
os: osx
|
||||
osx_image: xcode10.2
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 9/Shared/Mac-like"
|
||||
os: osx
|
||||
osx_image: xcode9
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 8/Shared/Mac-like"
|
||||
os: osx
|
||||
osx_image: xcode8
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
# Test with mingw-w64 (32 bit) cross-compile
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: &mingw32
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-i686
|
||||
- gcc-mingw-w64-i686
|
||||
- gcc-mingw-w64
|
||||
- gcc-multilib
|
||||
- wine
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 --enable-threads"
|
||||
script: &crosstest
|
||||
- make all
|
||||
- make tcltest
|
||||
# Include a high visibility marker that tests are skipped outright
|
||||
- >
|
||||
echo "`tput setaf 3`SKIPPED TEST: CROSS COMPILING`tput sgr0`"
|
||||
- name: "Linux-cross-Windows-32/GCC/Static/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
addons: *mingw32
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=i686-w64-mingw32 --disable-shared --enable-threads"
|
||||
script: *crosstest
|
||||
# Test with mingw-w64 (64 bit)
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows-64/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: &mingw64
|
||||
apt:
|
||||
packages:
|
||||
- gcc-mingw-w64-base
|
||||
- binutils-mingw-w64-x86-64
|
||||
- gcc-mingw-w64-x86-64
|
||||
- gcc-mingw-w64
|
||||
- wine
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-threads"
|
||||
script: *crosstest
|
||||
- name: "Linux-cross-Windows-64/GCC/Static/no test"
|
||||
os: linux
|
||||
dist: xenial
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
addons: *mingw64
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-threads --disable-shared"
|
||||
script: *crosstest
|
||||
before_install:
|
||||
- cd ${BUILD_DIR}
|
||||
install:
|
||||
- ./configure ${CFGOPT} --prefix=$HOME
|
||||
before_script:
|
||||
- export ERROR_ON_FAILURES=1
|
||||
script:
|
||||
- make all
|
||||
- make tcltest
|
||||
- make test
|
||||
@@ -1,185 +0,0 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.5.19 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
|
||||
3. Compiling and installing Tcl
|
||||
4. Development tools
|
||||
5. Tcl newsgroup
|
||||
6. The Tcler's Wiki
|
||||
7. Mailing lists
|
||||
8. Support and Training
|
||||
9. Tracking Development
|
||||
10. Thank You
|
||||
|
||||
1. Introduction
|
||||
---------------
|
||||
Tcl provides a powerful platform for creating integration applications that
|
||||
tie together diverse applications, protocols, devices, and frameworks.
|
||||
When paired with the Tk toolkit, Tcl provides the fastest and most powerful
|
||||
way to create GUI applications that run on PCs, Unix, and Mac OS X.
|
||||
Tcl can also be used for a variety of web-related tasks and for creating
|
||||
powerful command languages for applications.
|
||||
|
||||
Tcl is maintained, enhanced, and distributed freely by the Tcl community.
|
||||
Source code development and tracking of bug reports and feature requests
|
||||
takes place at:
|
||||
|
||||
http://core.tcl.tk/
|
||||
|
||||
Tcl/Tk release and mailing list services are hosted by SourceForge:
|
||||
|
||||
http://sourceforge.net/projects/tcl/
|
||||
|
||||
with the Tcl Developer Xchange hosted at:
|
||||
|
||||
http://www.tcl.tk/
|
||||
|
||||
Tcl is a freely available open source package. You can do virtually
|
||||
anything you like with it, such as modifying it, redistributing it,
|
||||
and selling it either in whole or in part. See the file
|
||||
"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.5.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.5 online,
|
||||
visit the URL:
|
||||
http://www.tcl.tk/man/tcl8.5/
|
||||
|
||||
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
|
||||
library procedures; and files with extension ".n" describe Tcl
|
||||
commands. The file "doc/Tcl.n" gives a quick summary of the Tcl
|
||||
language syntax. To print any of the man pages on Unix, cd to the
|
||||
"doc" directory and invoke your favorite variant of troff using the
|
||||
normal -man macros, for example
|
||||
|
||||
ditroff -man Tcl.n
|
||||
|
||||
to print Tcl.n. If Tcl has been installed correctly and your "man" program
|
||||
supports it, you should be able to access the Tcl manual entries using the
|
||||
normal "man" mechanisms, such as
|
||||
|
||||
man Tcl
|
||||
|
||||
2b. Windows Documentation
|
||||
-------------------------
|
||||
|
||||
The "doc" subdirectory in this release contains a complete set of Windows
|
||||
help files for Tcl. Once you install this Tcl release, a shortcut to the
|
||||
Windows help Tcl documentation will appear in the "Start" menu:
|
||||
|
||||
Start | Programs | Tcl | Tcl Help
|
||||
|
||||
3. Compiling and installing Tcl
|
||||
-------------------------------
|
||||
|
||||
There are brief notes in the unix/README, win/README, and macosx/README about
|
||||
compiling on these different platforms. There is additional information
|
||||
about building Tcl from sources at
|
||||
|
||||
http://www.tcl.tk/doc/howto/compile.html
|
||||
|
||||
4. Development tools
|
||||
---------------------------
|
||||
|
||||
ActiveState produces a high quality set of commercial quality development
|
||||
tools that is available to accelerate your Tcl application development.
|
||||
Tcl Dev Kit builds on the earlier TclPro toolset and provides a debugger,
|
||||
static code checker, single-file wrapping utility, bytecode compiler and
|
||||
more. More information can be found at
|
||||
|
||||
http://www.ActiveState.com/Tcl
|
||||
|
||||
5. Tcl newsgroup
|
||||
----------------
|
||||
|
||||
There is a USENET news group, "comp.lang.tcl", intended for the exchange of
|
||||
information about Tcl, Tk, and related applications. The newsgroup is a
|
||||
great place to ask general information questions. For bug reports, please
|
||||
see the "Support and bug fixes" section below.
|
||||
|
||||
6. Tcl'ers Wiki
|
||||
---------------
|
||||
|
||||
A Wiki-based open community site covering all aspects of Tcl/Tk is at:
|
||||
|
||||
http://wiki.tcl.tk/
|
||||
|
||||
It is dedicated to the Tcl programming language and its extensions. A
|
||||
wealth of useful information can be found there. It contains code
|
||||
snippets, references to papers, books, and FAQs, as well as pointers to
|
||||
development tools, extensions, and applications. You can also recommend
|
||||
additional URLs by editing the wiki yourself.
|
||||
|
||||
7. Mailing lists
|
||||
----------------
|
||||
|
||||
Several mailing lists are hosted at SourceForge to discuss development or
|
||||
use issues (like Macintosh and Windows topics). For more information and
|
||||
to subscribe, visit:
|
||||
|
||||
http://sourceforge.net/projects/tcl/
|
||||
|
||||
and go to the Mailing Lists page.
|
||||
|
||||
8. Support and Training
|
||||
------------------------
|
||||
|
||||
We are very interested in receiving bug reports, patches, and suggestions
|
||||
for improvements. We prefer that you send this information to us as
|
||||
tickets entered into our tracker at:
|
||||
|
||||
http://core.tcl.tk/tcl/reportlist
|
||||
|
||||
We will log and follow-up on each bug, although we cannot promise a
|
||||
specific turn-around time. Enhancements may take longer and may not happen
|
||||
at all unless there is widespread support for them (we're trying to
|
||||
slow the rate at which Tcl/Tk turns into a kitchen sink). It's very
|
||||
difficult to make incompatible changes to Tcl/Tk at this point, due to
|
||||
the size of the installed base.
|
||||
|
||||
The Tcl community is too large for us to provide much individual support
|
||||
for users. If you need help we suggest that you post questions to
|
||||
comp.lang.tcl. We read the newsgroup and will attempt to answer esoteric
|
||||
questions for which no one else is likely to know the answer. In addition,
|
||||
see the following Web site for links to other organizations that offer
|
||||
Tcl/Tk training:
|
||||
|
||||
http://wiki.tcl.tk/training
|
||||
|
||||
9. Tracking Development
|
||||
-----------------------
|
||||
|
||||
Tcl is developed in public. To keep an eye on how Tcl is changing, see
|
||||
http://core.tcl.tk/
|
||||
|
||||
10. Thank You
|
||||
-------------
|
||||
|
||||
We'd like to express our thanks to the Tcl community for all the
|
||||
helpful suggestions, bug reports, and patches we have received.
|
||||
Tcl/Tk has improved vastly and will continue to do so with your help.
|
||||
@@ -0,0 +1,148 @@
|
||||
# README: Tcl
|
||||
|
||||
This is the **Tcl 8.5.19** source distribution.
|
||||
|
||||
You can get any source release of Tcl from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
[](https://travis-ci.org/tcltk/tcl)
|
||||
|
||||
## Contents
|
||||
1. [Introduction](#intro)
|
||||
2. [Documentation](#doc)
|
||||
3. [Compiling and installing Tcl](#build)
|
||||
4. [Development tools](#devtools)
|
||||
5. [Tcl newsgroup](#complangtcl)
|
||||
6. [The Tcler's Wiki](#wiki)
|
||||
7. [Mailing lists](#email)
|
||||
8. [Support and Training](#support)
|
||||
9. [Tracking Development](#watch)
|
||||
10. [Thank You](#thanks)
|
||||
|
||||
## <a id="intro">1.</a> Introduction
|
||||
Tcl provides a powerful platform for creating integration applications that
|
||||
tie together diverse applications, protocols, devices, and frameworks.
|
||||
When paired with the Tk toolkit, Tcl provides the fastest and most powerful
|
||||
way to create GUI applications that run on PCs, Unix, and Mac OS X.
|
||||
Tcl can also be used for a variety of web-related tasks and for creating
|
||||
powerful command languages for applications.
|
||||
|
||||
Tcl is maintained, enhanced, and distributed freely by the Tcl community.
|
||||
Source code development and tracking of bug reports and feature requests
|
||||
takes place at [core.tcl-lang.org](https://core.tcl-lang.org/).
|
||||
Tcl/Tk release and mailing list services are [hosted by
|
||||
SourceForge](https://sourceforge.net/projects/tcl/)
|
||||
with the Tcl Developer Xchange hosted at
|
||||
[www.tcl-lang.org](https://www.tcl-lang.org).
|
||||
|
||||
Tcl is a freely available open source package. You can do virtually
|
||||
anything you like with it, such as modifying it, redistributing it,
|
||||
and selling it either in whole or in part. See the file
|
||||
`license.terms` for complete information.
|
||||
|
||||
## <a id="doc">2.</a> Documentation
|
||||
Extensive documentation is available at our website.
|
||||
The home page for this release, including new features, is
|
||||
[here](https://www.tcl.tk/software/tcltk/8.5.html).
|
||||
Detailed release notes can be found at the
|
||||
[file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/)
|
||||
by clicking on the relevant version.
|
||||
|
||||
Information about Tcl itself can be found at the [Developer
|
||||
Xchange](https://www.tcl-lang.org/about/).
|
||||
There have been many Tcl books on the market. Many are mentioned in
|
||||
[the Wiki](https://wiki.tcl-lang.org/_/ref?N=25206).
|
||||
|
||||
The complete set of reference manual entries for Tcl 8.5 is [online,
|
||||
here](https://www.tcl-lang.org/man/tcl8.5/).
|
||||
|
||||
### <a id="doc.unix">2a.</a> 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
|
||||
library procedures; and files with extension "`.n`" describe Tcl
|
||||
commands. The file "`doc/Tcl.n`" gives a quick summary of the Tcl
|
||||
language syntax. To print any of the man pages on Unix, cd to the
|
||||
"doc" directory and invoke your favorite variant of troff using the
|
||||
normal -man macros, for example
|
||||
|
||||
groff -man -Tpdf Tcl.n >output.pdf
|
||||
|
||||
to print Tcl.n to PDF. If Tcl has been installed correctly and your "man" program
|
||||
supports it, you should be able to access the Tcl manual entries using the
|
||||
normal "man" mechanisms, such as
|
||||
|
||||
man Tcl
|
||||
|
||||
### <a id="doc.win">2b.</a> Windows Documentation
|
||||
The "doc" subdirectory in this release contains a complete set of Windows
|
||||
help files for Tcl. Once you install this Tcl release, a shortcut to the
|
||||
Windows help Tcl documentation will appear in the "Start" menu:
|
||||
|
||||
Start | Programs | Tcl | Tcl Help
|
||||
|
||||
## <a id="build">3.</a> Compiling and installing Tcl
|
||||
There are brief notes in the `unix/README`, `win/README`, and `macosx/README`
|
||||
about compiling on these different platforms. There is additional information
|
||||
about building Tcl from sources
|
||||
[online](https://www.tcl-lang.org/doc/howto/compile.html).
|
||||
|
||||
## <a id="devtools">4.</a> Development tools
|
||||
ActiveState produces a high quality set of commercial quality development
|
||||
tools that is available to accelerate your Tcl application development.
|
||||
Tcl Dev Kit builds on the earlier TclPro toolset and provides a debugger,
|
||||
static code checker, single-file wrapping utility, bytecode compiler and
|
||||
more. More information can be found at
|
||||
|
||||
http://www.ActiveState.com/Tcl
|
||||
|
||||
## <a id="complangtcl">5.</a> Tcl newsgroup
|
||||
There is a USENET news group, "`comp.lang.tcl`", intended for the exchange of
|
||||
information about Tcl, Tk, and related applications. The newsgroup is a
|
||||
great place to ask general information questions. For bug reports, please
|
||||
see the "Support and bug fixes" section below.
|
||||
|
||||
## <a id="wiki">6.</a> Tcl'ers Wiki
|
||||
There is a [wiki-based open community site](https://wiki.tcl-lang.org/)
|
||||
covering all aspects of Tcl/Tk.
|
||||
|
||||
It is dedicated to the Tcl programming language and its extensions. A
|
||||
wealth of useful information can be found there. It contains code
|
||||
snippets, references to papers, books, and FAQs, as well as pointers to
|
||||
development tools, extensions, and applications. You can also recommend
|
||||
additional URLs by editing the wiki yourself.
|
||||
|
||||
## <a id="email">7.</a> Mailing lists
|
||||
Several mailing lists are hosted at SourceForge to discuss development or use
|
||||
issues (like Macintosh and Windows topics). For more information and to
|
||||
subscribe, visit [here](https://sourceforge.net/projects/tcl/) and go to the
|
||||
Mailing Lists page.
|
||||
|
||||
## <a id="support">8.</a> Support and Training
|
||||
We are very interested in receiving bug reports, patches, and suggestions for
|
||||
improvements. We prefer that you send this information to us as tickets
|
||||
entered into [our issue tracker](https://core.tcl-lang.org/tcl/reportlist).
|
||||
|
||||
We will log and follow-up on each bug, although we cannot promise a
|
||||
specific turn-around time. Enhancements may take longer and may not happen
|
||||
at all unless there is widespread support for them (we're trying to
|
||||
slow the rate at which Tcl/Tk turns into a kitchen sink). It's very
|
||||
difficult to make incompatible changes to Tcl/Tk at this point, due to
|
||||
the size of the installed base.
|
||||
|
||||
The Tcl community is too large for us to provide much individual support for
|
||||
users. If you need help we suggest that you post questions to `comp.lang.tcl`
|
||||
or ask a question on [Stack
|
||||
Overflow](https://stackoverflow.com/questions/tagged/tcl). We read the
|
||||
newsgroup and will attempt to answer esoteric questions for which no one else
|
||||
is likely to know the answer. In addition, see the wiki for [links to other
|
||||
organizations](https://wiki.tcl-lang.org/training) that offer Tcl/Tk training.
|
||||
|
||||
## <a id="watch">9.</a> Tracking Development
|
||||
Tcl is developed in public. You can keep an eye on how Tcl is changing at
|
||||
[core.tcl-lang.org](https://core.tcl-lang.org/).
|
||||
|
||||
## <a id="thanks">10.</a> Thank You
|
||||
We'd like to express our thanks to the Tcl community for all the
|
||||
helpful suggestions, bug reports, and patches we have received.
|
||||
Tcl/Tk has improved vastly and will continue to do so with your help.
|
||||
+4
-4
@@ -329,11 +329,11 @@ trace procedures will always be invoked.
|
||||
.SH "RESTRICTIONS"
|
||||
.PP
|
||||
A trace procedure can be called at any time, even when there
|
||||
is a partially formed result in the interpreter's result area. If
|
||||
are partially formed results stored in the interpreter. If
|
||||
the trace procedure does anything that could damage this result (such
|
||||
as calling \fBTcl_Eval\fR) then it must save the original values of
|
||||
the interpreter's \fBresult\fR and \fBfreeProc\fR fields and restore
|
||||
them before it returns.
|
||||
as calling \fBTcl_Eval\fR) then it must use the \fBTcl_SaveInterpState\fR
|
||||
and related routines to save and restore the original state of
|
||||
the interpreter before it returns.
|
||||
.SH "UNDEFINED VARIABLES"
|
||||
.PP
|
||||
It is legal to set a trace on an undefined variable.
|
||||
|
||||
+65
-15
@@ -26,9 +26,11 @@ as the corresponding C operators.
|
||||
Expressions almost always yield numeric results
|
||||
(integer or floating-point values).
|
||||
For example, the expression
|
||||
.PP
|
||||
.CS
|
||||
\fBexpr 8.2 + 6\fR
|
||||
.CE
|
||||
.PP
|
||||
evaluates to 14.2.
|
||||
Tcl expressions differ from C expressions in the way that
|
||||
operands are specified. Also, Tcl expressions support
|
||||
@@ -103,8 +105,9 @@ For some examples of simple expressions, suppose the variable
|
||||
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
|
||||
.ta 9c
|
||||
\fBexpr\fR 3.1 + $a \fI6.1\fR
|
||||
\fBexpr\fR 2 + "$a.$b" \fI5.6\fR
|
||||
\fBexpr\fR 4*[llength "6 2"] \fI8\fR
|
||||
@@ -189,16 +192,21 @@ Bit-wise OR. Valid for integer operands only.
|
||||
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.
|
||||
This operator evaluates lazily; it only evaluates its right-hand side if it
|
||||
must in order to determine its result.
|
||||
.TP 20
|
||||
\fB||\fR
|
||||
Logical OR. Produces a 0 result if both operands are zero, 1 otherwise.
|
||||
Valid for boolean and numeric (integers or floating-point) operands only.
|
||||
This operator evaluates lazily; it only evaluates its right-hand side if it
|
||||
must in order to determine its result.
|
||||
.TP 20
|
||||
\fIx\fB?\fIy\fB:\fIz\fR
|
||||
\fIx \fB? \fIy \fB: \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.
|
||||
This operator evaluates lazily; it only evaluates one of \fIy\fR or \fIz\fR.
|
||||
.LP
|
||||
See the C manual for more details on the results
|
||||
produced by each operator.
|
||||
@@ -209,18 +217,22 @@ of the \fBpow\fR function (after any type conversions.)
|
||||
.VE 8.5
|
||||
All of the binary operators group left-to-right within the same
|
||||
precedence level. For example, the command
|
||||
.PP
|
||||
.CS
|
||||
\fBexpr\fR {4*2 < 7}
|
||||
.CE
|
||||
.PP
|
||||
returns 0.
|
||||
.PP
|
||||
The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have
|
||||
.QW "lazy evaluation" ,
|
||||
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 {$v ? [a] : [b]}\fR
|
||||
\fBexpr\fR {$v ? [a] : [b]}
|
||||
.CE
|
||||
.PP
|
||||
only one of
|
||||
.QW \fB[a]\fR
|
||||
or
|
||||
@@ -238,18 +250,23 @@ before invoking the \fBexpr\fR command.
|
||||
.VS 8.5
|
||||
When the expression parser encounters a mathematical function
|
||||
such as \fBsin($x)\fR, it replaces it with a call to an ordinary
|
||||
Tcl function in the \fBtcl::mathfunc\fR namespace. The processing
|
||||
Tcl command in the \fBtcl::mathfunc\fR namespace. The processing
|
||||
of an expression such as:
|
||||
.PP
|
||||
.CS
|
||||
\fBexpr {sin($x+$y)}\fR
|
||||
\fBexpr\fR {sin($x+$y)}
|
||||
.CE
|
||||
.PP
|
||||
is the same in every way as the processing of:
|
||||
.PP
|
||||
.CS
|
||||
\fBexpr {[tcl::mathfunc::sin [expr {$x+$y}]]}\fR
|
||||
\fBexpr\fR {[tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]]}
|
||||
.CE
|
||||
.PP
|
||||
which in turn is the same as the processing of:
|
||||
.PP
|
||||
.CS
|
||||
\fBtcl::mathfunc::sin [expr {$x+$y}]\fR
|
||||
tcl::mathfunc::sin [\fBexpr\fR {$x+$y}]
|
||||
.CE
|
||||
.PP
|
||||
The executor will search for \fBtcl::mathfunc::sin\fR using the usual
|
||||
@@ -288,23 +305,29 @@ 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.
|
||||
Floating-point values are always returned with a
|
||||
.QW \fB.\fR
|
||||
or an
|
||||
.QW \fBe\fR
|
||||
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
|
||||
@@ -320,10 +343,12 @@ 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 {"0x03" > "2"}\fR
|
||||
\fBexpr {"0y" > "0x12"}\fR
|
||||
\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
|
||||
@@ -340,15 +365,19 @@ This allows the Tcl bytecode compiler to generate the best code.
|
||||
As mentioned above, expressions are substituted twice:
|
||||
once by the Tcl parser and once by the \fBexpr\fR command.
|
||||
For example, the commands
|
||||
.PP
|
||||
.CS
|
||||
\fBset a 3\fR
|
||||
\fBset b {$a + 2}\fR
|
||||
\fBexpr $b*4\fR
|
||||
set a 3
|
||||
set b {$a + 2}
|
||||
\fBexpr\fR $b*4
|
||||
.CE
|
||||
.PP
|
||||
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,
|
||||
then the \fBexpr\fR command will evaluate the expression \fB$a + 2*4\fR.
|
||||
This is because the Tcl parser will first substitute
|
||||
.QW "\fB$a + 2\fR"
|
||||
for the variable \fBb\fR,
|
||||
then the \fBexpr\fR command will evaluate the expression
|
||||
.QW "\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,
|
||||
@@ -362,6 +391,21 @@ 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.
|
||||
.PP
|
||||
If it is necessary to include a non-constant expression string within the
|
||||
wider context of an otherwise-constant expression, the most efficient
|
||||
technique is to put the varying part inside a recursive \fBexpr\fR, as this at
|
||||
least allows for the compilation of the outer part, though it does mean that
|
||||
the varying part must itself be evaluated as a separate expression. Thus, in
|
||||
this example the result is 20 and the outer expression benefits from fully
|
||||
cached bytecode compilation.
|
||||
.PP
|
||||
.CS
|
||||
set a 3
|
||||
set b {$a + 2}
|
||||
\fBexpr\fR {[\fBexpr\fR $b] * 4}
|
||||
.CE
|
||||
.PP
|
||||
.VS 8.5
|
||||
When the expression is unbraced to allow the substitution of a function or
|
||||
operator, consider using the commands documented in the \fBmathfunc\fR(n) or
|
||||
@@ -371,6 +415,7 @@ operator, consider using the commands documented in the \fBmathfunc\fR(n) or
|
||||
Define a procedure that computes an
|
||||
.QW interesting
|
||||
mathematical function:
|
||||
.PP
|
||||
.CS
|
||||
proc tcl::mathfunc::calc {x y} {
|
||||
\fBexpr\fR { ($x**2 - $y**2) / exp($x**2 + $y**2) }
|
||||
@@ -378,6 +423,7 @@ proc tcl::mathfunc::calc {x y} {
|
||||
.CE
|
||||
.PP
|
||||
Convert polar coordinates into cartesian coordinates:
|
||||
.PP
|
||||
.CS
|
||||
# convert from ($radius,$angle)
|
||||
set x [\fBexpr\fR { $radius * cos($angle) }]
|
||||
@@ -385,6 +431,7 @@ set y [\fBexpr\fR { $radius * sin($angle) }]
|
||||
.CE
|
||||
.PP
|
||||
Convert cartesian coordinates into polar coordinates:
|
||||
.PP
|
||||
.CS
|
||||
# convert from ($x,$y)
|
||||
set radius [\fBexpr\fR { hypot($y, $x) }]
|
||||
@@ -393,12 +440,14 @@ set angle [\fBexpr\fR { atan2($y, $x) }]
|
||||
.PP
|
||||
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 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)] &&
|
||||
@@ -407,6 +456,7 @@ set isTrue [\fBexpr\fR {
|
||||
.CE
|
||||
.PP
|
||||
Generate a random integer in the range 0..99 inclusive:
|
||||
.PP
|
||||
.CS
|
||||
set randNum [\fBexpr\fR { int(100 * rand()) }]
|
||||
.CE
|
||||
|
||||
+338
-197
File diff suppressed because it is too large
Load Diff
+146
@@ -0,0 +1,146 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2005 Sergey Brester aka sebres.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH timerate n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
timerate \- Calibrated performance measurements of script execution time
|
||||
.SH SYNOPSIS
|
||||
\fBtimerate \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
|
||||
.sp
|
||||
\fBtimerate \fR?\fB\-direct\fR? ?\fB\-overhead\fI double\fR? \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
|
||||
.sp
|
||||
\fBtimerate \fR?\fB\-calibrate\fR? ?\fB\-direct\fR? \fIscript\fR ?\fItime\fR? ?\fImax-count\fR?
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fBtimerate\fR command does calibrated performance measurement of a Tcl
|
||||
command or script, \fIscript\fR. The \fIscript\fR should be written so that it
|
||||
can be executed multiple times during the performance measurement process.
|
||||
Time is measured in elapsed time using the finest timer resolution as possible,
|
||||
not CPU time; if \fIscript\fR interacts with the OS, the cost of that
|
||||
interaction is included.
|
||||
This command may be used to provide information as to how well a script or
|
||||
Tcl command is performing, and can help determine bottlenecks and fine-tune
|
||||
application performance.
|
||||
.PP
|
||||
The first and second form will evaluate \fIscript\fR until the interval
|
||||
\fItime\fR given in milliseconds elapses, or for 1000 milliseconds (1 second)
|
||||
if \fItime\fR is not specified.
|
||||
.sp
|
||||
The parameter \fImax-count\fR could additionally impose a further restriction
|
||||
by the maximal number of iterations to evaluate the script.
|
||||
If \fImax-count\fR is specified, the evalution will stop either this count of
|
||||
iterations is reached or the time is exceeded.
|
||||
.sp
|
||||
It will then return a canonical tcl-list of the form:
|
||||
.PP
|
||||
.CS
|
||||
\fB0.095977 \(mcs/# 52095836 # 10419167 #/sec 5000.000 net-ms\fR
|
||||
.CE
|
||||
.PP
|
||||
which indicates:
|
||||
.IP \(bu 3
|
||||
the average amount of time required per iteration, in microseconds ([\fBlindex\fR $result 0])
|
||||
.IP \(bu 3
|
||||
the count how many times it was executed ([\fBlindex\fR $result 2])
|
||||
.IP \(bu 3
|
||||
the estimated rate per second ([\fBlindex\fR $result 4])
|
||||
.IP \(bu 3
|
||||
the estimated real execution time without measurement overhead ([\fBlindex\fR $result 6])
|
||||
.PP
|
||||
The following options may be supplied to the \fBtimerate\fR command:
|
||||
.TP
|
||||
\fB\-calibrate\fR
|
||||
.
|
||||
To measure very fast scripts as exactly as possible, a calibration process
|
||||
may be required.
|
||||
The \fB\-calibrate\fR option is used to calibrate \fBtimerate\fR itself,
|
||||
calculating the estimated overhead of the given script as the default overhead
|
||||
for future invocations of the \fBtimerate\fR command. If the \fItime\fR
|
||||
parameter is not specified, the calibrate procedure runs for up to 10 seconds.
|
||||
.RS
|
||||
.PP
|
||||
Note that calibration is not thread safe in the current implementation.
|
||||
.RE
|
||||
.TP
|
||||
\fB\-overhead \fIdouble\fR
|
||||
.
|
||||
The \fB\-overhead\fR parameter supplies an estimate (in microseconds) of the
|
||||
measurement overhead of each iteration of the tested script. This quantity
|
||||
will be subtracted from the measured time prior to reporting results. This can
|
||||
be useful for removing the cost of interpreter state reset commands from the
|
||||
script being measured.
|
||||
.TP
|
||||
\fB\-direct\fR
|
||||
.
|
||||
The \fB-direct\fR option causes direct execution of the supplied script,
|
||||
without compilation, in a manner similar to the \fBtime\fR command. It can be
|
||||
used to measure the cost of \fBTcl_EvalObjEx\fR, of the invocation of canonical
|
||||
lists, and of the uncompiled versions of bytecoded commands.
|
||||
.PP
|
||||
As opposed to the \fBtime\fR commmand, which runs the tested script for a fixed
|
||||
number of iterations, the timerate command runs it for a fixed time.
|
||||
Additionally, the compiled variant of the script will be used during the entire
|
||||
measurement, as if the script were part of a compiled procedure, if the \fB\-direct\fR
|
||||
option is not specified. The fixed time period and possibility of compilation allow
|
||||
for more precise results and prevent very long execution times by slow scripts, making
|
||||
it practical for measuring scripts with highly uncertain execution times.
|
||||
.SH EXAMPLES
|
||||
Estimate how fast it takes for a simple Tcl \fBfor\fR loop (including
|
||||
operations on variable \fIi\fR) to count to ten:
|
||||
.PP
|
||||
.CS
|
||||
\fI# calibrate\fR
|
||||
\fBtimerate\fR -calibrate {}
|
||||
|
||||
\fI# measure\fR
|
||||
\fBtimerate\fR { for {set i 0} {$i<10} {incr i} {} } 5000
|
||||
.CE
|
||||
.PP
|
||||
Estimate how fast it takes for a simple Tcl \fBfor\fR loop, ignoring the
|
||||
overhead of the management of the variable that controls the loop:
|
||||
.PP
|
||||
.CS
|
||||
\fI# calibrate for overhead of variable operations\fR
|
||||
set i 0; \fBtimerate\fR -calibrate {expr {$i<10}; incr i} 1000
|
||||
|
||||
\fI# measure\fR
|
||||
\fBtimerate\fR {
|
||||
for {set i 0} {$i<10} {incr i} {}
|
||||
} 5000
|
||||
.CE
|
||||
.PP
|
||||
Estimate the speed of calculating the hour of the day using \fBclock format\fR only,
|
||||
ignoring overhead of the portion of the script that prepares the time for it to
|
||||
calculate:
|
||||
.PP
|
||||
.CS
|
||||
\fI# calibrate\fR
|
||||
\fBtimerate\fR -calibrate {}
|
||||
|
||||
\fI# estimate overhead\fR
|
||||
set tm 0
|
||||
set ovh [lindex [\fBtimerate\fR {
|
||||
incr tm [expr {24*60*60}]
|
||||
}] 0]
|
||||
|
||||
\fI# measure using estimated overhead\fR
|
||||
set tm 0
|
||||
\fBtimerate\fR -overhead $ovh {
|
||||
clock format $tm -format %H
|
||||
incr tm [expr {24*60*60}]; # overhead for this is ignored
|
||||
} 5000
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
time(n)
|
||||
.SH KEYWORDS
|
||||
performance measurement, script, time
|
||||
.\" Local Variables:
|
||||
.\" mode: nroff
|
||||
.\" End:
|
||||
+166
-161
@@ -153,46 +153,46 @@ static const crange alphaRangeTable[] = {
|
||||
{0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xd05, 0xd0c},
|
||||
{0xd0e, 0xd10}, {0xd12, 0xd3a}, {0xd54, 0xd56}, {0xd5f, 0xd61},
|
||||
{0xd7a, 0xd7f}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb},
|
||||
{0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe40, 0xe46}, {0xe94, 0xe97},
|
||||
{0xe99, 0xe9f}, {0xea1, 0xea3}, {0xead, 0xeb0}, {0xec0, 0xec4},
|
||||
{0xedc, 0xedf}, {0xf40, 0xf47}, {0xf49, 0xf6c}, {0xf88, 0xf8c},
|
||||
{0x1000, 0x102a}, {0x1050, 0x1055}, {0x105a, 0x105d}, {0x106e, 0x1070},
|
||||
{0x1075, 0x1081}, {0x10a0, 0x10c5}, {0x10d0, 0x10fa}, {0x10fc, 0x1248},
|
||||
{0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d}, {0x1260, 0x1288},
|
||||
{0x128a, 0x128d}, {0x1290, 0x12b0}, {0x12b2, 0x12b5}, {0x12b8, 0x12be},
|
||||
{0x12c2, 0x12c5}, {0x12c8, 0x12d6}, {0x12d8, 0x1310}, {0x1312, 0x1315},
|
||||
{0x1318, 0x135a}, {0x1380, 0x138f}, {0x13a0, 0x13f5}, {0x13f8, 0x13fd},
|
||||
{0x1401, 0x166c}, {0x166f, 0x167f}, {0x1681, 0x169a}, {0x16a0, 0x16ea},
|
||||
{0x16f1, 0x16f8}, {0x1700, 0x170c}, {0x170e, 0x1711}, {0x1720, 0x1731},
|
||||
{0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17b3},
|
||||
{0x1820, 0x1878}, {0x1880, 0x1884}, {0x1887, 0x18a8}, {0x18b0, 0x18f5},
|
||||
{0x1900, 0x191e}, {0x1950, 0x196d}, {0x1970, 0x1974}, {0x1980, 0x19ab},
|
||||
{0x19b0, 0x19c9}, {0x1a00, 0x1a16}, {0x1a20, 0x1a54}, {0x1b05, 0x1b33},
|
||||
{0x1b45, 0x1b4b}, {0x1b83, 0x1ba0}, {0x1bba, 0x1be5}, {0x1c00, 0x1c23},
|
||||
{0x1c4d, 0x1c4f}, {0x1c5a, 0x1c7d}, {0x1c80, 0x1c88}, {0x1c90, 0x1cba},
|
||||
{0x1cbd, 0x1cbf}, {0x1ce9, 0x1cec}, {0x1cee, 0x1cf1}, {0x1d00, 0x1dbf},
|
||||
{0x1e00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d},
|
||||
{0x1f50, 0x1f57}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc},
|
||||
{0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb},
|
||||
{0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2090, 0x209c},
|
||||
{0x210a, 0x2113}, {0x2119, 0x211d}, {0x212a, 0x212d}, {0x212f, 0x2139},
|
||||
{0x213c, 0x213f}, {0x2145, 0x2149}, {0x2c00, 0x2c2e}, {0x2c30, 0x2c5e},
|
||||
{0x2c60, 0x2ce4}, {0x2ceb, 0x2cee}, {0x2d00, 0x2d25}, {0x2d30, 0x2d67},
|
||||
{0x2d80, 0x2d96}, {0x2da0, 0x2da6}, {0x2da8, 0x2dae}, {0x2db0, 0x2db6},
|
||||
{0x2db8, 0x2dbe}, {0x2dc0, 0x2dc6}, {0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6},
|
||||
{0x2dd8, 0x2dde}, {0x3031, 0x3035}, {0x3041, 0x3096}, {0x309d, 0x309f},
|
||||
{0x30a1, 0x30fa}, {0x30fc, 0x30ff}, {0x3105, 0x312f}, {0x3131, 0x318e},
|
||||
{0x31a0, 0x31ba}, {0x31f0, 0x31ff}, {0x3400, 0x4db5}, {0x4e00, 0x9fef},
|
||||
{0xa000, 0xa48c}, {0xa4d0, 0xa4fd}, {0xa500, 0xa60c}, {0xa610, 0xa61f},
|
||||
{0xa640, 0xa66e}, {0xa67f, 0xa69d}, {0xa6a0, 0xa6e5}, {0xa717, 0xa71f},
|
||||
{0xa722, 0xa788}, {0xa78b, 0xa7b9}, {0xa7f7, 0xa801}, {0xa803, 0xa805},
|
||||
{0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe40, 0xe46}, {0xe86, 0xe8a},
|
||||
{0xe8c, 0xea3}, {0xea7, 0xeb0}, {0xec0, 0xec4}, {0xedc, 0xedf},
|
||||
{0xf40, 0xf47}, {0xf49, 0xf6c}, {0xf88, 0xf8c}, {0x1000, 0x102a},
|
||||
{0x1050, 0x1055}, {0x105a, 0x105d}, {0x106e, 0x1070}, {0x1075, 0x1081},
|
||||
{0x10a0, 0x10c5}, {0x10d0, 0x10fa}, {0x10fc, 0x1248}, {0x124a, 0x124d},
|
||||
{0x1250, 0x1256}, {0x125a, 0x125d}, {0x1260, 0x1288}, {0x128a, 0x128d},
|
||||
{0x1290, 0x12b0}, {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5},
|
||||
{0x12c8, 0x12d6}, {0x12d8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135a},
|
||||
{0x1380, 0x138f}, {0x13a0, 0x13f5}, {0x13f8, 0x13fd}, {0x1401, 0x166c},
|
||||
{0x166f, 0x167f}, {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x16f1, 0x16f8},
|
||||
{0x1700, 0x170c}, {0x170e, 0x1711}, {0x1720, 0x1731}, {0x1740, 0x1751},
|
||||
{0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17b3}, {0x1820, 0x1878},
|
||||
{0x1880, 0x1884}, {0x1887, 0x18a8}, {0x18b0, 0x18f5}, {0x1900, 0x191e},
|
||||
{0x1950, 0x196d}, {0x1970, 0x1974}, {0x1980, 0x19ab}, {0x19b0, 0x19c9},
|
||||
{0x1a00, 0x1a16}, {0x1a20, 0x1a54}, {0x1b05, 0x1b33}, {0x1b45, 0x1b4b},
|
||||
{0x1b83, 0x1ba0}, {0x1bba, 0x1be5}, {0x1c00, 0x1c23}, {0x1c4d, 0x1c4f},
|
||||
{0x1c5a, 0x1c7d}, {0x1c80, 0x1c88}, {0x1c90, 0x1cba}, {0x1cbd, 0x1cbf},
|
||||
{0x1ce9, 0x1cec}, {0x1cee, 0x1cf3}, {0x1d00, 0x1dbf}, {0x1e00, 0x1f15},
|
||||
{0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57},
|
||||
{0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fc2, 0x1fc4},
|
||||
{0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec},
|
||||
{0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2090, 0x209c}, {0x210a, 0x2113},
|
||||
{0x2119, 0x211d}, {0x212a, 0x212d}, {0x212f, 0x2139}, {0x213c, 0x213f},
|
||||
{0x2145, 0x2149}, {0x2c00, 0x2c2e}, {0x2c30, 0x2c5e}, {0x2c60, 0x2ce4},
|
||||
{0x2ceb, 0x2cee}, {0x2d00, 0x2d25}, {0x2d30, 0x2d67}, {0x2d80, 0x2d96},
|
||||
{0x2da0, 0x2da6}, {0x2da8, 0x2dae}, {0x2db0, 0x2db6}, {0x2db8, 0x2dbe},
|
||||
{0x2dc0, 0x2dc6}, {0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde},
|
||||
{0x3031, 0x3035}, {0x3041, 0x3096}, {0x309d, 0x309f}, {0x30a1, 0x30fa},
|
||||
{0x30fc, 0x30ff}, {0x3105, 0x312f}, {0x3131, 0x318e}, {0x31a0, 0x31ba},
|
||||
{0x31f0, 0x31ff}, {0x3400, 0x4db5}, {0x4e00, 0x9fef}, {0xa000, 0xa48c},
|
||||
{0xa4d0, 0xa4fd}, {0xa500, 0xa60c}, {0xa610, 0xa61f}, {0xa640, 0xa66e},
|
||||
{0xa67f, 0xa69d}, {0xa6a0, 0xa6e5}, {0xa717, 0xa71f}, {0xa722, 0xa788},
|
||||
{0xa78b, 0xa7bf}, {0xa7c2, 0xa7c6}, {0xa7f7, 0xa801}, {0xa803, 0xa805},
|
||||
{0xa807, 0xa80a}, {0xa80c, 0xa822}, {0xa840, 0xa873}, {0xa882, 0xa8b3},
|
||||
{0xa8f2, 0xa8f7}, {0xa90a, 0xa925}, {0xa930, 0xa946}, {0xa960, 0xa97c},
|
||||
{0xa984, 0xa9b2}, {0xa9e0, 0xa9e4}, {0xa9e6, 0xa9ef}, {0xa9fa, 0xa9fe},
|
||||
{0xaa00, 0xaa28}, {0xaa40, 0xaa42}, {0xaa44, 0xaa4b}, {0xaa60, 0xaa76},
|
||||
{0xaa7e, 0xaaaf}, {0xaab9, 0xaabd}, {0xaadb, 0xaadd}, {0xaae0, 0xaaea},
|
||||
{0xaaf2, 0xaaf4}, {0xab01, 0xab06}, {0xab09, 0xab0e}, {0xab11, 0xab16},
|
||||
{0xab20, 0xab26}, {0xab28, 0xab2e}, {0xab30, 0xab5a}, {0xab5c, 0xab65},
|
||||
{0xab20, 0xab26}, {0xab28, 0xab2e}, {0xab30, 0xab5a}, {0xab5c, 0xab67},
|
||||
{0xab70, 0xabe2}, {0xac00, 0xd7a3}, {0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb},
|
||||
{0xf900, 0xfa6d}, {0xfa70, 0xfad9}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17},
|
||||
{0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb46, 0xfbb1},
|
||||
@@ -213,21 +213,22 @@ static const crange alphaRangeTable[] = {
|
||||
{0x10a80, 0x10a9c}, {0x10ac0, 0x10ac7}, {0x10ac9, 0x10ae4}, {0x10b00, 0x10b35},
|
||||
{0x10b40, 0x10b55}, {0x10b60, 0x10b72}, {0x10b80, 0x10b91}, {0x10c00, 0x10c48},
|
||||
{0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2}, {0x10d00, 0x10d23}, {0x10f00, 0x10f1c},
|
||||
{0x10f30, 0x10f45}, {0x11003, 0x11037}, {0x11083, 0x110af}, {0x110d0, 0x110e8},
|
||||
{0x11103, 0x11126}, {0x11150, 0x11172}, {0x11183, 0x111b2}, {0x111c1, 0x111c4},
|
||||
{0x11200, 0x11211}, {0x11213, 0x1122b}, {0x11280, 0x11286}, {0x1128a, 0x1128d},
|
||||
{0x1128f, 0x1129d}, {0x1129f, 0x112a8}, {0x112b0, 0x112de}, {0x11305, 0x1130c},
|
||||
{0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339}, {0x1135d, 0x11361},
|
||||
{0x11400, 0x11434}, {0x11447, 0x1144a}, {0x11480, 0x114af}, {0x11580, 0x115ae},
|
||||
{0x115d8, 0x115db}, {0x11600, 0x1162f}, {0x11680, 0x116aa}, {0x11700, 0x1171a},
|
||||
{0x11800, 0x1182b}, {0x118a0, 0x118df}, {0x11a0b, 0x11a32}, {0x11a5c, 0x11a83},
|
||||
{0x11a86, 0x11a89}, {0x11ac0, 0x11af8}, {0x11c00, 0x11c08}, {0x11c0a, 0x11c2e},
|
||||
{0x11c72, 0x11c8f}, {0x11d00, 0x11d06}, {0x11d0b, 0x11d30}, {0x11d60, 0x11d65},
|
||||
{0x11d6a, 0x11d89}, {0x11ee0, 0x11ef2}, {0x12000, 0x12399}, {0x12480, 0x12543},
|
||||
{0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38}, {0x16a40, 0x16a5e},
|
||||
{0x16ad0, 0x16aed}, {0x16b00, 0x16b2f}, {0x16b40, 0x16b43}, {0x16b63, 0x16b77},
|
||||
{0x16b7d, 0x16b8f}, {0x16e40, 0x16e7f}, {0x16f00, 0x16f44}, {0x16f93, 0x16f9f},
|
||||
{0x17000, 0x187f1}, {0x18800, 0x18af2}, {0x1b000, 0x1b11e}, {0x1b170, 0x1b2fb},
|
||||
{0x10f30, 0x10f45}, {0x10fe0, 0x10ff6}, {0x11003, 0x11037}, {0x11083, 0x110af},
|
||||
{0x110d0, 0x110e8}, {0x11103, 0x11126}, {0x11150, 0x11172}, {0x11183, 0x111b2},
|
||||
{0x111c1, 0x111c4}, {0x11200, 0x11211}, {0x11213, 0x1122b}, {0x11280, 0x11286},
|
||||
{0x1128a, 0x1128d}, {0x1128f, 0x1129d}, {0x1129f, 0x112a8}, {0x112b0, 0x112de},
|
||||
{0x11305, 0x1130c}, {0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339},
|
||||
{0x1135d, 0x11361}, {0x11400, 0x11434}, {0x11447, 0x1144a}, {0x11480, 0x114af},
|
||||
{0x11580, 0x115ae}, {0x115d8, 0x115db}, {0x11600, 0x1162f}, {0x11680, 0x116aa},
|
||||
{0x11700, 0x1171a}, {0x11800, 0x1182b}, {0x118a0, 0x118df}, {0x119a0, 0x119a7},
|
||||
{0x119aa, 0x119d0}, {0x11a0b, 0x11a32}, {0x11a5c, 0x11a89}, {0x11ac0, 0x11af8},
|
||||
{0x11c00, 0x11c08}, {0x11c0a, 0x11c2e}, {0x11c72, 0x11c8f}, {0x11d00, 0x11d06},
|
||||
{0x11d0b, 0x11d30}, {0x11d60, 0x11d65}, {0x11d6a, 0x11d89}, {0x11ee0, 0x11ef2},
|
||||
{0x12000, 0x12399}, {0x12480, 0x12543}, {0x13000, 0x1342e}, {0x14400, 0x14646},
|
||||
{0x16800, 0x16a38}, {0x16a40, 0x16a5e}, {0x16ad0, 0x16aed}, {0x16b00, 0x16b2f},
|
||||
{0x16b40, 0x16b43}, {0x16b63, 0x16b77}, {0x16b7d, 0x16b8f}, {0x16e40, 0x16e7f},
|
||||
{0x16f00, 0x16f4a}, {0x16f93, 0x16f9f}, {0x17000, 0x187f7}, {0x18800, 0x18af2},
|
||||
{0x1b000, 0x1b11e}, {0x1b150, 0x1b152}, {0x1b164, 0x1b167}, {0x1b170, 0x1b2fb},
|
||||
{0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, {0x1bc90, 0x1bc99},
|
||||
{0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b9},
|
||||
{0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514},
|
||||
@@ -235,12 +236,13 @@ static const crange alphaRangeTable[] = {
|
||||
{0x1d54a, 0x1d550}, {0x1d552, 0x1d6a5}, {0x1d6a8, 0x1d6c0}, {0x1d6c2, 0x1d6da},
|
||||
{0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, {0x1d736, 0x1d74e},
|
||||
{0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d7a8}, {0x1d7aa, 0x1d7c2},
|
||||
{0x1d7c4, 0x1d7cb}, {0x1e800, 0x1e8c4}, {0x1e900, 0x1e943}, {0x1ee00, 0x1ee03},
|
||||
{0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f},
|
||||
{0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c},
|
||||
{0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9},
|
||||
{0x1eeab, 0x1eebb}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d},
|
||||
{0x2b820, 0x2cea1}, {0x2ceb0, 0x2ebe0}, {0x2f800, 0x2fa1d}
|
||||
{0x1d7c4, 0x1d7cb}, {0x1e100, 0x1e12c}, {0x1e137, 0x1e13d}, {0x1e2c0, 0x1e2eb},
|
||||
{0x1e800, 0x1e8c4}, {0x1e900, 0x1e943}, {0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f},
|
||||
{0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a},
|
||||
{0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89},
|
||||
{0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb},
|
||||
{0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d}, {0x2b820, 0x2cea1},
|
||||
{0x2ceb0, 0x2ebe0}, {0x2f800, 0x2fa1d}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -257,24 +259,24 @@ static const chr alphaCharTable[] = {
|
||||
0xb83, 0xb99, 0xb9a, 0xb9c, 0xb9e, 0xb9f, 0xba3, 0xba4, 0xbd0,
|
||||
0xc3d, 0xc60, 0xc61, 0xc80, 0xcbd, 0xcde, 0xce0, 0xce1, 0xcf1,
|
||||
0xcf2, 0xd3d, 0xd4e, 0xdbd, 0xe32, 0xe33, 0xe81, 0xe82, 0xe84,
|
||||
0xe87, 0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, 0xeab, 0xeb2,
|
||||
0xeb3, 0xebd, 0xec6, 0xf00, 0x103f, 0x1061, 0x1065, 0x1066, 0x108e,
|
||||
0x10c7, 0x10cd, 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7, 0x1bae,
|
||||
0x1baf, 0x1cf5, 0x1cf6, 0x1f59, 0x1f5b, 0x1f5d, 0x1fbe, 0x2071, 0x207f,
|
||||
0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x214e, 0x2183, 0x2184,
|
||||
0x2cf2, 0x2cf3, 0x2d27, 0x2d2d, 0x2d6f, 0x2e2f, 0x3005, 0x3006, 0x303b,
|
||||
0x303c, 0xa62a, 0xa62b, 0xa8fb, 0xa8fd, 0xa8fe, 0xa9cf, 0xaa7a, 0xaab1,
|
||||
0xaab5, 0xaab6, 0xaac0, 0xaac2, 0xfb1d, 0xfb3e, 0xfb40, 0xfb41, 0xfb43,
|
||||
0xfb44
|
||||
0xea5, 0xeb2, 0xeb3, 0xebd, 0xec6, 0xf00, 0x103f, 0x1061, 0x1065,
|
||||
0x1066, 0x108e, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa,
|
||||
0x1aa7, 0x1bae, 0x1baf, 0x1cf5, 0x1cf6, 0x1cfa, 0x1f59, 0x1f5b, 0x1f5d,
|
||||
0x1fbe, 0x2071, 0x207f, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128,
|
||||
0x214e, 0x2183, 0x2184, 0x2cf2, 0x2cf3, 0x2d27, 0x2d2d, 0x2d6f, 0x2e2f,
|
||||
0x3005, 0x3006, 0x303b, 0x303c, 0xa62a, 0xa62b, 0xa8fb, 0xa8fd, 0xa8fe,
|
||||
0xa9cf, 0xaa7a, 0xaab1, 0xaab5, 0xaab6, 0xaac0, 0xaac2, 0xfb1d, 0xfb3e,
|
||||
0xfb40, 0xfb41, 0xfb43, 0xfb44
|
||||
#if CHRBITS > 16
|
||||
,0x1003c, 0x1003d, 0x10808, 0x10837, 0x10838, 0x1083c, 0x108f4, 0x108f5, 0x109be,
|
||||
0x109bf, 0x10a00, 0x10f27, 0x11144, 0x11176, 0x111da, 0x111dc, 0x11288, 0x1130f,
|
||||
0x11310, 0x11332, 0x11333, 0x1133d, 0x11350, 0x114c4, 0x114c5, 0x114c7, 0x11644,
|
||||
0x118ff, 0x11a00, 0x11a3a, 0x11a50, 0x11a9d, 0x11c40, 0x11d08, 0x11d09, 0x11d46,
|
||||
0x11d67, 0x11d68, 0x11d98, 0x16f50, 0x16fe0, 0x16fe1, 0x1d49e, 0x1d49f, 0x1d4a2,
|
||||
0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39,
|
||||
0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57,
|
||||
0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e
|
||||
0x11310, 0x11332, 0x11333, 0x1133d, 0x11350, 0x1145f, 0x114c4, 0x114c5, 0x114c7,
|
||||
0x11644, 0x116b8, 0x118ff, 0x119e1, 0x119e3, 0x11a00, 0x11a3a, 0x11a50, 0x11a9d,
|
||||
0x11c40, 0x11d08, 0x11d09, 0x11d46, 0x11d67, 0x11d68, 0x11d98, 0x16f50, 0x16fe0,
|
||||
0x16fe1, 0x16fe3, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546,
|
||||
0x1e14e, 0x1e94b, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39, 0x1ee3b, 0x1ee42,
|
||||
0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57, 0x1ee59, 0x1ee5b,
|
||||
0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -289,8 +291,8 @@ static const crange controlRangeTable[] = {
|
||||
{0x202a, 0x202e}, {0x2060, 0x2064}, {0x2066, 0x206f}, {0xe000, 0xf8ff},
|
||||
{0xfff9, 0xfffb}
|
||||
#if CHRBITS > 16
|
||||
,{0x1bca0, 0x1bca3}, {0x1d173, 0x1d17a}, {0xe0020, 0xe007f}, {0xf0000, 0xffffd},
|
||||
{0x100000, 0x10fffd}
|
||||
,{0x13430, 0x13438}, {0x1bca0, 0x1bca3}, {0x1d173, 0x1d17a}, {0xe0020, 0xe007f},
|
||||
{0xf0000, 0xffffd}, {0x100000, 0x10fffd}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -325,7 +327,8 @@ static const crange digitRangeTable[] = {
|
||||
{0x11136, 0x1113f}, {0x111d0, 0x111d9}, {0x112f0, 0x112f9}, {0x11450, 0x11459},
|
||||
{0x114d0, 0x114d9}, {0x11650, 0x11659}, {0x116c0, 0x116c9}, {0x11730, 0x11739},
|
||||
{0x118e0, 0x118e9}, {0x11c50, 0x11c59}, {0x11d50, 0x11d59}, {0x11da0, 0x11da9},
|
||||
{0x16a60, 0x16a69}, {0x16b50, 0x16b59}, {0x1d7ce, 0x1d7ff}, {0x1e950, 0x1e959}
|
||||
{0x16a60, 0x16a69}, {0x16b50, 0x16b59}, {0x1d7ce, 0x1d7ff}, {0x1e140, 0x1e149},
|
||||
{0x1e2f0, 0x1e2f9}, {0x1e950, 0x1e959}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -348,7 +351,7 @@ static const crange punctRangeTable[] = {
|
||||
{0x1b5a, 0x1b60}, {0x1bfc, 0x1bff}, {0x1c3b, 0x1c3f}, {0x1cc0, 0x1cc7},
|
||||
{0x2010, 0x2027}, {0x2030, 0x2043}, {0x2045, 0x2051}, {0x2053, 0x205e},
|
||||
{0x2308, 0x230b}, {0x2768, 0x2775}, {0x27e6, 0x27ef}, {0x2983, 0x2998},
|
||||
{0x29d8, 0x29db}, {0x2cf9, 0x2cfc}, {0x2e00, 0x2e2e}, {0x2e30, 0x2e4e},
|
||||
{0x29d8, 0x29db}, {0x2cf9, 0x2cfc}, {0x2e00, 0x2e2e}, {0x2e30, 0x2e4f},
|
||||
{0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, {0xa60d, 0xa60f},
|
||||
{0xa6f2, 0xa6f7}, {0xa874, 0xa877}, {0xa8f8, 0xa8fa}, {0xa9c1, 0xa9cd},
|
||||
{0xaa5c, 0xaa5f}, {0xfe10, 0xfe19}, {0xfe30, 0xfe52}, {0xfe54, 0xfe61},
|
||||
@@ -372,8 +375,8 @@ static const chr punctCharTable[] = {
|
||||
0xab, 0xb6, 0xb7, 0xbb, 0xbf, 0x37e, 0x387, 0x589, 0x58a,
|
||||
0x5be, 0x5c0, 0x5c3, 0x5c6, 0x5f3, 0x5f4, 0x609, 0x60a, 0x60c,
|
||||
0x60d, 0x61b, 0x61e, 0x61f, 0x6d4, 0x85e, 0x964, 0x965, 0x970,
|
||||
0x9fd, 0xa76, 0xaf0, 0xc84, 0xdf4, 0xe4f, 0xe5a, 0xe5b, 0xf14,
|
||||
0xf85, 0xfd9, 0xfda, 0x10fb, 0x1400, 0x166d, 0x166e, 0x169b, 0x169c,
|
||||
0x9fd, 0xa76, 0xaf0, 0xc77, 0xc84, 0xdf4, 0xe4f, 0xe5a, 0xe5b,
|
||||
0xf14, 0xf85, 0xfd9, 0xfda, 0x10fb, 0x1400, 0x166e, 0x169b, 0x169c,
|
||||
0x1735, 0x1736, 0x1944, 0x1945, 0x1a1e, 0x1a1f, 0x1c7e, 0x1c7f, 0x1cd3,
|
||||
0x207d, 0x207e, 0x208d, 0x208e, 0x2329, 0x232a, 0x27c5, 0x27c6, 0x29fc,
|
||||
0x29fd, 0x2cfe, 0x2cff, 0x2d70, 0x3030, 0x303d, 0x30a0, 0x30fb, 0xa4fe,
|
||||
@@ -384,8 +387,8 @@ static const chr punctCharTable[] = {
|
||||
#if CHRBITS > 16
|
||||
,0x1039f, 0x103d0, 0x1056f, 0x10857, 0x1091f, 0x1093f, 0x10a7f, 0x110bb, 0x110bc,
|
||||
0x11174, 0x11175, 0x111cd, 0x111db, 0x112a9, 0x1145b, 0x1145d, 0x114c6, 0x1183b,
|
||||
0x11c70, 0x11c71, 0x11ef7, 0x11ef8, 0x16a6e, 0x16a6f, 0x16af5, 0x16b44, 0x1bc9f,
|
||||
0x1e95e, 0x1e95f
|
||||
0x119e2, 0x11c70, 0x11c71, 0x11ef7, 0x11ef8, 0x11fff, 0x16a6e, 0x16a6f, 0x16af5,
|
||||
0x16b44, 0x16fe2, 0x1bc9f, 0x1e95e, 0x1e95f
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -424,7 +427,7 @@ static const crange lowerRangeTable[] = {
|
||||
{0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, {0x1fc2, 0x1fc4},
|
||||
{0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0x2146, 0x2149},
|
||||
{0x2c30, 0x2c5e}, {0x2c76, 0x2c7b}, {0x2d00, 0x2d25}, {0xa72f, 0xa731},
|
||||
{0xa771, 0xa778}, {0xa793, 0xa795}, {0xab30, 0xab5a}, {0xab60, 0xab65},
|
||||
{0xa771, 0xa778}, {0xa793, 0xa795}, {0xab30, 0xab5a}, {0xab60, 0xab67},
|
||||
{0xab70, 0xabbf}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xff41, 0xff5a}
|
||||
#if CHRBITS > 16
|
||||
,{0x10428, 0x1044f}, {0x104d8, 0x104fb}, {0x10cc0, 0x10cf2}, {0x118c0, 0x118df},
|
||||
@@ -504,7 +507,7 @@ static const chr lowerCharTable[] = {
|
||||
0xa763, 0xa765, 0xa767, 0xa769, 0xa76b, 0xa76d, 0xa76f, 0xa77a, 0xa77c,
|
||||
0xa77f, 0xa781, 0xa783, 0xa785, 0xa787, 0xa78c, 0xa78e, 0xa791, 0xa797,
|
||||
0xa799, 0xa79b, 0xa79d, 0xa79f, 0xa7a1, 0xa7a3, 0xa7a5, 0xa7a7, 0xa7a9,
|
||||
0xa7af, 0xa7b5, 0xa7b7, 0xa7b9, 0xa7fa
|
||||
0xa7af, 0xa7b5, 0xa7b7, 0xa7b9, 0xa7bb, 0xa7bd, 0xa7bf, 0xa7c3, 0xa7fa
|
||||
#if CHRBITS > 16
|
||||
,0x1d4bb, 0x1d7cb
|
||||
#endif
|
||||
@@ -527,7 +530,7 @@ static const crange upperRangeTable[] = {
|
||||
{0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, {0x210b, 0x210d}, {0x2110, 0x2112},
|
||||
{0x2119, 0x211d}, {0x212a, 0x212d}, {0x2130, 0x2133}, {0x2c00, 0x2c2e},
|
||||
{0x2c62, 0x2c64}, {0x2c6d, 0x2c70}, {0x2c7e, 0x2c80}, {0xa7aa, 0xa7ae},
|
||||
{0xa7b0, 0xa7b4}, {0xff21, 0xff3a}
|
||||
{0xa7b0, 0xa7b4}, {0xa7c4, 0xa7c6}, {0xff21, 0xff3a}
|
||||
#if CHRBITS > 16
|
||||
,{0x10400, 0x10427}, {0x104b0, 0x104d3}, {0x10c80, 0x10cb2}, {0x118a0, 0x118bf},
|
||||
{0x16e40, 0x16e5f}, {0x1d400, 0x1d419}, {0x1d434, 0x1d44d}, {0x1d468, 0x1d481},
|
||||
@@ -606,7 +609,7 @@ static const chr upperCharTable[] = {
|
||||
0xa768, 0xa76a, 0xa76c, 0xa76e, 0xa779, 0xa77b, 0xa77d, 0xa77e, 0xa780,
|
||||
0xa782, 0xa784, 0xa786, 0xa78b, 0xa78d, 0xa790, 0xa792, 0xa796, 0xa798,
|
||||
0xa79a, 0xa79c, 0xa79e, 0xa7a0, 0xa7a2, 0xa7a4, 0xa7a6, 0xa7a8, 0xa7b6,
|
||||
0xa7b8
|
||||
0xa7b8, 0xa7ba, 0xa7bc, 0xa7be, 0xa7c2
|
||||
#if CHRBITS > 16
|
||||
,0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d504, 0x1d505, 0x1d538,
|
||||
0x1d539, 0x1d546, 0x1d7ca
|
||||
@@ -640,54 +643,53 @@ static const crange graphRangeTable[] = {
|
||||
{0xbae, 0xbb9}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, {0xbca, 0xbcd},
|
||||
{0xbe6, 0xbfa}, {0xc00, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28},
|
||||
{0xc2a, 0xc39}, {0xc3d, 0xc44}, {0xc46, 0xc48}, {0xc4a, 0xc4d},
|
||||
{0xc58, 0xc5a}, {0xc60, 0xc63}, {0xc66, 0xc6f}, {0xc78, 0xc8c},
|
||||
{0xc58, 0xc5a}, {0xc60, 0xc63}, {0xc66, 0xc6f}, {0xc77, 0xc8c},
|
||||
{0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9},
|
||||
{0xcbc, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xce0, 0xce3},
|
||||
{0xce6, 0xcef}, {0xd00, 0xd03}, {0xd05, 0xd0c}, {0xd0e, 0xd10},
|
||||
{0xd12, 0xd44}, {0xd46, 0xd48}, {0xd4a, 0xd4f}, {0xd54, 0xd63},
|
||||
{0xd66, 0xd7f}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb},
|
||||
{0xdc0, 0xdc6}, {0xdcf, 0xdd4}, {0xdd8, 0xddf}, {0xde6, 0xdef},
|
||||
{0xdf2, 0xdf4}, {0xe01, 0xe3a}, {0xe3f, 0xe5b}, {0xe94, 0xe97},
|
||||
{0xe99, 0xe9f}, {0xea1, 0xea3}, {0xead, 0xeb9}, {0xebb, 0xebd},
|
||||
{0xec0, 0xec4}, {0xec8, 0xecd}, {0xed0, 0xed9}, {0xedc, 0xedf},
|
||||
{0xf00, 0xf47}, {0xf49, 0xf6c}, {0xf71, 0xf97}, {0xf99, 0xfbc},
|
||||
{0xfbe, 0xfcc}, {0xfce, 0xfda}, {0x1000, 0x10c5}, {0x10d0, 0x1248},
|
||||
{0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d}, {0x1260, 0x1288},
|
||||
{0x128a, 0x128d}, {0x1290, 0x12b0}, {0x12b2, 0x12b5}, {0x12b8, 0x12be},
|
||||
{0x12c2, 0x12c5}, {0x12c8, 0x12d6}, {0x12d8, 0x1310}, {0x1312, 0x1315},
|
||||
{0x1318, 0x135a}, {0x135d, 0x137c}, {0x1380, 0x1399}, {0x13a0, 0x13f5},
|
||||
{0x13f8, 0x13fd}, {0x1400, 0x167f}, {0x1681, 0x169c}, {0x16a0, 0x16f8},
|
||||
{0x1700, 0x170c}, {0x170e, 0x1714}, {0x1720, 0x1736}, {0x1740, 0x1753},
|
||||
{0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17dd}, {0x17e0, 0x17e9},
|
||||
{0x17f0, 0x17f9}, {0x1800, 0x180d}, {0x1810, 0x1819}, {0x1820, 0x1878},
|
||||
{0x1880, 0x18aa}, {0x18b0, 0x18f5}, {0x1900, 0x191e}, {0x1920, 0x192b},
|
||||
{0x1930, 0x193b}, {0x1944, 0x196d}, {0x1970, 0x1974}, {0x1980, 0x19ab},
|
||||
{0x19b0, 0x19c9}, {0x19d0, 0x19da}, {0x19de, 0x1a1b}, {0x1a1e, 0x1a5e},
|
||||
{0x1a60, 0x1a7c}, {0x1a7f, 0x1a89}, {0x1a90, 0x1a99}, {0x1aa0, 0x1aad},
|
||||
{0x1ab0, 0x1abe}, {0x1b00, 0x1b4b}, {0x1b50, 0x1b7c}, {0x1b80, 0x1bf3},
|
||||
{0x1bfc, 0x1c37}, {0x1c3b, 0x1c49}, {0x1c4d, 0x1c88}, {0x1c90, 0x1cba},
|
||||
{0x1cbd, 0x1cc7}, {0x1cd0, 0x1cf9}, {0x1d00, 0x1df9}, {0x1dfb, 0x1f15},
|
||||
{0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57},
|
||||
{0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fc4}, {0x1fc6, 0x1fd3},
|
||||
{0x1fd6, 0x1fdb}, {0x1fdd, 0x1fef}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffe},
|
||||
{0x2010, 0x2027}, {0x2030, 0x205e}, {0x2074, 0x208e}, {0x2090, 0x209c},
|
||||
{0x20a0, 0x20bf}, {0x20d0, 0x20f0}, {0x2100, 0x218b}, {0x2190, 0x2426},
|
||||
{0x2440, 0x244a}, {0x2460, 0x2b73}, {0x2b76, 0x2b95}, {0x2b98, 0x2bc8},
|
||||
{0x2bca, 0x2bfe}, {0x2c00, 0x2c2e}, {0x2c30, 0x2c5e}, {0x2c60, 0x2cf3},
|
||||
{0xdf2, 0xdf4}, {0xe01, 0xe3a}, {0xe3f, 0xe5b}, {0xe86, 0xe8a},
|
||||
{0xe8c, 0xea3}, {0xea7, 0xebd}, {0xec0, 0xec4}, {0xec8, 0xecd},
|
||||
{0xed0, 0xed9}, {0xedc, 0xedf}, {0xf00, 0xf47}, {0xf49, 0xf6c},
|
||||
{0xf71, 0xf97}, {0xf99, 0xfbc}, {0xfbe, 0xfcc}, {0xfce, 0xfda},
|
||||
{0x1000, 0x10c5}, {0x10d0, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256},
|
||||
{0x125a, 0x125d}, {0x1260, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12b0},
|
||||
{0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12d6},
|
||||
{0x12d8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135a}, {0x135d, 0x137c},
|
||||
{0x1380, 0x1399}, {0x13a0, 0x13f5}, {0x13f8, 0x13fd}, {0x1400, 0x167f},
|
||||
{0x1681, 0x169c}, {0x16a0, 0x16f8}, {0x1700, 0x170c}, {0x170e, 0x1714},
|
||||
{0x1720, 0x1736}, {0x1740, 0x1753}, {0x1760, 0x176c}, {0x176e, 0x1770},
|
||||
{0x1780, 0x17dd}, {0x17e0, 0x17e9}, {0x17f0, 0x17f9}, {0x1800, 0x180d},
|
||||
{0x1810, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18aa}, {0x18b0, 0x18f5},
|
||||
{0x1900, 0x191e}, {0x1920, 0x192b}, {0x1930, 0x193b}, {0x1944, 0x196d},
|
||||
{0x1970, 0x1974}, {0x1980, 0x19ab}, {0x19b0, 0x19c9}, {0x19d0, 0x19da},
|
||||
{0x19de, 0x1a1b}, {0x1a1e, 0x1a5e}, {0x1a60, 0x1a7c}, {0x1a7f, 0x1a89},
|
||||
{0x1a90, 0x1a99}, {0x1aa0, 0x1aad}, {0x1ab0, 0x1abe}, {0x1b00, 0x1b4b},
|
||||
{0x1b50, 0x1b7c}, {0x1b80, 0x1bf3}, {0x1bfc, 0x1c37}, {0x1c3b, 0x1c49},
|
||||
{0x1c4d, 0x1c88}, {0x1c90, 0x1cba}, {0x1cbd, 0x1cc7}, {0x1cd0, 0x1cfa},
|
||||
{0x1d00, 0x1df9}, {0x1dfb, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45},
|
||||
{0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4},
|
||||
{0x1fb6, 0x1fc4}, {0x1fc6, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fdd, 0x1fef},
|
||||
{0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffe}, {0x2010, 0x2027}, {0x2030, 0x205e},
|
||||
{0x2074, 0x208e}, {0x2090, 0x209c}, {0x20a0, 0x20bf}, {0x20d0, 0x20f0},
|
||||
{0x2100, 0x218b}, {0x2190, 0x2426}, {0x2440, 0x244a}, {0x2460, 0x2b73},
|
||||
{0x2b76, 0x2b95}, {0x2b98, 0x2c2e}, {0x2c30, 0x2c5e}, {0x2c60, 0x2cf3},
|
||||
{0x2cf9, 0x2d25}, {0x2d30, 0x2d67}, {0x2d7f, 0x2d96}, {0x2da0, 0x2da6},
|
||||
{0x2da8, 0x2dae}, {0x2db0, 0x2db6}, {0x2db8, 0x2dbe}, {0x2dc0, 0x2dc6},
|
||||
{0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x2de0, 0x2e4e},
|
||||
{0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x2de0, 0x2e4f},
|
||||
{0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb},
|
||||
{0x3001, 0x303f}, {0x3041, 0x3096}, {0x3099, 0x30ff}, {0x3105, 0x312f},
|
||||
{0x3131, 0x318e}, {0x3190, 0x31ba}, {0x31c0, 0x31e3}, {0x31f0, 0x321e},
|
||||
{0x3220, 0x32fe}, {0x3300, 0x4db5}, {0x4dc0, 0x9fef}, {0xa000, 0xa48c},
|
||||
{0xa490, 0xa4c6}, {0xa4d0, 0xa62b}, {0xa640, 0xa6f7}, {0xa700, 0xa7b9},
|
||||
{0x3220, 0x4db5}, {0x4dc0, 0x9fef}, {0xa000, 0xa48c}, {0xa490, 0xa4c6},
|
||||
{0xa4d0, 0xa62b}, {0xa640, 0xa6f7}, {0xa700, 0xa7bf}, {0xa7c2, 0xa7c6},
|
||||
{0xa7f7, 0xa82b}, {0xa830, 0xa839}, {0xa840, 0xa877}, {0xa880, 0xa8c5},
|
||||
{0xa8ce, 0xa8d9}, {0xa8e0, 0xa953}, {0xa95f, 0xa97c}, {0xa980, 0xa9cd},
|
||||
{0xa9cf, 0xa9d9}, {0xa9de, 0xa9fe}, {0xaa00, 0xaa36}, {0xaa40, 0xaa4d},
|
||||
{0xaa50, 0xaa59}, {0xaa5c, 0xaac2}, {0xaadb, 0xaaf6}, {0xab01, 0xab06},
|
||||
{0xab09, 0xab0e}, {0xab11, 0xab16}, {0xab20, 0xab26}, {0xab28, 0xab2e},
|
||||
{0xab30, 0xab65}, {0xab70, 0xabed}, {0xabf0, 0xabf9}, {0xac00, 0xd7a3},
|
||||
{0xab30, 0xab67}, {0xab70, 0xabed}, {0xabf0, 0xabf9}, {0xac00, 0xd7a3},
|
||||
{0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb}, {0xf900, 0xfa6d}, {0xfa70, 0xfad9},
|
||||
{0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb36}, {0xfb38, 0xfb3c},
|
||||
{0xfb46, 0xfbc1}, {0xfbd3, 0xfd3f}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7},
|
||||
@@ -711,29 +713,31 @@ static const crange graphRangeTable[] = {
|
||||
{0x10aeb, 0x10af6}, {0x10b00, 0x10b35}, {0x10b39, 0x10b55}, {0x10b58, 0x10b72},
|
||||
{0x10b78, 0x10b91}, {0x10b99, 0x10b9c}, {0x10ba9, 0x10baf}, {0x10c00, 0x10c48},
|
||||
{0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2}, {0x10cfa, 0x10d27}, {0x10d30, 0x10d39},
|
||||
{0x10e60, 0x10e7e}, {0x10f00, 0x10f27}, {0x10f30, 0x10f59}, {0x11000, 0x1104d},
|
||||
{0x11052, 0x1106f}, {0x1107f, 0x110bc}, {0x110be, 0x110c1}, {0x110d0, 0x110e8},
|
||||
{0x110f0, 0x110f9}, {0x11100, 0x11134}, {0x11136, 0x11146}, {0x11150, 0x11176},
|
||||
{0x11180, 0x111cd}, {0x111d0, 0x111df}, {0x111e1, 0x111f4}, {0x11200, 0x11211},
|
||||
{0x11213, 0x1123e}, {0x11280, 0x11286}, {0x1128a, 0x1128d}, {0x1128f, 0x1129d},
|
||||
{0x1129f, 0x112a9}, {0x112b0, 0x112ea}, {0x112f0, 0x112f9}, {0x11300, 0x11303},
|
||||
{0x11305, 0x1130c}, {0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339},
|
||||
{0x1133b, 0x11344}, {0x1134b, 0x1134d}, {0x1135d, 0x11363}, {0x11366, 0x1136c},
|
||||
{0x11370, 0x11374}, {0x11400, 0x11459}, {0x11480, 0x114c7}, {0x114d0, 0x114d9},
|
||||
{0x11580, 0x115b5}, {0x115b8, 0x115dd}, {0x11600, 0x11644}, {0x11650, 0x11659},
|
||||
{0x11660, 0x1166c}, {0x11680, 0x116b7}, {0x116c0, 0x116c9}, {0x11700, 0x1171a},
|
||||
{0x1171d, 0x1172b}, {0x11730, 0x1173f}, {0x11800, 0x1183b}, {0x118a0, 0x118f2},
|
||||
{0x11a00, 0x11a47}, {0x11a50, 0x11a83}, {0x11a86, 0x11aa2}, {0x11ac0, 0x11af8},
|
||||
{0x10e60, 0x10e7e}, {0x10f00, 0x10f27}, {0x10f30, 0x10f59}, {0x10fe0, 0x10ff6},
|
||||
{0x11000, 0x1104d}, {0x11052, 0x1106f}, {0x1107f, 0x110bc}, {0x110be, 0x110c1},
|
||||
{0x110d0, 0x110e8}, {0x110f0, 0x110f9}, {0x11100, 0x11134}, {0x11136, 0x11146},
|
||||
{0x11150, 0x11176}, {0x11180, 0x111cd}, {0x111d0, 0x111df}, {0x111e1, 0x111f4},
|
||||
{0x11200, 0x11211}, {0x11213, 0x1123e}, {0x11280, 0x11286}, {0x1128a, 0x1128d},
|
||||
{0x1128f, 0x1129d}, {0x1129f, 0x112a9}, {0x112b0, 0x112ea}, {0x112f0, 0x112f9},
|
||||
{0x11300, 0x11303}, {0x11305, 0x1130c}, {0x11313, 0x11328}, {0x1132a, 0x11330},
|
||||
{0x11335, 0x11339}, {0x1133b, 0x11344}, {0x1134b, 0x1134d}, {0x1135d, 0x11363},
|
||||
{0x11366, 0x1136c}, {0x11370, 0x11374}, {0x11400, 0x11459}, {0x1145d, 0x1145f},
|
||||
{0x11480, 0x114c7}, {0x114d0, 0x114d9}, {0x11580, 0x115b5}, {0x115b8, 0x115dd},
|
||||
{0x11600, 0x11644}, {0x11650, 0x11659}, {0x11660, 0x1166c}, {0x11680, 0x116b8},
|
||||
{0x116c0, 0x116c9}, {0x11700, 0x1171a}, {0x1171d, 0x1172b}, {0x11730, 0x1173f},
|
||||
{0x11800, 0x1183b}, {0x118a0, 0x118f2}, {0x119a0, 0x119a7}, {0x119aa, 0x119d7},
|
||||
{0x119da, 0x119e4}, {0x11a00, 0x11a47}, {0x11a50, 0x11aa2}, {0x11ac0, 0x11af8},
|
||||
{0x11c00, 0x11c08}, {0x11c0a, 0x11c36}, {0x11c38, 0x11c45}, {0x11c50, 0x11c6c},
|
||||
{0x11c70, 0x11c8f}, {0x11c92, 0x11ca7}, {0x11ca9, 0x11cb6}, {0x11d00, 0x11d06},
|
||||
{0x11d0b, 0x11d36}, {0x11d3f, 0x11d47}, {0x11d50, 0x11d59}, {0x11d60, 0x11d65},
|
||||
{0x11d6a, 0x11d8e}, {0x11d93, 0x11d98}, {0x11da0, 0x11da9}, {0x11ee0, 0x11ef8},
|
||||
{0x12000, 0x12399}, {0x12400, 0x1246e}, {0x12470, 0x12474}, {0x12480, 0x12543},
|
||||
{0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38}, {0x16a40, 0x16a5e},
|
||||
{0x16a60, 0x16a69}, {0x16ad0, 0x16aed}, {0x16af0, 0x16af5}, {0x16b00, 0x16b45},
|
||||
{0x16b50, 0x16b59}, {0x16b5b, 0x16b61}, {0x16b63, 0x16b77}, {0x16b7d, 0x16b8f},
|
||||
{0x16e40, 0x16e9a}, {0x16f00, 0x16f44}, {0x16f50, 0x16f7e}, {0x16f8f, 0x16f9f},
|
||||
{0x17000, 0x187f1}, {0x18800, 0x18af2}, {0x1b000, 0x1b11e}, {0x1b170, 0x1b2fb},
|
||||
{0x11fc0, 0x11ff1}, {0x11fff, 0x12399}, {0x12400, 0x1246e}, {0x12470, 0x12474},
|
||||
{0x12480, 0x12543}, {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38},
|
||||
{0x16a40, 0x16a5e}, {0x16a60, 0x16a69}, {0x16ad0, 0x16aed}, {0x16af0, 0x16af5},
|
||||
{0x16b00, 0x16b45}, {0x16b50, 0x16b59}, {0x16b5b, 0x16b61}, {0x16b63, 0x16b77},
|
||||
{0x16b7d, 0x16b8f}, {0x16e40, 0x16e9a}, {0x16f00, 0x16f4a}, {0x16f4f, 0x16f87},
|
||||
{0x16f8f, 0x16f9f}, {0x16fe0, 0x16fe3}, {0x17000, 0x187f7}, {0x18800, 0x18af2},
|
||||
{0x1b000, 0x1b11e}, {0x1b150, 0x1b152}, {0x1b164, 0x1b167}, {0x1b170, 0x1b2fb},
|
||||
{0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, {0x1bc90, 0x1bc99},
|
||||
{0x1bc9c, 0x1bc9f}, {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d129, 0x1d172},
|
||||
{0x1d17b, 0x1d1e8}, {0x1d200, 0x1d245}, {0x1d2e0, 0x1d2f3}, {0x1d300, 0x1d356},
|
||||
@@ -742,22 +746,24 @@ static const crange graphRangeTable[] = {
|
||||
{0x1d50d, 0x1d514}, {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e},
|
||||
{0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, {0x1d552, 0x1d6a5}, {0x1d6a8, 0x1d7cb},
|
||||
{0x1d7ce, 0x1da8b}, {0x1da9b, 0x1da9f}, {0x1daa1, 0x1daaf}, {0x1e000, 0x1e006},
|
||||
{0x1e008, 0x1e018}, {0x1e01b, 0x1e021}, {0x1e026, 0x1e02a}, {0x1e800, 0x1e8c4},
|
||||
{0x1e8c7, 0x1e8d6}, {0x1e900, 0x1e94a}, {0x1e950, 0x1e959}, {0x1ec71, 0x1ecb4},
|
||||
{0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37},
|
||||
{0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77},
|
||||
{0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3},
|
||||
{0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb}, {0x1f000, 0x1f02b}, {0x1f030, 0x1f093},
|
||||
{0x1f0a0, 0x1f0ae}, {0x1f0b1, 0x1f0bf}, {0x1f0c1, 0x1f0cf}, {0x1f0d1, 0x1f0f5},
|
||||
{0x1f100, 0x1f10c}, {0x1f110, 0x1f16b}, {0x1f170, 0x1f1ac}, {0x1f1e6, 0x1f202},
|
||||
{0x1f210, 0x1f23b}, {0x1f240, 0x1f248}, {0x1f260, 0x1f265}, {0x1f300, 0x1f6d4},
|
||||
{0x1f6e0, 0x1f6ec}, {0x1f6f0, 0x1f6f9}, {0x1f700, 0x1f773}, {0x1f780, 0x1f7d8},
|
||||
{0x1f800, 0x1f80b}, {0x1f810, 0x1f847}, {0x1f850, 0x1f859}, {0x1f860, 0x1f887},
|
||||
{0x1f890, 0x1f8ad}, {0x1f900, 0x1f90b}, {0x1f910, 0x1f93e}, {0x1f940, 0x1f970},
|
||||
{0x1f973, 0x1f976}, {0x1f97c, 0x1f9a2}, {0x1f9b0, 0x1f9b9}, {0x1f9c0, 0x1f9c2},
|
||||
{0x1f9d0, 0x1f9ff}, {0x1fa60, 0x1fa6d}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734},
|
||||
{0x2b740, 0x2b81d}, {0x2b820, 0x2cea1}, {0x2ceb0, 0x2ebe0}, {0x2f800, 0x2fa1d},
|
||||
{0xe0100, 0xe01ef}
|
||||
{0x1e008, 0x1e018}, {0x1e01b, 0x1e021}, {0x1e026, 0x1e02a}, {0x1e100, 0x1e12c},
|
||||
{0x1e130, 0x1e13d}, {0x1e140, 0x1e149}, {0x1e2c0, 0x1e2f9}, {0x1e800, 0x1e8c4},
|
||||
{0x1e8c7, 0x1e8d6}, {0x1e900, 0x1e94b}, {0x1e950, 0x1e959}, {0x1ec71, 0x1ecb4},
|
||||
{0x1ed01, 0x1ed3d}, {0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32},
|
||||
{0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72},
|
||||
{0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b},
|
||||
{0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb}, {0x1f000, 0x1f02b},
|
||||
{0x1f030, 0x1f093}, {0x1f0a0, 0x1f0ae}, {0x1f0b1, 0x1f0bf}, {0x1f0c1, 0x1f0cf},
|
||||
{0x1f0d1, 0x1f0f5}, {0x1f100, 0x1f10c}, {0x1f110, 0x1f16c}, {0x1f170, 0x1f1ac},
|
||||
{0x1f1e6, 0x1f202}, {0x1f210, 0x1f23b}, {0x1f240, 0x1f248}, {0x1f260, 0x1f265},
|
||||
{0x1f300, 0x1f6d5}, {0x1f6e0, 0x1f6ec}, {0x1f6f0, 0x1f6fa}, {0x1f700, 0x1f773},
|
||||
{0x1f780, 0x1f7d8}, {0x1f7e0, 0x1f7eb}, {0x1f800, 0x1f80b}, {0x1f810, 0x1f847},
|
||||
{0x1f850, 0x1f859}, {0x1f860, 0x1f887}, {0x1f890, 0x1f8ad}, {0x1f900, 0x1f90b},
|
||||
{0x1f90d, 0x1f971}, {0x1f973, 0x1f976}, {0x1f97a, 0x1f9a2}, {0x1f9a5, 0x1f9aa},
|
||||
{0x1f9ae, 0x1f9ca}, {0x1f9cd, 0x1fa53}, {0x1fa60, 0x1fa6d}, {0x1fa70, 0x1fa73},
|
||||
{0x1fa78, 0x1fa7a}, {0x1fa80, 0x1fa82}, {0x1fa90, 0x1fa95}, {0x20000, 0x2a6d6},
|
||||
{0x2a700, 0x2b734}, {0x2b740, 0x2b81d}, {0x2b820, 0x2cea1}, {0x2ceb0, 0x2ebe0},
|
||||
{0x2f800, 0x2fa1d}, {0xe0100, 0xe01ef}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -770,21 +776,20 @@ static const chr graphCharTable[] = {
|
||||
0xb10, 0xb32, 0xb33, 0xb47, 0xb48, 0xb56, 0xb57, 0xb5c, 0xb5d,
|
||||
0xb82, 0xb83, 0xb99, 0xb9a, 0xb9c, 0xb9e, 0xb9f, 0xba3, 0xba4,
|
||||
0xbd0, 0xbd7, 0xc55, 0xc56, 0xcd5, 0xcd6, 0xcde, 0xcf1, 0xcf2,
|
||||
0xd82, 0xd83, 0xdbd, 0xdca, 0xdd6, 0xe81, 0xe82, 0xe84, 0xe87,
|
||||
0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, 0xeab, 0xec6, 0x10c7,
|
||||
0x10cd, 0x1258, 0x12c0, 0x1772, 0x1773, 0x1940, 0x1f59, 0x1f5b, 0x1f5d,
|
||||
0x2070, 0x2071, 0x2d27, 0x2d2d, 0x2d6f, 0x2d70, 0xfb3e, 0xfb40, 0xfb41,
|
||||
0xfb43, 0xfb44, 0xfffc, 0xfffd
|
||||
0xd82, 0xd83, 0xdbd, 0xdca, 0xdd6, 0xe81, 0xe82, 0xe84, 0xea5,
|
||||
0xec6, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x1772, 0x1773, 0x1940, 0x1f59,
|
||||
0x1f5b, 0x1f5d, 0x2070, 0x2071, 0x2d27, 0x2d2d, 0x2d6f, 0x2d70, 0xfb3e,
|
||||
0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfffc, 0xfffd
|
||||
#if CHRBITS > 16
|
||||
,0x1003c, 0x1003d, 0x101a0, 0x1056f, 0x10808, 0x10837, 0x10838, 0x1083c, 0x108f4,
|
||||
0x108f5, 0x1093f, 0x10a05, 0x10a06, 0x11288, 0x1130f, 0x11310, 0x11332, 0x11333,
|
||||
0x11347, 0x11348, 0x11350, 0x11357, 0x1145b, 0x1145d, 0x1145e, 0x118ff, 0x11d08,
|
||||
0x11d09, 0x11d3a, 0x11d3c, 0x11d3d, 0x11d67, 0x11d68, 0x11d90, 0x11d91, 0x16a6e,
|
||||
0x16a6f, 0x16fe0, 0x16fe1, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb,
|
||||
0x1d546, 0x1e023, 0x1e024, 0x1e95e, 0x1e95f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27,
|
||||
0x1ee39, 0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54,
|
||||
0x1ee57, 0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e,
|
||||
0x1eef0, 0x1eef1, 0x1f250, 0x1f251, 0x1f97a
|
||||
0x11347, 0x11348, 0x11350, 0x11357, 0x1145b, 0x118ff, 0x11d08, 0x11d09, 0x11d3a,
|
||||
0x11d3c, 0x11d3d, 0x11d67, 0x11d68, 0x11d90, 0x11d91, 0x16a6e, 0x16a6f, 0x1d49e,
|
||||
0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, 0x1e023, 0x1e024, 0x1e14e,
|
||||
0x1e14f, 0x1e2ff, 0x1e95e, 0x1e95f, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39,
|
||||
0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57,
|
||||
0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e, 0x1eef0,
|
||||
0x1eef1, 0x1f250, 0x1f251
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -414,7 +414,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
|
||||
#if defined(__WIN32__)
|
||||
# ifdef __BORLANDC__
|
||||
typedef struct stati64 Tcl_StatBuf;
|
||||
# elif defined(_WIN64)
|
||||
# elif defined(_WIN64) || defined(__MINGW_USE_VC2005_COMPAT) || defined(_USE_64BIT_TIME_T)
|
||||
typedef struct __stat64 Tcl_StatBuf;
|
||||
# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
|
||||
typedef struct _stati64 Tcl_StatBuf;
|
||||
|
||||
+38
-17
@@ -203,6 +203,9 @@ static const CmdInfo builtInCmds[] = {
|
||||
{"source", Tcl_SourceObjCmd, NULL, 0},
|
||||
{"tell", Tcl_TellObjCmd, NULL, 1},
|
||||
{"time", Tcl_TimeObjCmd, NULL, 1},
|
||||
#ifdef TCL_TIMERATE
|
||||
{"timerate", Tcl_TimeRateObjCmd, NULL, 1},
|
||||
#endif
|
||||
{"unload", Tcl_UnloadObjCmd, NULL, 0},
|
||||
{"update", Tcl_UpdateObjCmd, NULL, 1},
|
||||
{"vwait", Tcl_VwaitObjCmd, NULL, 1},
|
||||
@@ -386,7 +389,7 @@ Tcl_CreateInterp(void)
|
||||
const BuiltinFuncDef *builtinFuncPtr;
|
||||
const OpCmdInfo *opcmdInfoPtr;
|
||||
const CmdInfo *cmdInfoPtr;
|
||||
Tcl_Namespace *mathfuncNSPtr, *mathopNSPtr;
|
||||
Tcl_Namespace *nsPtr;
|
||||
union {
|
||||
char c[sizeof(short)];
|
||||
short s;
|
||||
@@ -410,7 +413,15 @@ Tcl_CreateInterp(void)
|
||||
Tcl_Panic("Tcl_CallFrame must not be smaller than CallFrame");
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
#if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_64BIT_TIME_T) \
|
||||
&& !defined(__MINGW_USE_VC2005_COMPAT)
|
||||
/* If Tcl is compiled on Win32 using -D_USE_64BIT_TIME_T or
|
||||
* -D__MINGW_USE_VC2005_COMPAT, the result is a binary incompatible
|
||||
* with the 'standard' build of Tcl: All extensions using Tcl_StatBuf
|
||||
* or interal functions like TclpGetDate() need to be recompiled in
|
||||
* the same way. Therefore, this is not officially supported.
|
||||
* In stead, it is recommended to use Win64 or Tcl 9.0 (not released yet)
|
||||
*/
|
||||
if (sizeof(time_t) != 4) {
|
||||
/*NOTREACHED*/
|
||||
Tcl_Panic("<time.h> is not compatible with MSVC");
|
||||
@@ -721,6 +732,17 @@ Tcl_CreateInterp(void)
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::disassemble",
|
||||
Tcl_DisassembleObjCmd, NULL, NULL);
|
||||
|
||||
/* Create an unsupported command for timerate */
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::timerate",
|
||||
Tcl_TimeRateObjCmd, NULL, NULL);
|
||||
|
||||
/* Export unsupported commands */
|
||||
nsPtr = Tcl_FindNamespace(interp, "::tcl::unsupported", NULL, 0);
|
||||
if (nsPtr) {
|
||||
Tcl_Export(interp, nsPtr, "*", 1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_DTRACE
|
||||
/*
|
||||
* Register the tcl::dtrace command.
|
||||
@@ -733,8 +755,8 @@ Tcl_CreateInterp(void)
|
||||
* Register the builtin math functions.
|
||||
*/
|
||||
|
||||
mathfuncNSPtr = Tcl_CreateNamespace(interp, "::tcl::mathfunc", NULL,NULL);
|
||||
if (mathfuncNSPtr == NULL) {
|
||||
nsPtr = Tcl_CreateNamespace(interp, "::tcl::mathfunc", NULL,NULL);
|
||||
if (nsPtr == NULL) {
|
||||
Tcl_Panic("Can't create math function namespace");
|
||||
}
|
||||
strcpy(mathFuncName, "::tcl::mathfunc::");
|
||||
@@ -744,19 +766,19 @@ Tcl_CreateInterp(void)
|
||||
strcpy(mathFuncName+MATH_FUNC_PREFIX_LEN, builtinFuncPtr->name);
|
||||
Tcl_CreateObjCommand(interp, mathFuncName,
|
||||
builtinFuncPtr->objCmdProc, builtinFuncPtr->clientData, NULL);
|
||||
Tcl_Export(interp, mathfuncNSPtr, builtinFuncPtr->name, 0);
|
||||
Tcl_Export(interp, nsPtr, builtinFuncPtr->name, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register the mathematical "operator" commands. [TIP #174]
|
||||
*/
|
||||
|
||||
mathopNSPtr = Tcl_CreateNamespace(interp, "::tcl::mathop", NULL, NULL);
|
||||
nsPtr = Tcl_CreateNamespace(interp, "::tcl::mathop", NULL, NULL);
|
||||
#define MATH_OP_PREFIX_LEN 15 /* == strlen("::tcl::mathop::") */
|
||||
if (mathopNSPtr == NULL) {
|
||||
if (nsPtr == NULL) {
|
||||
Tcl_Panic("can't create math operator namespace");
|
||||
}
|
||||
(void) Tcl_Export(interp, mathopNSPtr, "*", 1);
|
||||
(void) Tcl_Export(interp, nsPtr, "*", 1);
|
||||
strcpy(mathFuncName, "::tcl::mathop::");
|
||||
for (opcmdInfoPtr=mathOpCmds ; opcmdInfoPtr->name!=NULL ; opcmdInfoPtr++){
|
||||
TclOpCmdClientData *occdPtr = (TclOpCmdClientData *)
|
||||
@@ -1906,7 +1928,7 @@ Tcl_CreateCommand(
|
||||
|
||||
/* An existing command conflicts. Try to delete it.. */
|
||||
cmdPtr = Tcl_GetHashValue(hPtr);
|
||||
|
||||
|
||||
/*
|
||||
* Be careful to preserve
|
||||
* any existing import links so we can restore them down below. That
|
||||
@@ -2093,7 +2115,7 @@ Tcl_CreateObjCommand(
|
||||
cmdPtr = Tcl_GetHashValue(hPtr);
|
||||
|
||||
/*
|
||||
* [***] This is wrong. See Tcl Bug a16752c252.
|
||||
* [***] This is wrong. See Tcl Bug a16752c252.
|
||||
* However, this buggy behavior is kept under particular
|
||||
* circumstances to accommodate deployed binaries of the
|
||||
* "tclcompiler" program. http://sourceforge.net/projects/tclpro/
|
||||
@@ -5174,7 +5196,7 @@ TclEvalObjEx(
|
||||
TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
|
||||
eoFramePtr->type = TCL_LOCATION_EVAL_LIST;
|
||||
eoFramePtr->level = (iPtr->cmdFramePtr == NULL? 1
|
||||
eoFramePtr->level = (iPtr->cmdFramePtr == NULL? 1
|
||||
: iPtr->cmdFramePtr->level + 1);
|
||||
eoFramePtr->framePtr = iPtr->framePtr;
|
||||
eoFramePtr->nextPtr = iPtr->cmdFramePtr;
|
||||
@@ -6332,7 +6354,7 @@ ExprIsqrtFunc(
|
||||
if (Tcl_GetBignumFromObj(interp, objv[1], &big) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (SIGN(&big) == MP_NEG) {
|
||||
if (mp_isneg(&big)) {
|
||||
mp_clear(&big);
|
||||
goto negarg;
|
||||
}
|
||||
@@ -6603,8 +6625,7 @@ ExprAbsFunc(
|
||||
#endif
|
||||
|
||||
if (type == TCL_NUMBER_BIG) {
|
||||
/* TODO: const correctness ? */
|
||||
if (mp_cmp_d((mp_int *) ptr, 0) == MP_LT) {
|
||||
if (mp_cmp_d(ptr, 0) == MP_LT) {
|
||||
Tcl_GetBignumFromObj(NULL, objv[1], &big);
|
||||
tooLarge:
|
||||
mp_neg(&big, &big);
|
||||
@@ -6754,7 +6775,7 @@ ExprIntFunc(
|
||||
mp_int big;
|
||||
|
||||
Tcl_GetBignumFromObj(NULL, objPtr, &big);
|
||||
mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
|
||||
mp_mod_2d(&big, CHAR_BIT * sizeof(long), &big);
|
||||
objPtr = Tcl_NewBignumObj(&big);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
TclGetLongFromObj(NULL, objPtr, &iResult);
|
||||
@@ -6786,7 +6807,7 @@ ExprWideFunc(
|
||||
mp_int big;
|
||||
|
||||
Tcl_GetBignumFromObj(NULL, objPtr, &big);
|
||||
mp_mod_2d(&big, (int) CHAR_BIT * sizeof(Tcl_WideInt), &big);
|
||||
mp_mod_2d(&big, CHAR_BIT * sizeof(Tcl_WideInt), &big);
|
||||
objPtr = Tcl_NewBignumObj(&big);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_GetWideIntFromObj(NULL, objPtr, &wResult);
|
||||
@@ -6993,7 +7014,7 @@ ExprSrandFunc(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
|
||||
mp_mod_2d(&big, CHAR_BIT * sizeof(long), &big);
|
||||
objPtr = Tcl_NewBignumObj(&big);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
TclGetLongFromObj(NULL, objPtr, &i);
|
||||
|
||||
+2
-8
@@ -1739,9 +1739,7 @@ ClockClicksObjCmd(
|
||||
break;
|
||||
}
|
||||
case CLICKS_MICROS:
|
||||
Tcl_GetTime(&now);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
|
||||
((Tcl_WideInt) now.sec * 1000000) + now.usec));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(TclpGetMicroseconds()));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1810,15 +1808,11 @@ ClockMicrosecondsObjCmd(
|
||||
int objc, /* Parameter count */
|
||||
Tcl_Obj* const* objv) /* Parameter values */
|
||||
{
|
||||
Tcl_Time now;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_GetTime(&now);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
|
||||
((Tcl_WideInt) now.sec * 1000000) + now.usec));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(TclpGetMicroseconds()));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
+8
-12
@@ -870,15 +870,11 @@ Tcl_FileObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (objc == 4) {
|
||||
/*
|
||||
* Need separate variable for reading longs from an object on
|
||||
* 64-bit platforms. [Bug #698146]
|
||||
*/
|
||||
Tcl_WideInt newTime;
|
||||
|
||||
long newTime;
|
||||
|
||||
if (TclGetLongFromObj(interp, objv[3], &newTime) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
|
||||
if (Tcl_GetWideIntFromObj(interp, objv[3], &newTime) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (index == FCMD_ATIME) {
|
||||
@@ -908,7 +904,7 @@ Tcl_FileObjCmd(
|
||||
}
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_NewLongObj((long)
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
|
||||
(index == FCMD_ATIME ? buf.st_atime : buf.st_mtime)));
|
||||
return TCL_OK;
|
||||
case FCMD_ATTRIBUTES:
|
||||
@@ -1527,9 +1523,9 @@ StoreStatData(
|
||||
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
|
||||
STORE_ARY("blksize", Tcl_NewLongObj((long)statPtr->st_blksize));
|
||||
#endif
|
||||
STORE_ARY("atime", Tcl_NewLongObj((long)statPtr->st_atime));
|
||||
STORE_ARY("mtime", Tcl_NewLongObj((long)statPtr->st_mtime));
|
||||
STORE_ARY("ctime", Tcl_NewLongObj((long)statPtr->st_ctime));
|
||||
STORE_ARY("atime", Tcl_NewWideIntObj(statPtr->st_atime));
|
||||
STORE_ARY("mtime", Tcl_NewWideIntObj(statPtr->st_mtime));
|
||||
STORE_ARY("ctime", Tcl_NewWideIntObj(statPtr->st_ctime));
|
||||
mode = (unsigned short) statPtr->st_mode;
|
||||
STORE_ARY("mode", Tcl_NewIntObj(mode));
|
||||
STORE_ARY("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1));
|
||||
|
||||
+554
-1
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "tclCompile.h"
|
||||
#include "tclRegexp.h"
|
||||
|
||||
static int UniCharIsAscii(int character);
|
||||
@@ -3931,7 +3932,7 @@ Tcl_TimeObjCmd(
|
||||
* Use int obj since we know time is not fractional. [Bug 1202178]
|
||||
*/
|
||||
|
||||
objs[0] = Tcl_NewIntObj((count <= 0) ? 0 : (int) totalMicroSec);
|
||||
objs[0] = Tcl_NewWideIntObj((count <= 0) ? 0 : (Tcl_WideInt)totalMicroSec);
|
||||
} else {
|
||||
objs[0] = Tcl_NewDoubleObj(totalMicroSec/count);
|
||||
}
|
||||
@@ -3949,6 +3950,558 @@ Tcl_TimeObjCmd(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_TimeRateObjCmd --
|
||||
*
|
||||
* This object-based procedure is invoked to process the "timerate" Tcl
|
||||
* command.
|
||||
*
|
||||
* This is similar to command "time", except the execution limited by
|
||||
* given time (in milliseconds) instead of repetition count.
|
||||
*
|
||||
* Example:
|
||||
* timerate {after 5} 1000; # equivalent to: time {after 5} [expr 1000/5]
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl object result.
|
||||
*
|
||||
* Side effects:
|
||||
* See the user documentation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_TimeRateObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
static double measureOverhead = 0;
|
||||
/* global measure-overhead */
|
||||
double overhead = -1; /* given measure-overhead */
|
||||
register Tcl_Obj *objPtr;
|
||||
register int result, i;
|
||||
Tcl_Obj *calibrate = NULL, *direct = NULL;
|
||||
TclWideMUInt count = 0; /* Holds repetition count */
|
||||
Tcl_WideInt maxms = WIDE_MIN;
|
||||
/* Maximal running time (in milliseconds) */
|
||||
TclWideMUInt maxcnt = WIDE_MAX;
|
||||
/* Maximal count of iterations. */
|
||||
TclWideMUInt threshold = 1; /* Current threshold for check time (faster
|
||||
* repeat count without time check) */
|
||||
TclWideMUInt maxIterTm = 1; /* Max time of some iteration as max
|
||||
* threshold, additionally avoiding divide to
|
||||
* zero (i.e., never < 1) */
|
||||
unsigned short factor = 50; /* Factor (4..50) limiting threshold to avoid
|
||||
* growth of execution time. */
|
||||
register Tcl_WideInt start, middle, stop;
|
||||
#ifndef TCL_WIDE_CLICKS
|
||||
Tcl_Time now;
|
||||
#endif /* !TCL_WIDE_CLICKS */
|
||||
static const char *const options[] = {
|
||||
"-direct", "-overhead", "-calibrate", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
TMRT_EV_DIRECT, TMRT_OVERHEAD, TMRT_CALIBRATE, TMRT_LAST
|
||||
};
|
||||
ByteCode *codePtr = NULL;
|
||||
int codeOptimized = 0;
|
||||
|
||||
for (i = 1; i < objc - 1; i++) {
|
||||
int index;
|
||||
|
||||
if (Tcl_GetIndexFromObj(NULL, objv[i], options, "option", TCL_EXACT,
|
||||
&index) != TCL_OK) {
|
||||
break;
|
||||
}
|
||||
if (index == TMRT_LAST) {
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
switch (index) {
|
||||
case TMRT_EV_DIRECT:
|
||||
direct = objv[i];
|
||||
break;
|
||||
case TMRT_OVERHEAD:
|
||||
if (++i >= objc - 1) {
|
||||
goto usage;
|
||||
}
|
||||
if (Tcl_GetDoubleFromObj(interp, objv[i], &overhead) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
break;
|
||||
case TMRT_CALIBRATE:
|
||||
calibrate = objv[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= objc || i < objc - 3) {
|
||||
usage:
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
"?-direct? ?-calibrate? ?-overhead double? "
|
||||
"command ?time ?max-count??");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
objPtr = objv[i++];
|
||||
if (i < objc) { /* max-time */
|
||||
result = Tcl_GetWideIntFromObj(interp, objv[i++], &maxms);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
if (i < objc) { /* max-count*/
|
||||
Tcl_WideInt v;
|
||||
|
||||
result = Tcl_GetWideIntFromObj(interp, objv[i], &v);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
maxcnt = (v > 0) ? v : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are doing calibration.
|
||||
*/
|
||||
|
||||
if (calibrate) {
|
||||
/*
|
||||
* If no time specified for the calibration.
|
||||
*/
|
||||
|
||||
if (maxms == WIDE_MIN) {
|
||||
Tcl_Obj *clobjv[6];
|
||||
Tcl_WideInt maxCalTime = 5000;
|
||||
double lastMeasureOverhead = measureOverhead;
|
||||
|
||||
clobjv[0] = objv[0];
|
||||
i = 1;
|
||||
if (direct) {
|
||||
clobjv[i++] = direct;
|
||||
}
|
||||
clobjv[i++] = objPtr;
|
||||
|
||||
/*
|
||||
* Reset last measurement overhead.
|
||||
*/
|
||||
|
||||
measureOverhead = (double) 0;
|
||||
|
||||
/*
|
||||
* Self-call with 100 milliseconds to warm-up, before entering the
|
||||
* calibration cycle.
|
||||
*/
|
||||
|
||||
TclNewLongObj(clobjv[i], 100);
|
||||
Tcl_IncrRefCount(clobjv[i]);
|
||||
result = Tcl_TimeRateObjCmd(NULL, interp, i + 1, clobjv);
|
||||
Tcl_DecrRefCount(clobjv[i]);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
i--;
|
||||
clobjv[i++] = calibrate;
|
||||
clobjv[i++] = objPtr;
|
||||
|
||||
/*
|
||||
* Set last measurement overhead to max.
|
||||
*/
|
||||
|
||||
measureOverhead = (double) UWIDE_MAX;
|
||||
|
||||
/*
|
||||
* Run the calibration cycle until it is more precise.
|
||||
*/
|
||||
|
||||
maxms = -1000;
|
||||
do {
|
||||
lastMeasureOverhead = measureOverhead;
|
||||
TclNewLongObj(clobjv[i], (int) maxms);
|
||||
Tcl_IncrRefCount(clobjv[i]);
|
||||
result = Tcl_TimeRateObjCmd(NULL, interp, i + 1, clobjv);
|
||||
Tcl_DecrRefCount(clobjv[i]);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
maxCalTime += maxms;
|
||||
|
||||
/*
|
||||
* Increase maxms for more precise calibration.
|
||||
*/
|
||||
|
||||
maxms -= -maxms / 4;
|
||||
|
||||
/*
|
||||
* As long as new value more as 0.05% better
|
||||
*/
|
||||
} while ((measureOverhead >= lastMeasureOverhead
|
||||
|| measureOverhead / lastMeasureOverhead <= 0.9995)
|
||||
&& maxCalTime > 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
if (maxms == 0) {
|
||||
/*
|
||||
* Reset last measurement overhead
|
||||
*/
|
||||
|
||||
measureOverhead = 0;
|
||||
Tcl_SetObjResult(interp, Tcl_NewLongObj(0));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* If time is negative, make current overhead more precise.
|
||||
*/
|
||||
|
||||
if (maxms > 0) {
|
||||
/*
|
||||
* Set last measurement overhead to max.
|
||||
*/
|
||||
|
||||
measureOverhead = (double) UWIDE_MAX;
|
||||
} else {
|
||||
maxms = -maxms;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxms == WIDE_MIN) {
|
||||
maxms = 1000;
|
||||
}
|
||||
if (overhead == -1) {
|
||||
overhead = measureOverhead;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure that resetting of result will not smudge the further
|
||||
* measurement.
|
||||
*/
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
|
||||
/*
|
||||
* Compile object if needed.
|
||||
*/
|
||||
|
||||
if (!direct) {
|
||||
if (TclInterpReady(interp) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
codePtr = TclCompileObj(interp, objPtr, NULL, 0);
|
||||
TclPreserveByteCode(codePtr);
|
||||
/*
|
||||
* Replace last compiled done instruction with continue: it's a part of
|
||||
* iteration, this way evaluation will be more similar to a cycle (also
|
||||
* avoids extra overhead to set result to interp, etc.)
|
||||
*/
|
||||
if (codePtr->codeStart[codePtr->numCodeBytes-1] == INST_DONE) {
|
||||
codePtr->codeStart[codePtr->numCodeBytes-1] = INST_CONTINUE;
|
||||
codeOptimized = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get start and stop time.
|
||||
*/
|
||||
|
||||
#ifdef TCL_WIDE_CLICKS
|
||||
start = middle = TclpGetWideClicks();
|
||||
|
||||
/*
|
||||
* Time to stop execution (in wide clicks).
|
||||
*/
|
||||
|
||||
stop = start + (maxms * 1000 / TclpWideClickInMicrosec());
|
||||
#else
|
||||
Tcl_GetTime(&now);
|
||||
start = now.sec;
|
||||
start *= 1000000;
|
||||
start += now.usec;
|
||||
middle = start;
|
||||
|
||||
/*
|
||||
* Time to stop execution (in microsecs).
|
||||
*/
|
||||
|
||||
stop = start + maxms * 1000;
|
||||
#endif /* TCL_WIDE_CLICKS */
|
||||
|
||||
/*
|
||||
* Start measurement.
|
||||
*/
|
||||
|
||||
if (maxcnt > 0) {
|
||||
while (1) {
|
||||
/*
|
||||
* Evaluate a single iteration.
|
||||
*/
|
||||
|
||||
count++;
|
||||
if (!direct) { /* precompiled */
|
||||
result = TclExecuteByteCode(interp, codePtr);
|
||||
} else { /* eval */
|
||||
result = TclEvalObjEx(interp, objPtr, 0, NULL, 0);
|
||||
}
|
||||
/*
|
||||
* Allow break and continue from measurement cycle (used for
|
||||
* conditional stop and flow control of iterations).
|
||||
*/
|
||||
|
||||
switch (result) {
|
||||
case TCL_OK:
|
||||
break;
|
||||
case TCL_BREAK:
|
||||
/*
|
||||
* Force stop immediately.
|
||||
*/
|
||||
threshold = 1;
|
||||
maxcnt = 0;
|
||||
case TCL_CONTINUE:
|
||||
result = TCL_OK;
|
||||
break;
|
||||
default:
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't check time up to threshold.
|
||||
*/
|
||||
|
||||
if (--threshold > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check stop time reached, estimate new threshold.
|
||||
*/
|
||||
|
||||
#ifdef TCL_WIDE_CLICKS
|
||||
middle = TclpGetWideClicks();
|
||||
#else
|
||||
Tcl_GetTime(&now);
|
||||
middle = now.sec;
|
||||
middle *= 1000000;
|
||||
middle += now.usec;
|
||||
#endif /* TCL_WIDE_CLICKS */
|
||||
|
||||
if (middle >= stop || count >= maxcnt) {
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't calculate threshold by few iterations, because sometimes
|
||||
* first iteration(s) can be too fast or slow (cached, delayed
|
||||
* clean up, etc).
|
||||
*/
|
||||
|
||||
if (count < 10) {
|
||||
threshold = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Average iteration time in microsecs.
|
||||
*/
|
||||
|
||||
threshold = (middle - start) / count;
|
||||
if (threshold > maxIterTm) {
|
||||
maxIterTm = threshold;
|
||||
/*
|
||||
* Iterations seem to be longer.
|
||||
*/
|
||||
if (threshold > maxIterTm * 2) {
|
||||
factor *= 2;
|
||||
if (factor > 50) {
|
||||
factor = 50;
|
||||
}
|
||||
} else {
|
||||
if (factor < 50) {
|
||||
factor++;
|
||||
}
|
||||
}
|
||||
} else if (factor > 4) {
|
||||
/*
|
||||
* Iterations seem to be shorter.
|
||||
*/
|
||||
|
||||
if (threshold < (maxIterTm / 2)) {
|
||||
factor /= 2;
|
||||
if (factor < 4) {
|
||||
factor = 4;
|
||||
}
|
||||
} else {
|
||||
factor--;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* As relation between remaining time and time since last check,
|
||||
* maximal some % of time (by factor), so avoid growing of the
|
||||
* execution time if iterations are not consistent, e.g. was
|
||||
* continuously on time).
|
||||
*/
|
||||
|
||||
threshold = ((stop - middle) / maxIterTm) / factor + 1;
|
||||
if (threshold > 100000) { /* fix for too large threshold */
|
||||
threshold = 100000;
|
||||
}
|
||||
|
||||
/*
|
||||
* Consider max-count
|
||||
*/
|
||||
|
||||
if (threshold > maxcnt - count) {
|
||||
threshold = maxcnt - count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Tcl_Obj *objarr[8], **objs = objarr;
|
||||
TclWideMUInt usec, val;
|
||||
int digits;
|
||||
|
||||
/*
|
||||
* Absolute execution time in microseconds or in wide clicks.
|
||||
*/
|
||||
usec = (TclWideMUInt)(middle - start);
|
||||
|
||||
#ifdef TCL_WIDE_CLICKS
|
||||
/*
|
||||
* convert execution time (in wide clicks) to microsecs.
|
||||
*/
|
||||
|
||||
usec *= TclpWideClickInMicrosec();
|
||||
#endif /* TCL_WIDE_CLICKS */
|
||||
|
||||
if (!count) { /* no iterations - avoid divide by zero */
|
||||
objs[0] = objs[2] = objs[4] = Tcl_NewWideIntObj(0);
|
||||
goto retRes;
|
||||
}
|
||||
|
||||
/*
|
||||
* If not calibrating...
|
||||
*/
|
||||
|
||||
if (!calibrate) {
|
||||
/*
|
||||
* Minimize influence of measurement overhead.
|
||||
*/
|
||||
|
||||
if (overhead > 0) {
|
||||
/*
|
||||
* Estimate the time of overhead (microsecs).
|
||||
*/
|
||||
|
||||
TclWideMUInt curOverhead = overhead * count;
|
||||
|
||||
if (usec > curOverhead) {
|
||||
usec -= curOverhead;
|
||||
} else {
|
||||
usec = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Calibration: obtaining new measurement overhead.
|
||||
*/
|
||||
|
||||
if (measureOverhead > ((double) usec) / count) {
|
||||
measureOverhead = ((double) usec) / count;
|
||||
}
|
||||
objs[0] = Tcl_NewDoubleObj(measureOverhead);
|
||||
TclNewLiteralStringObj(objs[1], "\xC2\xB5s/#-overhead"); /* mics */
|
||||
objs += 2;
|
||||
}
|
||||
|
||||
val = usec / count; /* microsecs per iteration */
|
||||
if (val >= 1000000) {
|
||||
objs[0] = Tcl_NewWideIntObj(val);
|
||||
} else {
|
||||
if (val < 10) {
|
||||
digits = 6;
|
||||
} else if (val < 100) {
|
||||
digits = 4;
|
||||
} else if (val < 1000) {
|
||||
digits = 3;
|
||||
} else if (val < 10000) {
|
||||
digits = 2;
|
||||
} else {
|
||||
digits = 1;
|
||||
}
|
||||
objs[0] = Tcl_ObjPrintf("%.*f", digits, ((double) usec)/count);
|
||||
}
|
||||
|
||||
objs[2] = Tcl_NewWideIntObj(count); /* iterations */
|
||||
|
||||
/*
|
||||
* Calculate speed as rate (count) per sec
|
||||
*/
|
||||
|
||||
if (!usec) {
|
||||
usec++; /* Avoid divide by zero. */
|
||||
}
|
||||
if (count < (WIDE_MAX / 1000000)) {
|
||||
val = (count * 1000000) / usec;
|
||||
if (val < 100000) {
|
||||
if (val < 100) {
|
||||
digits = 3;
|
||||
} else if (val < 1000) {
|
||||
digits = 2;
|
||||
} else {
|
||||
digits = 1;
|
||||
}
|
||||
objs[4] = Tcl_ObjPrintf("%.*f",
|
||||
digits, ((double) (count * 1000000)) / usec);
|
||||
} else {
|
||||
objs[4] = Tcl_NewWideIntObj(val);
|
||||
}
|
||||
} else {
|
||||
objs[4] = Tcl_NewWideIntObj((count / usec) * 1000000);
|
||||
}
|
||||
|
||||
retRes:
|
||||
/*
|
||||
* Estimated net execution time (in millisecs).
|
||||
*/
|
||||
|
||||
if (!calibrate) {
|
||||
if (usec >= 1) {
|
||||
objs[6] = Tcl_ObjPrintf("%.3f", (double)usec / 1000);
|
||||
} else {
|
||||
objs[6] = Tcl_NewWideIntObj(0);
|
||||
}
|
||||
TclNewLiteralStringObj(objs[7], "net-ms");
|
||||
}
|
||||
|
||||
/*
|
||||
* Construct the result as a list because many programs have always
|
||||
* parsed as such (extracting the first element, typically).
|
||||
*/
|
||||
|
||||
TclNewLiteralStringObj(objs[1], "\xC2\xB5s/#"); /* mics/# */
|
||||
TclNewLiteralStringObj(objs[3], "#");
|
||||
TclNewLiteralStringObj(objs[5], "#/sec");
|
||||
Tcl_SetObjResult(interp, Tcl_NewListObj(8, objarr));
|
||||
}
|
||||
|
||||
done:
|
||||
if (codePtr != NULL) {
|
||||
if ( codeOptimized
|
||||
&& codePtr->codeStart[codePtr->numCodeBytes-1] == INST_CONTINUE
|
||||
) {
|
||||
codePtr->codeStart[codePtr->numCodeBytes-1] = INST_DONE;
|
||||
}
|
||||
TclReleaseByteCode(codePtr);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
||||
@@ -574,12 +574,12 @@ ParseExpr(
|
||||
{
|
||||
OpNode *nodes = NULL; /* Pointer to the OpNode storage array where
|
||||
* we build the parse tree. */
|
||||
int nodesAvailable = 64; /* Initial size of the storage array. This
|
||||
unsigned nodesAvailable = 64; /* Initial size of the storage array. This
|
||||
* value establishes a minimum tree memory cost
|
||||
* of only about 1 kibyte, and is large enough
|
||||
* for most expressions to parse with no need
|
||||
* for array growth and reallocation. */
|
||||
int nodesUsed = 0; /* Number of OpNodes filled. */
|
||||
unsigned nodesUsed = 0; /* Number of OpNodes filled. */
|
||||
int scanned = 0; /* Capture number of byte scanned by
|
||||
* parsing routines. */
|
||||
int lastParsed; /* Stores info about what the lexeme parsed
|
||||
@@ -658,7 +658,7 @@ ParseExpr(
|
||||
*/
|
||||
|
||||
if (nodesUsed >= nodesAvailable) {
|
||||
int size = nodesUsed * 2;
|
||||
unsigned size = nodesUsed * 2;
|
||||
OpNode *newPtr = NULL;
|
||||
|
||||
do {
|
||||
|
||||
@@ -859,6 +859,9 @@ MODULE_SCOPE int TclEvalObjvInternal(Tcl_Interp *interp,
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
MODULE_SCOPE ByteCode * TclCompileObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
const CmdFrame *invoker, int word);
|
||||
|
||||
MODULE_SCOPE int TclCompEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
const CmdFrame *invoker, int word);
|
||||
|
||||
@@ -937,6 +940,25 @@ MODULE_SCOPE void TclPrintSource(FILE *outFile,
|
||||
CONST char *string, int maxChars);
|
||||
MODULE_SCOPE int TclRegisterLiteral(CompileEnv *envPtr,
|
||||
char *bytes, int length, int flags);
|
||||
|
||||
static inline void
|
||||
TclPreserveByteCode(
|
||||
register ByteCode *codePtr)
|
||||
{
|
||||
codePtr->refCount++;
|
||||
}
|
||||
|
||||
static inline void
|
||||
TclReleaseByteCode(
|
||||
register ByteCode *codePtr)
|
||||
{
|
||||
if (codePtr->refCount-- > 1) {
|
||||
return;
|
||||
}
|
||||
/* Just dropped to refcount==0. Clean up. */
|
||||
TclCleanupByteCode(codePtr);
|
||||
}
|
||||
|
||||
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
MODULE_SCOPE int TclSingleOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
|
||||
+1
-1
@@ -1348,7 +1348,7 @@ yyparse (info)
|
||||
int yychar;
|
||||
|
||||
/* The semantic value of the look-ahead symbol. */
|
||||
YYSTYPE yylval;
|
||||
YYSTYPE yylval = {0};
|
||||
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs;
|
||||
|
||||
+170
-250
@@ -1346,24 +1346,21 @@ FreeExprCodeInternalRep(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclCompEvalObj --
|
||||
* TclCompileObj --
|
||||
*
|
||||
* This procedure evaluates the script contained in a Tcl_Obj by first
|
||||
* compiling it and then passing it to TclExecuteByteCode.
|
||||
* This procedure compiles the script contained in a Tcl_Obj.
|
||||
*
|
||||
* Results:
|
||||
* The return value is one of the return codes defined in tcl.h (such as
|
||||
* TCL_OK), and interp->objResultPtr refers to a Tcl object that either
|
||||
* contains the result of executing the code or an error message.
|
||||
* A pointer to the corresponding ByteCode, never NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* Almost certainly, depending on the ByteCode's instructions.
|
||||
* The object is shimmered to bytecode type.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclCompEvalObj(
|
||||
ByteCode *
|
||||
TclCompileObj(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr,
|
||||
const CmdFrame *invoker,
|
||||
@@ -1371,23 +1368,7 @@ TclCompEvalObj(
|
||||
{
|
||||
register Interp *iPtr = (Interp *) interp;
|
||||
register ByteCode *codePtr; /* Tcl Internal type of bytecode. */
|
||||
int result;
|
||||
Namespace *namespacePtr;
|
||||
|
||||
/*
|
||||
* Check that the interpreter is ready to execute scripts. Note that we
|
||||
* manage the interp's runlevel here: it is a small white lie (maybe), but
|
||||
* saves a ++/-- pair at each invocation. Amazingly enough, the impact on
|
||||
* performance is noticeable.
|
||||
*/
|
||||
|
||||
iPtr->numLevels++;
|
||||
if (TclInterpReady(interp) == TCL_ERROR) {
|
||||
result = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
namespacePtr = iPtr->varFramePtr->nsPtr;
|
||||
Namespace *namespacePtr = iPtr->varFramePtr->nsPtr;
|
||||
|
||||
/*
|
||||
* If the object is not already of tclByteCodeType, compile it (and reset
|
||||
@@ -1418,19 +1399,24 @@ TclCompEvalObj(
|
||||
|| (codePtr->compileEpoch != iPtr->compileEpoch)
|
||||
|| (codePtr->nsPtr != namespacePtr)
|
||||
|| (codePtr->nsEpoch != namespacePtr->resolverEpoch)) {
|
||||
if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) {
|
||||
if ((Interp *) *codePtr->interpHandle != iPtr) {
|
||||
Tcl_Panic("Tcl_EvalObj: compiled script jumped interps");
|
||||
}
|
||||
codePtr->compileEpoch = iPtr->compileEpoch;
|
||||
} else {
|
||||
/*
|
||||
* This byteCode is invalid: free it and recompile.
|
||||
*/
|
||||
|
||||
objPtr->typePtr->freeIntRepProc(objPtr);
|
||||
if (!(codePtr->flags & TCL_BYTECODE_PRECOMPILED)) {
|
||||
goto recompileObj;
|
||||
}
|
||||
if ((Interp *) *codePtr->interpHandle != iPtr) {
|
||||
Tcl_Panic("Tcl_EvalObj: compiled script jumped interps");
|
||||
}
|
||||
codePtr->compileEpoch = iPtr->compileEpoch;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that any compiled locals do refer to the current proc
|
||||
* environment! If not, recompile.
|
||||
*/
|
||||
|
||||
if (!(codePtr->flags & TCL_BYTECODE_PRECOMPILED) &&
|
||||
(codePtr->procPtr == NULL) &&
|
||||
(codePtr->localCachePtr != iPtr->varFramePtr->localCachePtr)){
|
||||
goto recompileObj;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1468,77 +1454,68 @@ TclCompEvalObj(
|
||||
* information.
|
||||
*/
|
||||
|
||||
if (invoker) {
|
||||
if (invoker == NULL) {
|
||||
return codePtr;
|
||||
} else {
|
||||
Tcl_HashEntry *hePtr =
|
||||
Tcl_FindHashEntry(iPtr->lineBCPtr, (char *) codePtr);
|
||||
|
||||
if (hePtr) {
|
||||
ExtCmdLoc *eclPtr = Tcl_GetHashValue(hePtr);
|
||||
int redo = 0;
|
||||
CmdFrame *ctxPtr = TclStackAlloc(interp,sizeof(CmdFrame));
|
||||
ExtCmdLoc *eclPtr;
|
||||
CmdFrame *ctxCopyPtr;
|
||||
int redo;
|
||||
|
||||
*ctxPtr = *invoker;
|
||||
if (!hePtr) {
|
||||
return codePtr;
|
||||
}
|
||||
|
||||
if (invoker->type == TCL_LOCATION_BC) {
|
||||
eclPtr = Tcl_GetHashValue(hePtr);
|
||||
redo = 0;
|
||||
ctxCopyPtr = TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
*ctxCopyPtr = *invoker;
|
||||
|
||||
if (invoker->type == TCL_LOCATION_BC) {
|
||||
/*
|
||||
* Note: Type BC => ctx.data.eval.path is not used.
|
||||
* ctx.data.tebc.codePtr used instead
|
||||
*/
|
||||
|
||||
TclGetSrcInfoForPc(ctxCopyPtr);
|
||||
if (ctxCopyPtr->type == TCL_LOCATION_SOURCE) {
|
||||
/*
|
||||
* Note: Type BC => ctx.data.eval.path is not used.
|
||||
* ctx.data.tebc.codePtr used instead
|
||||
* The reference made by 'TclGetSrcInfoForPc' is dead.
|
||||
*/
|
||||
|
||||
TclGetSrcInfoForPc(ctxPtr);
|
||||
if (ctxPtr->type == TCL_LOCATION_SOURCE) {
|
||||
/*
|
||||
* The reference made by 'TclGetSrcInfoForPc' is
|
||||
* dead.
|
||||
*/
|
||||
|
||||
Tcl_DecrRefCount(ctxPtr->data.eval.path);
|
||||
ctxPtr->data.eval.path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (word < ctxPtr->nline) {
|
||||
/*
|
||||
* Note: We do not care if the line[word] is -1. This
|
||||
* is a difference and requires a recompile (location
|
||||
* changed from absolute to relative, literal is used
|
||||
* fixed and through variable)
|
||||
*
|
||||
* Example:
|
||||
* test info-32.0 using literal of info-24.8
|
||||
* (dict with ... vs set body ...).
|
||||
*/
|
||||
|
||||
redo = ((eclPtr->type == TCL_LOCATION_SOURCE)
|
||||
&& (eclPtr->start != ctxPtr->line[word]))
|
||||
|| ((eclPtr->type == TCL_LOCATION_BC)
|
||||
&& (ctxPtr->type == TCL_LOCATION_SOURCE));
|
||||
}
|
||||
|
||||
TclStackFree(interp, ctxPtr);
|
||||
|
||||
if (redo) {
|
||||
goto recompileObj;
|
||||
Tcl_DecrRefCount(ctxCopyPtr->data.eval.path);
|
||||
ctxCopyPtr->data.eval.path = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Increment the code's ref count while it is being executed. If
|
||||
* afterwards no references to it remain, free the code.
|
||||
*/
|
||||
if (word < ctxCopyPtr->nline) {
|
||||
/*
|
||||
* Note: We do not care if the line[word] is -1. This is a
|
||||
* difference and requires a recompile (location changed from
|
||||
* absolute to relative, literal is used fixed and through
|
||||
* variable)
|
||||
*
|
||||
* Example:
|
||||
* test info-32.0 using literal of info-24.8
|
||||
* (dict with ... vs set body ...).
|
||||
*/
|
||||
|
||||
runCompiledObj:
|
||||
codePtr->refCount++;
|
||||
result = TclExecuteByteCode(interp, codePtr);
|
||||
codePtr->refCount--;
|
||||
if (codePtr->refCount <= 0) {
|
||||
TclCleanupByteCode(codePtr);
|
||||
redo = ((eclPtr->type == TCL_LOCATION_SOURCE)
|
||||
&& (eclPtr->start != ctxCopyPtr->line[word]))
|
||||
|| ((eclPtr->type == TCL_LOCATION_BC)
|
||||
&& (ctxCopyPtr->type == TCL_LOCATION_SOURCE));
|
||||
}
|
||||
|
||||
TclStackFree(interp, ctxCopyPtr);
|
||||
if (!redo) {
|
||||
return codePtr;
|
||||
}
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
recompileObj:
|
||||
recompileObj:
|
||||
iPtr->errorLine = 1;
|
||||
|
||||
/*
|
||||
@@ -1550,12 +1527,75 @@ TclCompEvalObj(
|
||||
|
||||
iPtr->invokeCmdFramePtr = invoker;
|
||||
iPtr->invokeWord = word;
|
||||
tclByteCodeType.setFromAnyProc(interp, objPtr);
|
||||
TclSetByteCodeFromAny(interp, objPtr, NULL, NULL);
|
||||
iPtr->invokeCmdFramePtr = NULL;
|
||||
codePtr = (ByteCode *) objPtr->internalRep.twoPtrValue.ptr1;
|
||||
goto runCompiledObj;
|
||||
if (iPtr->varFramePtr->localCachePtr) {
|
||||
codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr;
|
||||
codePtr->localCachePtr->refCount++;
|
||||
}
|
||||
return codePtr;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclCompEvalObj --
|
||||
*
|
||||
* This procedure evaluates the script contained in a Tcl_Obj by first
|
||||
* compiling it and then passing it to TclExecuteByteCode.
|
||||
*
|
||||
* Results:
|
||||
* The return value is one of the return codes defined in tcl.h (such as
|
||||
* TCL_OK), and interp->objResultPtr refers to a Tcl object that either
|
||||
* contains the result of executing the code or an error message.
|
||||
*
|
||||
* Side effects:
|
||||
* Almost certainly, depending on the ByteCode's instructions.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
done:
|
||||
int
|
||||
TclCompEvalObj(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr,
|
||||
const CmdFrame *invoker,
|
||||
int word)
|
||||
{
|
||||
register Interp *iPtr = (Interp *) interp;
|
||||
register ByteCode *codePtr; /* Tcl Internal type of bytecode. */
|
||||
int result;
|
||||
|
||||
/*
|
||||
* Check that the interpreter is ready to execute scripts. Note that we
|
||||
* manage the interp's runlevel here: it is a small white lie (maybe), but
|
||||
* saves a ++/-- pair at each invocation. Amazingly enough, the impact on
|
||||
* performance is noticeable.
|
||||
*/
|
||||
|
||||
iPtr->numLevels++;
|
||||
if (TclInterpReady(interp) == TCL_ERROR) {
|
||||
result = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Compile objPtr to the byte code */
|
||||
codePtr = TclCompileObj(interp, objPtr, invoker, word);
|
||||
|
||||
/*
|
||||
* Increment the code's ref count while it is being executed. If
|
||||
* afterwards no references to it remain, free the code.
|
||||
*/
|
||||
|
||||
codePtr->refCount++;
|
||||
result = TclExecuteByteCode(interp, codePtr);
|
||||
codePtr->refCount--;
|
||||
if (codePtr->refCount <= 0) {
|
||||
TclCleanupByteCode(codePtr);
|
||||
}
|
||||
|
||||
done:
|
||||
iPtr->numLevels--;
|
||||
return result;
|
||||
}
|
||||
@@ -4898,33 +4938,30 @@ TclExecuteByteCode(
|
||||
}
|
||||
#endif
|
||||
{
|
||||
mp_int big2;
|
||||
mp_int big1, big2;
|
||||
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
|
||||
/* TODO: internals intrusion */
|
||||
if ((l1 > 0) ^ (big2.sign == MP_ZPOS)) {
|
||||
if ((l1 > 0) ^ mp_isneg(&big2)) {
|
||||
/*
|
||||
* Arguments are opposite sign; remainder is sum.
|
||||
* Arguments are same sign; remainder is first operand.
|
||||
*/
|
||||
|
||||
mp_int big1;
|
||||
|
||||
TclBNInitBignumFromLong(&big1, l1);
|
||||
mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
objResultPtr = Tcl_NewBignumObj(&big2);
|
||||
TRACE(("%s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
mp_clear(&big2);
|
||||
TRACE(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Arguments are same sign; remainder is first operand.
|
||||
* Arguments are opposite sign; remainder is sum.
|
||||
*/
|
||||
|
||||
mp_clear(&big2);
|
||||
TRACE(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
TclBNInitBignumFromLong(&big1, l1);
|
||||
mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
objResultPtr = Tcl_NewBignumObj(&big2);
|
||||
TRACE(("%s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
}
|
||||
}
|
||||
#ifndef NO_WIDE_TYPE
|
||||
@@ -4955,32 +4992,31 @@ TclExecuteByteCode(
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
}
|
||||
{
|
||||
mp_int big2;
|
||||
mp_int big1, big2;
|
||||
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
|
||||
/* TODO: internals intrusion */
|
||||
if ((w1 > ((Tcl_WideInt) 0)) ^ (big2.sign == MP_ZPOS)) {
|
||||
if ((w1 > ((Tcl_WideInt) 0)) ^ mp_isneg(&big2)) {
|
||||
/*
|
||||
* Arguments are opposite sign; remainder is sum.
|
||||
* Arguments are same sign; remainder is first operand.
|
||||
*/
|
||||
|
||||
mp_int big1;
|
||||
|
||||
TclBNInitBignumFromWideInt(&big1, w1);
|
||||
mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
objResultPtr = Tcl_NewBignumObj(&big2);
|
||||
TRACE(("%s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
mp_clear(&big2);
|
||||
TRACE(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Arguments are same sign; remainder is first operand.
|
||||
* Arguments are opposite sign; remainder is sum.
|
||||
*/
|
||||
|
||||
mp_clear(&big2);
|
||||
TRACE(("%s\n", O2S(valuePtr)));
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
TclBNInitBignumFromWideInt(&big1, w1);
|
||||
mp_add(&big2, &big1, &big2);
|
||||
mp_clear(&big1);
|
||||
objResultPtr = Tcl_NewBignumObj(&big2);
|
||||
TRACE(("%s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4993,7 +5029,7 @@ TclExecuteByteCode(
|
||||
mp_init(&bigRemainder);
|
||||
mp_div(&big1, &big2, &bigResult, &bigRemainder);
|
||||
if (!mp_iszero(&bigRemainder)
|
||||
&& (bigRemainder.sign != big2.sign)) {
|
||||
&& (mp_isneg(&bigRemainder) != mp_isneg(&big2))) {
|
||||
/*
|
||||
* Convert to Tcl's integer division rules.
|
||||
*/
|
||||
@@ -5276,139 +5312,24 @@ TclExecuteByteCode(
|
||||
}
|
||||
|
||||
if ((type1 == TCL_NUMBER_BIG) || (type2 == TCL_NUMBER_BIG)) {
|
||||
mp_int big1, big2, bigResult, *First, *Second;
|
||||
int numPos;
|
||||
mp_int big1, big2, bigResult;
|
||||
|
||||
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
|
||||
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
|
||||
|
||||
/*
|
||||
* Count how many positive arguments we have. If only one of the
|
||||
* arguments is negative, store it in 'Second'.
|
||||
*/
|
||||
|
||||
if (mp_cmp_d(&big1, 0) != MP_LT) {
|
||||
numPos = 1 + (mp_cmp_d(&big2, 0) != MP_LT);
|
||||
First = &big1;
|
||||
Second = &big2;
|
||||
} else {
|
||||
First = &big2;
|
||||
Second = &big1;
|
||||
numPos = (mp_cmp_d(First, 0) != MP_LT);
|
||||
}
|
||||
mp_init(&bigResult);
|
||||
|
||||
switch (*pc) {
|
||||
case INST_BITAND:
|
||||
switch (numPos) {
|
||||
case 2:
|
||||
/*
|
||||
* Both arguments positive, base case.
|
||||
*/
|
||||
|
||||
mp_and(First, Second, &bigResult);
|
||||
break;
|
||||
case 1:
|
||||
/*
|
||||
* First is positive; second negative:
|
||||
* P & N = P & ~~N = P&~(-N-1) = P & (P ^ (-N-1))
|
||||
*/
|
||||
|
||||
mp_neg(Second, Second);
|
||||
mp_sub_d(Second, 1, Second);
|
||||
mp_xor(First, Second, &bigResult);
|
||||
mp_and(First, &bigResult, &bigResult);
|
||||
break;
|
||||
case 0:
|
||||
/*
|
||||
* Both arguments negative:
|
||||
* a & b = ~ (~a | ~b) = -(-a-1|-b-1)-1
|
||||
*/
|
||||
|
||||
mp_neg(First, First);
|
||||
mp_sub_d(First, 1, First);
|
||||
mp_neg(Second, Second);
|
||||
mp_sub_d(Second, 1, Second);
|
||||
mp_or(First, Second, &bigResult);
|
||||
mp_neg(&bigResult, &bigResult);
|
||||
mp_sub_d(&bigResult, 1, &bigResult);
|
||||
break;
|
||||
}
|
||||
mp_and(&big1, &big2, &bigResult);
|
||||
break;
|
||||
|
||||
case INST_BITOR:
|
||||
switch (numPos) {
|
||||
case 2:
|
||||
/*
|
||||
* Both arguments positive, base case.
|
||||
*/
|
||||
|
||||
mp_or(First, Second, &bigResult);
|
||||
break;
|
||||
case 1:
|
||||
/*
|
||||
* First is positive; second negative:
|
||||
* N|P = ~(~N&~P) = ~((-N-1)&~P) = -((-N-1)&((-N-1)^P))-1
|
||||
*/
|
||||
|
||||
mp_neg(Second, Second);
|
||||
mp_sub_d(Second, 1, Second);
|
||||
mp_xor(First, Second, &bigResult);
|
||||
mp_and(Second, &bigResult, &bigResult);
|
||||
mp_neg(&bigResult, &bigResult);
|
||||
mp_sub_d(&bigResult, 1, &bigResult);
|
||||
break;
|
||||
case 0:
|
||||
/*
|
||||
* Both arguments negative:
|
||||
* a | b = ~ (~a & ~b) = -(-a-1&-b-1)-1
|
||||
*/
|
||||
|
||||
mp_neg(First, First);
|
||||
mp_sub_d(First, 1, First);
|
||||
mp_neg(Second, Second);
|
||||
mp_sub_d(Second, 1, Second);
|
||||
mp_and(First, Second, &bigResult);
|
||||
mp_neg(&bigResult, &bigResult);
|
||||
mp_sub_d(&bigResult, 1, &bigResult);
|
||||
break;
|
||||
}
|
||||
mp_or(&big1, &big2, &bigResult);
|
||||
break;
|
||||
|
||||
case INST_BITXOR:
|
||||
switch (numPos) {
|
||||
case 2:
|
||||
/*
|
||||
* Both arguments positive, base case.
|
||||
*/
|
||||
|
||||
mp_xor(First, Second, &bigResult);
|
||||
break;
|
||||
case 1:
|
||||
/*
|
||||
* First is positive; second negative:
|
||||
* P^N = ~(P^~N) = -(P^(-N-1))-1
|
||||
*/
|
||||
|
||||
mp_neg(Second, Second);
|
||||
mp_sub_d(Second, 1, Second);
|
||||
mp_xor(First, Second, &bigResult);
|
||||
mp_neg(&bigResult, &bigResult);
|
||||
mp_sub_d(&bigResult, 1, &bigResult);
|
||||
break;
|
||||
case 0:
|
||||
/*
|
||||
* Both arguments negative:
|
||||
* a ^ b = (~a ^ ~b) = (-a-1^-b-1)
|
||||
*/
|
||||
|
||||
mp_neg(First, First);
|
||||
mp_sub_d(First, 1, First);
|
||||
mp_neg(Second, Second);
|
||||
mp_sub_d(Second, 1, Second);
|
||||
mp_xor(First, Second, &bigResult);
|
||||
break;
|
||||
}
|
||||
mp_xor(&big1, &big2, &bigResult);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6216,9 +6137,8 @@ TclExecuteByteCode(
|
||||
}
|
||||
mp_init(&bigRemainder);
|
||||
mp_div(&big1, &big2, &bigResult, &bigRemainder);
|
||||
/* TODO: internals intrusion */
|
||||
if (!mp_iszero(&bigRemainder)
|
||||
&& (bigRemainder.sign != big2.sign)) {
|
||||
&& (mp_isneg(&bigRemainder) != mp_isneg(&big2))) {
|
||||
/*
|
||||
* Convert to Tcl's integer division rules.
|
||||
*/
|
||||
|
||||
+5
-1
@@ -324,7 +324,10 @@ CreateHashEntry(
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (compareKeysProc((VOID *) key, hPtr)) {
|
||||
/* if keys pointers or values are equal */
|
||||
if ((key == hPtr->key.oneWordValue)
|
||||
|| compareKeysProc((VOID *) key, hPtr)
|
||||
) {
|
||||
if (newPtr) {
|
||||
*newPtr = 0;
|
||||
}
|
||||
@@ -850,6 +853,7 @@ AllocStringEntry(
|
||||
allocsize = sizeof(hPtr->key);
|
||||
}
|
||||
hPtr = (Tcl_HashEntry *) ckalloc(sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key));
|
||||
memset(hPtr, 0, sizeof(Tcl_HashEntry) + allocsize - sizeof(hPtr->key));
|
||||
memcpy(hPtr->key.string, string, size);
|
||||
hPtr->clientData = 0;
|
||||
return hPtr;
|
||||
|
||||
+25
-19
@@ -49,7 +49,7 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
#if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \
|
||||
|| defined(__cplusplus) || defined(_MSC_VER)
|
||||
|| defined(__cplusplus) || defined(_MSC_VER) || defined(__ICC)
|
||||
#include <stddef.h>
|
||||
#else
|
||||
typedef int ptrdiff_t;
|
||||
@@ -2638,6 +2638,8 @@ MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[], Tcl_Obj **optionsPtrPtr,
|
||||
int *codePtr, int *levelPtr);
|
||||
MODULE_SCOPE int TclNokia770Doubles();
|
||||
MODULE_SCOPE void TclNsDecrRefCount(Namespace *nsPtr);
|
||||
MODULE_SCOPE int TclNamespaceDeleted(Namespace *nsPtr);
|
||||
MODULE_SCOPE void TclObjVarErrMsg(Tcl_Interp *interp, Tcl_Obj *part1Ptr,
|
||||
Tcl_Obj *part2Ptr, const char *operation,
|
||||
const char *reason, int index);
|
||||
@@ -2770,10 +2772,29 @@ MODULE_SCOPE int TclpLoadMemory(Tcl_Interp *interp, void *buffer,
|
||||
MODULE_SCOPE void TclInitThreadStorage(void);
|
||||
MODULE_SCOPE void TclpFinalizeThreadDataThread(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadStorage(void);
|
||||
|
||||
/* TclWideMUInt -- wide integer used for measurement calculations: */
|
||||
#if (!defined(_WIN32) || !defined(_MSC_VER) || (_MSC_VER >= 1400))
|
||||
# define TclWideMUInt Tcl_WideUInt
|
||||
#else
|
||||
/* older MSVS may not allow conversions between unsigned __int64 and double) */
|
||||
# define TclWideMUInt Tcl_WideInt
|
||||
#endif
|
||||
#ifdef TCL_WIDE_CLICKS
|
||||
MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void);
|
||||
MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks);
|
||||
MODULE_SCOPE double TclpWideClickInMicrosec(void);
|
||||
#else
|
||||
# ifdef _WIN32
|
||||
# define TCL_WIDE_CLICKS 1
|
||||
MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void);
|
||||
MODULE_SCOPE double TclpWideClickInMicrosec(void);
|
||||
# define TclpWideClicksToNanoseconds(clicks) \
|
||||
((double)(clicks) * TclpWideClickInMicrosec() * 1000)
|
||||
# endif
|
||||
#endif
|
||||
MODULE_SCOPE Tcl_WideInt TclpGetMicroseconds(void);
|
||||
|
||||
MODULE_SCOPE Tcl_Obj * TclDisassembleByteCodeObj(Tcl_Obj *objPtr);
|
||||
MODULE_SCOPE int TclUtfCasecmp(CONST char *cs, CONST char *ct);
|
||||
|
||||
@@ -3016,6 +3037,9 @@ MODULE_SCOPE int Tcl_TellObjCmd(ClientData clientData,
|
||||
MODULE_SCOPE int Tcl_TimeObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int Tcl_TimeRateObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int Tcl_TraceObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
@@ -3270,39 +3294,21 @@ MODULE_SCOPE int TclDivOpCmd(ClientData clientData,
|
||||
MODULE_SCOPE int TclCompileDivOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclLessOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclCompileLessOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclLeqOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclCompileLeqOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclGreaterOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclCompileGreaterOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclGeqOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclCompileGeqOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclEqOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclCompileEqOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclStreqOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclCompileStreqOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
|
||||
+17
-1
@@ -23,6 +23,7 @@
|
||||
|
||||
typedef struct Link {
|
||||
Tcl_Interp *interp; /* Interpreter containing Tcl variable. */
|
||||
Namespace *nsPtr; /* Namespace containing Tcl variable */
|
||||
Tcl_Obj *varName; /* Name of variable (must be global). This is
|
||||
* needed during trace callbacks, since the
|
||||
* actual variable may be aliased at that time
|
||||
@@ -114,6 +115,8 @@ Tcl_LinkVar(
|
||||
{
|
||||
Tcl_Obj *objPtr;
|
||||
Link *linkPtr;
|
||||
Namespace *dummy;
|
||||
const char *name;
|
||||
int code;
|
||||
|
||||
linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY,
|
||||
@@ -126,6 +129,7 @@ Tcl_LinkVar(
|
||||
|
||||
linkPtr = (Link *) ckalloc(sizeof(Link));
|
||||
linkPtr->interp = interp;
|
||||
linkPtr->nsPtr = NULL;
|
||||
linkPtr->varName = Tcl_NewStringObj(varName, -1);
|
||||
Tcl_IncrRefCount(linkPtr->varName);
|
||||
linkPtr->addr = addr;
|
||||
@@ -142,11 +146,17 @@ Tcl_LinkVar(
|
||||
ckfree((char *) linkPtr);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
TclGetNamespaceForQualName(interp, varName, NULL, TCL_GLOBAL_ONLY,
|
||||
&(linkPtr->nsPtr), &dummy, &dummy, &name);
|
||||
linkPtr->nsPtr->refCount++;
|
||||
|
||||
code = Tcl_TraceVar(interp, varName, TCL_GLOBAL_ONLY|TCL_TRACE_READS
|
||||
|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, LinkTraceProc,
|
||||
(ClientData) linkPtr);
|
||||
if (code != TCL_OK) {
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
TclNsDecrRefCount(linkPtr->nsPtr);
|
||||
ckfree((char *) linkPtr);
|
||||
}
|
||||
return code;
|
||||
@@ -186,6 +196,9 @@ Tcl_UnlinkVar(
|
||||
TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
|
||||
LinkTraceProc, (ClientData) linkPtr);
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
if (linkPtr->nsPtr) {
|
||||
TclNsDecrRefCount(linkPtr->nsPtr);
|
||||
}
|
||||
ckfree((char *) linkPtr);
|
||||
}
|
||||
|
||||
@@ -279,8 +292,11 @@ LinkTraceProc(
|
||||
*/
|
||||
|
||||
if (flags & TCL_TRACE_UNSETS) {
|
||||
if (Tcl_InterpDeleted(interp)) {
|
||||
if (Tcl_InterpDeleted(interp) || TclNamespaceDeleted(linkPtr->nsPtr)) {
|
||||
Tcl_DecrRefCount(linkPtr->varName);
|
||||
if (linkPtr->nsPtr) {
|
||||
TclNsDecrRefCount(linkPtr->nsPtr);
|
||||
}
|
||||
ckfree((char *) linkPtr);
|
||||
} else if (flags & TCL_TRACE_DESTROYED) {
|
||||
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
|
||||
|
||||
+18
-1
@@ -1872,7 +1872,21 @@ UpdateStringOfList(
|
||||
* Pass 2: copy into string rep buffer.
|
||||
*/
|
||||
|
||||
/*
|
||||
* We used to set the string length here, relying on a presumed
|
||||
* guarantee that the number of bytes TclScanElement() calls reported
|
||||
* to be needed was a precise count and not an over-estimate, so long
|
||||
* as the same flag values were passed to TclConvertElement().
|
||||
*
|
||||
* Then we saw [35a8f1c04a], where a bug in TclScanElement() caused
|
||||
* that guarantee to fail. Rather than trust there are no more bugs,
|
||||
* we set the length after the loop based on what was actually written,
|
||||
* an not on what was predicted.
|
||||
*
|
||||
listPtr->length = bytesNeeded - 1;
|
||||
*
|
||||
*/
|
||||
|
||||
listPtr->bytes = ckalloc((unsigned) bytesNeeded);
|
||||
dst = listPtr->bytes;
|
||||
for (i = 0; i < numElems; i++) {
|
||||
@@ -1881,7 +1895,10 @@ UpdateStringOfList(
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
|
||||
*dst++ = ' ';
|
||||
}
|
||||
listPtr->bytes[listPtr->length] = '\0';
|
||||
dst[-1] = '\0';
|
||||
|
||||
/* Here is the safe setting of the string length. */
|
||||
listPtr->length = dst - 1 - listPtr->bytes;
|
||||
|
||||
if (flagPtr != localFlags) {
|
||||
ckfree((char *) flagPtr);
|
||||
|
||||
+26
-15
@@ -198,25 +198,36 @@ TclCreateLiteral(
|
||||
for (globalPtr=globalTablePtr->buckets[globalHash] ; globalPtr!=NULL;
|
||||
globalPtr = globalPtr->nextPtr) {
|
||||
objPtr = globalPtr->objPtr;
|
||||
if ((globalPtr->nsPtr == nsPtr)
|
||||
&& (objPtr->length == length) && ((length == 0)
|
||||
|| ((objPtr->bytes[0] == bytes[0])
|
||||
&& (memcmp(objPtr->bytes, bytes, (unsigned) length) == 0)))) {
|
||||
if (globalPtr->nsPtr == nsPtr) {
|
||||
/*
|
||||
* A literal was found: return it
|
||||
* Literals should always have UTF-8 representations... but this
|
||||
* is not guaranteed so we need to be careful anyway.
|
||||
*
|
||||
* https://stackoverflow.com/q/54337750/301832
|
||||
*/
|
||||
|
||||
if (newPtr) {
|
||||
*newPtr = 0;
|
||||
int objLength;
|
||||
char *objBytes = TclGetStringFromObj(objPtr, &objLength);
|
||||
|
||||
if ((objLength == length) && ((length == 0)
|
||||
|| ((objBytes[0] == bytes[0])
|
||||
&& (memcmp(objBytes, bytes, (unsigned) length) == 0)))) {
|
||||
/*
|
||||
* A literal was found: return it
|
||||
*/
|
||||
|
||||
if (newPtr) {
|
||||
*newPtr = 0;
|
||||
}
|
||||
if (globalPtrPtr) {
|
||||
*globalPtrPtr = globalPtr;
|
||||
}
|
||||
if (flags & LITERAL_ON_HEAP) {
|
||||
ckfree(bytes);
|
||||
}
|
||||
globalPtr->refCount++;
|
||||
return objPtr;
|
||||
}
|
||||
if (globalPtrPtr) {
|
||||
*globalPtrPtr = globalPtr;
|
||||
}
|
||||
if (flags & LITERAL_ON_HEAP) {
|
||||
ckfree(bytes);
|
||||
}
|
||||
globalPtr->refCount++;
|
||||
return objPtr;
|
||||
}
|
||||
}
|
||||
if (!newPtr) {
|
||||
|
||||
@@ -1060,6 +1060,13 @@ Tcl_DeleteNamespace(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
TclNamespaceDeleted(
|
||||
Namespace *nsPtr)
|
||||
{
|
||||
return (nsPtr->flags & NS_DYING) ? 1 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -1237,6 +1244,33 @@ NamespaceFree(
|
||||
ckfree((char *) nsPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclNsDecrRefCount --
|
||||
*
|
||||
* Drops a reference to a namespace and frees it if the namespace has
|
||||
* been deleted and the last reference has just been dropped.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TclNsDecrRefCount(
|
||||
Namespace *nsPtr)
|
||||
{
|
||||
nsPtr->refCount--;
|
||||
if ((nsPtr->refCount == 0) && (nsPtr->flags & NS_DEAD)) {
|
||||
NamespaceFree(nsPtr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
||||
+15
-16
@@ -189,7 +189,7 @@ static Tcl_ThreadDataKey pendingObjDataKey;
|
||||
mp_shrink(&(bignum)); \
|
||||
} \
|
||||
(objPtr)->internalRep.ptrAndLongRep.ptr = (void*) (bignum).dp; \
|
||||
(objPtr)->internalRep.ptrAndLongRep.value = ( ((bignum).sign << 30) \
|
||||
(objPtr)->internalRep.ptrAndLongRep.value = ( (mp_isneg(&bignum) << 30) \
|
||||
| ((bignum).alloc << 15) | ((bignum).used)); \
|
||||
}
|
||||
|
||||
@@ -2778,8 +2778,8 @@ Tcl_GetLongFromObj(
|
||||
mp_int big;
|
||||
|
||||
UNPACK_BIGNUM(objPtr, big);
|
||||
if ((size_t)(big.used) <= (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1)
|
||||
/ DIGIT_BIT) {
|
||||
if ((size_t)(big.used) <= (CHAR_BIT * sizeof(long) + MP_DIGIT_BIT - 1)
|
||||
/ MP_DIGIT_BIT) {
|
||||
unsigned long value = 0, numBytes = sizeof(long);
|
||||
long scratch;
|
||||
unsigned char *bytes = (unsigned char *)&scratch;
|
||||
@@ -2787,7 +2787,7 @@ Tcl_GetLongFromObj(
|
||||
while (numBytes-- > 0) {
|
||||
value = (value << CHAR_BIT) | *bytes++;
|
||||
}
|
||||
if (big.sign) {
|
||||
if (mp_isneg(&big)) {
|
||||
*longPtr = - (long) value;
|
||||
} else {
|
||||
*longPtr = (long) value;
|
||||
@@ -3079,7 +3079,7 @@ Tcl_GetWideIntFromObj(
|
||||
|
||||
UNPACK_BIGNUM(objPtr, big);
|
||||
if ((size_t)(big.used) <= (CHAR_BIT * sizeof(Tcl_WideInt)
|
||||
+ DIGIT_BIT - 1) / DIGIT_BIT) {
|
||||
+ MP_DIGIT_BIT - 1) / MP_DIGIT_BIT) {
|
||||
Tcl_WideUInt value = 0;
|
||||
unsigned long numBytes = sizeof(Tcl_WideInt);
|
||||
Tcl_WideInt scratch;
|
||||
@@ -3089,7 +3089,7 @@ Tcl_GetWideIntFromObj(
|
||||
while (numBytes-- > 0) {
|
||||
value = (value << CHAR_BIT) | *bytes++;
|
||||
}
|
||||
if (big.sign) {
|
||||
if (mp_isneg(&big)) {
|
||||
*wideIntPtr = - (Tcl_WideInt) value;
|
||||
} else {
|
||||
*wideIntPtr = (Tcl_WideInt) value;
|
||||
@@ -3498,7 +3498,7 @@ Tcl_SetBignumObj(
|
||||
Tcl_Panic("%s called with shared object", "Tcl_SetBignumObj");
|
||||
}
|
||||
if ((size_t)(bignumValue->used)
|
||||
<= (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) / DIGIT_BIT) {
|
||||
<= (CHAR_BIT * sizeof(long) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT) {
|
||||
unsigned long value = 0, numBytes = sizeof(long);
|
||||
long scratch;
|
||||
unsigned char *bytes = (unsigned char *)&scratch;
|
||||
@@ -3508,10 +3508,10 @@ Tcl_SetBignumObj(
|
||||
while (numBytes-- > 0) {
|
||||
value = (value << CHAR_BIT) | *bytes++;
|
||||
}
|
||||
if (value > (((~(unsigned long)0) >> 1) + bignumValue->sign)) {
|
||||
if (value > (((~(unsigned long)0) >> 1) + mp_isneg(bignumValue))) {
|
||||
goto tooLargeForLong;
|
||||
}
|
||||
if (bignumValue->sign) {
|
||||
if (mp_isneg(bignumValue)) {
|
||||
TclSetLongObj(objPtr, -(long)value);
|
||||
} else {
|
||||
TclSetLongObj(objPtr, (long)value);
|
||||
@@ -3522,7 +3522,7 @@ Tcl_SetBignumObj(
|
||||
tooLargeForLong:
|
||||
#ifndef NO_WIDE_TYPE
|
||||
if ((size_t)(bignumValue->used)
|
||||
<= (CHAR_BIT * sizeof(Tcl_WideInt) + DIGIT_BIT - 1) / DIGIT_BIT) {
|
||||
<= (CHAR_BIT * sizeof(Tcl_WideInt) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT) {
|
||||
Tcl_WideUInt value = 0;
|
||||
unsigned long numBytes = sizeof(Tcl_WideInt);
|
||||
Tcl_WideInt scratch;
|
||||
@@ -3533,10 +3533,10 @@ Tcl_SetBignumObj(
|
||||
while (numBytes-- > 0) {
|
||||
value = (value << CHAR_BIT) | *bytes++;
|
||||
}
|
||||
if (value > (((~(Tcl_WideUInt)0) >> 1) + bignumValue->sign)) {
|
||||
if (value > (((~(Tcl_WideUInt)0) >> 1) + mp_isneg(bignumValue))) {
|
||||
goto tooLargeForWide;
|
||||
}
|
||||
if (bignumValue->sign) {
|
||||
if (mp_isneg(bignumValue)) {
|
||||
TclSetWideIntObj(objPtr, -(Tcl_WideInt)value);
|
||||
} else {
|
||||
TclSetWideIntObj(objPtr, (Tcl_WideInt)value);
|
||||
@@ -3921,11 +3921,10 @@ TclCompareObjKeys(
|
||||
|
||||
/*
|
||||
* If the object pointers are the same then they match.
|
||||
*/
|
||||
* OPT: this comparison was moved to the caller
|
||||
|
||||
if (objPtr1 == objPtr2) {
|
||||
return 1;
|
||||
}
|
||||
if (objPtr1 == objPtr2) return 1;
|
||||
*/
|
||||
|
||||
/*
|
||||
* Don't use Tcl_GetStringFromObj as it would prevent l1 and l2 being
|
||||
|
||||
+42
-39
@@ -29,6 +29,9 @@ static int IsSeparatorOrNull(int ch);
|
||||
static Tcl_Obj * GetExtension(Tcl_Obj *pathPtr);
|
||||
static int MakePathFromNormalized(Tcl_Interp *interp,
|
||||
Tcl_Obj *pathPtr);
|
||||
static Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[],
|
||||
int forceRelative);
|
||||
|
||||
|
||||
/*
|
||||
* Define the 'path' object type, which Tcl uses to represent file paths
|
||||
@@ -821,15 +824,13 @@ GetExtension(
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[]);
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_FSJoinPath(
|
||||
Tcl_Obj *listObj, /* Path elements to join, may have a zero
|
||||
* reference count. */
|
||||
int elements) /* Number of elements to use (-1 = all) */
|
||||
{
|
||||
Tcl_Obj *copy, *res;
|
||||
Tcl_Obj *res;
|
||||
int objc;
|
||||
Tcl_Obj **objv;
|
||||
|
||||
@@ -838,17 +839,17 @@ Tcl_FSJoinPath(
|
||||
}
|
||||
|
||||
elements = ((elements >= 0) && (elements <= objc)) ? elements : objc;
|
||||
copy = TclListObjCopy(NULL, listObj);
|
||||
Tcl_ListObjGetElements(NULL, listObj, &objc, &objv);
|
||||
res = TclJoinPath(elements, objv);
|
||||
Tcl_DecrRefCount(copy);
|
||||
res = TclJoinPath(elements, objv, 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
Tcl_Obj *
|
||||
static Tcl_Obj *
|
||||
TclJoinPath(
|
||||
int elements,
|
||||
Tcl_Obj * const objv[])
|
||||
int elements, /* Number of elements to use (-1 = all) */
|
||||
Tcl_Obj * const objv[], /* Path elements to join */
|
||||
int forceRelative) /* If non-zero, assume all more paths are
|
||||
* relative (e. g. simple normalization) */
|
||||
{
|
||||
Tcl_Obj *res = NULL; /* Resulting path object (container of join) */
|
||||
Tcl_Obj *elt; /* Path part (result if returns part of path) */
|
||||
@@ -875,13 +876,14 @@ TclJoinPath(
|
||||
* to be an absolute path. Added a check for that elt is absolute.
|
||||
*/
|
||||
|
||||
if ((i == (elements-2)) && (i == 0)
|
||||
if ((i == 0) && (elements == 2)
|
||||
&& (elt->typePtr == &tclFsPathType)
|
||||
&& !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))
|
||||
&& TclGetPathType(elt, NULL, NULL, NULL) == TCL_PATH_ABSOLUTE) {
|
||||
Tcl_Obj *tailObj = objv[i+1];
|
||||
|
||||
type = TclGetPathType(tailObj, NULL, NULL, NULL);
|
||||
/* if forceRelative - second path is relative */
|
||||
type = forceRelative ? TCL_PATH_RELATIVE :
|
||||
TclGetPathType(tailObj, NULL, NULL, NULL);
|
||||
if (type == TCL_PATH_RELATIVE) {
|
||||
const char *str;
|
||||
int len;
|
||||
@@ -953,7 +955,9 @@ TclJoinPath(
|
||||
}
|
||||
strElt = Tcl_GetStringFromObj(elt, &strEltLen);
|
||||
driveNameLength = 0;
|
||||
type = TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName);
|
||||
/* if forceRelative - all paths excepting first one are relative */
|
||||
type = (forceRelative && (i > 0)) ? TCL_PATH_RELATIVE :
|
||||
TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName);
|
||||
if (type != TCL_PATH_RELATIVE) {
|
||||
/*
|
||||
* Zero out the current result.
|
||||
@@ -2413,37 +2417,30 @@ SetFsPathFromAny(
|
||||
* Handle tilde substitutions, if needed.
|
||||
*/
|
||||
|
||||
if (name[0] == '~') {
|
||||
if (len && name[0] == '~') {
|
||||
char *expandedUser;
|
||||
Tcl_DString temp;
|
||||
int split;
|
||||
char separator = '/';
|
||||
|
||||
/*
|
||||
* We have multiple cases '~/foo/bar...', '~user/foo/bar...', etc.
|
||||
* split becomes value 1 for '~/...' as well as for '~'.
|
||||
*/
|
||||
split = FindSplitPos(name, separator);
|
||||
if (split != len) {
|
||||
/*
|
||||
* We have multiple pieces '~user/foo/bar...'
|
||||
*/
|
||||
|
||||
name[split] = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Do some tilde substitution.
|
||||
*/
|
||||
|
||||
if (name[1] == '\0') {
|
||||
if (split == 1) {
|
||||
/*
|
||||
* We have just '~'
|
||||
* We have just '~' (or '~/...')
|
||||
*/
|
||||
|
||||
const char *dir;
|
||||
Tcl_DString dirString;
|
||||
|
||||
if (split != len) {
|
||||
name[split] = separator;
|
||||
}
|
||||
|
||||
dir = TclGetEnv("HOME", &dirString);
|
||||
if (dir == NULL) {
|
||||
if (interp) {
|
||||
@@ -2461,22 +2458,24 @@ SetFsPathFromAny(
|
||||
* We have a user name '~user'
|
||||
*/
|
||||
|
||||
Tcl_DString userName;
|
||||
|
||||
Tcl_DStringInit(&userName);
|
||||
Tcl_DStringAppend(&userName, name+1, split-1);
|
||||
expandedUser = Tcl_DStringValue(&userName);
|
||||
|
||||
Tcl_DStringInit(&temp);
|
||||
if (TclpGetUserHome(name+1, &temp) == NULL) {
|
||||
if (TclpGetUserHome(expandedUser, &temp) == NULL) {
|
||||
if (interp != NULL) {
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendResult(interp, "user \"", name+1,
|
||||
Tcl_AppendResult(interp, "user \"", expandedUser,
|
||||
"\" doesn't exist", NULL);
|
||||
}
|
||||
Tcl_DStringFree(&userName);
|
||||
Tcl_DStringFree(&temp);
|
||||
if (split != len) {
|
||||
name[split] = separator;
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (split != len) {
|
||||
name[split] = separator;
|
||||
}
|
||||
Tcl_DStringFree(&userName);
|
||||
}
|
||||
|
||||
expandedUser = Tcl_DStringValue(&temp);
|
||||
@@ -2514,14 +2513,18 @@ SetFsPathFromAny(
|
||||
|
||||
pair[0] = transPtr;
|
||||
pair[1] = Tcl_NewStringObj(name+split+1, -1);
|
||||
transPtr = TclJoinPath(2, pair);
|
||||
TclDecrRefCount(pair[0]);
|
||||
TclDecrRefCount(pair[1]);
|
||||
transPtr = TclJoinPath(2, pair, 1);
|
||||
if (transPtr != pair[0]) {
|
||||
TclDecrRefCount(pair[0]);
|
||||
}
|
||||
if (transPtr != pair[1]) {
|
||||
TclDecrRefCount(pair[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Tcl_DStringFree(&temp);
|
||||
} else {
|
||||
transPtr = TclJoinPath(1, &pathPtr);
|
||||
transPtr = TclJoinPath(1, &pathPtr, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -39,5 +39,8 @@
|
||||
# define LLONG_MAX (~LLONG_MIN)
|
||||
#endif
|
||||
|
||||
#define UWIDE_MAX ((Tcl_WideUInt)-1)
|
||||
#define WIDE_MAX ((Tcl_WideInt)(UWIDE_MAX >> 1))
|
||||
#define WIDE_MIN ((Tcl_WideInt)((Tcl_WideUInt)WIDE_MAX+1))
|
||||
|
||||
#endif /* _TCLPORT */
|
||||
|
||||
+45
-45
@@ -129,7 +129,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
|
||||
/* Highest power of two that is greater than
|
||||
* DBL_MAX_10_EXP, divided by 16 */
|
||||
#define DIGIT_GROUP 8
|
||||
/* floor(DIGIT_BIT*log(2)/log(10)) */
|
||||
/* floor(MP_DIGIT_BIT*log(2)/log(10)) */
|
||||
|
||||
/* Union used to dismantle floating point numbers. */
|
||||
|
||||
@@ -1447,9 +1447,9 @@ AccumulateDecimalDigit(
|
||||
* More than single digit multiplication. Multiply by the appropriate
|
||||
* small powers of 5, and then shift. Large strings of zeroes are
|
||||
* eaten 256 at a time; this is less efficient than it could be, but
|
||||
* seems implausible. We presume that DIGIT_BIT is at least 27. The
|
||||
* seems implausible. We presume that MP_DIGIT_BIT is at least 27. The
|
||||
* first multiplication, by up to 10**7, is done with a one-DIGIT
|
||||
* multiply (this presumes that DIGIT_BIT >= 24).
|
||||
* multiply (this presumes that MP_DIGIT_BIT >= 24).
|
||||
*/
|
||||
|
||||
n = numZeros + 1;
|
||||
@@ -1833,15 +1833,15 @@ RefineApproximation(
|
||||
*/
|
||||
|
||||
msb = binExponent + M2; /* 1008 */
|
||||
nDigits = msb / DIGIT_BIT + 1;
|
||||
nDigits = msb / MP_DIGIT_BIT + 1;
|
||||
mp_init_size(&twoMv, nDigits);
|
||||
i = (msb % DIGIT_BIT + 1);
|
||||
i = (msb % MP_DIGIT_BIT + 1);
|
||||
twoMv.used = nDigits;
|
||||
significand *= SafeLdExp(1.0, i);
|
||||
while (--nDigits >= 0) {
|
||||
twoMv.dp[nDigits] = (mp_digit) significand;
|
||||
significand -= (mp_digit) significand;
|
||||
significand = SafeLdExp(significand, DIGIT_BIT);
|
||||
significand = SafeLdExp(significand, MP_DIGIT_BIT);
|
||||
}
|
||||
for (i = 0; i <= 8; ++i) {
|
||||
if (M5 & (1 << i)) {
|
||||
@@ -3100,7 +3100,7 @@ StrictInt64Conversion(Double* dPtr,
|
||||
*
|
||||
* Test whether bankers' rounding should round a digit up. Assumption
|
||||
* is made that the denominator of the fraction being tested is
|
||||
* a power of 2**DIGIT_BIT.
|
||||
* a power of 2**MP_DIGIT_BIT.
|
||||
*
|
||||
* Results:
|
||||
* Returns 1 iff the fraction is more than 1/2, or if the fraction
|
||||
@@ -3112,12 +3112,12 @@ StrictInt64Conversion(Double* dPtr,
|
||||
inline static int
|
||||
ShouldBankerRoundUpPowD(mp_int* b,
|
||||
/* Numerator of the fraction */
|
||||
int sd, /* Denominator is 2**(sd*DIGIT_BIT) */
|
||||
int sd, /* Denominator is 2**(sd*MP_DIGIT_BIT) */
|
||||
int isodd)
|
||||
/* 1 if the digit is odd, 0 if even */
|
||||
{
|
||||
int i;
|
||||
static const mp_digit topbit = (1<<(DIGIT_BIT-1));
|
||||
static const mp_digit topbit = (1<<(MP_DIGIT_BIT-1));
|
||||
if (b->used < sd || (b->dp[sd-1] & topbit) == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -3153,7 +3153,7 @@ ShouldBankerRoundUpToNextPowD(mp_int* b,
|
||||
mp_int* m,
|
||||
/* Numerator of the rounding tolerance */
|
||||
int sd,
|
||||
/* Common denominator is 2**(sd*DIGIT_BIT) */
|
||||
/* Common denominator is 2**(sd*MP_DIGIT_BIT) */
|
||||
int convType,
|
||||
/* Conversion type: STEELE defeats
|
||||
* round-to-even (Not sure why one wants to
|
||||
@@ -3168,7 +3168,7 @@ ShouldBankerRoundUpToNextPowD(mp_int* b,
|
||||
/*
|
||||
* Compare B and S-m -- which is the same as comparing B+m and S --
|
||||
* which we do by computing b+m and doing a bitwhack compare against
|
||||
* 2**(DIGIT_BIT*sd)
|
||||
* 2**(MP_DIGIT_BIT*sd)
|
||||
*/
|
||||
mp_add(b, m, temp);
|
||||
if (temp->used <= sd) { /* too few digits to be > S */
|
||||
@@ -3200,7 +3200,7 @@ ShouldBankerRoundUpToNextPowD(mp_int* b,
|
||||
* digits that reconverts exactly to the given number, or to
|
||||
* 'ilim' digits if that will yield a shorter result. The denominator
|
||||
* in David Gay's conversion algorithm is known to be a power of
|
||||
* 2**DIGIT_BIT, and hence the division in the main loop may be replaced
|
||||
* 2**MP_DIGIT_BIT, and hence the division in the main loop may be replaced
|
||||
* by a digit shift and mask.
|
||||
*
|
||||
* Results:
|
||||
@@ -3263,7 +3263,7 @@ ShorteningBignumConversionPowD(Double* dPtr,
|
||||
*/
|
||||
|
||||
TclBNInitBignumFromWideUInt(&b, bw);
|
||||
mp_init_set_int(&mminus, 1);
|
||||
mp_init_set(&mminus, 1);
|
||||
MulPow5(&b, b5, &b);
|
||||
mp_mul_2d(&b, b2, &b);
|
||||
|
||||
@@ -3289,7 +3289,7 @@ ShorteningBignumConversionPowD(Double* dPtr,
|
||||
}
|
||||
mp_init(&temp);
|
||||
|
||||
/* Loop through the digits. Do division and mod by s == 2**(sd*DIGIT_BIT)
|
||||
/* Loop through the digits. Do division and mod by s == 2**(sd*MP_DIGIT_BIT)
|
||||
* by mp_digit extraction */
|
||||
|
||||
i = 0;
|
||||
@@ -3396,7 +3396,7 @@ ShorteningBignumConversionPowD(Double* dPtr,
|
||||
* Converts a double-precision number to a fixed-lengt string of
|
||||
* 'ilim' digits (or 'ilim1' if log10(d) has been overestimated.)
|
||||
* The denominator in David Gay's conversion algorithm is known to
|
||||
* be a power of 2**DIGIT_BIT, and hence the division in the main
|
||||
* be a power of 2**MP_DIGIT_BIT, and hence the division in the main
|
||||
* loop may be replaced by a digit shift and mask.
|
||||
*
|
||||
* Results:
|
||||
@@ -3465,7 +3465,7 @@ StrictBignumConversionPowD(Double* dPtr,
|
||||
mp_init(&temp);
|
||||
|
||||
/*
|
||||
* Loop through the digits. Do division and mod by s == 2**(sd*DIGIT_BIT)
|
||||
* Loop through the digits. Do division and mod by s == 2**(sd*MP_DIGIT_BIT)
|
||||
* by mp_digit extraction
|
||||
*/
|
||||
|
||||
@@ -3666,7 +3666,7 @@ ShorteningBignumConversion(Double* dPtr,
|
||||
|
||||
TclBNInitBignumFromWideUInt(&b, bw);
|
||||
mp_mul_2d(&b, b2, &b);
|
||||
mp_init_set_int(&S, 1);
|
||||
mp_init_set(&S, 1);
|
||||
MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S);
|
||||
|
||||
/*
|
||||
@@ -3683,7 +3683,7 @@ ShorteningBignumConversion(Double* dPtr,
|
||||
|
||||
/* mminus = 2**m2minus * 5**m5 */
|
||||
|
||||
mp_init_set_int(&mminus, minit);
|
||||
mp_init_set(&mminus, minit);
|
||||
mp_mul_2d(&mminus, m2minus, &mminus);
|
||||
if (m2plus > m2minus) {
|
||||
mp_init_copy(&mplus, &mminus);
|
||||
@@ -3879,7 +3879,7 @@ StrictBignumConversion(Double* dPtr,
|
||||
mp_init_multi(&temp, &dig, NULL);
|
||||
TclBNInitBignumFromWideUInt(&b, bw);
|
||||
mp_mul_2d(&b, b2, &b);
|
||||
mp_init_set_int(&S, 1);
|
||||
mp_init_set(&S, 1);
|
||||
MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S);
|
||||
|
||||
/*
|
||||
@@ -4234,12 +4234,12 @@ TclDoubleDigits(double dv, /* Number to convert */
|
||||
/*
|
||||
* The denominator is a power of 2, so we can replace division
|
||||
* by digit shifts. First we round up s2 to a multiple of
|
||||
* DIGIT_BIT, and adjust m2 and b2 accordingly. Then we launch
|
||||
* MP_DIGIT_BIT, and adjust m2 and b2 accordingly. Then we launch
|
||||
* into a version of the comparison that's specialized for
|
||||
* the 'power of mp_digit in the denominator' case.
|
||||
*/
|
||||
if (s2 % DIGIT_BIT != 0) {
|
||||
int delta = DIGIT_BIT - (s2 % DIGIT_BIT);
|
||||
if (s2 % MP_DIGIT_BIT != 0) {
|
||||
int delta = MP_DIGIT_BIT - (s2 % MP_DIGIT_BIT);
|
||||
b2 += delta;
|
||||
m2plus += delta;
|
||||
m2minus += delta;
|
||||
@@ -4247,7 +4247,7 @@ TclDoubleDigits(double dv, /* Number to convert */
|
||||
}
|
||||
return ShorteningBignumConversionPowD(&d, convType, bw, b2, b5,
|
||||
m2plus, m2minus, m5,
|
||||
s2/DIGIT_BIT, k, len,
|
||||
s2/MP_DIGIT_BIT, k, len,
|
||||
ilim, ilim1, decpt, endPtr);
|
||||
} else {
|
||||
|
||||
@@ -4294,17 +4294,17 @@ TclDoubleDigits(double dv, /* Number to convert */
|
||||
/*
|
||||
* The denominator is a power of 2, so we can replace division
|
||||
* by digit shifts. First we round up s2 to a multiple of
|
||||
* DIGIT_BIT, and adjust m2 and b2 accordingly. Then we launch
|
||||
* MP_DIGIT_BIT, and adjust m2 and b2 accordingly. Then we launch
|
||||
* into a version of the comparison that's specialized for
|
||||
* the 'power of mp_digit in the denominator' case.
|
||||
*/
|
||||
if (s2 % DIGIT_BIT != 0) {
|
||||
int delta = DIGIT_BIT - (s2 % DIGIT_BIT);
|
||||
if (s2 % MP_DIGIT_BIT != 0) {
|
||||
int delta = MP_DIGIT_BIT - (s2 % MP_DIGIT_BIT);
|
||||
b2 += delta;
|
||||
s2 += delta;
|
||||
}
|
||||
return StrictBignumConversionPowD(&d, convType, bw, b2, b5,
|
||||
s2/DIGIT_BIT, k, len,
|
||||
s2/MP_DIGIT_BIT, k, len,
|
||||
ilim, ilim1, decpt, endPtr);
|
||||
} else {
|
||||
/*
|
||||
@@ -4433,7 +4433,7 @@ TclInitDoubleConversion(void)
|
||||
+ 0.5 * log(10.)) / log(10.));
|
||||
minDigits = (int) floor((DBL_MIN_EXP - DBL_MANT_DIG)
|
||||
* log((double) FLT_RADIX) / log(10.));
|
||||
log10_DIGIT_MAX = (int) floor(DIGIT_BIT * log(2.) / log(10.));
|
||||
log10_DIGIT_MAX = (int) floor(MP_DIGIT_BIT * log(2.) / log(10.));
|
||||
|
||||
/*
|
||||
* Nokia 770's software-emulated floating point is "middle endian": the
|
||||
@@ -4573,10 +4573,10 @@ TclBignumToDouble(
|
||||
bits = mp_count_bits(a);
|
||||
if (bits > DBL_MAX_EXP*log2FLT_RADIX) {
|
||||
errno = ERANGE;
|
||||
if (a->sign == MP_ZPOS) {
|
||||
return HUGE_VAL;
|
||||
} else {
|
||||
if (mp_isneg(a)) {
|
||||
return -HUGE_VAL;
|
||||
} else {
|
||||
return HUGE_VAL;
|
||||
}
|
||||
}
|
||||
shift = mantBits - bits;
|
||||
@@ -4606,10 +4606,10 @@ TclBignumToDouble(
|
||||
|
||||
mp_div_2d(a, -shift, &b, NULL);
|
||||
if (mp_isodd(&b)) {
|
||||
if (b.sign == MP_ZPOS) {
|
||||
mp_add_d(&b, 1, &b);
|
||||
} else {
|
||||
if (mp_isneg(&b)) {
|
||||
mp_sub_d(&b, 1, &b);
|
||||
} else {
|
||||
mp_add_d(&b, 1, &b);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -4619,10 +4619,10 @@ TclBignumToDouble(
|
||||
*/
|
||||
|
||||
mp_div_2d(a, -1-shift, &b, NULL);
|
||||
if (b.sign == MP_ZPOS) {
|
||||
mp_add_d(&b, 1, &b);
|
||||
} else {
|
||||
if (mp_isneg(&b)) {
|
||||
mp_sub_d(&b, 1, &b);
|
||||
} else {
|
||||
mp_add_d(&b, 1, &b);
|
||||
}
|
||||
mp_div_2d(&b, 1, &b, NULL);
|
||||
}
|
||||
@@ -4634,7 +4634,7 @@ TclBignumToDouble(
|
||||
|
||||
r = 0.0;
|
||||
for (i=b.used-1 ; i>=0 ; --i) {
|
||||
r = ldexp(r, DIGIT_BIT) + b.dp[i];
|
||||
r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
|
||||
}
|
||||
mp_clear(&b);
|
||||
|
||||
@@ -4648,10 +4648,10 @@ TclBignumToDouble(
|
||||
* Return the result with the appropriate sign.
|
||||
*/
|
||||
|
||||
if (a->sign == MP_ZPOS) {
|
||||
return r;
|
||||
} else {
|
||||
if (mp_isneg(a)) {
|
||||
return -r;
|
||||
} else {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4703,7 +4703,7 @@ TclCeil(
|
||||
mp_add_d(&b, 1, &b);
|
||||
}
|
||||
for (i=b.used-1 ; i>=0 ; --i) {
|
||||
r = ldexp(r, DIGIT_BIT) + b.dp[i];
|
||||
r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
|
||||
}
|
||||
r = ldexp(r, bits - mantBits);
|
||||
}
|
||||
@@ -4753,7 +4753,7 @@ TclFloor(
|
||||
mp_copy(a, &b);
|
||||
}
|
||||
for (i=b.used-1 ; i>=0 ; --i) {
|
||||
r = ldexp(r, DIGIT_BIT) + b.dp[i];
|
||||
r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
|
||||
}
|
||||
r = ldexp(r, bits - mantBits);
|
||||
}
|
||||
@@ -4815,7 +4815,7 @@ BignumToBiasedFrExp(
|
||||
|
||||
r = 0.0;
|
||||
for (i=b.used-1; i>=0; --i) {
|
||||
r = ldexp(r, DIGIT_BIT) + b.dp[i];
|
||||
r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
|
||||
}
|
||||
mp_clear(&b);
|
||||
|
||||
@@ -4824,7 +4824,7 @@ BignumToBiasedFrExp(
|
||||
*/
|
||||
|
||||
*machexp = bits - mantBits + 2;
|
||||
return ((a->sign == MP_ZPOS) ? r : -r);
|
||||
return (mp_isneg(a) ? -r : r);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2093,7 +2093,7 @@ Tcl_AppendFormatToObj(
|
||||
if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
|
||||
goto error;
|
||||
}
|
||||
mp_mod_2d(&big, (int) CHAR_BIT*sizeof(Tcl_WideInt), &big);
|
||||
mp_mod_2d(&big, CHAR_BIT*sizeof(Tcl_WideInt), &big);
|
||||
objPtr = Tcl_NewBignumObj(&big);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_GetWideIntFromObj(NULL, objPtr, &w);
|
||||
@@ -2107,7 +2107,7 @@ Tcl_AppendFormatToObj(
|
||||
if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
|
||||
goto error;
|
||||
}
|
||||
mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
|
||||
mp_mod_2d(&big, CHAR_BIT * sizeof(long), &big);
|
||||
objPtr = Tcl_NewBignumObj(&big);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
TclGetLongFromObj(NULL, objPtr, &l);
|
||||
@@ -2251,11 +2251,11 @@ Tcl_AppendFormatToObj(
|
||||
uw /= base;
|
||||
}
|
||||
} else if (useBig && big.used) {
|
||||
int leftover = (big.used * DIGIT_BIT) % numBits;
|
||||
mp_digit mask = (~(mp_digit)0) << (DIGIT_BIT-leftover);
|
||||
int leftover = (big.used * MP_DIGIT_BIT) % numBits;
|
||||
mp_digit mask = (~(mp_digit)0) << (MP_DIGIT_BIT-leftover);
|
||||
|
||||
numDigits = 1 +
|
||||
(((Tcl_WideInt)big.used * DIGIT_BIT) / numBits);
|
||||
(((Tcl_WideInt)big.used * MP_DIGIT_BIT) / numBits);
|
||||
while ((mask & big.dp[big.used-1]) == 0) {
|
||||
numDigits--;
|
||||
mask >>= numBits;
|
||||
@@ -2290,9 +2290,9 @@ Tcl_AppendFormatToObj(
|
||||
|
||||
if (useBig && big.used) {
|
||||
if (index < big.used && (size_t) shift <
|
||||
CHAR_BIT*sizeof(Tcl_WideUInt) - DIGIT_BIT) {
|
||||
CHAR_BIT*sizeof(Tcl_WideUInt) - MP_DIGIT_BIT) {
|
||||
bits |= (((Tcl_WideUInt)big.dp[index++]) <<shift);
|
||||
shift += DIGIT_BIT;
|
||||
shift += MP_DIGIT_BIT;
|
||||
}
|
||||
shift -= numBits;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4326,7 +4326,7 @@ TesttranslatefilenameCmd(
|
||||
*
|
||||
* TestupvarCmd --
|
||||
*
|
||||
* This procedure implements the "testupvar2" command. It is used
|
||||
* This procedure implements the "testupvar" command. It is used
|
||||
* to test Tcl_UpVar and Tcl_UpVar2.
|
||||
*
|
||||
* Results:
|
||||
|
||||
@@ -269,9 +269,9 @@ TestbignumobjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (!Tcl_IsShared(varPtr[varIndex])) {
|
||||
Tcl_SetIntObj(varPtr[varIndex], mp_iseven(&bignumValue));
|
||||
Tcl_SetIntObj(varPtr[varIndex], !mp_isodd(&bignumValue));
|
||||
} else {
|
||||
SetVarToObj(varIndex, Tcl_NewIntObj(mp_iseven(&bignumValue)));
|
||||
SetVarToObj(varIndex, Tcl_NewIntObj(!mp_isodd(&bignumValue)));
|
||||
}
|
||||
mp_clear(&bignumValue);
|
||||
break;
|
||||
|
||||
+71
-71
@@ -1,9 +1,8 @@
|
||||
# tclTomMath.decls --
|
||||
#
|
||||
# This file contains the declarations for the functions in
|
||||
# 'libtommath' that are contained within the Tcl library.
|
||||
# This file is used to generate the 'tclTomMathDecls.h' and
|
||||
# 'tclStubInit.c' files.
|
||||
# This file contains the declarations for the functions in 'libtommath'
|
||||
# that are contained within the Tcl library. This file is used to
|
||||
# generate the 'tclTomMathDecls.h' and 'tclStubInit.c' files.
|
||||
#
|
||||
# If you edit this file, advance the revision number (and the epoch
|
||||
# if the new stubs are not backward compatible) in tclTomMathDecls.h
|
||||
@@ -19,196 +18,197 @@ library tcl
|
||||
|
||||
interface tclTomMath
|
||||
# hooks {tclTomMathInt}
|
||||
scspec EXTERN
|
||||
|
||||
# Declare each of the functions in the Tcl tommath interface
|
||||
|
||||
declare 0 generic {
|
||||
declare 0 {
|
||||
int TclBN_epoch(void)
|
||||
}
|
||||
declare 1 generic {
|
||||
declare 1 {
|
||||
int TclBN_revision(void)
|
||||
}
|
||||
|
||||
declare 2 generic {
|
||||
declare 2 {
|
||||
int TclBN_mp_add(mp_int *a, mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 3 generic {
|
||||
declare 3 {
|
||||
int TclBN_mp_add_d(mp_int *a, mp_digit b, mp_int *c)
|
||||
}
|
||||
declare 4 generic {
|
||||
int TclBN_mp_and(mp_int *a, mp_int *b, mp_int *c)
|
||||
declare 4 {
|
||||
int TclBN_mp_and(const mp_int *a, const mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 5 generic {
|
||||
declare 5 {
|
||||
void TclBN_mp_clamp(mp_int *a)
|
||||
}
|
||||
declare 6 generic {
|
||||
declare 6 {
|
||||
void TclBN_mp_clear(mp_int *a)
|
||||
}
|
||||
declare 7 generic {
|
||||
declare 7 {
|
||||
void TclBN_mp_clear_multi(mp_int *a, ...)
|
||||
}
|
||||
declare 8 generic {
|
||||
int TclBN_mp_cmp(mp_int *a, mp_int *b)
|
||||
declare 8 {
|
||||
int TclBN_mp_cmp(const mp_int *a, const mp_int *b)
|
||||
}
|
||||
declare 9 generic {
|
||||
int TclBN_mp_cmp_d(mp_int *a, mp_digit b)
|
||||
declare 9 {
|
||||
int TclBN_mp_cmp_d(const mp_int *a, mp_digit b)
|
||||
}
|
||||
declare 10 generic {
|
||||
int TclBN_mp_cmp_mag(mp_int *a, mp_int *b)
|
||||
declare 10 {
|
||||
int TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b)
|
||||
}
|
||||
declare 11 generic {
|
||||
declare 11 {
|
||||
int TclBN_mp_copy(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 12 generic {
|
||||
declare 12 {
|
||||
int TclBN_mp_count_bits(mp_int *a)
|
||||
}
|
||||
declare 13 generic {
|
||||
declare 13 {
|
||||
int TclBN_mp_div(mp_int *a, mp_int *b, mp_int *q, mp_int *r)
|
||||
}
|
||||
declare 14 generic {
|
||||
declare 14 {
|
||||
int TclBN_mp_div_d(mp_int *a, mp_digit b, mp_int *q, mp_digit *r)
|
||||
}
|
||||
declare 15 generic {
|
||||
declare 15 {
|
||||
int TclBN_mp_div_2(mp_int *a, mp_int *q)
|
||||
}
|
||||
declare 16 generic {
|
||||
declare 16 {
|
||||
int TclBN_mp_div_2d(mp_int *a, int b, mp_int *q, mp_int *r)
|
||||
}
|
||||
declare 17 generic {
|
||||
declare 17 {
|
||||
int TclBN_mp_div_3(mp_int *a, mp_int *q, mp_digit *r)
|
||||
}
|
||||
declare 18 generic {
|
||||
declare 18 {
|
||||
void TclBN_mp_exch(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 19 generic {
|
||||
declare 19 {
|
||||
int TclBN_mp_expt_d(mp_int *a, mp_digit b, mp_int *c)
|
||||
}
|
||||
declare 20 generic {
|
||||
declare 20 {
|
||||
int TclBN_mp_grow(mp_int *a, int size)
|
||||
}
|
||||
declare 21 generic {
|
||||
declare 21 {
|
||||
int TclBN_mp_init(mp_int *a)
|
||||
}
|
||||
declare 22 generic {
|
||||
declare 22 {
|
||||
int TclBN_mp_init_copy(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 23 generic {
|
||||
declare 23 {
|
||||
int TclBN_mp_init_multi(mp_int *a, ...)
|
||||
}
|
||||
declare 24 generic {
|
||||
declare 24 {
|
||||
int TclBN_mp_init_set(mp_int *a, mp_digit b)
|
||||
}
|
||||
declare 25 generic {
|
||||
declare 25 {
|
||||
int TclBN_mp_init_size(mp_int *a, int size)
|
||||
}
|
||||
declare 26 generic {
|
||||
declare 26 {
|
||||
int TclBN_mp_lshd(mp_int *a, int shift)
|
||||
}
|
||||
declare 27 generic {
|
||||
declare 27 {
|
||||
int TclBN_mp_mod(mp_int *a, mp_int *b, mp_int *r)
|
||||
}
|
||||
declare 28 generic {
|
||||
declare 28 {
|
||||
int TclBN_mp_mod_2d(mp_int *a, int b, mp_int *r)
|
||||
}
|
||||
declare 29 generic {
|
||||
declare 29 {
|
||||
int TclBN_mp_mul(mp_int *a, mp_int *b, mp_int *p)
|
||||
}
|
||||
declare 30 generic {
|
||||
declare 30 {
|
||||
int TclBN_mp_mul_d(mp_int *a, mp_digit b, mp_int *p)
|
||||
}
|
||||
declare 31 generic {
|
||||
declare 31 {
|
||||
int TclBN_mp_mul_2(mp_int *a, mp_int *p)
|
||||
}
|
||||
declare 32 generic {
|
||||
declare 32 {
|
||||
int TclBN_mp_mul_2d(mp_int *a, int d, mp_int *p)
|
||||
}
|
||||
declare 33 generic {
|
||||
declare 33 {
|
||||
int TclBN_mp_neg(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 34 generic {
|
||||
int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c)
|
||||
declare 34 {
|
||||
int TclBN_mp_or(const mp_int *a, const mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 35 generic {
|
||||
declare 35 {
|
||||
int TclBN_mp_radix_size(mp_int *a, int radix, int *size)
|
||||
}
|
||||
declare 36 generic {
|
||||
declare 36 {
|
||||
int TclBN_mp_read_radix(mp_int *a, const char *str, int radix)
|
||||
}
|
||||
declare 37 generic {
|
||||
declare 37 {
|
||||
void TclBN_mp_rshd(mp_int *a, int shift)
|
||||
}
|
||||
declare 38 generic {
|
||||
declare 38 {
|
||||
int TclBN_mp_shrink(mp_int *a)
|
||||
}
|
||||
declare 39 generic {
|
||||
declare 39 {
|
||||
void TclBN_mp_set(mp_int *a, mp_digit b)
|
||||
}
|
||||
declare 40 generic {
|
||||
declare 40 {
|
||||
int TclBN_mp_sqr(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 41 generic {
|
||||
declare 41 {
|
||||
int TclBN_mp_sqrt(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 42 generic {
|
||||
declare 42 {
|
||||
int TclBN_mp_sub(mp_int *a, mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 43 generic {
|
||||
declare 43 {
|
||||
int TclBN_mp_sub_d(mp_int *a, mp_digit b, mp_int *c)
|
||||
}
|
||||
declare 44 generic {
|
||||
declare 44 {
|
||||
int TclBN_mp_to_unsigned_bin(mp_int *a, unsigned char *b)
|
||||
}
|
||||
declare 45 generic {
|
||||
declare 45 {
|
||||
int TclBN_mp_to_unsigned_bin_n(mp_int *a, unsigned char *b,
|
||||
unsigned long *outlen)
|
||||
}
|
||||
declare 46 generic {
|
||||
declare 46 {
|
||||
int TclBN_mp_toradix_n(mp_int *a, char *str, int radix, int maxlen)
|
||||
}
|
||||
declare 47 generic {
|
||||
declare 47 {
|
||||
int TclBN_mp_unsigned_bin_size(mp_int *a)
|
||||
}
|
||||
declare 48 generic {
|
||||
int TclBN_mp_xor(mp_int *a, mp_int *b, mp_int *c)
|
||||
declare 48 {
|
||||
int TclBN_mp_xor(const mp_int *a, const mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 49 generic {
|
||||
declare 49 {
|
||||
void TclBN_mp_zero(mp_int *a)
|
||||
}
|
||||
|
||||
# internal routines to libtommath - should not be called but must be
|
||||
# exported to accommodate the "tommath" extension
|
||||
|
||||
declare 50 generic {
|
||||
declare 50 {
|
||||
void TclBN_reverse(unsigned char *s, int len)
|
||||
}
|
||||
declare 51 generic {
|
||||
declare 51 {
|
||||
int TclBN_fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs)
|
||||
}
|
||||
declare 52 generic {
|
||||
declare 52 {
|
||||
int TclBN_fast_s_mp_sqr(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 53 generic {
|
||||
declare 53 {
|
||||
int TclBN_mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 54 generic {
|
||||
declare 54 {
|
||||
int TclBN_mp_karatsuba_sqr(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 55 generic {
|
||||
declare 55 {
|
||||
int TclBN_mp_toom_mul(mp_int *a, mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 56 generic {
|
||||
declare 56 {
|
||||
int TclBN_mp_toom_sqr(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 57 generic {
|
||||
declare 57 {
|
||||
int TclBN_s_mp_add(mp_int *a, mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 58 generic {
|
||||
declare 58 {
|
||||
int TclBN_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs)
|
||||
}
|
||||
declare 59 generic {
|
||||
declare 59 {
|
||||
int TclBN_s_mp_sqr(mp_int *a, mp_int *b)
|
||||
}
|
||||
declare 60 generic {
|
||||
declare 60 {
|
||||
int TclBN_s_mp_sub(mp_int *a, mp_int *b, mp_int *c)
|
||||
}
|
||||
declare 61 {
|
||||
|
||||
+88
-51
@@ -1,17 +1,6 @@
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
#ifndef BN_H_
|
||||
#define BN_H_
|
||||
|
||||
@@ -148,30 +137,31 @@ extern "C" {
|
||||
#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
|
||||
#define MP_DIGIT_MAX MP_MASK
|
||||
|
||||
/* equalities */
|
||||
typedef int mp_sign;
|
||||
#define MP_ZPOS 0 /* positive integer */
|
||||
#define MP_NEG 1 /* negative */
|
||||
typedef int mp_ord;
|
||||
#define MP_LT -1 /* less than */
|
||||
#define MP_EQ 0 /* equal to */
|
||||
#define MP_GT 1 /* greater than */
|
||||
|
||||
#define MP_ZPOS 0 /* positive integer */
|
||||
#define MP_NEG 1 /* negative */
|
||||
|
||||
typedef int mp_bool;
|
||||
#define MP_YES 1 /* yes response */
|
||||
#define MP_NO 0 /* no response */
|
||||
typedef int mp_err;
|
||||
#define MP_OKAY 0 /* ok result */
|
||||
#define MP_ERR -1 /* unknown error */
|
||||
#define MP_MEM -2 /* out of mem */
|
||||
#define MP_VAL -3 /* invalid input */
|
||||
#define MP_RANGE MP_VAL
|
||||
|
||||
#define MP_YES 1 /* yes response */
|
||||
#define MP_NO 0 /* no response */
|
||||
#define MP_ITER -4 /* Max. iterations reached */
|
||||
|
||||
/* Primality generation flags */
|
||||
#define LTM_PRIME_BBS 0x0001 /* BBS style prime */
|
||||
#define LTM_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
|
||||
#define LTM_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
|
||||
|
||||
typedef int mp_err;
|
||||
/* tunable cutoffs */
|
||||
|
||||
/* you'll have to tune these... */
|
||||
#if defined(BUILD_tcl) || !defined(_WIN32)
|
||||
MODULE_SCOPE int KARATSUBA_MUL_CUTOFF,
|
||||
KARATSUBA_SQR_CUTOFF,
|
||||
@@ -184,16 +174,57 @@ MODULE_SCOPE int KARATSUBA_MUL_CUTOFF,
|
||||
|
||||
/* 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 */
|
||||
# elif defined(MP_8BIT)
|
||||
# define MP_PREC 16 /* 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))
|
||||
|
||||
/*
|
||||
* MP_WUR - warn unused result
|
||||
* ---------------------------
|
||||
*
|
||||
* The result of functions annotated with MP_WUR must be
|
||||
* checked and cannot be ignored.
|
||||
*
|
||||
* Most functions in libtommath return an error code.
|
||||
* This error code must be checked in order to prevent crashes or invalid
|
||||
* results.
|
||||
*
|
||||
* If you still want to avoid the error checks for quick and dirty programs
|
||||
* without robustness guarantees, you can `#define MP_WUR` before including
|
||||
* tommath.h, disabling the warnings.
|
||||
*/
|
||||
#ifndef MP_WUR
|
||||
# if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define MP_WUR __attribute__((warn_unused_result))
|
||||
# else
|
||||
# define MP_WUR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 301)
|
||||
# define MP_DEPRECATED(x) __attribute__((deprecated("replaced by " #x)))
|
||||
# define PRIVATE_MP_DEPRECATED_PRAGMA(s) _Pragma(#s)
|
||||
# define MP_DEPRECATED_PRAGMA(s) PRIVATE_MP_DEPRECATED_PRAGMA(GCC warning s)
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
# define MP_DEPRECATED(x) __declspec(deprecated("replaced by " #x))
|
||||
# define MP_DEPRECATED_PRAGMA(s) __pragma(message(s))
|
||||
#else
|
||||
# define MP_DEPRECATED
|
||||
# define MP_DEPRECATED_PRAGMA(s)
|
||||
#endif
|
||||
|
||||
#define USED(m) ((m)->used)
|
||||
#define DIGIT(m,k) ((m)->dp[(k)])
|
||||
#define SIGN(m) ((m)->sign)
|
||||
|
||||
/* the infamous mp_int structure */
|
||||
#ifndef MP_INT_DECLARED
|
||||
#define MP_INT_DECLARED
|
||||
@@ -208,19 +239,15 @@ struct mp_int {
|
||||
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 */
|
||||
/*
|
||||
char *mp_error_to_string(int code);
|
||||
const char *mp_error_to_string(mp_err code);
|
||||
*/
|
||||
|
||||
/* ---> init and deinit bignum functions <--- */
|
||||
/* init a bignum */
|
||||
/*
|
||||
int mp_init(mp_int *a);
|
||||
mp_err mp_init(mp_int *a);
|
||||
*/
|
||||
|
||||
/* free a bignum */
|
||||
@@ -230,7 +257,7 @@ void mp_clear(mp_int *a);
|
||||
|
||||
/* init a null terminated series of arguments */
|
||||
/*
|
||||
int mp_init_multi(mp_int *mp, ...);
|
||||
mp_err mp_init_multi(mp_int *mp, ...);
|
||||
*/
|
||||
|
||||
/* clear a null terminated series of arguments */
|
||||
@@ -245,23 +272,24 @@ void mp_exch(mp_int *a, mp_int *b);
|
||||
|
||||
/* shrink ram required for a bignum */
|
||||
/*
|
||||
int mp_shrink(mp_int *a);
|
||||
mp_err mp_shrink(mp_int *a);
|
||||
*/
|
||||
|
||||
/* grow an int to a given size */
|
||||
/*
|
||||
int mp_grow(mp_int *a, int size);
|
||||
mp_err mp_grow(mp_int *a, int size);
|
||||
*/
|
||||
|
||||
/* init to a given number of digits */
|
||||
/*
|
||||
int mp_init_size(mp_int *a, int size);
|
||||
mp_err 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] & 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 */
|
||||
/*
|
||||
@@ -278,6 +306,16 @@ void mp_set(mp_int *a, mp_digit b);
|
||||
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);
|
||||
|
||||
@@ -639,18 +677,18 @@ int mp_prime_is_divisible(mp_int *a, int *result);
|
||||
* Sets result to 0 if composite or 1 if probable prime
|
||||
*/
|
||||
/*
|
||||
int mp_prime_fermat(mp_int *a, mp_int *b, int *result);
|
||||
mp_err mp_prime_fermat(const mp_int *a, const mp_int *b, mp_bool *result);
|
||||
*/
|
||||
|
||||
/* performs one Miller-Rabin test of "a" using base "b".
|
||||
* Sets result to 0 if composite or 1 if probable prime
|
||||
*/
|
||||
/*
|
||||
int mp_prime_miller_rabin(mp_int *a, mp_int *b, int *result);
|
||||
mp_err mp_prime_miller_rabin(const mp_int *a, const mp_int *b, mp_bool *result);
|
||||
*/
|
||||
|
||||
/* This gives [for a given bit size] the number of trials required
|
||||
* such that Miller-Rabin gives a prob of failure lower than 2^-96
|
||||
* such that Miller-Rabin gives a prob of failure lower than 2^-96
|
||||
*/
|
||||
/*
|
||||
int mp_prime_rabin_miller_trials(int size);
|
||||
@@ -664,7 +702,7 @@ int mp_prime_rabin_miller_trials(int size);
|
||||
* Sets result to 1 if probably prime, 0 otherwise
|
||||
*/
|
||||
/*
|
||||
int mp_prime_is_prime(mp_int *a, int t, int *result);
|
||||
mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result);
|
||||
*/
|
||||
|
||||
/* finds the next prime after the number "a" using "t" trials
|
||||
@@ -673,11 +711,11 @@ int mp_prime_is_prime(mp_int *a, int t, int *result);
|
||||
* bbs_style = 1 means the prime must be congruent to 3 mod 4
|
||||
*/
|
||||
/*
|
||||
int mp_prime_next_prime(mp_int *a, int t, int bbs_style);
|
||||
mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style);
|
||||
*/
|
||||
|
||||
/* makes a truly random prime of a given size (bytes),
|
||||
* call with bbs = 1 if you want it to be congruent to 3 mod 4
|
||||
* call with bbs = 1 if you want it to be congruent to 3 mod 4
|
||||
*
|
||||
* 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
|
||||
@@ -690,11 +728,10 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style);
|
||||
/* 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
|
||||
*
|
||||
* MP_PRIME_BBS - make prime congruent to 3 mod 4
|
||||
* MP_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies MP_PRIME_BBS)
|
||||
* MP_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
|
||||
@@ -830,7 +867,7 @@ MODULE_SCOPE const char *mp_s_rmap;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+22
-19
@@ -44,16 +44,12 @@
|
||||
#define XREALLOC(x,n) TclBNRealloc(x,n)
|
||||
#define XCALLOC(n,x) TclBNCalloc(n,x)
|
||||
|
||||
/* Rename the global symbols in libtommath to avoid linkage conflicts */
|
||||
|
||||
#define KARATSUBA_MUL_CUTOFF TclBNKaratsubaMulCutoff
|
||||
#define KARATSUBA_SQR_CUTOFF TclBNKaratsubaSqrCutoff
|
||||
#define TOOM_MUL_CUTOFF TclBNToomMulCutoff
|
||||
#define TOOM_SQR_CUTOFF TclBNToomSqrCutoff
|
||||
|
||||
#define bn_reverse TclBN_reverse
|
||||
#define s_mp_reverse TclBN_reverse
|
||||
#define fast_s_mp_mul_digs TclBN_fast_s_mp_mul_digs
|
||||
#define s_mp_mul_digs_fast TclBN_fast_s_mp_mul_digs
|
||||
#define fast_s_mp_sqr TclBN_fast_s_mp_sqr
|
||||
#define s_mp_sqr_fast TclBN_fast_s_mp_sqr
|
||||
#define mp_add TclBN_mp_add
|
||||
#define mp_add_d TclBN_mp_add_d
|
||||
#define mp_and TclBN_mp_and
|
||||
@@ -81,7 +77,9 @@
|
||||
#define mp_init_set_int TclBN_mp_init_set_int
|
||||
#define mp_init_size TclBN_mp_init_size
|
||||
#define mp_karatsuba_mul TclBN_mp_karatsuba_mul
|
||||
#define s_mp_karatsuba_mul TclBN_mp_karatsuba_mul
|
||||
#define mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
|
||||
#define s_mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
|
||||
#define mp_lshd TclBN_mp_lshd
|
||||
#define mp_mod TclBN_mp_mod
|
||||
#define mp_mod_2d TclBN_mp_mod_2d
|
||||
@@ -105,7 +103,9 @@
|
||||
#define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin
|
||||
#define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n
|
||||
#define mp_toom_mul TclBN_mp_toom_mul
|
||||
#define s_mp_toom_mul TclBN_mp_toom_mul
|
||||
#define mp_toom_sqr TclBN_mp_toom_sqr
|
||||
#define s_mp_toom_sqr TclBN_mp_toom_sqr
|
||||
#define mp_toradix_n TclBN_mp_toradix_n
|
||||
#define mp_unsigned_bin_size TclBN_mp_unsigned_bin_size
|
||||
#define mp_xor TclBN_mp_xor
|
||||
@@ -165,7 +165,8 @@ EXTERN int TclBN_mp_add_d(mp_int *a, mp_digit b, mp_int *c);
|
||||
#ifndef TclBN_mp_and_TCL_DECLARED
|
||||
#define TclBN_mp_and_TCL_DECLARED
|
||||
/* 4 */
|
||||
EXTERN int TclBN_mp_and(mp_int *a, mp_int *b, mp_int *c);
|
||||
EXTERN int TclBN_mp_and(CONST mp_int *a, CONST mp_int *b,
|
||||
mp_int *c);
|
||||
#endif
|
||||
#ifndef TclBN_mp_clamp_TCL_DECLARED
|
||||
#define TclBN_mp_clamp_TCL_DECLARED
|
||||
@@ -185,17 +186,17 @@ EXTERN void TclBN_mp_clear_multi(mp_int *a, ...);
|
||||
#ifndef TclBN_mp_cmp_TCL_DECLARED
|
||||
#define TclBN_mp_cmp_TCL_DECLARED
|
||||
/* 8 */
|
||||
EXTERN int TclBN_mp_cmp(mp_int *a, mp_int *b);
|
||||
EXTERN int TclBN_mp_cmp(CONST mp_int *a, CONST mp_int *b);
|
||||
#endif
|
||||
#ifndef TclBN_mp_cmp_d_TCL_DECLARED
|
||||
#define TclBN_mp_cmp_d_TCL_DECLARED
|
||||
/* 9 */
|
||||
EXTERN int TclBN_mp_cmp_d(mp_int *a, mp_digit b);
|
||||
EXTERN int TclBN_mp_cmp_d(CONST mp_int *a, mp_digit b);
|
||||
#endif
|
||||
#ifndef TclBN_mp_cmp_mag_TCL_DECLARED
|
||||
#define TclBN_mp_cmp_mag_TCL_DECLARED
|
||||
/* 10 */
|
||||
EXTERN int TclBN_mp_cmp_mag(mp_int *a, mp_int *b);
|
||||
EXTERN int TclBN_mp_cmp_mag(CONST mp_int *a, CONST mp_int *b);
|
||||
#endif
|
||||
#ifndef TclBN_mp_copy_TCL_DECLARED
|
||||
#define TclBN_mp_copy_TCL_DECLARED
|
||||
@@ -318,7 +319,8 @@ EXTERN int TclBN_mp_neg(mp_int *a, mp_int *b);
|
||||
#ifndef TclBN_mp_or_TCL_DECLARED
|
||||
#define TclBN_mp_or_TCL_DECLARED
|
||||
/* 34 */
|
||||
EXTERN int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c);
|
||||
EXTERN int TclBN_mp_or(CONST mp_int *a, CONST mp_int *b,
|
||||
mp_int *c);
|
||||
#endif
|
||||
#ifndef TclBN_mp_radix_size_TCL_DECLARED
|
||||
#define TclBN_mp_radix_size_TCL_DECLARED
|
||||
@@ -391,7 +393,8 @@ EXTERN int TclBN_mp_unsigned_bin_size(mp_int *a);
|
||||
#ifndef TclBN_mp_xor_TCL_DECLARED
|
||||
#define TclBN_mp_xor_TCL_DECLARED
|
||||
/* 48 */
|
||||
EXTERN int TclBN_mp_xor(mp_int *a, mp_int *b, mp_int *c);
|
||||
EXTERN int TclBN_mp_xor(CONST mp_int *a, CONST mp_int *b,
|
||||
mp_int *c);
|
||||
#endif
|
||||
#ifndef TclBN_mp_zero_TCL_DECLARED
|
||||
#define TclBN_mp_zero_TCL_DECLARED
|
||||
@@ -480,13 +483,13 @@ typedef struct TclTomMathStubs {
|
||||
int (*tclBN_revision) (void); /* 1 */
|
||||
int (*tclBN_mp_add) (mp_int *a, mp_int *b, mp_int *c); /* 2 */
|
||||
int (*tclBN_mp_add_d) (mp_int *a, mp_digit b, mp_int *c); /* 3 */
|
||||
int (*tclBN_mp_and) (mp_int *a, mp_int *b, mp_int *c); /* 4 */
|
||||
int (*tclBN_mp_and) (CONST mp_int *a, CONST mp_int *b, mp_int *c); /* 4 */
|
||||
void (*tclBN_mp_clamp) (mp_int *a); /* 5 */
|
||||
void (*tclBN_mp_clear) (mp_int *a); /* 6 */
|
||||
void (*tclBN_mp_clear_multi) (mp_int *a, ...); /* 7 */
|
||||
int (*tclBN_mp_cmp) (mp_int *a, mp_int *b); /* 8 */
|
||||
int (*tclBN_mp_cmp_d) (mp_int *a, mp_digit b); /* 9 */
|
||||
int (*tclBN_mp_cmp_mag) (mp_int *a, mp_int *b); /* 10 */
|
||||
int (*tclBN_mp_cmp) (CONST mp_int *a, CONST mp_int *b); /* 8 */
|
||||
int (*tclBN_mp_cmp_d) (CONST mp_int *a, mp_digit b); /* 9 */
|
||||
int (*tclBN_mp_cmp_mag) (CONST mp_int *a, CONST mp_int *b); /* 10 */
|
||||
int (*tclBN_mp_copy) (mp_int *a, mp_int *b); /* 11 */
|
||||
int (*tclBN_mp_count_bits) (mp_int *a); /* 12 */
|
||||
int (*tclBN_mp_div) (mp_int *a, mp_int *b, mp_int *q, mp_int *r); /* 13 */
|
||||
@@ -510,7 +513,7 @@ typedef struct TclTomMathStubs {
|
||||
int (*tclBN_mp_mul_2) (mp_int *a, mp_int *p); /* 31 */
|
||||
int (*tclBN_mp_mul_2d) (mp_int *a, int d, mp_int *p); /* 32 */
|
||||
int (*tclBN_mp_neg) (mp_int *a, mp_int *b); /* 33 */
|
||||
int (*tclBN_mp_or) (mp_int *a, mp_int *b, mp_int *c); /* 34 */
|
||||
int (*tclBN_mp_or) (CONST mp_int *a, CONST mp_int *b, mp_int *c); /* 34 */
|
||||
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 */
|
||||
@@ -524,7 +527,7 @@ typedef struct TclTomMathStubs {
|
||||
int (*tclBN_mp_to_unsigned_bin_n) (mp_int *a, unsigned char *b, unsigned long *outlen); /* 45 */
|
||||
int (*tclBN_mp_toradix_n) (mp_int *a, char *str, int radix, int maxlen); /* 46 */
|
||||
int (*tclBN_mp_unsigned_bin_size) (mp_int *a); /* 47 */
|
||||
int (*tclBN_mp_xor) (mp_int *a, mp_int *b, mp_int *c); /* 48 */
|
||||
int (*tclBN_mp_xor) (CONST mp_int *a, CONST mp_int *b, mp_int *c); /* 48 */
|
||||
void (*tclBN_mp_zero) (mp_int *a); /* 49 */
|
||||
void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
|
||||
int (*tclBN_fast_s_mp_mul_digs) (mp_int *a, mp_int *b, mp_int *c, int digs); /* 51 */
|
||||
|
||||
@@ -196,7 +196,7 @@ TclBNInitBignumFromLong(
|
||||
*/
|
||||
|
||||
status = mp_init_size(a,
|
||||
(CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) / DIGIT_BIT);
|
||||
(CHAR_BIT * sizeof(long) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT);
|
||||
if (status != MP_OKAY) {
|
||||
Tcl_Panic("initialization failure in TclBNInitBignumFromLong");
|
||||
}
|
||||
@@ -283,7 +283,7 @@ TclBNInitBignumFromWideUInt(
|
||||
*/
|
||||
|
||||
status = mp_init_size(a,
|
||||
(CHAR_BIT * sizeof(Tcl_WideUInt) + DIGIT_BIT - 1) / DIGIT_BIT);
|
||||
(CHAR_BIT * sizeof(Tcl_WideUInt) + MP_DIGIT_BIT - 1) / MP_DIGIT_BIT);
|
||||
if (status != MP_OKAY) {
|
||||
Tcl_Panic("initialization failure in TclBNInitBignumFromWideUInt");
|
||||
}
|
||||
|
||||
+871
-839
File diff suppressed because it is too large
Load Diff
+17
-7
@@ -69,11 +69,11 @@ static CONST unsigned char totalBytes[256] = {
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
||||
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
|
||||
#if TCL_UTF_MAX > 3
|
||||
4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,
|
||||
#else
|
||||
1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,
|
||||
#endif
|
||||
1,1,1,1,1,1,1,1
|
||||
1,1,1,1,1,1,1,1,1,1,1
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -426,18 +426,28 @@ Tcl_UtfToUniCharDString(
|
||||
|
||||
oldLength = Tcl_DStringLength(dsPtr);
|
||||
Tcl_DStringSetLength(dsPtr,
|
||||
(int) ((oldLength + length + 1) * sizeof(Tcl_UniChar)));
|
||||
oldLength + (int) ((length + 1) * sizeof(Tcl_UniChar)));
|
||||
wString = (Tcl_UniChar *) (Tcl_DStringValue(dsPtr) + oldLength);
|
||||
|
||||
w = wString;
|
||||
end = src + length;
|
||||
for (p = src; p < end; ) {
|
||||
p = src;
|
||||
end = src + length - TCL_UTF_MAX;
|
||||
while (p < end) {
|
||||
p += TclUtfToUniChar(p, w);
|
||||
w++;
|
||||
}
|
||||
end += TCL_UTF_MAX;
|
||||
while (p < end) {
|
||||
if (Tcl_UtfCharComplete(p, end-p)) {
|
||||
p += TclUtfToUniChar(p, w);
|
||||
} else {
|
||||
*w = UCHAR(*p++);
|
||||
}
|
||||
w++;
|
||||
}
|
||||
*w = '\0';
|
||||
Tcl_DStringSetLength(dsPtr,
|
||||
(oldLength + ((char *) w - (char *) wString)));
|
||||
oldLength + ((char *) w - (char *) wString));
|
||||
|
||||
return wString;
|
||||
}
|
||||
|
||||
@@ -952,6 +952,23 @@ TclScanElement(
|
||||
return 2;
|
||||
}
|
||||
|
||||
#if COMPAT
|
||||
/*
|
||||
* We have an established history in TclConvertElement() when quoting
|
||||
* because of a leading hash character to force what would be the
|
||||
* CONVERT_MASK mode into the CONVERT_BRACE mode. That is, we format
|
||||
* the element #{a"b} like this:
|
||||
* {#{a"b}}
|
||||
* and not like this:
|
||||
* \#{a\"b}
|
||||
* This is inconsistent with [list x{a"b}], but we will not change that now.
|
||||
* Set that preference here so that we compute a tight size requirement.
|
||||
*/
|
||||
if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) {
|
||||
preferBrace = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((*p == '{') || (*p == '"')) {
|
||||
/*
|
||||
* Must escape or protect so leading character of value is not
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if {![package vsatisfies [package provide Tcl] 8]} return
|
||||
if {[info sharedlibextension] != ".dll"} return
|
||||
if {[info exists ::tcl_platform(debug)]} {
|
||||
package ifneeded dde 1.3.3 [list load [file join $dir tcldde13g.dll] dde]
|
||||
package ifneeded dde 1.4.1 [list load [file join $dir tcldde14g.dll] dde]
|
||||
} else {
|
||||
package ifneeded dde 1.3.3 [list load [file join $dir tcldde13.dll] dde]
|
||||
package ifneeded dde 1.4.1 [list load [file join $dir tcldde14.dll] dde]
|
||||
}
|
||||
|
||||
@@ -339,12 +339,12 @@ proc http_formatQuery {args} {
|
||||
# 2 Convert every other character to an array lookup
|
||||
# 3 Escape constructs that are "special" to the tcl parser
|
||||
# 4 "subst" the result, doing all the array substitutions
|
||||
|
||||
|
||||
proc httpMapReply {string} {
|
||||
global httpFormMap
|
||||
set alphanumeric a-zA-Z0-9
|
||||
if {![info exists httpFormMap]} {
|
||||
|
||||
|
||||
for {set i 1} {$i <= 256} {incr i} {
|
||||
set c [format %c $i]
|
||||
if {![string match \[$alphanumeric\] $c]} {
|
||||
@@ -363,7 +363,7 @@ proc http_formatQuery {args} {
|
||||
return [subst $string]
|
||||
}
|
||||
|
||||
# Default proxy filter.
|
||||
# Default proxy filter.
|
||||
proc httpProxyRequired {host} {
|
||||
global http
|
||||
if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} {
|
||||
|
||||
+1
-1
@@ -40,5 +40,5 @@ namespace eval ::tcl::clock {
|
||||
::msgcat::mcset ja LOCALE_DATE_FORMAT "%EY\u5e74%m\u6708%d\u65e5"
|
||||
::msgcat::mcset ja LOCALE_TIME_FORMAT "%H\u6642%M\u5206%S\u79d2"
|
||||
::msgcat::mcset ja LOCALE_DATE_TIME_FORMAT "%EY\u5e74%m\u6708%d\u65e5 (%a) %H\u6642%M\u5206%S\u79d2 %z"
|
||||
::msgcat::mcset ja LOCALE_ERAS "\u007b-9223372036854775808 \u897f\u66a6 0\u007d \u007b-3061011600 \u660e\u6cbb 1867\u007d \u007b-1812186000 \u5927\u6b63 1911\u007d \u007b-1357635600 \u662d\u548c 1925\u007d \u007b600220800 \u5e73\u6210 1988\u007d"
|
||||
::msgcat::mcset ja LOCALE_ERAS "{-9223372036854775808 \u897f\u66a6 0} {-3061011600 \u660e\u6cbb 1867} {-1812186000 \u5927\u6b63 1911} {-1357635600 \u662d\u548c 1925} {600220800 \u5e73\u6210 1988} {1556668800 \u4ee4\u548c 2018}"
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace eval ::tcl {
|
||||
# Every OptProc give usage information on "procname -help".
|
||||
# Try "tcl::OptParseTest -help" and "tcl::OptParseTest -a" and
|
||||
# then other arguments.
|
||||
#
|
||||
#
|
||||
# example of 'valid' call:
|
||||
# ::tcl::OptParseTest save -4 -pr 23 -libsok SybTcl\
|
||||
# -nostatics false ch1
|
||||
@@ -84,8 +84,8 @@ namespace eval ::tcl {
|
||||
#
|
||||
# The general structure of a "program" is
|
||||
# notation (pseudo bnf like)
|
||||
# name :== definition defines "name" as being "definition"
|
||||
# { x y z } means list of x, y, and z
|
||||
# name :== definition defines "name" as being "definition"
|
||||
# { x y z } means list of x, y, and z
|
||||
# x* means x repeated 0 or more time
|
||||
# x+ means "x x*"
|
||||
# x? means optionally x
|
||||
@@ -110,7 +110,7 @@ namespace eval ::tcl {
|
||||
#
|
||||
# And for this application:
|
||||
#
|
||||
# singleStep :== { instruction varname {hasBeenSet currentValue} type
|
||||
# singleStep :== { instruction varname {hasBeenSet currentValue} type
|
||||
# typeArgs help }
|
||||
# instruction :== "flags" | "value"
|
||||
# type :== knowType | anyword
|
||||
@@ -343,7 +343,7 @@ proc ::tcl::OptProcArgGiven {argname} {
|
||||
proc OptState {item} {
|
||||
lindex $item 0
|
||||
}
|
||||
|
||||
|
||||
# current state
|
||||
proc OptCurState {descriptions} {
|
||||
OptState [OptCurDesc $descriptions];
|
||||
@@ -535,7 +535,7 @@ proc ::tcl::OptKeyParse {descKey arglist} {
|
||||
if {![Lempty $arglist]} {
|
||||
return -code error [OptTooManyArgs $desc $arglist];
|
||||
}
|
||||
|
||||
|
||||
# Analyse the result
|
||||
# Walk through the tree:
|
||||
OptTreeVars $desc "#[expr {[info level]-1}]" ;
|
||||
@@ -781,7 +781,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} {
|
||||
3 {
|
||||
# varname type value
|
||||
# varname value comment
|
||||
|
||||
|
||||
if {[regexp {^-(.+)$} $arg1 x type]} {
|
||||
# flags/optValue as they are optional, need a "value",
|
||||
# on the contrary, for a variable (non optional),
|
||||
@@ -919,7 +919,7 @@ proc ::tcl::OptError {prefix desc {header 0}} {
|
||||
set desc [concat $h $desc]
|
||||
}
|
||||
OptLengths $desc nl tl dl
|
||||
# actually output
|
||||
# actually output
|
||||
return "$prefix[OptTree $desc $nl $tl $dl]"
|
||||
}
|
||||
|
||||
@@ -952,7 +952,7 @@ proc ::tcl::Lget {list indexLst} {
|
||||
# it would be even slower... needs to be written in C !)
|
||||
# (nb: there is a non trivial recursive problem with indexes 0,
|
||||
# which appear because there is no difference between a list
|
||||
# of 1 element and 1 element alone : [list "a"] == "a" while
|
||||
# of 1 element and 1 element alone : [list "a"] == "a" while
|
||||
# it should be {a} and [listp a] should be 0 while [listp {a b}] would be 1
|
||||
# and [listp "a b"] maybe 0. listp does not exist either...)
|
||||
proc ::tcl::Lvarset {listName indexLst newValue} {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
if {![package vsatisfies [package provide Tcl] 8]} return
|
||||
if {[info sharedlibextension] != ".dll"} return
|
||||
if {[info exists ::tcl_platform(debug)]} {
|
||||
package ifneeded registry 1.2.2 \
|
||||
[list load [file join $dir tclreg12g.dll] registry]
|
||||
package ifneeded registry 1.3.3 \
|
||||
[list load [file join $dir tclreg13g.dll] registry]
|
||||
} else {
|
||||
package ifneeded registry 1.2.2 \
|
||||
[list load [file join $dir tclreg12.dll] registry]
|
||||
package ifneeded registry 1.3.3 \
|
||||
[list load [file join $dir tclreg13.dll] registry]
|
||||
}
|
||||
|
||||
@@ -85,3 +85,6 @@ set auto_index(::tcl::tm::list) [list source [file join $dir tm.tcl]]
|
||||
set auto_index(::tcl::tm::UnknownHandler) [list source [file join $dir tm.tcl]]
|
||||
set auto_index(::tcl::tm::roots) [list source [file join $dir tm.tcl]]
|
||||
set auto_index(::tcl::tm::path) [list source [file join $dir tm.tcl]]
|
||||
if {[namespace exists ::tcl::unsupported]} {
|
||||
set auto_index(timerate) {namespace import ::tcl::unsupported::timerate}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
# script is sourced, the variable $dir must contain the
|
||||
# full path name of this file's directory.
|
||||
|
||||
if {![package vsatisfies [package provide Tcl] 8.5]} {return}
|
||||
package ifneeded tcltest 2.3.8 [list source [file join $dir tcltest.tcl]]
|
||||
if {![package vsatisfies [package provide Tcl] 8.5-]} {return}
|
||||
package ifneeded tcltest 2.5.0 [list source [file join $dir tcltest.tcl]]
|
||||
|
||||
+86
-43
@@ -16,13 +16,13 @@
|
||||
# Contributions from Don Porter, NIST, 2002. (not subject to US copyright)
|
||||
# All rights reserved.
|
||||
|
||||
package require Tcl 8.5 ;# -verbose line uses [info frame]
|
||||
package require Tcl 8.5- ;# -verbose line uses [info frame]
|
||||
namespace eval tcltest {
|
||||
|
||||
# When the version number changes, be sure to update the pkgIndex.tcl file,
|
||||
# and the install directory in the Makefiles. When the minor version
|
||||
# changes (new feature) be sure to update the man page as well.
|
||||
variable Version 2.3.8
|
||||
variable Version 2.5.0
|
||||
|
||||
# Compatibility support for dumb variables defined in tcltest 1
|
||||
# Do not use these. Call [package provide Tcl] and [info patchlevel]
|
||||
@@ -347,7 +347,7 @@ namespace eval tcltest {
|
||||
# This is very subtle and tricky, so let me try to explain.
|
||||
# (Hopefully this longer comment will be clear when I come
|
||||
# back in a few months, unlike its predecessor :) )
|
||||
#
|
||||
#
|
||||
# The [outputChannel] command (and underlying variable) have to
|
||||
# be kept in sync with the [configure -outfile] configuration
|
||||
# option ( and underlying variable Option(-outfile) ). This is
|
||||
@@ -362,12 +362,12 @@ namespace eval tcltest {
|
||||
# configuration options to parse the command line option the first
|
||||
# time they are read. These traces are cancelled whenever the
|
||||
# program itself calls [configure].
|
||||
#
|
||||
#
|
||||
# OK, then so to support tcltest 1 compatibility, it seems we want
|
||||
# to get the return from [outputFile] to trigger the read traces,
|
||||
# just in case.
|
||||
#
|
||||
# BUT! A little known feature of Tcl variable traces is that
|
||||
# BUT! A little known feature of Tcl variable traces is that
|
||||
# traces are disabled during the handling of other traces. So,
|
||||
# if we trigger read traces on Option(-outfile) and that triggers
|
||||
# command line parsing which turns around and sets an initial
|
||||
@@ -608,19 +608,30 @@ namespace eval tcltest {
|
||||
set code [catch {Configure {*}$args} msg]
|
||||
return -code $code $msg
|
||||
}
|
||||
|
||||
|
||||
proc AcceptVerbose { level } {
|
||||
set level [AcceptList $level]
|
||||
set levelMap {
|
||||
l list
|
||||
p pass
|
||||
b body
|
||||
s skip
|
||||
t start
|
||||
e error
|
||||
l line
|
||||
m msec
|
||||
u usec
|
||||
}
|
||||
set levelRegexp "^([join [dict values $levelMap] |])\$"
|
||||
if {[llength $level] == 1} {
|
||||
if {![regexp {^(pass|body|skip|start|error|line)$} $level]} {
|
||||
if {![regexp $levelRegexp $level]} {
|
||||
# translate single characters abbreviations to expanded list
|
||||
set level [string map {p pass b body s skip t start e error l line} \
|
||||
[split $level {}]]
|
||||
set level [string map $levelMap [split $level {}]]
|
||||
}
|
||||
}
|
||||
set valid [list]
|
||||
foreach v $level {
|
||||
if {[regexp {^(pass|body|skip|start|error|line)$} $v]} {
|
||||
if {[regexp $levelRegexp $v]} {
|
||||
lappend valid $v
|
||||
}
|
||||
}
|
||||
@@ -639,7 +650,7 @@ namespace eval tcltest {
|
||||
skipped tests if 's' is specified, the bodies of failed tests if
|
||||
'b' is specified, and when tests start if 't' is specified.
|
||||
ErrorInfo is displayed if 'e' is specified. Source file line
|
||||
information of failed tests is displayed if 'l' is specified.
|
||||
information of failed tests is displayed if 'l' is specified.
|
||||
} AcceptVerbose verbose
|
||||
|
||||
# Match and skip patterns default to the empty list, except for
|
||||
@@ -687,7 +698,7 @@ namespace eval tcltest {
|
||||
# some additional output regarding operations of the test harness.
|
||||
# The tcltest package currently implements only up to debug level 3.
|
||||
Option -debug 0 {
|
||||
Internal debug level
|
||||
Internal debug level
|
||||
} AcceptInteger debug
|
||||
|
||||
proc SetSelectedConstraints args {
|
||||
@@ -715,7 +726,7 @@ namespace eval tcltest {
|
||||
}
|
||||
Option -limitconstraints 0 {
|
||||
whether to run only tests with the constraints
|
||||
} AcceptBoolean limitConstraints
|
||||
} AcceptBoolean limitConstraints
|
||||
trace add variable Option(-limitconstraints) write \
|
||||
[namespace code {ClearUnselectedConstraints ;#}]
|
||||
|
||||
@@ -728,7 +739,7 @@ namespace eval tcltest {
|
||||
# Default is to run each test file in a separate process
|
||||
Option -singleproc 0 {
|
||||
whether to run all tests in one process
|
||||
} AcceptBoolean singleProcess
|
||||
} AcceptBoolean singleProcess
|
||||
|
||||
proc AcceptTemporaryDirectory { directory } {
|
||||
set directory [AcceptAbsolutePath $directory]
|
||||
@@ -1243,10 +1254,6 @@ proc tcltest::DefineConstraintInitializers {} {
|
||||
ConstraintInitializer interactive \
|
||||
{expr {[info exists ::tcl_interactive] && $::tcl_interactive}}
|
||||
|
||||
# Skip slow tests (to enable slow tests add parameter `-constraints slowTest`)
|
||||
|
||||
ConstraintInitializer slowTest {format 0}
|
||||
|
||||
# Some tests can only be run if the installation came from a CD
|
||||
# image instead of a web image. Some tests must be skipped if you
|
||||
# are running as root on Unix. Other tests can only be run if you
|
||||
@@ -1261,7 +1268,7 @@ proc tcltest::DefineConstraintInitializers {} {
|
||||
# setting files into nonblocking mode.
|
||||
|
||||
ConstraintInitializer nonBlockFiles {
|
||||
set code [expr {[catch {set f [open defs r]}]
|
||||
set code [expr {[catch {set f [open defs r]}]
|
||||
|| [catch {chan configure $f -blocking off}]}]
|
||||
catch {close $f}
|
||||
set code
|
||||
@@ -1275,7 +1282,7 @@ proc tcltest::DefineConstraintInitializers {} {
|
||||
# (Mark Diekhans).
|
||||
|
||||
ConstraintInitializer asyncPipeClose {expr {
|
||||
!([string equal unix $::tcl_platform(platform)]
|
||||
!([string equal unix $::tcl_platform(platform)]
|
||||
&& ([catch {exec uname -X | fgrep {Release = 3.2v}}] == 0))}}
|
||||
|
||||
# Test to see if we have a broken version of sprintf with respect
|
||||
@@ -1834,6 +1841,9 @@ proc tcltest::SubstArguments {argList} {
|
||||
# is optional; default is {}.
|
||||
# returnCodes - Expected return codes. This attribute is
|
||||
# optional; default is {0 2}.
|
||||
# errorCode - Expected error code. This attribute is
|
||||
# optional; default is {*}. It is a glob pattern.
|
||||
# If given, returnCodes defaults to {1}.
|
||||
# setup - Code to run before $script (above). This
|
||||
# attribute is optional; default is {}.
|
||||
# cleanup - Code to run after $script (above). This
|
||||
@@ -1875,7 +1885,7 @@ proc tcltest::test {name description args} {
|
||||
# Pre-define everything to null except output and errorOutput. We
|
||||
# determine whether or not to trap output based on whether or not
|
||||
# these variables (output & errorOutput) are defined.
|
||||
lassign {} constraints setup cleanup body result returnCodes match
|
||||
lassign {} constraints setup cleanup body result returnCodes errorCode match
|
||||
|
||||
# Set the default match mode
|
||||
set match exact
|
||||
@@ -1885,6 +1895,9 @@ proc tcltest::test {name description args} {
|
||||
# 'return' being used in the test script).
|
||||
set returnCodes [list 0 2]
|
||||
|
||||
# Set the default error code pattern
|
||||
set errorCode "*"
|
||||
|
||||
# The old test format can't have a 3rd argument (constraints or
|
||||
# script) that starts with '-'.
|
||||
if {[string match -* [lindex $args 0]] || ([llength $args] <= 1)} {
|
||||
@@ -1894,7 +1907,7 @@ proc tcltest::test {name description args} {
|
||||
set testAttributes($element) $value
|
||||
}
|
||||
foreach item {constraints match setup body cleanup \
|
||||
result returnCodes output errorOutput} {
|
||||
result returnCodes errorCode output errorOutput} {
|
||||
if {[info exists testAttributes(-$item)]} {
|
||||
set testAttributes(-$item) [uplevel 1 \
|
||||
::concat $testAttributes(-$item)]
|
||||
@@ -1905,7 +1918,7 @@ proc tcltest::test {name description args} {
|
||||
}
|
||||
|
||||
set validFlags {-setup -cleanup -body -result -returnCodes \
|
||||
-match -output -errorOutput -constraints}
|
||||
-errorCode -match -output -errorOutput -constraints}
|
||||
|
||||
foreach flag [array names testAttributes] {
|
||||
if {$flag ni $validFlags} {
|
||||
@@ -1937,6 +1950,10 @@ proc tcltest::test {name description args} {
|
||||
foreach {strcode numcode} {ok 0 normal 0 error 1 return 2 break 3 continue 4} {
|
||||
set returnCodes [string map -nocase [list $strcode $numcode] $returnCodes]
|
||||
}
|
||||
# errorCode without returnCode 1 is meaningless
|
||||
if {$errorCode ne "*" && 1 ni $returnCodes} {
|
||||
set returnCodes 1
|
||||
}
|
||||
} else {
|
||||
# This is parsing for the old test command format; it is here
|
||||
# for backward compatibility.
|
||||
@@ -1958,7 +1975,7 @@ proc tcltest::test {name description args} {
|
||||
return
|
||||
}
|
||||
|
||||
# Save information about the core file.
|
||||
# Save information about the core file.
|
||||
if {[preserveCore]} {
|
||||
if {[file exists [file join [workingDirectory] core]]} {
|
||||
set coreModTime [file mtime [file join [workingDirectory] core]]
|
||||
@@ -1969,13 +1986,18 @@ proc tcltest::test {name description args} {
|
||||
set code [catch {uplevel 1 $setup} setupMsg]
|
||||
if {$code == 1} {
|
||||
set errorInfo(setup) $::errorInfo
|
||||
set errorCode(setup) $::errorCode
|
||||
set errorCodeRes(setup) $::errorCode
|
||||
}
|
||||
set setupFailure [expr {$code != 0}]
|
||||
|
||||
# Only run the test body if the setup was successful
|
||||
if {!$setupFailure} {
|
||||
|
||||
# Register startup time
|
||||
if {[IsVerbose msec] || [IsVerbose usec]} {
|
||||
set timeStart [clock microseconds]
|
||||
}
|
||||
|
||||
# Verbose notification of $body start
|
||||
if {[IsVerbose start]} {
|
||||
puts [outputChannel] "---- $name start"
|
||||
@@ -1991,7 +2013,7 @@ proc tcltest::test {name description args} {
|
||||
lassign $testResult actualAnswer returnCode
|
||||
if {$returnCode == 1} {
|
||||
set errorInfo(body) $::errorInfo
|
||||
set errorCode(body) $::errorCode
|
||||
set errorCodeRes(body) $::errorCode
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2000,6 +2022,11 @@ proc tcltest::test {name description args} {
|
||||
if {!$setupFailure && ($returnCode ni $returnCodes)} {
|
||||
set codeFailure 1
|
||||
}
|
||||
set errorCodeFailure 0
|
||||
if {!$setupFailure && !$codeFailure && $returnCode == 1 && \
|
||||
![string match $errorCode $errorCodeRes(body)]} {
|
||||
set errorCodeFailure 1
|
||||
}
|
||||
|
||||
# If expected output/error strings exist, we have to compare
|
||||
# them. If the comparison fails, then so did the test.
|
||||
@@ -2043,7 +2070,7 @@ proc tcltest::test {name description args} {
|
||||
set code [catch {uplevel 1 $cleanup} cleanupMsg]
|
||||
if {$code == 1} {
|
||||
set errorInfo(cleanup) $::errorInfo
|
||||
set errorCode(cleanup) $::errorCode
|
||||
set errorCodeRes(cleanup) $::errorCode
|
||||
}
|
||||
set cleanupFailure [expr {$code != 0}]
|
||||
|
||||
@@ -2064,7 +2091,7 @@ proc tcltest::test {name description args} {
|
||||
} else {
|
||||
set coreFailure 1
|
||||
}
|
||||
|
||||
|
||||
if {([preserveCore] > 1) && ($coreFailure)} {
|
||||
append coreMsg "\nMoving file to:\
|
||||
[file join [temporaryDirectory] core-$name]"
|
||||
@@ -2080,11 +2107,21 @@ proc tcltest::test {name description args} {
|
||||
}
|
||||
}
|
||||
|
||||
if {[IsVerbose msec] || [IsVerbose usec]} {
|
||||
set t [expr {[clock microseconds] - $timeStart}]
|
||||
if {[IsVerbose usec]} {
|
||||
puts [outputChannel] "++++ $name took $t μs"
|
||||
}
|
||||
if {[IsVerbose msec]} {
|
||||
puts [outputChannel] "++++ $name took [expr {round($t/1000.)}] ms"
|
||||
}
|
||||
}
|
||||
|
||||
# if we didn't experience any failures, then we passed
|
||||
variable numTests
|
||||
if {!($setupFailure || $cleanupFailure || $coreFailure
|
||||
|| $outputFailure || $errorFailure || $codeFailure
|
||||
|| $scriptFailure)} {
|
||||
|| $errorCodeFailure || $scriptFailure)} {
|
||||
if {$testLevel == 1} {
|
||||
incr numTests(Passed)
|
||||
if {[IsVerbose pass]} {
|
||||
@@ -2104,7 +2141,7 @@ proc tcltest::test {name description args} {
|
||||
variable currentFailure true
|
||||
if {![IsVerbose body]} {
|
||||
set body ""
|
||||
}
|
||||
}
|
||||
puts [outputChannel] "\n"
|
||||
if {[IsVerbose line]} {
|
||||
if {![catch {set testFrame [info frame -1]}] &&
|
||||
@@ -2125,7 +2162,7 @@ proc tcltest::test {name description args} {
|
||||
puts [outputChannel] "$testFile:$testLine: error: test failed:\
|
||||
$name [string trim $description]"
|
||||
}
|
||||
}
|
||||
}
|
||||
puts [outputChannel] "==== $name\
|
||||
[string trim $description] FAILED"
|
||||
if {[string length $body]} {
|
||||
@@ -2137,7 +2174,7 @@ proc tcltest::test {name description args} {
|
||||
failed:\n$setupMsg"
|
||||
if {[info exists errorInfo(setup)]} {
|
||||
puts [outputChannel] "---- errorInfo(setup): $errorInfo(setup)"
|
||||
puts [outputChannel] "---- errorCode(setup): $errorCode(setup)"
|
||||
puts [outputChannel] "---- errorCode(setup): $errorCodeRes(setup)"
|
||||
}
|
||||
}
|
||||
if {$scriptFailure} {
|
||||
@@ -2149,6 +2186,10 @@ proc tcltest::test {name description args} {
|
||||
($match matching):\n$result"
|
||||
}
|
||||
}
|
||||
if {$errorCodeFailure} {
|
||||
puts [outputChannel] "---- Error code was: '$errorCodeRes(body)'"
|
||||
puts [outputChannel] "---- Error code should have been: '$errorCode'"
|
||||
}
|
||||
if {$codeFailure} {
|
||||
switch -- $returnCode {
|
||||
0 { set msg "Test completed normally" }
|
||||
@@ -2164,7 +2205,7 @@ proc tcltest::test {name description args} {
|
||||
if {[IsVerbose error]} {
|
||||
if {[info exists errorInfo(body)] && (1 ni $returnCodes)} {
|
||||
puts [outputChannel] "---- errorInfo: $errorInfo(body)"
|
||||
puts [outputChannel] "---- errorCode: $errorCode(body)"
|
||||
puts [outputChannel] "---- errorCode: $errorCodeRes(body)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2190,7 +2231,7 @@ proc tcltest::test {name description args} {
|
||||
puts [outputChannel] "---- Test cleanup failed:\n$cleanupMsg"
|
||||
if {[info exists errorInfo(cleanup)]} {
|
||||
puts [outputChannel] "---- errorInfo(cleanup): $errorInfo(cleanup)"
|
||||
puts [outputChannel] "---- errorCode(cleanup): $errorCode(cleanup)"
|
||||
puts [outputChannel] "---- errorCode(cleanup): $errorCodeRes(cleanup)"
|
||||
}
|
||||
}
|
||||
if {$coreFailure} {
|
||||
@@ -2281,7 +2322,7 @@ proc tcltest::Skipped {name constraints} {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if {!$doTest} {
|
||||
if {[IsVerbose skip]} {
|
||||
puts [outputChannel] "++++ $name SKIPPED: $constraints"
|
||||
@@ -2687,7 +2728,7 @@ proc tcltest::GetMatchingDirectories {rootdir} {
|
||||
DebugPuts 1 "No test directories remain after applying match\
|
||||
and skip patterns!"
|
||||
}
|
||||
return $matchDirs
|
||||
return [lsort $matchDirs]
|
||||
}
|
||||
|
||||
# tcltest::runAllTests --
|
||||
@@ -2700,7 +2741,7 @@ proc tcltest::GetMatchingDirectories {rootdir} {
|
||||
# shell being tested
|
||||
#
|
||||
# Results:
|
||||
# None.
|
||||
# Whether there were any failures.
|
||||
#
|
||||
# Side effects:
|
||||
# None.
|
||||
@@ -2711,6 +2752,7 @@ proc tcltest::runAllTests { {shell ""} } {
|
||||
variable numTests
|
||||
variable failFiles
|
||||
variable DefaultValue
|
||||
set failFilesAccum {}
|
||||
|
||||
FillFilesExisted
|
||||
if {[llength [info level 0]] == 1} {
|
||||
@@ -2800,6 +2842,7 @@ proc tcltest::runAllTests { {shell ""} } {
|
||||
}
|
||||
if {$Failed > 0} {
|
||||
lappend failFiles $testFile
|
||||
lappend failFilesAccum $testFile
|
||||
}
|
||||
} elseif {[regexp [join {
|
||||
{^Number of tests skipped }
|
||||
@@ -2838,15 +2881,15 @@ proc tcltest::runAllTests { {shell ""} } {
|
||||
set dir [file tail $directory]
|
||||
puts [outputChannel] [string repeat ~ 44]
|
||||
puts [outputChannel] "$dir test began at [eval $timeCmd]\n"
|
||||
|
||||
|
||||
uplevel 1 [list ::source [file join $directory all.tcl]]
|
||||
|
||||
|
||||
set endTime [eval $timeCmd]
|
||||
puts [outputChannel] "\n$dir test ended at $endTime"
|
||||
puts [outputChannel] ""
|
||||
puts [outputChannel] [string repeat ~ 44]
|
||||
}
|
||||
return
|
||||
return [expr {[info exists testFileFailures] || [llength $failFilesAccum]}]
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
@@ -3023,7 +3066,7 @@ proc tcltest::removeFile {name {directory ""}} {
|
||||
DebugDo 1 {
|
||||
Warn "removeFile removing \"$fullName\":\n not created by makeFile"
|
||||
}
|
||||
}
|
||||
}
|
||||
if {![file isfile $fullName]} {
|
||||
DebugDo 1 {
|
||||
Warn "removeFile removing \"$fullName\":\n not a file"
|
||||
@@ -3094,7 +3137,7 @@ proc tcltest::removeDirectory {name {directory ""}} {
|
||||
Warn "removeDirectory removing \"$fullName\":\n not created\
|
||||
by makeDirectory"
|
||||
}
|
||||
}
|
||||
}
|
||||
if {![file isdirectory $fullName]} {
|
||||
DebugDo 1 {
|
||||
Warn "removeDirectory removing \"$fullName\":\n not a directory"
|
||||
@@ -3289,7 +3332,7 @@ proc tcltest::threadReap {} {
|
||||
testthread errorproc ThreadError
|
||||
return [llength [testthread names]]
|
||||
} elseif {[info commands thread::id] ne {}} {
|
||||
|
||||
|
||||
# Thread extension
|
||||
|
||||
thread::errorproc ThreadNullError
|
||||
|
||||
@@ -2,229 +2,99 @@
|
||||
|
||||
set TZData(:Africa/Casablanca) {
|
||||
{-9223372036854775808 -1820 0 LMT}
|
||||
{-1773012580 0 0 WET}
|
||||
{-956361600 3600 1 WEST}
|
||||
{-950490000 0 0 WET}
|
||||
{-942019200 3600 1 WEST}
|
||||
{-761187600 0 0 WET}
|
||||
{-617241600 3600 1 WEST}
|
||||
{-605149200 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}
|
||||
{231292800 3600 1 WEST}
|
||||
{244249200 0 0 WET}
|
||||
{265507200 3600 1 WEST}
|
||||
{271033200 0 0 WET}
|
||||
{448243200 3600 0 CET}
|
||||
{504918000 0 0 WET}
|
||||
{1212278400 3600 1 WEST}
|
||||
{1220223600 0 0 WET}
|
||||
{1243814400 3600 1 WEST}
|
||||
{1250809200 0 0 WET}
|
||||
{1272758400 3600 1 WEST}
|
||||
{1281222000 0 0 WET}
|
||||
{1301788800 3600 1 WEST}
|
||||
{1312066800 0 0 WET}
|
||||
{1335664800 3600 1 WEST}
|
||||
{1342749600 0 0 WET}
|
||||
{1345428000 3600 1 WEST}
|
||||
{1348970400 0 0 WET}
|
||||
{1367114400 3600 1 WEST}
|
||||
{1373162400 0 0 WET}
|
||||
{1376100000 3600 1 WEST}
|
||||
{1382839200 0 0 WET}
|
||||
{1396144800 3600 1 WEST}
|
||||
{1403920800 0 0 WET}
|
||||
{1406944800 3600 1 WEST}
|
||||
{1414288800 0 0 WET}
|
||||
{1427594400 3600 1 WEST}
|
||||
{1434247200 0 0 WET}
|
||||
{1437271200 3600 1 WEST}
|
||||
{1445738400 0 0 WET}
|
||||
{1459044000 3600 1 WEST}
|
||||
{1465092000 0 0 WET}
|
||||
{1468116000 3600 1 WEST}
|
||||
{1477792800 0 0 WET}
|
||||
{1490493600 3600 1 WEST}
|
||||
{1495332000 0 0 WET}
|
||||
{1498960800 3600 1 WEST}
|
||||
{1509242400 0 0 WET}
|
||||
{1521943200 3600 1 WEST}
|
||||
{1526176800 0 0 WET}
|
||||
{1529200800 3600 1 WEST}
|
||||
{1540692000 0 0 WET}
|
||||
{1553997600 3600 1 WEST}
|
||||
{1557021600 0 0 WET}
|
||||
{1560045600 3600 1 WEST}
|
||||
{1572141600 0 0 WET}
|
||||
{1585447200 3600 1 WEST}
|
||||
{1587261600 0 0 WET}
|
||||
{1590285600 3600 1 WEST}
|
||||
{1603591200 0 0 WET}
|
||||
{1616896800 3600 1 WEST}
|
||||
{1618106400 0 0 WET}
|
||||
{1621130400 3600 1 WEST}
|
||||
{1635645600 0 0 WET}
|
||||
{1651975200 3600 1 WEST}
|
||||
{1667095200 0 0 WET}
|
||||
{1682215200 3600 1 WEST}
|
||||
{1698544800 0 0 WET}
|
||||
{1713060000 3600 1 WEST}
|
||||
{1729994400 0 0 WET}
|
||||
{1743904800 3600 1 WEST}
|
||||
{1761444000 0 0 WET}
|
||||
{1774749600 3600 1 WEST}
|
||||
{1792893600 0 0 WET}
|
||||
{1806199200 3600 1 WEST}
|
||||
{1824948000 0 0 WET}
|
||||
{1837648800 3600 1 WEST}
|
||||
{1856397600 0 0 WET}
|
||||
{1869098400 3600 1 WEST}
|
||||
{1887847200 0 0 WET}
|
||||
{1901152800 3600 1 WEST}
|
||||
{1919296800 0 0 WET}
|
||||
{1932602400 3600 1 WEST}
|
||||
{1950746400 0 0 WET}
|
||||
{1964052000 3600 1 WEST}
|
||||
{1982800800 0 0 WET}
|
||||
{1995501600 3600 1 WEST}
|
||||
{2014250400 0 0 WET}
|
||||
{2026951200 3600 1 WEST}
|
||||
{2045700000 0 0 WET}
|
||||
{2058400800 3600 1 WEST}
|
||||
{2077149600 0 0 WET}
|
||||
{2090455200 3600 1 WEST}
|
||||
{2107994400 0 0 WET}
|
||||
{2108602800 0 0 WET}
|
||||
{2121904800 3600 1 WEST}
|
||||
{2138234400 0 0 WET}
|
||||
{2140052400 0 0 WET}
|
||||
{2153354400 3600 1 WEST}
|
||||
{2172103200 0 0 WET}
|
||||
{2184804000 3600 1 WEST}
|
||||
{2203552800 0 0 WET}
|
||||
{2216253600 3600 1 WEST}
|
||||
{2235002400 0 0 WET}
|
||||
{2248308000 3600 1 WEST}
|
||||
{2266452000 0 0 WET}
|
||||
{2279757600 3600 1 WEST}
|
||||
{2297901600 0 0 WET}
|
||||
{2311207200 3600 1 WEST}
|
||||
{2329351200 0 0 WET}
|
||||
{2342656800 3600 1 WEST}
|
||||
{2361405600 0 0 WET}
|
||||
{2374106400 3600 1 WEST}
|
||||
{2392855200 0 0 WET}
|
||||
{2405556000 3600 1 WEST}
|
||||
{2424304800 0 0 WET}
|
||||
{2437610400 3600 1 WEST}
|
||||
{2455754400 0 0 WET}
|
||||
{2469060000 3600 1 WEST}
|
||||
{2487204000 0 0 WET}
|
||||
{2500509600 3600 1 WEST}
|
||||
{2519258400 0 0 WET}
|
||||
{2531959200 3600 1 WEST}
|
||||
{2550708000 0 0 WET}
|
||||
{2563408800 3600 1 WEST}
|
||||
{2582157600 0 0 WET}
|
||||
{2595463200 3600 1 WEST}
|
||||
{2613607200 0 0 WET}
|
||||
{2626912800 3600 1 WEST}
|
||||
{2645056800 0 0 WET}
|
||||
{2658362400 3600 1 WEST}
|
||||
{2676506400 0 0 WET}
|
||||
{2689812000 3600 1 WEST}
|
||||
{2708560800 0 0 WET}
|
||||
{2721261600 3600 1 WEST}
|
||||
{2740010400 0 0 WET}
|
||||
{2752711200 3600 1 WEST}
|
||||
{2771460000 0 0 WET}
|
||||
{2784765600 3600 1 WEST}
|
||||
{2802909600 0 0 WET}
|
||||
{2816215200 3600 1 WEST}
|
||||
{2834359200 0 0 WET}
|
||||
{2847664800 3600 1 WEST}
|
||||
{2866413600 0 0 WET}
|
||||
{2879114400 3600 1 WEST}
|
||||
{2897863200 0 0 WET}
|
||||
{2910564000 3600 1 WEST}
|
||||
{2929312800 0 0 WET}
|
||||
{2942013600 3600 1 WEST}
|
||||
{2960762400 0 0 WET}
|
||||
{2974068000 3600 1 WEST}
|
||||
{2992212000 0 0 WET}
|
||||
{3005517600 3600 1 WEST}
|
||||
{3023661600 0 0 WET}
|
||||
{3036967200 3600 1 WEST}
|
||||
{3055716000 0 0 WET}
|
||||
{3068416800 3600 1 WEST}
|
||||
{3087165600 0 0 WET}
|
||||
{3099866400 3600 1 WEST}
|
||||
{3118615200 0 0 WET}
|
||||
{3131920800 3600 1 WEST}
|
||||
{3150064800 0 0 WET}
|
||||
{3163370400 3600 1 WEST}
|
||||
{3181514400 0 0 WET}
|
||||
{3194820000 3600 1 WEST}
|
||||
{3212964000 0 0 WET}
|
||||
{3226269600 3600 1 WEST}
|
||||
{3245018400 0 0 WET}
|
||||
{3257719200 3600 1 WEST}
|
||||
{3276468000 0 0 WET}
|
||||
{3289168800 3600 1 WEST}
|
||||
{3307917600 0 0 WET}
|
||||
{3321223200 3600 1 WEST}
|
||||
{3339367200 0 0 WET}
|
||||
{3352672800 3600 1 WEST}
|
||||
{3370816800 0 0 WET}
|
||||
{3384122400 3600 1 WEST}
|
||||
{3402871200 0 0 WET}
|
||||
{3415572000 3600 1 WEST}
|
||||
{3434320800 0 0 WET}
|
||||
{3447021600 3600 1 WEST}
|
||||
{3465770400 0 0 WET}
|
||||
{3479076000 3600 1 WEST}
|
||||
{3497220000 0 0 WET}
|
||||
{3510525600 3600 1 WEST}
|
||||
{3528669600 0 0 WET}
|
||||
{3541975200 3600 1 WEST}
|
||||
{3560119200 0 0 WET}
|
||||
{3573424800 3600 1 WEST}
|
||||
{3592173600 0 0 WET}
|
||||
{3604874400 3600 1 WEST}
|
||||
{3623623200 0 0 WET}
|
||||
{3636324000 3600 1 WEST}
|
||||
{3655072800 0 0 WET}
|
||||
{3668378400 3600 1 WEST}
|
||||
{3686522400 0 0 WET}
|
||||
{3699828000 3600 1 WEST}
|
||||
{3717972000 0 0 WET}
|
||||
{3731277600 3600 1 WEST}
|
||||
{3750026400 0 0 WET}
|
||||
{3762727200 3600 1 WEST}
|
||||
{3781476000 0 0 WET}
|
||||
{3794176800 3600 1 WEST}
|
||||
{3812925600 0 0 WET}
|
||||
{3825626400 3600 1 WEST}
|
||||
{3844375200 0 0 WET}
|
||||
{3857680800 3600 1 WEST}
|
||||
{3875824800 0 0 WET}
|
||||
{3889130400 3600 1 WEST}
|
||||
{3907274400 0 0 WET}
|
||||
{3920580000 3600 1 WEST}
|
||||
{3939328800 0 0 WET}
|
||||
{3952029600 3600 1 WEST}
|
||||
{3970778400 0 0 WET}
|
||||
{3983479200 3600 1 WEST}
|
||||
{4002228000 0 0 WET}
|
||||
{4015533600 3600 1 WEST}
|
||||
{4033677600 0 0 WET}
|
||||
{4046983200 3600 1 WEST}
|
||||
{4065127200 0 0 WET}
|
||||
{4078432800 3600 1 WEST}
|
||||
{4096576800 0 0 WET}
|
||||
{-1773012580 0 0 +00}
|
||||
{-956361600 3600 1 +00}
|
||||
{-950490000 0 0 +00}
|
||||
{-942019200 3600 1 +00}
|
||||
{-761187600 0 0 +00}
|
||||
{-617241600 3600 1 +00}
|
||||
{-605149200 0 0 +00}
|
||||
{-81432000 3600 1 +00}
|
||||
{-71110800 0 0 +00}
|
||||
{141264000 3600 1 +00}
|
||||
{147222000 0 0 +00}
|
||||
{199756800 3600 1 +00}
|
||||
{207702000 0 0 +00}
|
||||
{231292800 3600 1 +00}
|
||||
{244249200 0 0 +00}
|
||||
{265507200 3600 1 +00}
|
||||
{271033200 0 0 +00}
|
||||
{448243200 3600 0 +01}
|
||||
{504918000 0 0 +00}
|
||||
{1212278400 3600 1 +00}
|
||||
{1220223600 0 0 +00}
|
||||
{1243814400 3600 1 +00}
|
||||
{1250809200 0 0 +00}
|
||||
{1272758400 3600 1 +00}
|
||||
{1281222000 0 0 +00}
|
||||
{1301788800 3600 1 +00}
|
||||
{1312066800 0 0 +00}
|
||||
{1335664800 3600 1 +00}
|
||||
{1342749600 0 0 +00}
|
||||
{1345428000 3600 1 +00}
|
||||
{1348970400 0 0 +00}
|
||||
{1367114400 3600 1 +00}
|
||||
{1373162400 0 0 +00}
|
||||
{1376100000 3600 1 +00}
|
||||
{1382839200 0 0 +00}
|
||||
{1396144800 3600 1 +00}
|
||||
{1403920800 0 0 +00}
|
||||
{1406944800 3600 1 +00}
|
||||
{1414288800 0 0 +00}
|
||||
{1427594400 3600 1 +00}
|
||||
{1434247200 0 0 +00}
|
||||
{1437271200 3600 1 +00}
|
||||
{1445738400 0 0 +00}
|
||||
{1459044000 3600 1 +00}
|
||||
{1465092000 0 0 +00}
|
||||
{1468116000 3600 1 +00}
|
||||
{1477792800 0 0 +00}
|
||||
{1490493600 3600 1 +00}
|
||||
{1495332000 0 0 +00}
|
||||
{1498960800 3600 1 +00}
|
||||
{1509242400 0 0 +00}
|
||||
{1521943200 3600 1 +00}
|
||||
{1526176800 0 0 +00}
|
||||
{1529200800 3600 1 +00}
|
||||
{1540695600 3600 0 +01}
|
||||
{1557021600 0 1 +01}
|
||||
{1560045600 3600 0 +01}
|
||||
{1587261600 0 1 +01}
|
||||
{1590285600 3600 0 +01}
|
||||
{1618106400 0 1 +01}
|
||||
{1621130400 3600 0 +01}
|
||||
{1648346400 0 1 +01}
|
||||
{1651975200 3600 0 +01}
|
||||
{1679191200 0 1 +01}
|
||||
{1682215200 3600 0 +01}
|
||||
{1710036000 0 1 +01}
|
||||
{1713060000 3600 0 +01}
|
||||
{1740276000 0 1 +01}
|
||||
{1743904800 3600 0 +01}
|
||||
{1771120800 0 1 +01}
|
||||
{1774144800 3600 0 +01}
|
||||
{1801965600 0 1 +01}
|
||||
{1804989600 3600 0 +01}
|
||||
{1832205600 0 1 +01}
|
||||
{1835229600 3600 0 +01}
|
||||
{1863050400 0 1 +01}
|
||||
{1866074400 3600 0 +01}
|
||||
{1893290400 0 1 +01}
|
||||
{1896919200 3600 0 +01}
|
||||
{1924135200 0 1 +01}
|
||||
{1927159200 3600 0 +01}
|
||||
{1954980000 0 1 +01}
|
||||
{1958004000 3600 0 +01}
|
||||
{1985220000 0 1 +01}
|
||||
{1988848800 3600 0 +01}
|
||||
{2016064800 0 1 +01}
|
||||
{2019088800 3600 0 +01}
|
||||
{2046304800 0 1 +01}
|
||||
{2049933600 3600 0 +01}
|
||||
{2077149600 0 1 +01}
|
||||
{2080173600 3600 0 +01}
|
||||
{2107994400 0 1 +01}
|
||||
{2111018400 3600 0 +01}
|
||||
{2138234400 0 1 +01}
|
||||
{2141863200 3600 0 +01}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ set TZData(:Africa/Ceuta) {
|
||||
{-1316390400 3600 1 WEST}
|
||||
{-1301270400 0 0 WET}
|
||||
{-1293840000 0 0 WET}
|
||||
{-94694400 0 0 WET}
|
||||
{-81432000 3600 1 WEST}
|
||||
{-71110800 0 0 WET}
|
||||
{141264000 3600 1 WEST}
|
||||
|
||||
+83
-213
@@ -3,217 +3,87 @@
|
||||
set TZData(:Africa/El_Aaiun) {
|
||||
{-9223372036854775808 -3168 0 LMT}
|
||||
{-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}
|
||||
{1212278400 3600 1 WEST}
|
||||
{1220223600 0 0 WET}
|
||||
{1243814400 3600 1 WEST}
|
||||
{1250809200 0 0 WET}
|
||||
{1272758400 3600 1 WEST}
|
||||
{1281222000 0 0 WET}
|
||||
{1301788800 3600 1 WEST}
|
||||
{1312066800 0 0 WET}
|
||||
{1335664800 3600 1 WEST}
|
||||
{1342749600 0 0 WET}
|
||||
{1345428000 3600 1 WEST}
|
||||
{1348970400 0 0 WET}
|
||||
{1367114400 3600 1 WEST}
|
||||
{1373162400 0 0 WET}
|
||||
{1376100000 3600 1 WEST}
|
||||
{1382839200 0 0 WET}
|
||||
{1396144800 3600 1 WEST}
|
||||
{1403920800 0 0 WET}
|
||||
{1406944800 3600 1 WEST}
|
||||
{1414288800 0 0 WET}
|
||||
{1427594400 3600 1 WEST}
|
||||
{1434247200 0 0 WET}
|
||||
{1437271200 3600 1 WEST}
|
||||
{1445738400 0 0 WET}
|
||||
{1459044000 3600 1 WEST}
|
||||
{1465092000 0 0 WET}
|
||||
{1468116000 3600 1 WEST}
|
||||
{1477792800 0 0 WET}
|
||||
{1490493600 3600 1 WEST}
|
||||
{1495332000 0 0 WET}
|
||||
{1498960800 3600 1 WEST}
|
||||
{1509242400 0 0 WET}
|
||||
{1521943200 3600 1 WEST}
|
||||
{1526176800 0 0 WET}
|
||||
{1529200800 3600 1 WEST}
|
||||
{1540692000 0 0 WET}
|
||||
{1553997600 3600 1 WEST}
|
||||
{1557021600 0 0 WET}
|
||||
{1560045600 3600 1 WEST}
|
||||
{1572141600 0 0 WET}
|
||||
{1585447200 3600 1 WEST}
|
||||
{1587261600 0 0 WET}
|
||||
{1590285600 3600 1 WEST}
|
||||
{1603591200 0 0 WET}
|
||||
{1616896800 3600 1 WEST}
|
||||
{1618106400 0 0 WET}
|
||||
{1621130400 3600 1 WEST}
|
||||
{1635645600 0 0 WET}
|
||||
{1651975200 3600 1 WEST}
|
||||
{1667095200 0 0 WET}
|
||||
{1682215200 3600 1 WEST}
|
||||
{1698544800 0 0 WET}
|
||||
{1713060000 3600 1 WEST}
|
||||
{1729994400 0 0 WET}
|
||||
{1743904800 3600 1 WEST}
|
||||
{1761444000 0 0 WET}
|
||||
{1774749600 3600 1 WEST}
|
||||
{1792893600 0 0 WET}
|
||||
{1806199200 3600 1 WEST}
|
||||
{1824948000 0 0 WET}
|
||||
{1837648800 3600 1 WEST}
|
||||
{1856397600 0 0 WET}
|
||||
{1869098400 3600 1 WEST}
|
||||
{1887847200 0 0 WET}
|
||||
{1901152800 3600 1 WEST}
|
||||
{1919296800 0 0 WET}
|
||||
{1932602400 3600 1 WEST}
|
||||
{1950746400 0 0 WET}
|
||||
{1964052000 3600 1 WEST}
|
||||
{1982800800 0 0 WET}
|
||||
{1995501600 3600 1 WEST}
|
||||
{2014250400 0 0 WET}
|
||||
{2026951200 3600 1 WEST}
|
||||
{2045700000 0 0 WET}
|
||||
{2058400800 3600 1 WEST}
|
||||
{2077149600 0 0 WET}
|
||||
{2090455200 3600 1 WEST}
|
||||
{2107994400 0 0 WET}
|
||||
{2108602800 0 0 WET}
|
||||
{2121904800 3600 1 WEST}
|
||||
{2138234400 0 0 WET}
|
||||
{2140052400 0 0 WET}
|
||||
{2153354400 3600 1 WEST}
|
||||
{2172103200 0 0 WET}
|
||||
{2184804000 3600 1 WEST}
|
||||
{2203552800 0 0 WET}
|
||||
{2216253600 3600 1 WEST}
|
||||
{2235002400 0 0 WET}
|
||||
{2248308000 3600 1 WEST}
|
||||
{2266452000 0 0 WET}
|
||||
{2279757600 3600 1 WEST}
|
||||
{2297901600 0 0 WET}
|
||||
{2311207200 3600 1 WEST}
|
||||
{2329351200 0 0 WET}
|
||||
{2342656800 3600 1 WEST}
|
||||
{2361405600 0 0 WET}
|
||||
{2374106400 3600 1 WEST}
|
||||
{2392855200 0 0 WET}
|
||||
{2405556000 3600 1 WEST}
|
||||
{2424304800 0 0 WET}
|
||||
{2437610400 3600 1 WEST}
|
||||
{2455754400 0 0 WET}
|
||||
{2469060000 3600 1 WEST}
|
||||
{2487204000 0 0 WET}
|
||||
{2500509600 3600 1 WEST}
|
||||
{2519258400 0 0 WET}
|
||||
{2531959200 3600 1 WEST}
|
||||
{2550708000 0 0 WET}
|
||||
{2563408800 3600 1 WEST}
|
||||
{2582157600 0 0 WET}
|
||||
{2595463200 3600 1 WEST}
|
||||
{2613607200 0 0 WET}
|
||||
{2626912800 3600 1 WEST}
|
||||
{2645056800 0 0 WET}
|
||||
{2658362400 3600 1 WEST}
|
||||
{2676506400 0 0 WET}
|
||||
{2689812000 3600 1 WEST}
|
||||
{2708560800 0 0 WET}
|
||||
{2721261600 3600 1 WEST}
|
||||
{2740010400 0 0 WET}
|
||||
{2752711200 3600 1 WEST}
|
||||
{2771460000 0 0 WET}
|
||||
{2784765600 3600 1 WEST}
|
||||
{2802909600 0 0 WET}
|
||||
{2816215200 3600 1 WEST}
|
||||
{2834359200 0 0 WET}
|
||||
{2847664800 3600 1 WEST}
|
||||
{2866413600 0 0 WET}
|
||||
{2879114400 3600 1 WEST}
|
||||
{2897863200 0 0 WET}
|
||||
{2910564000 3600 1 WEST}
|
||||
{2929312800 0 0 WET}
|
||||
{2942013600 3600 1 WEST}
|
||||
{2960762400 0 0 WET}
|
||||
{2974068000 3600 1 WEST}
|
||||
{2992212000 0 0 WET}
|
||||
{3005517600 3600 1 WEST}
|
||||
{3023661600 0 0 WET}
|
||||
{3036967200 3600 1 WEST}
|
||||
{3055716000 0 0 WET}
|
||||
{3068416800 3600 1 WEST}
|
||||
{3087165600 0 0 WET}
|
||||
{3099866400 3600 1 WEST}
|
||||
{3118615200 0 0 WET}
|
||||
{3131920800 3600 1 WEST}
|
||||
{3150064800 0 0 WET}
|
||||
{3163370400 3600 1 WEST}
|
||||
{3181514400 0 0 WET}
|
||||
{3194820000 3600 1 WEST}
|
||||
{3212964000 0 0 WET}
|
||||
{3226269600 3600 1 WEST}
|
||||
{3245018400 0 0 WET}
|
||||
{3257719200 3600 1 WEST}
|
||||
{3276468000 0 0 WET}
|
||||
{3289168800 3600 1 WEST}
|
||||
{3307917600 0 0 WET}
|
||||
{3321223200 3600 1 WEST}
|
||||
{3339367200 0 0 WET}
|
||||
{3352672800 3600 1 WEST}
|
||||
{3370816800 0 0 WET}
|
||||
{3384122400 3600 1 WEST}
|
||||
{3402871200 0 0 WET}
|
||||
{3415572000 3600 1 WEST}
|
||||
{3434320800 0 0 WET}
|
||||
{3447021600 3600 1 WEST}
|
||||
{3465770400 0 0 WET}
|
||||
{3479076000 3600 1 WEST}
|
||||
{3497220000 0 0 WET}
|
||||
{3510525600 3600 1 WEST}
|
||||
{3528669600 0 0 WET}
|
||||
{3541975200 3600 1 WEST}
|
||||
{3560119200 0 0 WET}
|
||||
{3573424800 3600 1 WEST}
|
||||
{3592173600 0 0 WET}
|
||||
{3604874400 3600 1 WEST}
|
||||
{3623623200 0 0 WET}
|
||||
{3636324000 3600 1 WEST}
|
||||
{3655072800 0 0 WET}
|
||||
{3668378400 3600 1 WEST}
|
||||
{3686522400 0 0 WET}
|
||||
{3699828000 3600 1 WEST}
|
||||
{3717972000 0 0 WET}
|
||||
{3731277600 3600 1 WEST}
|
||||
{3750026400 0 0 WET}
|
||||
{3762727200 3600 1 WEST}
|
||||
{3781476000 0 0 WET}
|
||||
{3794176800 3600 1 WEST}
|
||||
{3812925600 0 0 WET}
|
||||
{3825626400 3600 1 WEST}
|
||||
{3844375200 0 0 WET}
|
||||
{3857680800 3600 1 WEST}
|
||||
{3875824800 0 0 WET}
|
||||
{3889130400 3600 1 WEST}
|
||||
{3907274400 0 0 WET}
|
||||
{3920580000 3600 1 WEST}
|
||||
{3939328800 0 0 WET}
|
||||
{3952029600 3600 1 WEST}
|
||||
{3970778400 0 0 WET}
|
||||
{3983479200 3600 1 WEST}
|
||||
{4002228000 0 0 WET}
|
||||
{4015533600 3600 1 WEST}
|
||||
{4033677600 0 0 WET}
|
||||
{4046983200 3600 1 WEST}
|
||||
{4065127200 0 0 WET}
|
||||
{4078432800 3600 1 WEST}
|
||||
{4096576800 0 0 WET}
|
||||
{198291600 0 0 +00}
|
||||
{199756800 3600 1 +00}
|
||||
{207702000 0 0 +00}
|
||||
{231292800 3600 1 +00}
|
||||
{244249200 0 0 +00}
|
||||
{265507200 3600 1 +00}
|
||||
{271033200 0 0 +00}
|
||||
{1212278400 3600 1 +00}
|
||||
{1220223600 0 0 +00}
|
||||
{1243814400 3600 1 +00}
|
||||
{1250809200 0 0 +00}
|
||||
{1272758400 3600 1 +00}
|
||||
{1281222000 0 0 +00}
|
||||
{1301788800 3600 1 +00}
|
||||
{1312066800 0 0 +00}
|
||||
{1335664800 3600 1 +00}
|
||||
{1342749600 0 0 +00}
|
||||
{1345428000 3600 1 +00}
|
||||
{1348970400 0 0 +00}
|
||||
{1367114400 3600 1 +00}
|
||||
{1373162400 0 0 +00}
|
||||
{1376100000 3600 1 +00}
|
||||
{1382839200 0 0 +00}
|
||||
{1396144800 3600 1 +00}
|
||||
{1403920800 0 0 +00}
|
||||
{1406944800 3600 1 +00}
|
||||
{1414288800 0 0 +00}
|
||||
{1427594400 3600 1 +00}
|
||||
{1434247200 0 0 +00}
|
||||
{1437271200 3600 1 +00}
|
||||
{1445738400 0 0 +00}
|
||||
{1459044000 3600 1 +00}
|
||||
{1465092000 0 0 +00}
|
||||
{1468116000 3600 1 +00}
|
||||
{1477792800 0 0 +00}
|
||||
{1490493600 3600 1 +00}
|
||||
{1495332000 0 0 +00}
|
||||
{1498960800 3600 1 +00}
|
||||
{1509242400 0 0 +00}
|
||||
{1521943200 3600 1 +00}
|
||||
{1526176800 0 0 +00}
|
||||
{1529200800 3600 1 +00}
|
||||
{1540695600 3600 0 +01}
|
||||
{1557021600 0 1 +01}
|
||||
{1560045600 3600 0 +01}
|
||||
{1587261600 0 1 +01}
|
||||
{1590285600 3600 0 +01}
|
||||
{1618106400 0 1 +01}
|
||||
{1621130400 3600 0 +01}
|
||||
{1648346400 0 1 +01}
|
||||
{1651975200 3600 0 +01}
|
||||
{1679191200 0 1 +01}
|
||||
{1682215200 3600 0 +01}
|
||||
{1710036000 0 1 +01}
|
||||
{1713060000 3600 0 +01}
|
||||
{1740276000 0 1 +01}
|
||||
{1743904800 3600 0 +01}
|
||||
{1771120800 0 1 +01}
|
||||
{1774144800 3600 0 +01}
|
||||
{1801965600 0 1 +01}
|
||||
{1804989600 3600 0 +01}
|
||||
{1832205600 0 1 +01}
|
||||
{1835229600 3600 0 +01}
|
||||
{1863050400 0 1 +01}
|
||||
{1866074400 3600 0 +01}
|
||||
{1893290400 0 1 +01}
|
||||
{1896919200 3600 0 +01}
|
||||
{1924135200 0 1 +01}
|
||||
{1927159200 3600 0 +01}
|
||||
{1954980000 0 1 +01}
|
||||
{1958004000 3600 0 +01}
|
||||
{1985220000 0 1 +01}
|
||||
{1988848800 3600 0 +01}
|
||||
{2016064800 0 1 +01}
|
||||
{2019088800 3600 0 +01}
|
||||
{2046304800 0 1 +01}
|
||||
{2049933600 3600 0 +01}
|
||||
{2077149600 0 1 +01}
|
||||
{2080173600 3600 0 +01}
|
||||
{2107994400 0 1 +01}
|
||||
{2111018400 3600 0 +01}
|
||||
{2138234400 0 1 +01}
|
||||
{2141863200 3600 0 +01}
|
||||
}
|
||||
|
||||
@@ -5,4 +5,5 @@ set TZData(:Africa/Sao_Tome) {
|
||||
{-2713912016 -2205 0 LMT}
|
||||
{-1830384000 0 0 GMT}
|
||||
{1514768400 3600 0 WAT}
|
||||
{1546304400 0 0 GMT}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ set TZData(:America/Metlakatla) {
|
||||
{1489316400 -28800 1 AKDT}
|
||||
{1509876000 -32400 0 AKST}
|
||||
{1520766000 -28800 1 AKDT}
|
||||
{1541325600 -32400 0 AKST}
|
||||
{1541329200 -28800 0 PST}
|
||||
{1547978400 -32400 0 AKST}
|
||||
{1552215600 -28800 1 AKDT}
|
||||
{1572775200 -32400 0 AKST}
|
||||
{1583665200 -28800 1 AKDT}
|
||||
|
||||
+162
-162
@@ -124,166 +124,166 @@ set TZData(:America/Santiago) {
|
||||
{1502596800 -10800 1 -04}
|
||||
{1526180400 -14400 0 -04}
|
||||
{1534046400 -10800 1 -04}
|
||||
{1557630000 -14400 0 -04}
|
||||
{1565496000 -10800 1 -04}
|
||||
{1589079600 -14400 0 -04}
|
||||
{1596945600 -10800 1 -04}
|
||||
{1620529200 -14400 0 -04}
|
||||
{1629000000 -10800 1 -04}
|
||||
{1652583600 -14400 0 -04}
|
||||
{1660449600 -10800 1 -04}
|
||||
{1684033200 -14400 0 -04}
|
||||
{1691899200 -10800 1 -04}
|
||||
{1715482800 -14400 0 -04}
|
||||
{1723348800 -10800 1 -04}
|
||||
{1746932400 -14400 0 -04}
|
||||
{1754798400 -10800 1 -04}
|
||||
{1778382000 -14400 0 -04}
|
||||
{1786248000 -10800 1 -04}
|
||||
{1809831600 -14400 0 -04}
|
||||
{1818302400 -10800 1 -04}
|
||||
{1841886000 -14400 0 -04}
|
||||
{1849752000 -10800 1 -04}
|
||||
{1873335600 -14400 0 -04}
|
||||
{1881201600 -10800 1 -04}
|
||||
{1904785200 -14400 0 -04}
|
||||
{1912651200 -10800 1 -04}
|
||||
{1936234800 -14400 0 -04}
|
||||
{1944100800 -10800 1 -04}
|
||||
{1967684400 -14400 0 -04}
|
||||
{1976155200 -10800 1 -04}
|
||||
{1999738800 -14400 0 -04}
|
||||
{2007604800 -10800 1 -04}
|
||||
{2031188400 -14400 0 -04}
|
||||
{2039054400 -10800 1 -04}
|
||||
{2062638000 -14400 0 -04}
|
||||
{2070504000 -10800 1 -04}
|
||||
{2094087600 -14400 0 -04}
|
||||
{2101953600 -10800 1 -04}
|
||||
{2125537200 -14400 0 -04}
|
||||
{2133403200 -10800 1 -04}
|
||||
{2156986800 -14400 0 -04}
|
||||
{2165457600 -10800 1 -04}
|
||||
{2189041200 -14400 0 -04}
|
||||
{2196907200 -10800 1 -04}
|
||||
{2220490800 -14400 0 -04}
|
||||
{2228356800 -10800 1 -04}
|
||||
{2251940400 -14400 0 -04}
|
||||
{2259806400 -10800 1 -04}
|
||||
{2283390000 -14400 0 -04}
|
||||
{2291256000 -10800 1 -04}
|
||||
{2314839600 -14400 0 -04}
|
||||
{2322705600 -10800 1 -04}
|
||||
{2346894000 -14400 0 -04}
|
||||
{2354760000 -10800 1 -04}
|
||||
{2378343600 -14400 0 -04}
|
||||
{2386209600 -10800 1 -04}
|
||||
{2409793200 -14400 0 -04}
|
||||
{2417659200 -10800 1 -04}
|
||||
{2441242800 -14400 0 -04}
|
||||
{2449108800 -10800 1 -04}
|
||||
{2472692400 -14400 0 -04}
|
||||
{2480558400 -10800 1 -04}
|
||||
{2504142000 -14400 0 -04}
|
||||
{2512612800 -10800 1 -04}
|
||||
{2536196400 -14400 0 -04}
|
||||
{2544062400 -10800 1 -04}
|
||||
{2567646000 -14400 0 -04}
|
||||
{2575512000 -10800 1 -04}
|
||||
{2599095600 -14400 0 -04}
|
||||
{2606961600 -10800 1 -04}
|
||||
{2630545200 -14400 0 -04}
|
||||
{2638411200 -10800 1 -04}
|
||||
{2661994800 -14400 0 -04}
|
||||
{2669860800 -10800 1 -04}
|
||||
{2693444400 -14400 0 -04}
|
||||
{2701915200 -10800 1 -04}
|
||||
{2725498800 -14400 0 -04}
|
||||
{2733364800 -10800 1 -04}
|
||||
{2756948400 -14400 0 -04}
|
||||
{2764814400 -10800 1 -04}
|
||||
{2788398000 -14400 0 -04}
|
||||
{2796264000 -10800 1 -04}
|
||||
{2819847600 -14400 0 -04}
|
||||
{2827713600 -10800 1 -04}
|
||||
{2851297200 -14400 0 -04}
|
||||
{2859768000 -10800 1 -04}
|
||||
{2883351600 -14400 0 -04}
|
||||
{2891217600 -10800 1 -04}
|
||||
{2914801200 -14400 0 -04}
|
||||
{2922667200 -10800 1 -04}
|
||||
{2946250800 -14400 0 -04}
|
||||
{2954116800 -10800 1 -04}
|
||||
{2977700400 -14400 0 -04}
|
||||
{2985566400 -10800 1 -04}
|
||||
{3009150000 -14400 0 -04}
|
||||
{3017016000 -10800 1 -04}
|
||||
{3040599600 -14400 0 -04}
|
||||
{3049070400 -10800 1 -04}
|
||||
{3072654000 -14400 0 -04}
|
||||
{3080520000 -10800 1 -04}
|
||||
{3104103600 -14400 0 -04}
|
||||
{3111969600 -10800 1 -04}
|
||||
{3135553200 -14400 0 -04}
|
||||
{3143419200 -10800 1 -04}
|
||||
{3167002800 -14400 0 -04}
|
||||
{3174868800 -10800 1 -04}
|
||||
{3198452400 -14400 0 -04}
|
||||
{3206318400 -10800 1 -04}
|
||||
{3230506800 -14400 0 -04}
|
||||
{3238372800 -10800 1 -04}
|
||||
{3261956400 -14400 0 -04}
|
||||
{3269822400 -10800 1 -04}
|
||||
{3293406000 -14400 0 -04}
|
||||
{3301272000 -10800 1 -04}
|
||||
{3324855600 -14400 0 -04}
|
||||
{3332721600 -10800 1 -04}
|
||||
{3356305200 -14400 0 -04}
|
||||
{3364171200 -10800 1 -04}
|
||||
{3387754800 -14400 0 -04}
|
||||
{3396225600 -10800 1 -04}
|
||||
{3419809200 -14400 0 -04}
|
||||
{3427675200 -10800 1 -04}
|
||||
{3451258800 -14400 0 -04}
|
||||
{3459124800 -10800 1 -04}
|
||||
{3482708400 -14400 0 -04}
|
||||
{3490574400 -10800 1 -04}
|
||||
{3514158000 -14400 0 -04}
|
||||
{3522024000 -10800 1 -04}
|
||||
{3545607600 -14400 0 -04}
|
||||
{3553473600 -10800 1 -04}
|
||||
{3577057200 -14400 0 -04}
|
||||
{3585528000 -10800 1 -04}
|
||||
{3609111600 -14400 0 -04}
|
||||
{3616977600 -10800 1 -04}
|
||||
{3640561200 -14400 0 -04}
|
||||
{3648427200 -10800 1 -04}
|
||||
{3672010800 -14400 0 -04}
|
||||
{3679876800 -10800 1 -04}
|
||||
{3703460400 -14400 0 -04}
|
||||
{3711326400 -10800 1 -04}
|
||||
{3734910000 -14400 0 -04}
|
||||
{3743380800 -10800 1 -04}
|
||||
{3766964400 -14400 0 -04}
|
||||
{3774830400 -10800 1 -04}
|
||||
{3798414000 -14400 0 -04}
|
||||
{3806280000 -10800 1 -04}
|
||||
{3829863600 -14400 0 -04}
|
||||
{3837729600 -10800 1 -04}
|
||||
{3861313200 -14400 0 -04}
|
||||
{3869179200 -10800 1 -04}
|
||||
{3892762800 -14400 0 -04}
|
||||
{3900628800 -10800 1 -04}
|
||||
{3924212400 -14400 0 -04}
|
||||
{3932683200 -10800 1 -04}
|
||||
{3956266800 -14400 0 -04}
|
||||
{3964132800 -10800 1 -04}
|
||||
{3987716400 -14400 0 -04}
|
||||
{3995582400 -10800 1 -04}
|
||||
{4019166000 -14400 0 -04}
|
||||
{4027032000 -10800 1 -04}
|
||||
{4050615600 -14400 0 -04}
|
||||
{4058481600 -10800 1 -04}
|
||||
{4082065200 -14400 0 -04}
|
||||
{4089931200 -10800 1 -04}
|
||||
{1554606000 -14400 0 -04}
|
||||
{1567915200 -10800 1 -04}
|
||||
{1586055600 -14400 0 -04}
|
||||
{1599364800 -10800 1 -04}
|
||||
{1617505200 -14400 0 -04}
|
||||
{1630814400 -10800 1 -04}
|
||||
{1648954800 -14400 0 -04}
|
||||
{1662264000 -10800 1 -04}
|
||||
{1680404400 -14400 0 -04}
|
||||
{1693713600 -10800 1 -04}
|
||||
{1712458800 -14400 0 -04}
|
||||
{1725768000 -10800 1 -04}
|
||||
{1743908400 -14400 0 -04}
|
||||
{1757217600 -10800 1 -04}
|
||||
{1775358000 -14400 0 -04}
|
||||
{1788667200 -10800 1 -04}
|
||||
{1806807600 -14400 0 -04}
|
||||
{1820116800 -10800 1 -04}
|
||||
{1838257200 -14400 0 -04}
|
||||
{1851566400 -10800 1 -04}
|
||||
{1870311600 -14400 0 -04}
|
||||
{1883016000 -10800 1 -04}
|
||||
{1901761200 -14400 0 -04}
|
||||
{1915070400 -10800 1 -04}
|
||||
{1933210800 -14400 0 -04}
|
||||
{1946520000 -10800 1 -04}
|
||||
{1964660400 -14400 0 -04}
|
||||
{1977969600 -10800 1 -04}
|
||||
{1996110000 -14400 0 -04}
|
||||
{2009419200 -10800 1 -04}
|
||||
{2027559600 -14400 0 -04}
|
||||
{2040868800 -10800 1 -04}
|
||||
{2059614000 -14400 0 -04}
|
||||
{2072318400 -10800 1 -04}
|
||||
{2091063600 -14400 0 -04}
|
||||
{2104372800 -10800 1 -04}
|
||||
{2122513200 -14400 0 -04}
|
||||
{2135822400 -10800 1 -04}
|
||||
{2153962800 -14400 0 -04}
|
||||
{2167272000 -10800 1 -04}
|
||||
{2185412400 -14400 0 -04}
|
||||
{2198721600 -10800 1 -04}
|
||||
{2217466800 -14400 0 -04}
|
||||
{2230171200 -10800 1 -04}
|
||||
{2248916400 -14400 0 -04}
|
||||
{2262225600 -10800 1 -04}
|
||||
{2280366000 -14400 0 -04}
|
||||
{2293675200 -10800 1 -04}
|
||||
{2311815600 -14400 0 -04}
|
||||
{2325124800 -10800 1 -04}
|
||||
{2343265200 -14400 0 -04}
|
||||
{2356574400 -10800 1 -04}
|
||||
{2374714800 -14400 0 -04}
|
||||
{2388024000 -10800 1 -04}
|
||||
{2406769200 -14400 0 -04}
|
||||
{2419473600 -10800 1 -04}
|
||||
{2438218800 -14400 0 -04}
|
||||
{2451528000 -10800 1 -04}
|
||||
{2469668400 -14400 0 -04}
|
||||
{2482977600 -10800 1 -04}
|
||||
{2501118000 -14400 0 -04}
|
||||
{2514427200 -10800 1 -04}
|
||||
{2532567600 -14400 0 -04}
|
||||
{2545876800 -10800 1 -04}
|
||||
{2564017200 -14400 0 -04}
|
||||
{2577326400 -10800 1 -04}
|
||||
{2596071600 -14400 0 -04}
|
||||
{2609380800 -10800 1 -04}
|
||||
{2627521200 -14400 0 -04}
|
||||
{2640830400 -10800 1 -04}
|
||||
{2658970800 -14400 0 -04}
|
||||
{2672280000 -10800 1 -04}
|
||||
{2690420400 -14400 0 -04}
|
||||
{2703729600 -10800 1 -04}
|
||||
{2721870000 -14400 0 -04}
|
||||
{2735179200 -10800 1 -04}
|
||||
{2753924400 -14400 0 -04}
|
||||
{2766628800 -10800 1 -04}
|
||||
{2785374000 -14400 0 -04}
|
||||
{2798683200 -10800 1 -04}
|
||||
{2816823600 -14400 0 -04}
|
||||
{2830132800 -10800 1 -04}
|
||||
{2848273200 -14400 0 -04}
|
||||
{2861582400 -10800 1 -04}
|
||||
{2879722800 -14400 0 -04}
|
||||
{2893032000 -10800 1 -04}
|
||||
{2911172400 -14400 0 -04}
|
||||
{2924481600 -10800 1 -04}
|
||||
{2943226800 -14400 0 -04}
|
||||
{2955931200 -10800 1 -04}
|
||||
{2974676400 -14400 0 -04}
|
||||
{2987985600 -10800 1 -04}
|
||||
{3006126000 -14400 0 -04}
|
||||
{3019435200 -10800 1 -04}
|
||||
{3037575600 -14400 0 -04}
|
||||
{3050884800 -10800 1 -04}
|
||||
{3069025200 -14400 0 -04}
|
||||
{3082334400 -10800 1 -04}
|
||||
{3101079600 -14400 0 -04}
|
||||
{3113784000 -10800 1 -04}
|
||||
{3132529200 -14400 0 -04}
|
||||
{3145838400 -10800 1 -04}
|
||||
{3163978800 -14400 0 -04}
|
||||
{3177288000 -10800 1 -04}
|
||||
{3195428400 -14400 0 -04}
|
||||
{3208737600 -10800 1 -04}
|
||||
{3226878000 -14400 0 -04}
|
||||
{3240187200 -10800 1 -04}
|
||||
{3258327600 -14400 0 -04}
|
||||
{3271636800 -10800 1 -04}
|
||||
{3290382000 -14400 0 -04}
|
||||
{3303086400 -10800 1 -04}
|
||||
{3321831600 -14400 0 -04}
|
||||
{3335140800 -10800 1 -04}
|
||||
{3353281200 -14400 0 -04}
|
||||
{3366590400 -10800 1 -04}
|
||||
{3384730800 -14400 0 -04}
|
||||
{3398040000 -10800 1 -04}
|
||||
{3416180400 -14400 0 -04}
|
||||
{3429489600 -10800 1 -04}
|
||||
{3447630000 -14400 0 -04}
|
||||
{3460939200 -10800 1 -04}
|
||||
{3479684400 -14400 0 -04}
|
||||
{3492993600 -10800 1 -04}
|
||||
{3511134000 -14400 0 -04}
|
||||
{3524443200 -10800 1 -04}
|
||||
{3542583600 -14400 0 -04}
|
||||
{3555892800 -10800 1 -04}
|
||||
{3574033200 -14400 0 -04}
|
||||
{3587342400 -10800 1 -04}
|
||||
{3605482800 -14400 0 -04}
|
||||
{3618792000 -10800 1 -04}
|
||||
{3637537200 -14400 0 -04}
|
||||
{3650241600 -10800 1 -04}
|
||||
{3668986800 -14400 0 -04}
|
||||
{3682296000 -10800 1 -04}
|
||||
{3700436400 -14400 0 -04}
|
||||
{3713745600 -10800 1 -04}
|
||||
{3731886000 -14400 0 -04}
|
||||
{3745195200 -10800 1 -04}
|
||||
{3763335600 -14400 0 -04}
|
||||
{3776644800 -10800 1 -04}
|
||||
{3794785200 -14400 0 -04}
|
||||
{3808094400 -10800 1 -04}
|
||||
{3826839600 -14400 0 -04}
|
||||
{3839544000 -10800 1 -04}
|
||||
{3858289200 -14400 0 -04}
|
||||
{3871598400 -10800 1 -04}
|
||||
{3889738800 -14400 0 -04}
|
||||
{3903048000 -10800 1 -04}
|
||||
{3921188400 -14400 0 -04}
|
||||
{3934497600 -10800 1 -04}
|
||||
{3952638000 -14400 0 -04}
|
||||
{3965947200 -10800 1 -04}
|
||||
{3984692400 -14400 0 -04}
|
||||
{3997396800 -10800 1 -04}
|
||||
{4016142000 -14400 0 -04}
|
||||
{4029451200 -10800 1 -04}
|
||||
{4047591600 -14400 0 -04}
|
||||
{4060900800 -10800 1 -04}
|
||||
{4079041200 -14400 0 -04}
|
||||
{4092350400 -10800 1 -04}
|
||||
}
|
||||
|
||||
+28
-24
@@ -40,6 +40,10 @@ set TZData(:Asia/Gaza) {
|
||||
{150843600 7200 0 IST}
|
||||
{167176800 10800 1 IDT}
|
||||
{178664400 7200 0 IST}
|
||||
{334015200 10800 1 IDT}
|
||||
{337644000 7200 0 IST}
|
||||
{452556000 10800 1 IDT}
|
||||
{462232800 7200 0 IST}
|
||||
{482277600 10800 1 IDT}
|
||||
{495579600 7200 0 IST}
|
||||
{516751200 10800 1 IDT}
|
||||
@@ -113,7 +117,7 @@ set TZData(:Asia/Gaza) {
|
||||
{1509141600 7200 0 EET}
|
||||
{1521846000 10800 1 EEST}
|
||||
{1540591200 7200 0 EET}
|
||||
{1553295600 10800 1 EEST}
|
||||
{1553900400 10800 1 EEST}
|
||||
{1572040800 7200 0 EET}
|
||||
{1585350000 10800 1 EEST}
|
||||
{1604095200 7200 0 EET}
|
||||
@@ -123,9 +127,9 @@ set TZData(:Asia/Gaza) {
|
||||
{1666994400 7200 0 EET}
|
||||
{1679698800 10800 1 EEST}
|
||||
{1698444000 7200 0 EET}
|
||||
{1711148400 10800 1 EEST}
|
||||
{1711753200 10800 1 EEST}
|
||||
{1729893600 7200 0 EET}
|
||||
{1742598000 10800 1 EEST}
|
||||
{1743202800 10800 1 EEST}
|
||||
{1761343200 7200 0 EET}
|
||||
{1774652400 10800 1 EEST}
|
||||
{1793397600 7200 0 EET}
|
||||
@@ -135,9 +139,9 @@ set TZData(:Asia/Gaza) {
|
||||
{1856296800 7200 0 EET}
|
||||
{1869001200 10800 1 EEST}
|
||||
{1887746400 7200 0 EET}
|
||||
{1900450800 10800 1 EEST}
|
||||
{1901055600 10800 1 EEST}
|
||||
{1919196000 7200 0 EET}
|
||||
{1931900400 10800 1 EEST}
|
||||
{1932505200 10800 1 EEST}
|
||||
{1950645600 7200 0 EET}
|
||||
{1963954800 10800 1 EEST}
|
||||
{1982700000 7200 0 EET}
|
||||
@@ -147,7 +151,7 @@ set TZData(:Asia/Gaza) {
|
||||
{2045599200 7200 0 EET}
|
||||
{2058303600 10800 1 EEST}
|
||||
{2077048800 7200 0 EET}
|
||||
{2089753200 10800 1 EEST}
|
||||
{2090358000 10800 1 EEST}
|
||||
{2108498400 7200 0 EET}
|
||||
{2121807600 10800 1 EEST}
|
||||
{2140552800 7200 0 EET}
|
||||
@@ -157,9 +161,9 @@ set TZData(:Asia/Gaza) {
|
||||
{2203452000 7200 0 EET}
|
||||
{2216156400 10800 1 EEST}
|
||||
{2234901600 7200 0 EET}
|
||||
{2247606000 10800 1 EEST}
|
||||
{2248210800 10800 1 EEST}
|
||||
{2266351200 7200 0 EET}
|
||||
{2279055600 10800 1 EEST}
|
||||
{2279660400 10800 1 EEST}
|
||||
{2297800800 7200 0 EET}
|
||||
{2311110000 10800 1 EEST}
|
||||
{2329855200 7200 0 EET}
|
||||
@@ -169,7 +173,7 @@ set TZData(:Asia/Gaza) {
|
||||
{2392754400 7200 0 EET}
|
||||
{2405458800 10800 1 EEST}
|
||||
{2424204000 7200 0 EET}
|
||||
{2436908400 10800 1 EEST}
|
||||
{2437513200 10800 1 EEST}
|
||||
{2455653600 7200 0 EET}
|
||||
{2468962800 10800 1 EEST}
|
||||
{2487708000 7200 0 EET}
|
||||
@@ -179,9 +183,9 @@ set TZData(:Asia/Gaza) {
|
||||
{2550607200 7200 0 EET}
|
||||
{2563311600 10800 1 EEST}
|
||||
{2582056800 7200 0 EET}
|
||||
{2594761200 10800 1 EEST}
|
||||
{2595366000 10800 1 EEST}
|
||||
{2613506400 7200 0 EET}
|
||||
{2626210800 10800 1 EEST}
|
||||
{2626815600 10800 1 EEST}
|
||||
{2644956000 7200 0 EET}
|
||||
{2658265200 10800 1 EEST}
|
||||
{2677010400 7200 0 EET}
|
||||
@@ -191,9 +195,9 @@ set TZData(:Asia/Gaza) {
|
||||
{2739909600 7200 0 EET}
|
||||
{2752614000 10800 1 EEST}
|
||||
{2771359200 7200 0 EET}
|
||||
{2784063600 10800 1 EEST}
|
||||
{2784668400 10800 1 EEST}
|
||||
{2802808800 7200 0 EET}
|
||||
{2815513200 10800 1 EEST}
|
||||
{2816118000 10800 1 EEST}
|
||||
{2834258400 7200 0 EET}
|
||||
{2847567600 10800 1 EEST}
|
||||
{2866312800 7200 0 EET}
|
||||
@@ -203,7 +207,7 @@ set TZData(:Asia/Gaza) {
|
||||
{2929212000 7200 0 EET}
|
||||
{2941916400 10800 1 EEST}
|
||||
{2960661600 7200 0 EET}
|
||||
{2973366000 10800 1 EEST}
|
||||
{2973970800 10800 1 EEST}
|
||||
{2992111200 7200 0 EET}
|
||||
{3005420400 10800 1 EEST}
|
||||
{3024165600 7200 0 EET}
|
||||
@@ -213,9 +217,9 @@ set TZData(:Asia/Gaza) {
|
||||
{3087064800 7200 0 EET}
|
||||
{3099769200 10800 1 EEST}
|
||||
{3118514400 7200 0 EET}
|
||||
{3131218800 10800 1 EEST}
|
||||
{3131823600 10800 1 EEST}
|
||||
{3149964000 7200 0 EET}
|
||||
{3162668400 10800 1 EEST}
|
||||
{3163273200 10800 1 EEST}
|
||||
{3181413600 7200 0 EET}
|
||||
{3194722800 10800 1 EEST}
|
||||
{3213468000 7200 0 EET}
|
||||
@@ -225,7 +229,7 @@ set TZData(:Asia/Gaza) {
|
||||
{3276367200 7200 0 EET}
|
||||
{3289071600 10800 1 EEST}
|
||||
{3307816800 7200 0 EET}
|
||||
{3320521200 10800 1 EEST}
|
||||
{3321126000 10800 1 EEST}
|
||||
{3339266400 7200 0 EET}
|
||||
{3352575600 10800 1 EEST}
|
||||
{3371320800 7200 0 EET}
|
||||
@@ -235,9 +239,9 @@ set TZData(:Asia/Gaza) {
|
||||
{3434220000 7200 0 EET}
|
||||
{3446924400 10800 1 EEST}
|
||||
{3465669600 7200 0 EET}
|
||||
{3478374000 10800 1 EEST}
|
||||
{3478978800 10800 1 EEST}
|
||||
{3497119200 7200 0 EET}
|
||||
{3509823600 10800 1 EEST}
|
||||
{3510428400 10800 1 EEST}
|
||||
{3528568800 7200 0 EET}
|
||||
{3541878000 10800 1 EEST}
|
||||
{3560623200 7200 0 EET}
|
||||
@@ -247,9 +251,9 @@ set TZData(:Asia/Gaza) {
|
||||
{3623522400 7200 0 EET}
|
||||
{3636226800 10800 1 EEST}
|
||||
{3654972000 7200 0 EET}
|
||||
{3667676400 10800 1 EEST}
|
||||
{3668281200 10800 1 EEST}
|
||||
{3686421600 7200 0 EET}
|
||||
{3699126000 10800 1 EEST}
|
||||
{3699730800 10800 1 EEST}
|
||||
{3717871200 7200 0 EET}
|
||||
{3731180400 10800 1 EEST}
|
||||
{3749925600 7200 0 EET}
|
||||
@@ -259,7 +263,7 @@ set TZData(:Asia/Gaza) {
|
||||
{3812824800 7200 0 EET}
|
||||
{3825529200 10800 1 EEST}
|
||||
{3844274400 7200 0 EET}
|
||||
{3856978800 10800 1 EEST}
|
||||
{3857583600 10800 1 EEST}
|
||||
{3875724000 7200 0 EET}
|
||||
{3889033200 10800 1 EEST}
|
||||
{3907778400 7200 0 EET}
|
||||
@@ -269,9 +273,9 @@ set TZData(:Asia/Gaza) {
|
||||
{3970677600 7200 0 EET}
|
||||
{3983382000 10800 1 EEST}
|
||||
{4002127200 7200 0 EET}
|
||||
{4014831600 10800 1 EEST}
|
||||
{4015436400 10800 1 EEST}
|
||||
{4033576800 7200 0 EET}
|
||||
{4046281200 10800 1 EEST}
|
||||
{4046886000 10800 1 EEST}
|
||||
{4065026400 7200 0 EET}
|
||||
{4078335600 10800 1 EEST}
|
||||
{4097080800 7200 0 EET}
|
||||
|
||||
+28
-24
@@ -40,6 +40,10 @@ set TZData(:Asia/Hebron) {
|
||||
{150843600 7200 0 IST}
|
||||
{167176800 10800 1 IDT}
|
||||
{178664400 7200 0 IST}
|
||||
{334015200 10800 1 IDT}
|
||||
{337644000 7200 0 IST}
|
||||
{452556000 10800 1 IDT}
|
||||
{462232800 7200 0 IST}
|
||||
{482277600 10800 1 IDT}
|
||||
{495579600 7200 0 IST}
|
||||
{516751200 10800 1 IDT}
|
||||
@@ -112,7 +116,7 @@ set TZData(:Asia/Hebron) {
|
||||
{1509141600 7200 0 EET}
|
||||
{1521846000 10800 1 EEST}
|
||||
{1540591200 7200 0 EET}
|
||||
{1553295600 10800 1 EEST}
|
||||
{1553900400 10800 1 EEST}
|
||||
{1572040800 7200 0 EET}
|
||||
{1585350000 10800 1 EEST}
|
||||
{1604095200 7200 0 EET}
|
||||
@@ -122,9 +126,9 @@ set TZData(:Asia/Hebron) {
|
||||
{1666994400 7200 0 EET}
|
||||
{1679698800 10800 1 EEST}
|
||||
{1698444000 7200 0 EET}
|
||||
{1711148400 10800 1 EEST}
|
||||
{1711753200 10800 1 EEST}
|
||||
{1729893600 7200 0 EET}
|
||||
{1742598000 10800 1 EEST}
|
||||
{1743202800 10800 1 EEST}
|
||||
{1761343200 7200 0 EET}
|
||||
{1774652400 10800 1 EEST}
|
||||
{1793397600 7200 0 EET}
|
||||
@@ -134,9 +138,9 @@ set TZData(:Asia/Hebron) {
|
||||
{1856296800 7200 0 EET}
|
||||
{1869001200 10800 1 EEST}
|
||||
{1887746400 7200 0 EET}
|
||||
{1900450800 10800 1 EEST}
|
||||
{1901055600 10800 1 EEST}
|
||||
{1919196000 7200 0 EET}
|
||||
{1931900400 10800 1 EEST}
|
||||
{1932505200 10800 1 EEST}
|
||||
{1950645600 7200 0 EET}
|
||||
{1963954800 10800 1 EEST}
|
||||
{1982700000 7200 0 EET}
|
||||
@@ -146,7 +150,7 @@ set TZData(:Asia/Hebron) {
|
||||
{2045599200 7200 0 EET}
|
||||
{2058303600 10800 1 EEST}
|
||||
{2077048800 7200 0 EET}
|
||||
{2089753200 10800 1 EEST}
|
||||
{2090358000 10800 1 EEST}
|
||||
{2108498400 7200 0 EET}
|
||||
{2121807600 10800 1 EEST}
|
||||
{2140552800 7200 0 EET}
|
||||
@@ -156,9 +160,9 @@ set TZData(:Asia/Hebron) {
|
||||
{2203452000 7200 0 EET}
|
||||
{2216156400 10800 1 EEST}
|
||||
{2234901600 7200 0 EET}
|
||||
{2247606000 10800 1 EEST}
|
||||
{2248210800 10800 1 EEST}
|
||||
{2266351200 7200 0 EET}
|
||||
{2279055600 10800 1 EEST}
|
||||
{2279660400 10800 1 EEST}
|
||||
{2297800800 7200 0 EET}
|
||||
{2311110000 10800 1 EEST}
|
||||
{2329855200 7200 0 EET}
|
||||
@@ -168,7 +172,7 @@ set TZData(:Asia/Hebron) {
|
||||
{2392754400 7200 0 EET}
|
||||
{2405458800 10800 1 EEST}
|
||||
{2424204000 7200 0 EET}
|
||||
{2436908400 10800 1 EEST}
|
||||
{2437513200 10800 1 EEST}
|
||||
{2455653600 7200 0 EET}
|
||||
{2468962800 10800 1 EEST}
|
||||
{2487708000 7200 0 EET}
|
||||
@@ -178,9 +182,9 @@ set TZData(:Asia/Hebron) {
|
||||
{2550607200 7200 0 EET}
|
||||
{2563311600 10800 1 EEST}
|
||||
{2582056800 7200 0 EET}
|
||||
{2594761200 10800 1 EEST}
|
||||
{2595366000 10800 1 EEST}
|
||||
{2613506400 7200 0 EET}
|
||||
{2626210800 10800 1 EEST}
|
||||
{2626815600 10800 1 EEST}
|
||||
{2644956000 7200 0 EET}
|
||||
{2658265200 10800 1 EEST}
|
||||
{2677010400 7200 0 EET}
|
||||
@@ -190,9 +194,9 @@ set TZData(:Asia/Hebron) {
|
||||
{2739909600 7200 0 EET}
|
||||
{2752614000 10800 1 EEST}
|
||||
{2771359200 7200 0 EET}
|
||||
{2784063600 10800 1 EEST}
|
||||
{2784668400 10800 1 EEST}
|
||||
{2802808800 7200 0 EET}
|
||||
{2815513200 10800 1 EEST}
|
||||
{2816118000 10800 1 EEST}
|
||||
{2834258400 7200 0 EET}
|
||||
{2847567600 10800 1 EEST}
|
||||
{2866312800 7200 0 EET}
|
||||
@@ -202,7 +206,7 @@ set TZData(:Asia/Hebron) {
|
||||
{2929212000 7200 0 EET}
|
||||
{2941916400 10800 1 EEST}
|
||||
{2960661600 7200 0 EET}
|
||||
{2973366000 10800 1 EEST}
|
||||
{2973970800 10800 1 EEST}
|
||||
{2992111200 7200 0 EET}
|
||||
{3005420400 10800 1 EEST}
|
||||
{3024165600 7200 0 EET}
|
||||
@@ -212,9 +216,9 @@ set TZData(:Asia/Hebron) {
|
||||
{3087064800 7200 0 EET}
|
||||
{3099769200 10800 1 EEST}
|
||||
{3118514400 7200 0 EET}
|
||||
{3131218800 10800 1 EEST}
|
||||
{3131823600 10800 1 EEST}
|
||||
{3149964000 7200 0 EET}
|
||||
{3162668400 10800 1 EEST}
|
||||
{3163273200 10800 1 EEST}
|
||||
{3181413600 7200 0 EET}
|
||||
{3194722800 10800 1 EEST}
|
||||
{3213468000 7200 0 EET}
|
||||
@@ -224,7 +228,7 @@ set TZData(:Asia/Hebron) {
|
||||
{3276367200 7200 0 EET}
|
||||
{3289071600 10800 1 EEST}
|
||||
{3307816800 7200 0 EET}
|
||||
{3320521200 10800 1 EEST}
|
||||
{3321126000 10800 1 EEST}
|
||||
{3339266400 7200 0 EET}
|
||||
{3352575600 10800 1 EEST}
|
||||
{3371320800 7200 0 EET}
|
||||
@@ -234,9 +238,9 @@ set TZData(:Asia/Hebron) {
|
||||
{3434220000 7200 0 EET}
|
||||
{3446924400 10800 1 EEST}
|
||||
{3465669600 7200 0 EET}
|
||||
{3478374000 10800 1 EEST}
|
||||
{3478978800 10800 1 EEST}
|
||||
{3497119200 7200 0 EET}
|
||||
{3509823600 10800 1 EEST}
|
||||
{3510428400 10800 1 EEST}
|
||||
{3528568800 7200 0 EET}
|
||||
{3541878000 10800 1 EEST}
|
||||
{3560623200 7200 0 EET}
|
||||
@@ -246,9 +250,9 @@ set TZData(:Asia/Hebron) {
|
||||
{3623522400 7200 0 EET}
|
||||
{3636226800 10800 1 EEST}
|
||||
{3654972000 7200 0 EET}
|
||||
{3667676400 10800 1 EEST}
|
||||
{3668281200 10800 1 EEST}
|
||||
{3686421600 7200 0 EET}
|
||||
{3699126000 10800 1 EEST}
|
||||
{3699730800 10800 1 EEST}
|
||||
{3717871200 7200 0 EET}
|
||||
{3731180400 10800 1 EEST}
|
||||
{3749925600 7200 0 EET}
|
||||
@@ -258,7 +262,7 @@ set TZData(:Asia/Hebron) {
|
||||
{3812824800 7200 0 EET}
|
||||
{3825529200 10800 1 EEST}
|
||||
{3844274400 7200 0 EET}
|
||||
{3856978800 10800 1 EEST}
|
||||
{3857583600 10800 1 EEST}
|
||||
{3875724000 7200 0 EET}
|
||||
{3889033200 10800 1 EEST}
|
||||
{3907778400 7200 0 EET}
|
||||
@@ -268,9 +272,9 @@ set TZData(:Asia/Hebron) {
|
||||
{3970677600 7200 0 EET}
|
||||
{3983382000 10800 1 EEST}
|
||||
{4002127200 7200 0 EET}
|
||||
{4014831600 10800 1 EEST}
|
||||
{4015436400 10800 1 EEST}
|
||||
{4033576800 7200 0 EET}
|
||||
{4046281200 10800 1 EEST}
|
||||
{4046886000 10800 1 EEST}
|
||||
{4065026400 7200 0 EET}
|
||||
{4078335600 10800 1 EEST}
|
||||
{4097080800 7200 0 EET}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
set TZData(:Asia/Hong_Kong) {
|
||||
{-9223372036854775808 27402 0 LMT}
|
||||
{-2056693002 28800 0 HKT}
|
||||
{-907389000 32400 1 HKST}
|
||||
{-891667800 28800 0 HKT}
|
||||
{-884246400 32400 0 JST}
|
||||
{-766746000 28800 0 HKT}
|
||||
{-2056690800 28800 0 HKT}
|
||||
{-900909000 32400 1 HKST}
|
||||
{-891579600 30600 0 HKT}
|
||||
{-884248200 32400 0 JST}
|
||||
{-766659600 28800 0 HKT}
|
||||
{-747981000 32400 1 HKST}
|
||||
{-728544600 28800 0 HKT}
|
||||
{-717049800 32400 1 HKST}
|
||||
@@ -20,7 +20,7 @@ set TZData(:Asia/Hong_Kong) {
|
||||
{-591856200 32400 1 HKST}
|
||||
{-573715800 28800 0 HKT}
|
||||
{-559801800 32400 1 HKST}
|
||||
{-542352600 28800 0 HKT}
|
||||
{-541661400 28800 0 HKT}
|
||||
{-528352200 32400 1 HKST}
|
||||
{-510211800 28800 0 HKT}
|
||||
{-498112200 32400 1 HKST}
|
||||
|
||||
@@ -39,6 +39,10 @@ set TZData(:Asia/Jerusalem) {
|
||||
{150843600 7200 0 IST}
|
||||
{167176800 10800 1 IDT}
|
||||
{178664400 7200 0 IST}
|
||||
{334015200 10800 1 IDT}
|
||||
{337644000 7200 0 IST}
|
||||
{452556000 10800 1 IDT}
|
||||
{462232800 7200 0 IST}
|
||||
{482277600 10800 1 IDT}
|
||||
{495579600 7200 0 IST}
|
||||
{516751200 10800 1 IDT}
|
||||
|
||||
+49
-19
@@ -1,20 +1,56 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Macau) {
|
||||
{-9223372036854775808 27260 0 LMT}
|
||||
{-1830412800 28800 0 CST}
|
||||
{-9223372036854775808 27250 0 LMT}
|
||||
{-2056692850 28800 0 CST}
|
||||
{-884509200 32400 0 +09}
|
||||
{-873280800 36000 1 +09}
|
||||
{-855918000 32400 0 +09}
|
||||
{-841744800 36000 1 +09}
|
||||
{-828529200 32400 0 +10}
|
||||
{-765363600 28800 0 CT}
|
||||
{-747046800 32400 1 CDT}
|
||||
{-733827600 28800 0 CST}
|
||||
{-716461200 32400 1 CDT}
|
||||
{-697021200 28800 0 CST}
|
||||
{-683715600 32400 1 CDT}
|
||||
{-667990800 28800 0 CST}
|
||||
{-654771600 32400 1 CDT}
|
||||
{-636627600 28800 0 CST}
|
||||
{-623322000 32400 1 CDT}
|
||||
{-605178000 28800 0 CST}
|
||||
{-591872400 32400 1 CDT}
|
||||
{-573642000 28800 0 CST}
|
||||
{-559818000 32400 1 CDT}
|
||||
{-541674000 28800 0 CST}
|
||||
{-528368400 32400 1 CDT}
|
||||
{-510224400 28800 0 CST}
|
||||
{-498128400 32400 1 CDT}
|
||||
{-478774800 28800 0 CST}
|
||||
{-466678800 32400 1 CDT}
|
||||
{-446720400 28800 0 CST}
|
||||
{-435229200 32400 1 CDT}
|
||||
{-415258200 28800 0 CST}
|
||||
{-403158600 32400 1 CDT}
|
||||
{-383808600 28800 0 CST}
|
||||
{-371709000 32400 1 CDT}
|
||||
{-352359000 28800 0 CST}
|
||||
{-340259400 32400 1 CDT}
|
||||
{-320909400 28800 0 CST}
|
||||
{-308809800 32400 1 CDT}
|
||||
{-288855000 28800 0 CST}
|
||||
{-277360200 32400 1 CDT}
|
||||
{-257405400 28800 0 CST}
|
||||
{-245910600 32400 1 CDT}
|
||||
{-225955800 28800 0 CST}
|
||||
{-214473600 32400 1 CDT}
|
||||
{-213856200 32400 1 CDT}
|
||||
{-194506200 28800 0 CST}
|
||||
{-182406600 32400 1 CDT}
|
||||
{-163056600 28800 0 CST}
|
||||
{-150969600 32400 1 CDT}
|
||||
{-131619600 28800 0 CST}
|
||||
{-148537800 32400 1 CDT}
|
||||
{-132820200 28800 0 CST}
|
||||
{-117088200 32400 1 CDT}
|
||||
{-101367000 28800 0 CST}
|
||||
{-101370600 28800 0 CST}
|
||||
{-85638600 32400 1 CDT}
|
||||
{-69312600 28800 0 CST}
|
||||
{-53584200 32400 1 CDT}
|
||||
@@ -25,22 +61,16 @@ set TZData(:Asia/Macau) {
|
||||
{25036200 28800 0 CST}
|
||||
{40764600 32400 1 CDT}
|
||||
{56485800 28800 0 CST}
|
||||
{72201600 32400 1 CDT}
|
||||
{87922800 28800 0 CST}
|
||||
{103651200 32400 1 CDT}
|
||||
{119977200 28800 0 CST}
|
||||
{135705600 32400 1 CDT}
|
||||
{72214200 32400 1 CDT}
|
||||
{88540200 28800 0 CST}
|
||||
{104268600 32400 1 CDT}
|
||||
{119989800 28800 0 CST}
|
||||
{126041400 32400 1 CDT}
|
||||
{151439400 28800 0 CST}
|
||||
{167167800 32400 1 CDT}
|
||||
{182889000 28800 0 CST}
|
||||
{198617400 32400 1 CDT}
|
||||
{214338600 28800 0 CST}
|
||||
{230067000 32400 1 CDT}
|
||||
{245788200 28800 0 CST}
|
||||
{261504000 32400 1 CDT}
|
||||
{277225200 28800 0 CST}
|
||||
{292953600 32400 1 CDT}
|
||||
{309279600 28800 0 CST}
|
||||
{325008000 32400 1 CDT}
|
||||
{340729200 28800 0 CST}
|
||||
{295385400 32400 1 CDT}
|
||||
{309292200 28800 0 CST}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
set TZData(:Asia/Manila) {
|
||||
{-9223372036854775808 -57360 0 LMT}
|
||||
{-3944621040 29040 0 LMT}
|
||||
{-2229321840 28800 0 +08}
|
||||
{-1046678400 32400 1 +08}
|
||||
{-1038733200 28800 0 +08}
|
||||
{-873273600 32400 0 +09}
|
||||
{-794221200 28800 0 +08}
|
||||
{-496224000 32400 1 +08}
|
||||
{-489315600 28800 0 +08}
|
||||
{259344000 32400 1 +08}
|
||||
{275151600 28800 0 +08}
|
||||
{-2229321840 28800 0 PST}
|
||||
{-1046678400 32400 1 PDT}
|
||||
{-1038733200 28800 0 PST}
|
||||
{-873273600 32400 0 JST}
|
||||
{-794221200 28800 0 PST}
|
||||
{-496224000 32400 1 PDT}
|
||||
{-489315600 28800 0 PST}
|
||||
{259344000 32400 1 PDT}
|
||||
{275151600 28800 0 PST}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ set TZData(:Asia/Pyongyang) {
|
||||
{-1830414600 32400 0 JST}
|
||||
{-768646800 32400 0 KST}
|
||||
{1439564400 30600 0 KST}
|
||||
{1525447800 32400 0 KST}
|
||||
{1525446000 32400 0 KST}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Qostanay) {
|
||||
{-9223372036854775808 15268 0 LMT}
|
||||
{-1441167268 14400 0 +04}
|
||||
{-1247544000 18000 0 +05}
|
||||
{354913200 21600 1 +06}
|
||||
{370720800 21600 0 +06}
|
||||
{386445600 18000 0 +05}
|
||||
{386449200 21600 1 +05}
|
||||
{402256800 18000 0 +05}
|
||||
{417985200 21600 1 +05}
|
||||
{433792800 18000 0 +05}
|
||||
{449607600 21600 1 +05}
|
||||
{465339600 18000 0 +05}
|
||||
{481064400 21600 1 +05}
|
||||
{496789200 18000 0 +05}
|
||||
{512514000 21600 1 +05}
|
||||
{528238800 18000 0 +05}
|
||||
{543963600 21600 1 +05}
|
||||
{559688400 18000 0 +05}
|
||||
{575413200 21600 1 +05}
|
||||
{591138000 18000 0 +05}
|
||||
{606862800 21600 1 +05}
|
||||
{622587600 18000 0 +05}
|
||||
{638312400 21600 1 +05}
|
||||
{654642000 18000 0 +05}
|
||||
{670366800 14400 0 +04}
|
||||
{670370400 18000 1 +04}
|
||||
{686095200 14400 0 +04}
|
||||
{695772000 18000 0 +05}
|
||||
{701816400 21600 1 +05}
|
||||
{717541200 18000 0 +05}
|
||||
{733266000 21600 1 +05}
|
||||
{748990800 18000 0 +05}
|
||||
{764715600 21600 1 +05}
|
||||
{780440400 18000 0 +05}
|
||||
{796165200 21600 1 +05}
|
||||
{811890000 18000 0 +05}
|
||||
{828219600 21600 1 +05}
|
||||
{846363600 18000 0 +05}
|
||||
{859669200 21600 1 +05}
|
||||
{877813200 18000 0 +05}
|
||||
{891118800 21600 1 +05}
|
||||
{909262800 18000 0 +05}
|
||||
{922568400 21600 1 +05}
|
||||
{941317200 18000 0 +05}
|
||||
{954018000 21600 1 +05}
|
||||
{972766800 18000 0 +05}
|
||||
{985467600 21600 1 +05}
|
||||
{1004216400 18000 0 +05}
|
||||
{1017522000 21600 1 +05}
|
||||
{1035666000 18000 0 +05}
|
||||
{1048971600 21600 1 +05}
|
||||
{1067115600 18000 0 +05}
|
||||
{1080421200 21600 1 +05}
|
||||
{1099170000 21600 0 +06}
|
||||
}
|
||||
@@ -54,4 +54,5 @@ set TZData(:Asia/Qyzylorda) {
|
||||
{1067115600 18000 0 +05}
|
||||
{1080421200 21600 1 +05}
|
||||
{1099170000 21600 0 +06}
|
||||
{1545328800 18000 0 +05}
|
||||
}
|
||||
|
||||
@@ -3,21 +3,30 @@
|
||||
set TZData(:Asia/Shanghai) {
|
||||
{-9223372036854775808 29143 0 LMT}
|
||||
{-2177481943 28800 0 CST}
|
||||
{-933494400 32400 1 CDT}
|
||||
{-923130000 28800 0 CST}
|
||||
{-908784000 32400 1 CDT}
|
||||
{-891594000 28800 0 CST}
|
||||
{-662716800 28800 0 CST}
|
||||
{515520000 32400 1 CDT}
|
||||
{527007600 28800 0 CST}
|
||||
{545155200 32400 1 CDT}
|
||||
{558457200 28800 0 CST}
|
||||
{576604800 32400 1 CDT}
|
||||
{589906800 28800 0 CST}
|
||||
{608659200 32400 1 CDT}
|
||||
{621961200 28800 0 CST}
|
||||
{640108800 32400 1 CDT}
|
||||
{653410800 28800 0 CST}
|
||||
{671558400 32400 1 CDT}
|
||||
{684860400 28800 0 CST}
|
||||
{-933667200 32400 1 CDT}
|
||||
{-922093200 28800 0 CST}
|
||||
{-908870400 32400 1 CDT}
|
||||
{-888829200 28800 0 CST}
|
||||
{-881049600 32400 1 CDT}
|
||||
{-767869200 28800 0 CST}
|
||||
{-745833600 32400 1 CDT}
|
||||
{-733827600 28800 0 CST}
|
||||
{-716889600 32400 1 CDT}
|
||||
{-699613200 28800 0 CST}
|
||||
{-683884800 32400 1 CDT}
|
||||
{-670669200 28800 0 CST}
|
||||
{-652348800 32400 1 CDT}
|
||||
{-650016000 28800 0 CST}
|
||||
{515527200 32400 1 CDT}
|
||||
{527014800 28800 0 CST}
|
||||
{545162400 32400 1 CDT}
|
||||
{558464400 28800 0 CST}
|
||||
{577216800 32400 1 CDT}
|
||||
{589914000 28800 0 CST}
|
||||
{608666400 32400 1 CDT}
|
||||
{621968400 28800 0 CST}
|
||||
{640116000 32400 1 CDT}
|
||||
{653418000 28800 0 CST}
|
||||
{671565600 32400 1 CDT}
|
||||
{684867600 28800 0 CST}
|
||||
}
|
||||
|
||||
+38
-38
@@ -102,106 +102,106 @@ set TZData(:Asia/Tehran) {
|
||||
{2105551800 12600 0 +0330}
|
||||
{2121193800 16200 1 +0330}
|
||||
{2137087800 12600 0 +0330}
|
||||
{2152729800 16200 1 +0330}
|
||||
{2168623800 12600 0 +0330}
|
||||
{2184265800 16200 1 +0330}
|
||||
{2200159800 12600 0 +0330}
|
||||
{2152816200 16200 1 +0330}
|
||||
{2168710200 12600 0 +0330}
|
||||
{2184352200 16200 1 +0330}
|
||||
{2200246200 12600 0 +0330}
|
||||
{2215888200 16200 1 +0330}
|
||||
{2231782200 12600 0 +0330}
|
||||
{2247424200 16200 1 +0330}
|
||||
{2263318200 12600 0 +0330}
|
||||
{2278960200 16200 1 +0330}
|
||||
{2294854200 12600 0 +0330}
|
||||
{2310496200 16200 1 +0330}
|
||||
{2326390200 12600 0 +0330}
|
||||
{2279046600 16200 1 +0330}
|
||||
{2294940600 12600 0 +0330}
|
||||
{2310582600 16200 1 +0330}
|
||||
{2326476600 12600 0 +0330}
|
||||
{2342118600 16200 1 +0330}
|
||||
{2358012600 12600 0 +0330}
|
||||
{2373654600 16200 1 +0330}
|
||||
{2389548600 12600 0 +0330}
|
||||
{2405190600 16200 1 +0330}
|
||||
{2421084600 12600 0 +0330}
|
||||
{2436726600 16200 1 +0330}
|
||||
{2452620600 12600 0 +0330}
|
||||
{2405277000 16200 1 +0330}
|
||||
{2421171000 12600 0 +0330}
|
||||
{2436813000 16200 1 +0330}
|
||||
{2452707000 12600 0 +0330}
|
||||
{2468349000 16200 1 +0330}
|
||||
{2484243000 12600 0 +0330}
|
||||
{2499885000 16200 1 +0330}
|
||||
{2515779000 12600 0 +0330}
|
||||
{2531421000 16200 1 +0330}
|
||||
{2547315000 12600 0 +0330}
|
||||
{2562957000 16200 1 +0330}
|
||||
{2578851000 12600 0 +0330}
|
||||
{2531507400 16200 1 +0330}
|
||||
{2547401400 12600 0 +0330}
|
||||
{2563043400 16200 1 +0330}
|
||||
{2578937400 12600 0 +0330}
|
||||
{2594579400 16200 1 +0330}
|
||||
{2610473400 12600 0 +0330}
|
||||
{2626115400 16200 1 +0330}
|
||||
{2642009400 12600 0 +0330}
|
||||
{2657651400 16200 1 +0330}
|
||||
{2673545400 12600 0 +0330}
|
||||
{2689187400 16200 1 +0330}
|
||||
{2705081400 12600 0 +0330}
|
||||
{2657737800 16200 1 +0330}
|
||||
{2673631800 12600 0 +0330}
|
||||
{2689273800 16200 1 +0330}
|
||||
{2705167800 12600 0 +0330}
|
||||
{2720809800 16200 1 +0330}
|
||||
{2736703800 12600 0 +0330}
|
||||
{2752345800 16200 1 +0330}
|
||||
{2768239800 12600 0 +0330}
|
||||
{2783881800 16200 1 +0330}
|
||||
{2799775800 12600 0 +0330}
|
||||
{2815417800 16200 1 +0330}
|
||||
{2831311800 12600 0 +0330}
|
||||
{2783968200 16200 1 +0330}
|
||||
{2799862200 12600 0 +0330}
|
||||
{2815504200 16200 1 +0330}
|
||||
{2831398200 12600 0 +0330}
|
||||
{2847040200 16200 1 +0330}
|
||||
{2862934200 12600 0 +0330}
|
||||
{2878576200 16200 1 +0330}
|
||||
{2894470200 12600 0 +0330}
|
||||
{2910112200 16200 1 +0330}
|
||||
{2926006200 12600 0 +0330}
|
||||
{2941648200 16200 1 +0330}
|
||||
{2957542200 12600 0 +0330}
|
||||
{2941734600 16200 1 +0330}
|
||||
{2957628600 12600 0 +0330}
|
||||
{2973270600 16200 1 +0330}
|
||||
{2989164600 12600 0 +0330}
|
||||
{3004806600 16200 1 +0330}
|
||||
{3020700600 12600 0 +0330}
|
||||
{3036342600 16200 1 +0330}
|
||||
{3052236600 12600 0 +0330}
|
||||
{3067878600 16200 1 +0330}
|
||||
{3083772600 12600 0 +0330}
|
||||
{3067965000 16200 1 +0330}
|
||||
{3083859000 12600 0 +0330}
|
||||
{3099501000 16200 1 +0330}
|
||||
{3115395000 12600 0 +0330}
|
||||
{3131037000 16200 1 +0330}
|
||||
{3146931000 12600 0 +0330}
|
||||
{3162573000 16200 1 +0330}
|
||||
{3178467000 12600 0 +0330}
|
||||
{3194109000 16200 1 +0330}
|
||||
{3210003000 12600 0 +0330}
|
||||
{3194195400 16200 1 +0330}
|
||||
{3210089400 12600 0 +0330}
|
||||
{3225731400 16200 1 +0330}
|
||||
{3241625400 12600 0 +0330}
|
||||
{3257267400 16200 1 +0330}
|
||||
{3273161400 12600 0 +0330}
|
||||
{3288803400 16200 1 +0330}
|
||||
{3304697400 12600 0 +0330}
|
||||
{3320339400 16200 1 +0330}
|
||||
{3336233400 12600 0 +0330}
|
||||
{3320425800 16200 1 +0330}
|
||||
{3336319800 12600 0 +0330}
|
||||
{3351961800 16200 1 +0330}
|
||||
{3367855800 12600 0 +0330}
|
||||
{3383497800 16200 1 +0330}
|
||||
{3399391800 12600 0 +0330}
|
||||
{3415033800 16200 1 +0330}
|
||||
{3430927800 12600 0 +0330}
|
||||
{3446569800 16200 1 +0330}
|
||||
{3462463800 12600 0 +0330}
|
||||
{3446656200 16200 1 +0330}
|
||||
{3462550200 12600 0 +0330}
|
||||
{3478192200 16200 1 +0330}
|
||||
{3494086200 12600 0 +0330}
|
||||
{3509728200 16200 1 +0330}
|
||||
{3525622200 12600 0 +0330}
|
||||
{3541264200 16200 1 +0330}
|
||||
{3557158200 12600 0 +0330}
|
||||
{3572800200 16200 1 +0330}
|
||||
{3588694200 12600 0 +0330}
|
||||
{3572886600 16200 1 +0330}
|
||||
{3588780600 12600 0 +0330}
|
||||
{3604422600 16200 1 +0330}
|
||||
{3620316600 12600 0 +0330}
|
||||
{3635958600 16200 1 +0330}
|
||||
{3651852600 12600 0 +0330}
|
||||
{3667494600 16200 1 +0330}
|
||||
{3683388600 12600 0 +0330}
|
||||
{3699030600 16200 1 +0330}
|
||||
{3714924600 12600 0 +0330}
|
||||
{3699117000 16200 1 +0330}
|
||||
{3715011000 12600 0 +0330}
|
||||
{3730653000 16200 1 +0330}
|
||||
{3746547000 12600 0 +0330}
|
||||
{3762189000 16200 1 +0330}
|
||||
|
||||
@@ -4,11 +4,11 @@ set TZData(:Asia/Tokyo) {
|
||||
{-9223372036854775808 33539 0 LMT}
|
||||
{-2587712400 32400 0 JST}
|
||||
{-683802000 36000 1 JDT}
|
||||
{-672314400 32400 0 JST}
|
||||
{-672310800 32400 0 JST}
|
||||
{-654771600 36000 1 JDT}
|
||||
{-640864800 32400 0 JST}
|
||||
{-640861200 32400 0 JST}
|
||||
{-620298000 36000 1 JDT}
|
||||
{-609415200 32400 0 JST}
|
||||
{-609411600 32400 0 JST}
|
||||
{-588848400 36000 1 JDT}
|
||||
{-577965600 32400 0 JST}
|
||||
{-577962000 32400 0 JST}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Etc/UCT) {
|
||||
{-9223372036854775808 0 0 UCT}
|
||||
if {![info exists TZData(Etc/UTC)]} {
|
||||
LoadTimeZoneFile Etc/UTC
|
||||
}
|
||||
set TZData(:Etc/UCT) $TZData(:Etc/UTC)
|
||||
|
||||
@@ -68,4 +68,5 @@ set TZData(:Europe/Volgograd) {
|
||||
{1288479600 10800 0 +03}
|
||||
{1301180400 14400 0 +04}
|
||||
{1414274400 10800 0 +03}
|
||||
{1540681200 14400 0 +04}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Pacific/Chuuk) {
|
||||
{-9223372036854775808 36428 0 LMT}
|
||||
{-9223372036854775808 -49972 0 LMT}
|
||||
{-3944628428 36428 0 LMT}
|
||||
{-2177489228 36000 0 +10}
|
||||
{-1743674400 32400 0 +09}
|
||||
{-1606813200 36000 0 +10}
|
||||
{-907408800 32400 0 +09}
|
||||
{-770634000 36000 0 +10}
|
||||
}
|
||||
|
||||
+162
-162
@@ -103,166 +103,166 @@ set TZData(:Pacific/Easter) {
|
||||
{1502596800 -18000 1 -06}
|
||||
{1526180400 -21600 0 -06}
|
||||
{1534046400 -18000 1 -06}
|
||||
{1557630000 -21600 0 -06}
|
||||
{1565496000 -18000 1 -06}
|
||||
{1589079600 -21600 0 -06}
|
||||
{1596945600 -18000 1 -06}
|
||||
{1620529200 -21600 0 -06}
|
||||
{1629000000 -18000 1 -06}
|
||||
{1652583600 -21600 0 -06}
|
||||
{1660449600 -18000 1 -06}
|
||||
{1684033200 -21600 0 -06}
|
||||
{1691899200 -18000 1 -06}
|
||||
{1715482800 -21600 0 -06}
|
||||
{1723348800 -18000 1 -06}
|
||||
{1746932400 -21600 0 -06}
|
||||
{1754798400 -18000 1 -06}
|
||||
{1778382000 -21600 0 -06}
|
||||
{1786248000 -18000 1 -06}
|
||||
{1809831600 -21600 0 -06}
|
||||
{1818302400 -18000 1 -06}
|
||||
{1841886000 -21600 0 -06}
|
||||
{1849752000 -18000 1 -06}
|
||||
{1873335600 -21600 0 -06}
|
||||
{1881201600 -18000 1 -06}
|
||||
{1904785200 -21600 0 -06}
|
||||
{1912651200 -18000 1 -06}
|
||||
{1936234800 -21600 0 -06}
|
||||
{1944100800 -18000 1 -06}
|
||||
{1967684400 -21600 0 -06}
|
||||
{1976155200 -18000 1 -06}
|
||||
{1999738800 -21600 0 -06}
|
||||
{2007604800 -18000 1 -06}
|
||||
{2031188400 -21600 0 -06}
|
||||
{2039054400 -18000 1 -06}
|
||||
{2062638000 -21600 0 -06}
|
||||
{2070504000 -18000 1 -06}
|
||||
{2094087600 -21600 0 -06}
|
||||
{2101953600 -18000 1 -06}
|
||||
{2125537200 -21600 0 -06}
|
||||
{2133403200 -18000 1 -06}
|
||||
{2156986800 -21600 0 -06}
|
||||
{2165457600 -18000 1 -06}
|
||||
{2189041200 -21600 0 -06}
|
||||
{2196907200 -18000 1 -06}
|
||||
{2220490800 -21600 0 -06}
|
||||
{2228356800 -18000 1 -06}
|
||||
{2251940400 -21600 0 -06}
|
||||
{2259806400 -18000 1 -06}
|
||||
{2283390000 -21600 0 -06}
|
||||
{2291256000 -18000 1 -06}
|
||||
{2314839600 -21600 0 -06}
|
||||
{2322705600 -18000 1 -06}
|
||||
{2346894000 -21600 0 -06}
|
||||
{2354760000 -18000 1 -06}
|
||||
{2378343600 -21600 0 -06}
|
||||
{2386209600 -18000 1 -06}
|
||||
{2409793200 -21600 0 -06}
|
||||
{2417659200 -18000 1 -06}
|
||||
{2441242800 -21600 0 -06}
|
||||
{2449108800 -18000 1 -06}
|
||||
{2472692400 -21600 0 -06}
|
||||
{2480558400 -18000 1 -06}
|
||||
{2504142000 -21600 0 -06}
|
||||
{2512612800 -18000 1 -06}
|
||||
{2536196400 -21600 0 -06}
|
||||
{2544062400 -18000 1 -06}
|
||||
{2567646000 -21600 0 -06}
|
||||
{2575512000 -18000 1 -06}
|
||||
{2599095600 -21600 0 -06}
|
||||
{2606961600 -18000 1 -06}
|
||||
{2630545200 -21600 0 -06}
|
||||
{2638411200 -18000 1 -06}
|
||||
{2661994800 -21600 0 -06}
|
||||
{2669860800 -18000 1 -06}
|
||||
{2693444400 -21600 0 -06}
|
||||
{2701915200 -18000 1 -06}
|
||||
{2725498800 -21600 0 -06}
|
||||
{2733364800 -18000 1 -06}
|
||||
{2756948400 -21600 0 -06}
|
||||
{2764814400 -18000 1 -06}
|
||||
{2788398000 -21600 0 -06}
|
||||
{2796264000 -18000 1 -06}
|
||||
{2819847600 -21600 0 -06}
|
||||
{2827713600 -18000 1 -06}
|
||||
{2851297200 -21600 0 -06}
|
||||
{2859768000 -18000 1 -06}
|
||||
{2883351600 -21600 0 -06}
|
||||
{2891217600 -18000 1 -06}
|
||||
{2914801200 -21600 0 -06}
|
||||
{2922667200 -18000 1 -06}
|
||||
{2946250800 -21600 0 -06}
|
||||
{2954116800 -18000 1 -06}
|
||||
{2977700400 -21600 0 -06}
|
||||
{2985566400 -18000 1 -06}
|
||||
{3009150000 -21600 0 -06}
|
||||
{3017016000 -18000 1 -06}
|
||||
{3040599600 -21600 0 -06}
|
||||
{3049070400 -18000 1 -06}
|
||||
{3072654000 -21600 0 -06}
|
||||
{3080520000 -18000 1 -06}
|
||||
{3104103600 -21600 0 -06}
|
||||
{3111969600 -18000 1 -06}
|
||||
{3135553200 -21600 0 -06}
|
||||
{3143419200 -18000 1 -06}
|
||||
{3167002800 -21600 0 -06}
|
||||
{3174868800 -18000 1 -06}
|
||||
{3198452400 -21600 0 -06}
|
||||
{3206318400 -18000 1 -06}
|
||||
{3230506800 -21600 0 -06}
|
||||
{3238372800 -18000 1 -06}
|
||||
{3261956400 -21600 0 -06}
|
||||
{3269822400 -18000 1 -06}
|
||||
{3293406000 -21600 0 -06}
|
||||
{3301272000 -18000 1 -06}
|
||||
{3324855600 -21600 0 -06}
|
||||
{3332721600 -18000 1 -06}
|
||||
{3356305200 -21600 0 -06}
|
||||
{3364171200 -18000 1 -06}
|
||||
{3387754800 -21600 0 -06}
|
||||
{3396225600 -18000 1 -06}
|
||||
{3419809200 -21600 0 -06}
|
||||
{3427675200 -18000 1 -06}
|
||||
{3451258800 -21600 0 -06}
|
||||
{3459124800 -18000 1 -06}
|
||||
{3482708400 -21600 0 -06}
|
||||
{3490574400 -18000 1 -06}
|
||||
{3514158000 -21600 0 -06}
|
||||
{3522024000 -18000 1 -06}
|
||||
{3545607600 -21600 0 -06}
|
||||
{3553473600 -18000 1 -06}
|
||||
{3577057200 -21600 0 -06}
|
||||
{3585528000 -18000 1 -06}
|
||||
{3609111600 -21600 0 -06}
|
||||
{3616977600 -18000 1 -06}
|
||||
{3640561200 -21600 0 -06}
|
||||
{3648427200 -18000 1 -06}
|
||||
{3672010800 -21600 0 -06}
|
||||
{3679876800 -18000 1 -06}
|
||||
{3703460400 -21600 0 -06}
|
||||
{3711326400 -18000 1 -06}
|
||||
{3734910000 -21600 0 -06}
|
||||
{3743380800 -18000 1 -06}
|
||||
{3766964400 -21600 0 -06}
|
||||
{3774830400 -18000 1 -06}
|
||||
{3798414000 -21600 0 -06}
|
||||
{3806280000 -18000 1 -06}
|
||||
{3829863600 -21600 0 -06}
|
||||
{3837729600 -18000 1 -06}
|
||||
{3861313200 -21600 0 -06}
|
||||
{3869179200 -18000 1 -06}
|
||||
{3892762800 -21600 0 -06}
|
||||
{3900628800 -18000 1 -06}
|
||||
{3924212400 -21600 0 -06}
|
||||
{3932683200 -18000 1 -06}
|
||||
{3956266800 -21600 0 -06}
|
||||
{3964132800 -18000 1 -06}
|
||||
{3987716400 -21600 0 -06}
|
||||
{3995582400 -18000 1 -06}
|
||||
{4019166000 -21600 0 -06}
|
||||
{4027032000 -18000 1 -06}
|
||||
{4050615600 -21600 0 -06}
|
||||
{4058481600 -18000 1 -06}
|
||||
{4082065200 -21600 0 -06}
|
||||
{4089931200 -18000 1 -06}
|
||||
{1554606000 -21600 0 -06}
|
||||
{1567915200 -18000 1 -06}
|
||||
{1586055600 -21600 0 -06}
|
||||
{1599364800 -18000 1 -06}
|
||||
{1617505200 -21600 0 -06}
|
||||
{1630814400 -18000 1 -06}
|
||||
{1648954800 -21600 0 -06}
|
||||
{1662264000 -18000 1 -06}
|
||||
{1680404400 -21600 0 -06}
|
||||
{1693713600 -18000 1 -06}
|
||||
{1712458800 -21600 0 -06}
|
||||
{1725768000 -18000 1 -06}
|
||||
{1743908400 -21600 0 -06}
|
||||
{1757217600 -18000 1 -06}
|
||||
{1775358000 -21600 0 -06}
|
||||
{1788667200 -18000 1 -06}
|
||||
{1806807600 -21600 0 -06}
|
||||
{1820116800 -18000 1 -06}
|
||||
{1838257200 -21600 0 -06}
|
||||
{1851566400 -18000 1 -06}
|
||||
{1870311600 -21600 0 -06}
|
||||
{1883016000 -18000 1 -06}
|
||||
{1901761200 -21600 0 -06}
|
||||
{1915070400 -18000 1 -06}
|
||||
{1933210800 -21600 0 -06}
|
||||
{1946520000 -18000 1 -06}
|
||||
{1964660400 -21600 0 -06}
|
||||
{1977969600 -18000 1 -06}
|
||||
{1996110000 -21600 0 -06}
|
||||
{2009419200 -18000 1 -06}
|
||||
{2027559600 -21600 0 -06}
|
||||
{2040868800 -18000 1 -06}
|
||||
{2059614000 -21600 0 -06}
|
||||
{2072318400 -18000 1 -06}
|
||||
{2091063600 -21600 0 -06}
|
||||
{2104372800 -18000 1 -06}
|
||||
{2122513200 -21600 0 -06}
|
||||
{2135822400 -18000 1 -06}
|
||||
{2153962800 -21600 0 -06}
|
||||
{2167272000 -18000 1 -06}
|
||||
{2185412400 -21600 0 -06}
|
||||
{2198721600 -18000 1 -06}
|
||||
{2217466800 -21600 0 -06}
|
||||
{2230171200 -18000 1 -06}
|
||||
{2248916400 -21600 0 -06}
|
||||
{2262225600 -18000 1 -06}
|
||||
{2280366000 -21600 0 -06}
|
||||
{2293675200 -18000 1 -06}
|
||||
{2311815600 -21600 0 -06}
|
||||
{2325124800 -18000 1 -06}
|
||||
{2343265200 -21600 0 -06}
|
||||
{2356574400 -18000 1 -06}
|
||||
{2374714800 -21600 0 -06}
|
||||
{2388024000 -18000 1 -06}
|
||||
{2406769200 -21600 0 -06}
|
||||
{2419473600 -18000 1 -06}
|
||||
{2438218800 -21600 0 -06}
|
||||
{2451528000 -18000 1 -06}
|
||||
{2469668400 -21600 0 -06}
|
||||
{2482977600 -18000 1 -06}
|
||||
{2501118000 -21600 0 -06}
|
||||
{2514427200 -18000 1 -06}
|
||||
{2532567600 -21600 0 -06}
|
||||
{2545876800 -18000 1 -06}
|
||||
{2564017200 -21600 0 -06}
|
||||
{2577326400 -18000 1 -06}
|
||||
{2596071600 -21600 0 -06}
|
||||
{2609380800 -18000 1 -06}
|
||||
{2627521200 -21600 0 -06}
|
||||
{2640830400 -18000 1 -06}
|
||||
{2658970800 -21600 0 -06}
|
||||
{2672280000 -18000 1 -06}
|
||||
{2690420400 -21600 0 -06}
|
||||
{2703729600 -18000 1 -06}
|
||||
{2721870000 -21600 0 -06}
|
||||
{2735179200 -18000 1 -06}
|
||||
{2753924400 -21600 0 -06}
|
||||
{2766628800 -18000 1 -06}
|
||||
{2785374000 -21600 0 -06}
|
||||
{2798683200 -18000 1 -06}
|
||||
{2816823600 -21600 0 -06}
|
||||
{2830132800 -18000 1 -06}
|
||||
{2848273200 -21600 0 -06}
|
||||
{2861582400 -18000 1 -06}
|
||||
{2879722800 -21600 0 -06}
|
||||
{2893032000 -18000 1 -06}
|
||||
{2911172400 -21600 0 -06}
|
||||
{2924481600 -18000 1 -06}
|
||||
{2943226800 -21600 0 -06}
|
||||
{2955931200 -18000 1 -06}
|
||||
{2974676400 -21600 0 -06}
|
||||
{2987985600 -18000 1 -06}
|
||||
{3006126000 -21600 0 -06}
|
||||
{3019435200 -18000 1 -06}
|
||||
{3037575600 -21600 0 -06}
|
||||
{3050884800 -18000 1 -06}
|
||||
{3069025200 -21600 0 -06}
|
||||
{3082334400 -18000 1 -06}
|
||||
{3101079600 -21600 0 -06}
|
||||
{3113784000 -18000 1 -06}
|
||||
{3132529200 -21600 0 -06}
|
||||
{3145838400 -18000 1 -06}
|
||||
{3163978800 -21600 0 -06}
|
||||
{3177288000 -18000 1 -06}
|
||||
{3195428400 -21600 0 -06}
|
||||
{3208737600 -18000 1 -06}
|
||||
{3226878000 -21600 0 -06}
|
||||
{3240187200 -18000 1 -06}
|
||||
{3258327600 -21600 0 -06}
|
||||
{3271636800 -18000 1 -06}
|
||||
{3290382000 -21600 0 -06}
|
||||
{3303086400 -18000 1 -06}
|
||||
{3321831600 -21600 0 -06}
|
||||
{3335140800 -18000 1 -06}
|
||||
{3353281200 -21600 0 -06}
|
||||
{3366590400 -18000 1 -06}
|
||||
{3384730800 -21600 0 -06}
|
||||
{3398040000 -18000 1 -06}
|
||||
{3416180400 -21600 0 -06}
|
||||
{3429489600 -18000 1 -06}
|
||||
{3447630000 -21600 0 -06}
|
||||
{3460939200 -18000 1 -06}
|
||||
{3479684400 -21600 0 -06}
|
||||
{3492993600 -18000 1 -06}
|
||||
{3511134000 -21600 0 -06}
|
||||
{3524443200 -18000 1 -06}
|
||||
{3542583600 -21600 0 -06}
|
||||
{3555892800 -18000 1 -06}
|
||||
{3574033200 -21600 0 -06}
|
||||
{3587342400 -18000 1 -06}
|
||||
{3605482800 -21600 0 -06}
|
||||
{3618792000 -18000 1 -06}
|
||||
{3637537200 -21600 0 -06}
|
||||
{3650241600 -18000 1 -06}
|
||||
{3668986800 -21600 0 -06}
|
||||
{3682296000 -18000 1 -06}
|
||||
{3700436400 -21600 0 -06}
|
||||
{3713745600 -18000 1 -06}
|
||||
{3731886000 -21600 0 -06}
|
||||
{3745195200 -18000 1 -06}
|
||||
{3763335600 -21600 0 -06}
|
||||
{3776644800 -18000 1 -06}
|
||||
{3794785200 -21600 0 -06}
|
||||
{3808094400 -18000 1 -06}
|
||||
{3826839600 -21600 0 -06}
|
||||
{3839544000 -18000 1 -06}
|
||||
{3858289200 -21600 0 -06}
|
||||
{3871598400 -18000 1 -06}
|
||||
{3889738800 -21600 0 -06}
|
||||
{3903048000 -18000 1 -06}
|
||||
{3921188400 -21600 0 -06}
|
||||
{3934497600 -18000 1 -06}
|
||||
{3952638000 -21600 0 -06}
|
||||
{3965947200 -18000 1 -06}
|
||||
{3984692400 -21600 0 -06}
|
||||
{3997396800 -18000 1 -06}
|
||||
{4016142000 -21600 0 -06}
|
||||
{4029451200 -18000 1 -06}
|
||||
{4047591600 -21600 0 -06}
|
||||
{4060900800 -18000 1 -06}
|
||||
{4079041200 -21600 0 -06}
|
||||
{4092350400 -18000 1 -06}
|
||||
}
|
||||
|
||||
+12
-12
@@ -26,7 +26,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{1509804000 46800 1 +12}
|
||||
{1515852000 43200 0 +12}
|
||||
{1541253600 46800 1 +12}
|
||||
{1547906400 43200 0 +12}
|
||||
{1547301600 43200 0 +12}
|
||||
{1572703200 46800 1 +12}
|
||||
{1579356000 43200 0 +12}
|
||||
{1604152800 46800 1 +12}
|
||||
@@ -48,7 +48,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{1856959200 46800 1 +12}
|
||||
{1863007200 43200 0 +12}
|
||||
{1888408800 46800 1 +12}
|
||||
{1895061600 43200 0 +12}
|
||||
{1894456800 43200 0 +12}
|
||||
{1919858400 46800 1 +12}
|
||||
{1926511200 43200 0 +12}
|
||||
{1951308000 46800 1 +12}
|
||||
@@ -60,7 +60,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{2046261600 46800 1 +12}
|
||||
{2052309600 43200 0 +12}
|
||||
{2077711200 46800 1 +12}
|
||||
{2084364000 43200 0 +12}
|
||||
{2083759200 43200 0 +12}
|
||||
{2109160800 46800 1 +12}
|
||||
{2115813600 43200 0 +12}
|
||||
{2140610400 46800 1 +12}
|
||||
@@ -70,7 +70,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{2204114400 46800 1 +12}
|
||||
{2210162400 43200 0 +12}
|
||||
{2235564000 46800 1 +12}
|
||||
{2242216800 43200 0 +12}
|
||||
{2241612000 43200 0 +12}
|
||||
{2267013600 46800 1 +12}
|
||||
{2273666400 43200 0 +12}
|
||||
{2298463200 46800 1 +12}
|
||||
@@ -82,7 +82,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{2393416800 46800 1 +12}
|
||||
{2399464800 43200 0 +12}
|
||||
{2424866400 46800 1 +12}
|
||||
{2431519200 43200 0 +12}
|
||||
{2430914400 43200 0 +12}
|
||||
{2456316000 46800 1 +12}
|
||||
{2462968800 43200 0 +12}
|
||||
{2487765600 46800 1 +12}
|
||||
@@ -104,7 +104,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{2740572000 46800 1 +12}
|
||||
{2746620000 43200 0 +12}
|
||||
{2772021600 46800 1 +12}
|
||||
{2778674400 43200 0 +12}
|
||||
{2778069600 43200 0 +12}
|
||||
{2803471200 46800 1 +12}
|
||||
{2810124000 43200 0 +12}
|
||||
{2834920800 46800 1 +12}
|
||||
@@ -116,7 +116,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{2929874400 46800 1 +12}
|
||||
{2935922400 43200 0 +12}
|
||||
{2961324000 46800 1 +12}
|
||||
{2967976800 43200 0 +12}
|
||||
{2967372000 43200 0 +12}
|
||||
{2992773600 46800 1 +12}
|
||||
{2999426400 43200 0 +12}
|
||||
{3024223200 46800 1 +12}
|
||||
@@ -126,7 +126,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{3087727200 46800 1 +12}
|
||||
{3093775200 43200 0 +12}
|
||||
{3119176800 46800 1 +12}
|
||||
{3125829600 43200 0 +12}
|
||||
{3125224800 43200 0 +12}
|
||||
{3150626400 46800 1 +12}
|
||||
{3157279200 43200 0 +12}
|
||||
{3182076000 46800 1 +12}
|
||||
@@ -138,7 +138,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{3277029600 46800 1 +12}
|
||||
{3283077600 43200 0 +12}
|
||||
{3308479200 46800 1 +12}
|
||||
{3315132000 43200 0 +12}
|
||||
{3314527200 43200 0 +12}
|
||||
{3339928800 46800 1 +12}
|
||||
{3346581600 43200 0 +12}
|
||||
{3371378400 46800 1 +12}
|
||||
@@ -160,7 +160,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{3624184800 46800 1 +12}
|
||||
{3630232800 43200 0 +12}
|
||||
{3655634400 46800 1 +12}
|
||||
{3662287200 43200 0 +12}
|
||||
{3661682400 43200 0 +12}
|
||||
{3687084000 46800 1 +12}
|
||||
{3693736800 43200 0 +12}
|
||||
{3718533600 46800 1 +12}
|
||||
@@ -172,7 +172,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{3813487200 46800 1 +12}
|
||||
{3819535200 43200 0 +12}
|
||||
{3844936800 46800 1 +12}
|
||||
{3851589600 43200 0 +12}
|
||||
{3850984800 43200 0 +12}
|
||||
{3876386400 46800 1 +12}
|
||||
{3883039200 43200 0 +12}
|
||||
{3907836000 46800 1 +12}
|
||||
@@ -182,7 +182,7 @@ set TZData(:Pacific/Fiji) {
|
||||
{3971340000 46800 1 +12}
|
||||
{3977388000 43200 0 +12}
|
||||
{4002789600 46800 1 +12}
|
||||
{4009442400 43200 0 +12}
|
||||
{4008837600 43200 0 +12}
|
||||
{4034239200 46800 1 +12}
|
||||
{4040892000 43200 0 +12}
|
||||
{4065688800 46800 1 +12}
|
||||
|
||||
@@ -4,5 +4,23 @@ set TZData(:Pacific/Guam) {
|
||||
{-9223372036854775808 -51660 0 LMT}
|
||||
{-3944626740 34740 0 LMT}
|
||||
{-2177487540 36000 0 GST}
|
||||
{-885549600 32400 0 +09}
|
||||
{-802256400 36000 0 GST}
|
||||
{-331891200 39600 1 GDT}
|
||||
{-281610000 36000 0 GST}
|
||||
{-73728000 39600 1 GDT}
|
||||
{-29415540 36000 0 GST}
|
||||
{-16704000 39600 1 GDT}
|
||||
{-10659600 36000 0 GST}
|
||||
{9907200 39600 1 GDT}
|
||||
{21394800 36000 0 GST}
|
||||
{41356800 39600 1 GDT}
|
||||
{52844400 36000 0 GST}
|
||||
{124819200 39600 1 GDT}
|
||||
{130863600 36000 0 GST}
|
||||
{201888000 39600 1 GDT}
|
||||
{209487660 36000 0 GST}
|
||||
{230659200 39600 1 GDT}
|
||||
{241542000 36000 0 GST}
|
||||
{977493600 36000 0 ChST}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ set TZData(:Pacific/Honolulu) {
|
||||
{-9223372036854775808 -37886 0 LMT}
|
||||
{-2334101314 -37800 0 HST}
|
||||
{-1157283000 -34200 1 HDT}
|
||||
{-1155436200 -37800 0 HST}
|
||||
{-880198200 -34200 1 HDT}
|
||||
{-1155436200 -34200 0 HST}
|
||||
{-880201800 -34200 1 HWT}
|
||||
{-769395600 -34200 1 HPT}
|
||||
{-765376200 -37800 0 HST}
|
||||
{-712150200 -36000 0 HST}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Pacific/Kosrae) {
|
||||
{-9223372036854775808 39116 0 LMT}
|
||||
{-9223372036854775808 -47284 0 LMT}
|
||||
{-3944631116 39116 0 LMT}
|
||||
{-2177491916 39600 0 +11}
|
||||
{-1743678000 32400 0 +09}
|
||||
{-1606813200 39600 0 +11}
|
||||
{-1041418800 36000 0 +10}
|
||||
{-907408800 32400 0 +09}
|
||||
{-770634000 39600 0 +11}
|
||||
{-7988400 43200 0 +12}
|
||||
{915105600 39600 0 +11}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
set TZData(:Pacific/Kwajalein) {
|
||||
{-9223372036854775808 40160 0 LMT}
|
||||
{-2177492960 39600 0 +11}
|
||||
{-1041418800 36000 0 +10}
|
||||
{-907408800 32400 0 +09}
|
||||
{-817462800 39600 0 +11}
|
||||
{-7988400 -43200 0 -12}
|
||||
{745848000 43200 0 +12}
|
||||
{745934400 43200 0 +12}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,10 @@
|
||||
set TZData(:Pacific/Majuro) {
|
||||
{-9223372036854775808 41088 0 LMT}
|
||||
{-2177493888 39600 0 +11}
|
||||
{-1743678000 32400 0 +09}
|
||||
{-1606813200 39600 0 +11}
|
||||
{-1041418800 36000 0 +10}
|
||||
{-907408800 32400 0 +09}
|
||||
{-818067600 39600 0 +11}
|
||||
{-7988400 43200 0 +12}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set TZData(:Pacific/Nauru) {
|
||||
{-9223372036854775808 40060 0 LMT}
|
||||
{-1545131260 41400 0 +1130}
|
||||
{-877347000 32400 0 +09}
|
||||
{-800960400 41400 0 +1130}
|
||||
{294323400 43200 0 +12}
|
||||
{-862918200 32400 0 +09}
|
||||
{-767350800 41400 0 +1130}
|
||||
{287418600 43200 0 +12}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Pacific/Palau) {
|
||||
{-9223372036854775808 32276 0 LMT}
|
||||
{-9223372036854775808 -54124 0 LMT}
|
||||
{-3944624276 32276 0 LMT}
|
||||
{-2177485076 32400 0 +09}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Pacific/Pohnpei) {
|
||||
{-9223372036854775808 37972 0 LMT}
|
||||
{-9223372036854775808 -48428 0 LMT}
|
||||
{-3944629972 37972 0 LMT}
|
||||
{-2177490772 39600 0 +11}
|
||||
{-1743678000 32400 0 +09}
|
||||
{-1606813200 39600 0 +11}
|
||||
{-1041418800 36000 0 +10}
|
||||
{-907408800 32400 0 +09}
|
||||
{-770634000 39600 0 +11}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(Etc/UCT)]} {
|
||||
LoadTimeZoneFile Etc/UCT
|
||||
if {![info exists TZData(Etc/UTC)]} {
|
||||
LoadTimeZoneFile Etc/UTC
|
||||
}
|
||||
set TZData(:UCT) $TZData(:Etc/UCT)
|
||||
set TZData(:UCT) $TZData(:Etc/UTC)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
This is makeindex, version 2.14 [02-Oct-2002] (kpathsea + Thai support).
|
||||
Scanning input file bn.idx....done (79 entries accepted, 0 rejected).
|
||||
Sorting entries....done (511 comparisons).
|
||||
Generating output file bn.ind....done (82 lines written, 0 warnings).
|
||||
Output written in bn.ind.
|
||||
Transcript written in bn.ilg.
|
||||
@@ -1,82 +0,0 @@
|
||||
\begin{theindex}
|
||||
|
||||
\item mp\_add, \hyperpage{29}
|
||||
\item mp\_add\_d, \hyperpage{52}
|
||||
\item mp\_and, \hyperpage{29}
|
||||
\item mp\_clear, \hyperpage{11}
|
||||
\item mp\_clear\_multi, \hyperpage{12}
|
||||
\item mp\_cmp, \hyperpage{24}
|
||||
\item mp\_cmp\_d, \hyperpage{25}
|
||||
\item mp\_cmp\_mag, \hyperpage{23}
|
||||
\item mp\_div, \hyperpage{30}
|
||||
\item mp\_div\_2, \hyperpage{26}
|
||||
\item mp\_div\_2d, \hyperpage{28}
|
||||
\item mp\_div\_d, \hyperpage{52}
|
||||
\item mp\_dr\_reduce, \hyperpage{40}
|
||||
\item mp\_dr\_setup, \hyperpage{40}
|
||||
\item MP\_EQ, \hyperpage{22}
|
||||
\item mp\_error\_to\_string, \hyperpage{10}
|
||||
\item mp\_expt\_d, \hyperpage{43}
|
||||
\item mp\_exptmod, \hyperpage{43}
|
||||
\item mp\_exteuclid, \hyperpage{51}
|
||||
\item mp\_gcd, \hyperpage{51}
|
||||
\item mp\_get\_int, \hyperpage{20}
|
||||
\item mp\_grow, \hyperpage{16}
|
||||
\item MP\_GT, \hyperpage{22}
|
||||
\item mp\_init, \hyperpage{11}
|
||||
\item mp\_init\_copy, \hyperpage{13}
|
||||
\item mp\_init\_multi, \hyperpage{12}
|
||||
\item mp\_init\_set, \hyperpage{21}
|
||||
\item mp\_init\_set\_int, \hyperpage{21}
|
||||
\item mp\_init\_size, \hyperpage{14}
|
||||
\item mp\_int, \hyperpage{10}
|
||||
\item mp\_invmod, \hyperpage{52}
|
||||
\item mp\_jacobi, \hyperpage{52}
|
||||
\item mp\_lcm, \hyperpage{51}
|
||||
\item mp\_lshd, \hyperpage{28}
|
||||
\item MP\_LT, \hyperpage{22}
|
||||
\item MP\_MEM, \hyperpage{9}
|
||||
\item mp\_mod, \hyperpage{35}
|
||||
\item mp\_mod\_d, \hyperpage{52}
|
||||
\item mp\_montgomery\_calc\_normalization, \hyperpage{38}
|
||||
\item mp\_montgomery\_reduce, \hyperpage{37}
|
||||
\item mp\_montgomery\_setup, \hyperpage{37}
|
||||
\item mp\_mul, \hyperpage{31}
|
||||
\item mp\_mul\_2, \hyperpage{26}
|
||||
\item mp\_mul\_2d, \hyperpage{28}
|
||||
\item mp\_mul\_d, \hyperpage{52}
|
||||
\item mp\_n\_root, \hyperpage{44}
|
||||
\item mp\_neg, \hyperpage{29}
|
||||
\item MP\_NO, \hyperpage{9}
|
||||
\item MP\_OKAY, \hyperpage{9}
|
||||
\item mp\_or, \hyperpage{29}
|
||||
\item mp\_prime\_fermat, \hyperpage{45}
|
||||
\item mp\_prime\_is\_divisible, \hyperpage{45}
|
||||
\item mp\_prime\_is\_prime, \hyperpage{46}
|
||||
\item mp\_prime\_miller\_rabin, \hyperpage{45}
|
||||
\item mp\_prime\_next\_prime, \hyperpage{46}
|
||||
\item mp\_prime\_rabin\_miller\_trials, \hyperpage{46}
|
||||
\item mp\_prime\_random, \hyperpage{47}
|
||||
\item mp\_prime\_random\_ex, \hyperpage{47}
|
||||
\item mp\_radix\_size, \hyperpage{49}
|
||||
\item mp\_read\_radix, \hyperpage{49}
|
||||
\item mp\_read\_unsigned\_bin, \hyperpage{50}
|
||||
\item mp\_reduce, \hyperpage{36}
|
||||
\item mp\_reduce\_2k, \hyperpage{41}
|
||||
\item mp\_reduce\_2k\_setup, \hyperpage{41}
|
||||
\item mp\_reduce\_setup, \hyperpage{36}
|
||||
\item mp\_rshd, \hyperpage{28}
|
||||
\item mp\_set, \hyperpage{19}
|
||||
\item mp\_set\_int, \hyperpage{20}
|
||||
\item mp\_shrink, \hyperpage{15}
|
||||
\item mp\_sqr, \hyperpage{33}
|
||||
\item mp\_sub, \hyperpage{29}
|
||||
\item mp\_sub\_d, \hyperpage{52}
|
||||
\item mp\_to\_unsigned\_bin, \hyperpage{50}
|
||||
\item mp\_toradix, \hyperpage{49}
|
||||
\item mp\_unsigned\_bin\_size, \hyperpage{50}
|
||||
\item MP\_VAL, \hyperpage{9}
|
||||
\item mp\_xor, \hyperpage{29}
|
||||
\item MP\_YES, \hyperpage{9}
|
||||
|
||||
\end{theindex}
|
||||
Binary file not shown.
-1835
File diff suppressed because it is too large
Load Diff
@@ -87,7 +87,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
|
||||
{
|
||||
register mp_digit *tmpc;
|
||||
tmpc = c->dp;
|
||||
for (ix = 0; ix < pa+1; ix++) {
|
||||
for (ix = 0; ix < pa; ix++) {
|
||||
/* now extract the previous digit [below the carry] */
|
||||
*tmpc++ = W[ix];
|
||||
}
|
||||
|
||||
+46
-43
@@ -1,53 +1,56 @@
|
||||
#include <tommath.h>
|
||||
#ifdef BN_MP_AND_C
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
/* AND two ints together */
|
||||
int
|
||||
mp_and (mp_int * a, mp_int * b, mp_int * c)
|
||||
/* two complement and */
|
||||
mp_err mp_and(const mp_int *a, const mp_int *b, mp_int *c)
|
||||
{
|
||||
int res, ix, px;
|
||||
mp_int t, *x;
|
||||
int used = MAX(a->used, b->used) + 1, i;
|
||||
mp_err err;
|
||||
mp_digit ac = 1, bc = 1, cc = 1;
|
||||
mp_sign csign = ((a->sign == MP_NEG) && (b->sign == MP_NEG)) ? MP_NEG : MP_ZPOS;
|
||||
|
||||
if (a->used > b->used) {
|
||||
if ((res = mp_init_copy (&t, a)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
px = b->used;
|
||||
x = b;
|
||||
} else {
|
||||
if ((res = mp_init_copy (&t, b)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
px = a->used;
|
||||
x = a;
|
||||
}
|
||||
if (c->alloc < used) {
|
||||
if ((err = mp_grow(c, used)) != MP_OKAY) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
for (ix = 0; ix < px; ix++) {
|
||||
t.dp[ix] &= x->dp[ix];
|
||||
}
|
||||
for (i = 0; i < used; i++) {
|
||||
mp_digit x, y;
|
||||
|
||||
/* zero digits above the last from the smallest mp_int */
|
||||
for (; ix < t.used; ix++) {
|
||||
t.dp[ix] = 0;
|
||||
}
|
||||
/* convert to two complement if negative */
|
||||
if (a->sign == MP_NEG) {
|
||||
ac += (i >= a->used) ? MP_MASK : (~a->dp[i] & MP_MASK);
|
||||
x = ac & MP_MASK;
|
||||
ac >>= MP_DIGIT_BIT;
|
||||
} else {
|
||||
x = (i >= a->used) ? 0uL : a->dp[i];
|
||||
}
|
||||
|
||||
mp_clamp (&t);
|
||||
mp_exch (c, &t);
|
||||
mp_clear (&t);
|
||||
return MP_OKAY;
|
||||
/* convert to two complement if negative */
|
||||
if (b->sign == MP_NEG) {
|
||||
bc += (i >= b->used) ? MP_MASK : (~b->dp[i] & MP_MASK);
|
||||
y = bc & MP_MASK;
|
||||
bc >>= MP_DIGIT_BIT;
|
||||
} else {
|
||||
y = (i >= b->used) ? 0uL : b->dp[i];
|
||||
}
|
||||
|
||||
c->dp[i] = x & y;
|
||||
|
||||
/* convert to to sign-magnitude if negative */
|
||||
if (csign == MP_NEG) {
|
||||
cc += ~c->dp[i] & MP_MASK;
|
||||
c->dp[i] = cc & MP_MASK;
|
||||
cc >>= MP_DIGIT_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
c->used = used;
|
||||
c->sign = csign;
|
||||
mp_clamp(c);
|
||||
return MP_OKAY;
|
||||
}
|
||||
#endif
|
||||
|
||||
+19
-32
@@ -1,39 +1,26 @@
|
||||
#include <tommath.h>
|
||||
#ifdef BN_MP_CMP_C
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
/* compare two ints (signed)*/
|
||||
int
|
||||
mp_cmp (mp_int * a, mp_int * b)
|
||||
mp_ord mp_cmp(const mp_int *a, const mp_int *b)
|
||||
{
|
||||
/* compare based on sign */
|
||||
if (a->sign != b->sign) {
|
||||
if (a->sign == MP_NEG) {
|
||||
return MP_LT;
|
||||
} else {
|
||||
return MP_GT;
|
||||
}
|
||||
}
|
||||
|
||||
/* compare digits */
|
||||
if (a->sign == MP_NEG) {
|
||||
/* if negative compare opposite direction */
|
||||
return mp_cmp_mag(b, a);
|
||||
} else {
|
||||
return mp_cmp_mag(a, b);
|
||||
}
|
||||
/* compare based on sign */
|
||||
if (a->sign != b->sign) {
|
||||
if (a->sign == MP_NEG) {
|
||||
return MP_LT;
|
||||
} else {
|
||||
return MP_GT;
|
||||
}
|
||||
}
|
||||
|
||||
/* compare digits */
|
||||
if (a->sign == MP_NEG) {
|
||||
/* if negative compare opposite direction */
|
||||
return mp_cmp_mag(b, a);
|
||||
} else {
|
||||
return mp_cmp_mag(a, b);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+19
-31
@@ -1,40 +1,28 @@
|
||||
#include <tommath.h>
|
||||
#ifdef BN_MP_CMP_D_C
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
/* compare a digit */
|
||||
int mp_cmp_d(mp_int * a, mp_digit b)
|
||||
mp_ord mp_cmp_d(const mp_int *a, mp_digit b)
|
||||
{
|
||||
/* compare based on sign */
|
||||
if (a->sign == MP_NEG) {
|
||||
return MP_LT;
|
||||
}
|
||||
/* compare based on sign */
|
||||
if (a->sign == MP_NEG) {
|
||||
return MP_LT;
|
||||
}
|
||||
|
||||
/* compare based on magnitude */
|
||||
if (a->used > 1) {
|
||||
return MP_GT;
|
||||
}
|
||||
/* compare based on magnitude */
|
||||
if (a->used > 1) {
|
||||
return MP_GT;
|
||||
}
|
||||
|
||||
/* compare the only digit of a to b */
|
||||
if (a->dp[0] > b) {
|
||||
return MP_GT;
|
||||
} else if (a->dp[0] < b) {
|
||||
return MP_LT;
|
||||
} else {
|
||||
return MP_EQ;
|
||||
}
|
||||
/* compare the only digit of a to b */
|
||||
if (a->dp[0] > b) {
|
||||
return MP_GT;
|
||||
} else if (a->dp[0] < b) {
|
||||
return MP_LT;
|
||||
} else {
|
||||
return MP_EQ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+28
-40
@@ -1,51 +1,39 @@
|
||||
#include <tommath.h>
|
||||
#ifdef BN_MP_CMP_MAG_C
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
/* compare maginitude of two ints (unsigned) */
|
||||
int mp_cmp_mag (mp_int * a, mp_int * b)
|
||||
mp_ord mp_cmp_mag(const mp_int *a, const mp_int *b)
|
||||
{
|
||||
int n;
|
||||
mp_digit *tmpa, *tmpb;
|
||||
int n;
|
||||
const mp_digit *tmpa, *tmpb;
|
||||
|
||||
/* compare based on # of non-zero digits */
|
||||
if (a->used > b->used) {
|
||||
return MP_GT;
|
||||
}
|
||||
|
||||
if (a->used < b->used) {
|
||||
return MP_LT;
|
||||
}
|
||||
|
||||
/* alias for a */
|
||||
tmpa = a->dp + (a->used - 1);
|
||||
|
||||
/* alias for b */
|
||||
tmpb = b->dp + (a->used - 1);
|
||||
|
||||
/* compare based on digits */
|
||||
for (n = 0; n < a->used; ++n, --tmpa, --tmpb) {
|
||||
if (*tmpa > *tmpb) {
|
||||
/* compare based on # of non-zero digits */
|
||||
if (a->used > b->used) {
|
||||
return MP_GT;
|
||||
}
|
||||
}
|
||||
|
||||
if (*tmpa < *tmpb) {
|
||||
if (a->used < b->used) {
|
||||
return MP_LT;
|
||||
}
|
||||
}
|
||||
return MP_EQ;
|
||||
}
|
||||
|
||||
/* alias for a */
|
||||
tmpa = a->dp + (a->used - 1);
|
||||
|
||||
/* alias for b */
|
||||
tmpb = b->dp + (a->used - 1);
|
||||
|
||||
/* compare based on digits */
|
||||
for (n = 0; n < a->used; ++n, --tmpa, --tmpb) {
|
||||
if (*tmpa > *tmpb) {
|
||||
return MP_GT;
|
||||
}
|
||||
|
||||
if (*tmpa < *tmpb) {
|
||||
return MP_LT;
|
||||
}
|
||||
}
|
||||
return MP_EQ;
|
||||
}
|
||||
#endif
|
||||
|
||||
+48
-38
@@ -1,46 +1,56 @@
|
||||
#include <tommath.h>
|
||||
#ifdef BN_MP_OR_C
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
/* OR two ints together */
|
||||
int mp_or (mp_int * a, mp_int * b, mp_int * c)
|
||||
/* two complement or */
|
||||
mp_err mp_or(const mp_int *a, const mp_int *b, mp_int *c)
|
||||
{
|
||||
int res, ix, px;
|
||||
mp_int t, *x;
|
||||
int used = MAX(a->used, b->used) + 1, i;
|
||||
mp_err err;
|
||||
mp_digit ac = 1, bc = 1, cc = 1;
|
||||
mp_sign csign = ((a->sign == MP_NEG) || (b->sign == MP_NEG)) ? MP_NEG : MP_ZPOS;
|
||||
|
||||
if (a->used > b->used) {
|
||||
if ((res = mp_init_copy (&t, a)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
px = b->used;
|
||||
x = b;
|
||||
} else {
|
||||
if ((res = mp_init_copy (&t, b)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
px = a->used;
|
||||
x = a;
|
||||
}
|
||||
if (c->alloc < used) {
|
||||
if ((err = mp_grow(c, used)) != MP_OKAY) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
for (ix = 0; ix < px; ix++) {
|
||||
t.dp[ix] |= x->dp[ix];
|
||||
}
|
||||
mp_clamp (&t);
|
||||
mp_exch (c, &t);
|
||||
mp_clear (&t);
|
||||
return MP_OKAY;
|
||||
for (i = 0; i < used; i++) {
|
||||
mp_digit x, y;
|
||||
|
||||
/* convert to two complement if negative */
|
||||
if (a->sign == MP_NEG) {
|
||||
ac += (i >= a->used) ? MP_MASK : (~a->dp[i] & MP_MASK);
|
||||
x = ac & MP_MASK;
|
||||
ac >>= MP_DIGIT_BIT;
|
||||
} else {
|
||||
x = (i >= a->used) ? 0uL : a->dp[i];
|
||||
}
|
||||
|
||||
/* convert to two complement if negative */
|
||||
if (b->sign == MP_NEG) {
|
||||
bc += (i >= b->used) ? MP_MASK : (~b->dp[i] & MP_MASK);
|
||||
y = bc & MP_MASK;
|
||||
bc >>= MP_DIGIT_BIT;
|
||||
} else {
|
||||
y = (i >= b->used) ? 0uL : b->dp[i];
|
||||
}
|
||||
|
||||
c->dp[i] = x | y;
|
||||
|
||||
/* convert to to sign-magnitude if negative */
|
||||
if (csign == MP_NEG) {
|
||||
cc += ~c->dp[i] & MP_MASK;
|
||||
c->dp[i] = cc & MP_MASK;
|
||||
cc >>= MP_DIGIT_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
c->used = used;
|
||||
c->sign = csign;
|
||||
mp_clamp(c);
|
||||
return MP_OKAY;
|
||||
}
|
||||
#endif
|
||||
|
||||
+48
-39
@@ -1,47 +1,56 @@
|
||||
#include <tommath.h>
|
||||
#ifdef BN_MP_XOR_C
|
||||
/* 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, tomstdenis@gmail.com, http://math.libtomcrypt.com
|
||||
*/
|
||||
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
|
||||
/* XOR two ints together */
|
||||
int
|
||||
mp_xor (mp_int * a, mp_int * b, mp_int * c)
|
||||
/* two complement xor */
|
||||
mp_err mp_xor(const mp_int *a, const mp_int *b, mp_int *c)
|
||||
{
|
||||
int res, ix, px;
|
||||
mp_int t, *x;
|
||||
int used = MAX(a->used, b->used) + 1, i;
|
||||
mp_err err;
|
||||
mp_digit ac = 1, bc = 1, cc = 1;
|
||||
mp_sign csign = (a->sign != b->sign) ? MP_NEG : MP_ZPOS;
|
||||
|
||||
if (a->used > b->used) {
|
||||
if ((res = mp_init_copy (&t, a)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
px = b->used;
|
||||
x = b;
|
||||
} else {
|
||||
if ((res = mp_init_copy (&t, b)) != MP_OKAY) {
|
||||
return res;
|
||||
}
|
||||
px = a->used;
|
||||
x = a;
|
||||
}
|
||||
if (c->alloc < used) {
|
||||
if ((err = mp_grow(c, used)) != MP_OKAY) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
for (ix = 0; ix < px; ix++) {
|
||||
t.dp[ix] ^= x->dp[ix];
|
||||
}
|
||||
mp_clamp (&t);
|
||||
mp_exch (c, &t);
|
||||
mp_clear (&t);
|
||||
return MP_OKAY;
|
||||
for (i = 0; i < used; i++) {
|
||||
mp_digit x, y;
|
||||
|
||||
/* convert to two complement if negative */
|
||||
if (a->sign == MP_NEG) {
|
||||
ac += (i >= a->used) ? MP_MASK : (~a->dp[i] & MP_MASK);
|
||||
x = ac & MP_MASK;
|
||||
ac >>= MP_DIGIT_BIT;
|
||||
} else {
|
||||
x = (i >= a->used) ? 0uL : a->dp[i];
|
||||
}
|
||||
|
||||
/* convert to two complement if negative */
|
||||
if (b->sign == MP_NEG) {
|
||||
bc += (i >= b->used) ? MP_MASK : (~b->dp[i] & MP_MASK);
|
||||
y = bc & MP_MASK;
|
||||
bc >>= MP_DIGIT_BIT;
|
||||
} else {
|
||||
y = (i >= b->used) ? 0uL : b->dp[i];
|
||||
}
|
||||
|
||||
c->dp[i] = x ^ y;
|
||||
|
||||
/* convert to to sign-magnitude if negative */
|
||||
if (csign == MP_NEG) {
|
||||
cc += ~c->dp[i] & MP_MASK;
|
||||
c->dp[i] = cc & MP_MASK;
|
||||
cc >>= MP_DIGIT_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
c->used = used;
|
||||
c->sign = csign;
|
||||
mp_clamp(c);
|
||||
return MP_OKAY;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,265 +0,0 @@
|
||||
#!/bin/perl
|
||||
#
|
||||
#Used to prepare the book "tommath.src" for LaTeX by pre-processing it into a .tex file
|
||||
#
|
||||
#Essentially you write the "tommath.src" as normal LaTex except where you want code snippets you put
|
||||
#
|
||||
#EXAM,file
|
||||
#
|
||||
#This preprocessor will then open "file" and insert it as a verbatim copy.
|
||||
#
|
||||
#Tom St Denis
|
||||
|
||||
#get graphics type
|
||||
if (shift =~ /PDF/) {
|
||||
$graph = "";
|
||||
} else {
|
||||
$graph = ".ps";
|
||||
}
|
||||
|
||||
open(IN,"<tommath.src") or die "Can't open source file";
|
||||
open(OUT,">tommath.tex") or die "Can't open destination file";
|
||||
|
||||
print "Scanning for sections\n";
|
||||
$chapter = $section = $subsection = 0;
|
||||
$x = 0;
|
||||
while (<IN>) {
|
||||
print ".";
|
||||
if (!(++$x % 80)) { print "\n"; }
|
||||
#update the headings
|
||||
if (~($_ =~ /\*/)) {
|
||||
if ($_ =~ /\\chapter{.+}/) {
|
||||
++$chapter;
|
||||
$section = $subsection = 0;
|
||||
} elsif ($_ =~ /\\section{.+}/) {
|
||||
++$section;
|
||||
$subsection = 0;
|
||||
} elsif ($_ =~ /\\subsection{.+}/) {
|
||||
++$subsection;
|
||||
}
|
||||
}
|
||||
|
||||
if ($_ =~ m/MARK/) {
|
||||
@m = split(",",$_);
|
||||
chomp(@m[1]);
|
||||
$index1{@m[1]} = $chapter;
|
||||
$index2{@m[1]} = $section;
|
||||
$index3{@m[1]} = $subsection;
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
open(IN,"<tommath.src") or die "Can't open source file";
|
||||
$readline = $wroteline = 0;
|
||||
$srcline = 0;
|
||||
|
||||
while (<IN>) {
|
||||
++$readline;
|
||||
++$srcline;
|
||||
|
||||
if ($_ =~ m/MARK/) {
|
||||
} elsif ($_ =~ m/EXAM/ || $_ =~ m/LIST/) {
|
||||
if ($_ =~ m/EXAM/) {
|
||||
$skipheader = 1;
|
||||
} else {
|
||||
$skipheader = 0;
|
||||
}
|
||||
|
||||
# EXAM,file
|
||||
chomp($_);
|
||||
@m = split(",",$_);
|
||||
open(SRC,"<$m[1]") or die "Error:$srcline:Can't open source file $m[1]";
|
||||
|
||||
print "$srcline:Inserting $m[1]:";
|
||||
|
||||
$line = 0;
|
||||
$tmp = $m[1];
|
||||
$tmp =~ s/_/"\\_"/ge;
|
||||
print OUT "\\vspace{+3mm}\\begin{small}\n\\hspace{-5.1mm}{\\bf File}: $tmp\n\\vspace{-3mm}\n\\begin{alltt}\n";
|
||||
$wroteline += 5;
|
||||
|
||||
if ($skipheader == 1) {
|
||||
# scan till next end of comment, e.g. skip license
|
||||
while (<SRC>) {
|
||||
$text[$line++] = $_;
|
||||
last if ($_ =~ /math\.libtomcrypt\.org/);
|
||||
}
|
||||
<SRC>;
|
||||
}
|
||||
|
||||
$inline = 0;
|
||||
while (<SRC>) {
|
||||
next if ($_ =~ /\$Source/);
|
||||
next if ($_ =~ /\$Revision/);
|
||||
next if ($_ =~ /\$Date/);
|
||||
$text[$line++] = $_;
|
||||
++$inline;
|
||||
chomp($_);
|
||||
$_ =~ s/\t/" "/ge;
|
||||
$_ =~ s/{/"^{"/ge;
|
||||
$_ =~ s/}/"^}"/ge;
|
||||
$_ =~ s/\\/'\symbol{92}'/ge;
|
||||
$_ =~ s/\^/"\\"/ge;
|
||||
|
||||
printf OUT ("%03d ", $line);
|
||||
for ($x = 0; $x < length($_); $x++) {
|
||||
print OUT chr(vec($_, $x, 8));
|
||||
if ($x == 75) {
|
||||
print OUT "\n ";
|
||||
++$wroteline;
|
||||
}
|
||||
}
|
||||
print OUT "\n";
|
||||
++$wroteline;
|
||||
}
|
||||
$totlines = $line;
|
||||
print OUT "\\end{alltt}\n\\end{small}\n";
|
||||
close(SRC);
|
||||
print "$inline lines\n";
|
||||
$wroteline += 2;
|
||||
} elsif ($_ =~ m/@\d+,.+@/) {
|
||||
# line contains [number,text]
|
||||
# e.g. @14,for (ix = 0)@
|
||||
$txt = $_;
|
||||
while ($txt =~ m/@\d+,.+@/) {
|
||||
@m = split("@",$txt); # splits into text, one, two
|
||||
@parms = split(",",$m[1]); # splits one,two into two elements
|
||||
|
||||
# now search from $parms[0] down for $parms[1]
|
||||
$found1 = 0;
|
||||
$found2 = 0;
|
||||
for ($i = $parms[0]; $i < $totlines && $found1 == 0; $i++) {
|
||||
if ($text[$i] =~ m/\Q$parms[1]\E/) {
|
||||
$foundline1 = $i + 1;
|
||||
$found1 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# now search backwards
|
||||
for ($i = $parms[0] - 1; $i >= 0 && $found2 == 0; $i--) {
|
||||
if ($text[$i] =~ m/\Q$parms[1]\E/) {
|
||||
$foundline2 = $i + 1;
|
||||
$found2 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# now use the closest match or the first if tied
|
||||
if ($found1 == 1 && $found2 == 0) {
|
||||
$found = 1;
|
||||
$foundline = $foundline1;
|
||||
} elsif ($found1 == 0 && $found2 == 1) {
|
||||
$found = 1;
|
||||
$foundline = $foundline2;
|
||||
} elsif ($found1 == 1 && $found2 == 1) {
|
||||
$found = 1;
|
||||
if (($foundline1 - $parms[0]) <= ($parms[0] - $foundline2)) {
|
||||
$foundline = $foundline1;
|
||||
} else {
|
||||
$foundline = $foundline2;
|
||||
}
|
||||
} else {
|
||||
$found = 0;
|
||||
}
|
||||
|
||||
# if found replace
|
||||
if ($found == 1) {
|
||||
$delta = $parms[0] - $foundline;
|
||||
print "Found replacement tag for \"$parms[1]\" on line $srcline which refers to line $foundline (delta $delta)\n";
|
||||
$_ =~ s/@\Q$m[1]\E@/$foundline/;
|
||||
} else {
|
||||
print "ERROR: The tag \"$parms[1]\" on line $srcline was not found in the most recently parsed source!\n";
|
||||
}
|
||||
|
||||
# remake the rest of the line
|
||||
$cnt = @m;
|
||||
$txt = "";
|
||||
for ($i = 2; $i < $cnt; $i++) {
|
||||
$txt = $txt . $m[$i] . "@";
|
||||
}
|
||||
}
|
||||
print OUT $_;
|
||||
++$wroteline;
|
||||
} elsif ($_ =~ /~.+~/) {
|
||||
# line contains a ~text~ pair used to refer to indexing :-)
|
||||
$txt = $_;
|
||||
while ($txt =~ /~.+~/) {
|
||||
@m = split("~", $txt);
|
||||
|
||||
# word is the second position
|
||||
$word = @m[1];
|
||||
$a = $index1{$word};
|
||||
$b = $index2{$word};
|
||||
$c = $index3{$word};
|
||||
|
||||
# if chapter (a) is zero it wasn't found
|
||||
if ($a == 0) {
|
||||
print "ERROR: the tag \"$word\" on line $srcline was not found previously marked.\n";
|
||||
} else {
|
||||
# format the tag as x, x.y or x.y.z depending on the values
|
||||
$str = $a;
|
||||
$str = $str . ".$b" if ($b != 0);
|
||||
$str = $str . ".$c" if ($c != 0);
|
||||
|
||||
if ($b == 0 && $c == 0) {
|
||||
# its a chapter
|
||||
if ($a <= 10) {
|
||||
if ($a == 1) {
|
||||
$str = "chapter one";
|
||||
} elsif ($a == 2) {
|
||||
$str = "chapter two";
|
||||
} elsif ($a == 3) {
|
||||
$str = "chapter three";
|
||||
} elsif ($a == 4) {
|
||||
$str = "chapter four";
|
||||
} elsif ($a == 5) {
|
||||
$str = "chapter five";
|
||||
} elsif ($a == 6) {
|
||||
$str = "chapter six";
|
||||
} elsif ($a == 7) {
|
||||
$str = "chapter seven";
|
||||
} elsif ($a == 8) {
|
||||
$str = "chapter eight";
|
||||
} elsif ($a == 9) {
|
||||
$str = "chapter nine";
|
||||
} elsif ($a == 10) {
|
||||
$str = "chapter ten";
|
||||
}
|
||||
} else {
|
||||
$str = "chapter " . $str;
|
||||
}
|
||||
} else {
|
||||
$str = "section " . $str if ($b != 0 && $c == 0);
|
||||
$str = "sub-section " . $str if ($b != 0 && $c != 0);
|
||||
}
|
||||
|
||||
#substitute
|
||||
$_ =~ s/~\Q$word\E~/$str/;
|
||||
|
||||
print "Found replacement tag for marker \"$word\" on line $srcline which refers to $str\n";
|
||||
}
|
||||
|
||||
# remake rest of the line
|
||||
$cnt = @m;
|
||||
$txt = "";
|
||||
for ($i = 2; $i < $cnt; $i++) {
|
||||
$txt = $txt . $m[$i] . "~";
|
||||
}
|
||||
}
|
||||
print OUT $_;
|
||||
++$wroteline;
|
||||
} elsif ($_ =~ m/FIGU/) {
|
||||
# FIGU,file,caption
|
||||
chomp($_);
|
||||
@m = split(",", $_);
|
||||
print OUT "\\begin{center}\n\\begin{figure}[here]\n\\includegraphics{pics/$m[1]$graph}\n";
|
||||
print OUT "\\caption{$m[2]}\n\\label{pic:$m[1]}\n\\end{figure}\n\\end{center}\n";
|
||||
$wroteline += 4;
|
||||
} else {
|
||||
print OUT $_;
|
||||
++$wroteline;
|
||||
}
|
||||
}
|
||||
print "Read $readline lines, wrote $wroteline lines\n";
|
||||
|
||||
close (OUT);
|
||||
close (IN);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,736 +0,0 @@
|
||||
#include <time.h>
|
||||
|
||||
#ifdef IOWNANATHLON
|
||||
#include <unistd.h>
|
||||
#define SLEEP sleep(4)
|
||||
#else
|
||||
#define SLEEP
|
||||
#endif
|
||||
|
||||
#include "tommath.h"
|
||||
|
||||
void ndraw(mp_int * a, char *name)
|
||||
{
|
||||
char buf[16000];
|
||||
|
||||
printf("%s: ", name);
|
||||
mp_toradix(a, buf, 10);
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
|
||||
static void draw(mp_int * a)
|
||||
{
|
||||
ndraw(a, "");
|
||||
}
|
||||
|
||||
|
||||
unsigned long lfsr = 0xAAAAAAAAUL;
|
||||
|
||||
int lbit(void)
|
||||
{
|
||||
if (lfsr & 0x80000000UL) {
|
||||
lfsr = ((lfsr << 1) ^ 0x8000001BUL) & 0xFFFFFFFFUL;
|
||||
return 1;
|
||||
} else {
|
||||
lfsr <<= 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int myrng(unsigned char *dst, int len, void *dat)
|
||||
{
|
||||
int x;
|
||||
|
||||
for (x = 0; x < len; x++)
|
||||
dst[x] = rand() & 0xFF;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char cmd[4096], buf[4096];
|
||||
int main(void)
|
||||
{
|
||||
mp_int a, b, c, d, e, f;
|
||||
unsigned long expt_n, add_n, sub_n, mul_n, div_n, sqr_n, mul2d_n, div2d_n,
|
||||
gcd_n, lcm_n, inv_n, div2_n, mul2_n, add_d_n, sub_d_n, t;
|
||||
unsigned rr;
|
||||
int i, n, err, cnt, ix, old_kara_m, old_kara_s;
|
||||
mp_digit mp;
|
||||
|
||||
|
||||
mp_init(&a);
|
||||
mp_init(&b);
|
||||
mp_init(&c);
|
||||
mp_init(&d);
|
||||
mp_init(&e);
|
||||
mp_init(&f);
|
||||
|
||||
srand(time(NULL));
|
||||
|
||||
#if 0
|
||||
// test montgomery
|
||||
printf("Testing montgomery...\n");
|
||||
for (i = 1; i < 10; i++) {
|
||||
printf("Testing digit size: %d\n", i);
|
||||
for (n = 0; n < 1000; n++) {
|
||||
mp_rand(&a, i);
|
||||
a.dp[0] |= 1;
|
||||
|
||||
// let's see if R is right
|
||||
mp_montgomery_calc_normalization(&b, &a);
|
||||
mp_montgomery_setup(&a, &mp);
|
||||
|
||||
// now test a random reduction
|
||||
for (ix = 0; ix < 100; ix++) {
|
||||
mp_rand(&c, 1 + abs(rand()) % (2*i));
|
||||
mp_copy(&c, &d);
|
||||
mp_copy(&c, &e);
|
||||
|
||||
mp_mod(&d, &a, &d);
|
||||
mp_montgomery_reduce(&c, &a, mp);
|
||||
mp_mulmod(&c, &b, &a, &c);
|
||||
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("d = e mod a, c = e MOD a\n");
|
||||
mp_todecimal(&a, buf); printf("a = %s\n", buf);
|
||||
mp_todecimal(&e, buf); printf("e = %s\n", buf);
|
||||
mp_todecimal(&d, buf); printf("d = %s\n", buf);
|
||||
mp_todecimal(&c, buf); printf("c = %s\n", buf);
|
||||
printf("compare no compare!\n"); exit(EXIT_FAILURE); }
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("done\n");
|
||||
|
||||
// test mp_get_int
|
||||
printf("Testing: mp_get_int\n");
|
||||
for (i = 0; i < 1000; ++i) {
|
||||
t = ((unsigned long) rand() * rand() + 1) & 0xFFFFFFFF;
|
||||
mp_set_int(&a, t);
|
||||
if (t != mp_get_int(&a)) {
|
||||
printf("mp_get_int() bad result!\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
mp_set_int(&a, 0);
|
||||
if (mp_get_int(&a) != 0) {
|
||||
printf("mp_get_int() bad result!\n");
|
||||
return 1;
|
||||
}
|
||||
mp_set_int(&a, 0xffffffff);
|
||||
if (mp_get_int(&a) != 0xffffffff) {
|
||||
printf("mp_get_int() bad result!\n");
|
||||
return 1;
|
||||
}
|
||||
// test mp_sqrt
|
||||
printf("Testing: mp_sqrt\n");
|
||||
for (i = 0; i < 1000; ++i) {
|
||||
printf("%6d\r", i);
|
||||
fflush(stdout);
|
||||
n = (rand() & 15) + 1;
|
||||
mp_rand(&a, n);
|
||||
if (mp_sqrt(&a, &b) != MP_OKAY) {
|
||||
printf("mp_sqrt() error!\n");
|
||||
return 1;
|
||||
}
|
||||
mp_n_root(&a, 2, &a);
|
||||
if (mp_cmp_mag(&b, &a) != MP_EQ) {
|
||||
printf("mp_sqrt() bad result!\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf("\nTesting: mp_is_square\n");
|
||||
for (i = 0; i < 1000; ++i) {
|
||||
printf("%6d\r", i);
|
||||
fflush(stdout);
|
||||
|
||||
/* test mp_is_square false negatives */
|
||||
n = (rand() & 7) + 1;
|
||||
mp_rand(&a, n);
|
||||
mp_sqr(&a, &a);
|
||||
if (mp_is_square(&a, &n) != MP_OKAY) {
|
||||
printf("fn:mp_is_square() error!\n");
|
||||
return 1;
|
||||
}
|
||||
if (n == 0) {
|
||||
printf("fn:mp_is_square() bad result!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* test for false positives */
|
||||
mp_add_d(&a, 1, &a);
|
||||
if (mp_is_square(&a, &n) != MP_OKAY) {
|
||||
printf("fp:mp_is_square() error!\n");
|
||||
return 1;
|
||||
}
|
||||
if (n == 1) {
|
||||
printf("fp:mp_is_square() bad result!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
printf("\n\n");
|
||||
|
||||
/* test for size */
|
||||
for (ix = 10; ix < 128; ix++) {
|
||||
printf("Testing (not safe-prime): %9d bits \r", ix);
|
||||
fflush(stdout);
|
||||
err =
|
||||
mp_prime_random_ex(&a, 8, ix,
|
||||
(rand() & 1) ? LTM_PRIME_2MSB_OFF :
|
||||
LTM_PRIME_2MSB_ON, myrng, NULL);
|
||||
if (err != MP_OKAY) {
|
||||
printf("failed with err code %d\n", err);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (mp_count_bits(&a) != ix) {
|
||||
printf("Prime is %d not %d bits!!!\n", mp_count_bits(&a), ix);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
for (ix = 16; ix < 128; ix++) {
|
||||
printf("Testing ( safe-prime): %9d bits \r", ix);
|
||||
fflush(stdout);
|
||||
err =
|
||||
mp_prime_random_ex(&a, 8, ix,
|
||||
((rand() & 1) ? LTM_PRIME_2MSB_OFF :
|
||||
LTM_PRIME_2MSB_ON) | LTM_PRIME_SAFE, myrng,
|
||||
NULL);
|
||||
if (err != MP_OKAY) {
|
||||
printf("failed with err code %d\n", err);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (mp_count_bits(&a) != ix) {
|
||||
printf("Prime is %d not %d bits!!!\n", mp_count_bits(&a), ix);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
/* let's see if it's really a safe prime */
|
||||
mp_sub_d(&a, 1, &a);
|
||||
mp_div_2(&a, &a);
|
||||
mp_prime_is_prime(&a, 8, &cnt);
|
||||
if (cnt != MP_YES) {
|
||||
printf("sub is not prime!\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
mp_read_radix(&a, "123456", 10);
|
||||
mp_toradix_n(&a, buf, 10, 3);
|
||||
printf("a == %s\n", buf);
|
||||
mp_toradix_n(&a, buf, 10, 4);
|
||||
printf("a == %s\n", buf);
|
||||
mp_toradix_n(&a, buf, 10, 30);
|
||||
printf("a == %s\n", buf);
|
||||
|
||||
|
||||
#if 0
|
||||
for (;;) {
|
||||
fgets(buf, sizeof(buf), stdin);
|
||||
mp_read_radix(&a, buf, 10);
|
||||
mp_prime_next_prime(&a, 5, 1);
|
||||
mp_toradix(&a, buf, 10);
|
||||
printf("%s, %lu\n", buf, a.dp[0] & 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* test mp_cnt_lsb */
|
||||
printf("testing mp_cnt_lsb...\n");
|
||||
mp_set(&a, 1);
|
||||
for (ix = 0; ix < 1024; ix++) {
|
||||
if (mp_cnt_lsb(&a) != ix) {
|
||||
printf("Failed at %d, %d\n", ix, mp_cnt_lsb(&a));
|
||||
return 0;
|
||||
}
|
||||
mp_mul_2(&a, &a);
|
||||
}
|
||||
|
||||
/* test mp_reduce_2k */
|
||||
printf("Testing mp_reduce_2k...\n");
|
||||
for (cnt = 3; cnt <= 128; ++cnt) {
|
||||
mp_digit tmp;
|
||||
|
||||
mp_2expt(&a, cnt);
|
||||
mp_sub_d(&a, 2, &a); /* a = 2**cnt - 2 */
|
||||
|
||||
|
||||
printf("\nTesting %4d bits", cnt);
|
||||
printf("(%d)", mp_reduce_is_2k(&a));
|
||||
mp_reduce_2k_setup(&a, &tmp);
|
||||
printf("(%d)", tmp);
|
||||
for (ix = 0; ix < 1000; ix++) {
|
||||
if (!(ix & 127)) {
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
}
|
||||
mp_rand(&b, (cnt / DIGIT_BIT + 1) * 2);
|
||||
mp_copy(&c, &b);
|
||||
mp_mod(&c, &a, &c);
|
||||
mp_reduce_2k(&b, &a, 2);
|
||||
if (mp_cmp(&c, &b)) {
|
||||
printf("FAILED\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* test mp_div_3 */
|
||||
printf("Testing mp_div_3...\n");
|
||||
mp_set(&d, 3);
|
||||
for (cnt = 0; cnt < 10000;) {
|
||||
mp_digit r1, r2;
|
||||
|
||||
if (!(++cnt & 127))
|
||||
printf("%9d\r", cnt);
|
||||
mp_rand(&a, abs(rand()) % 128 + 1);
|
||||
mp_div(&a, &d, &b, &e);
|
||||
mp_div_3(&a, &c, &r2);
|
||||
|
||||
if (mp_cmp(&b, &c) || mp_cmp_d(&e, r2)) {
|
||||
printf("\n\nmp_div_3 => Failure\n");
|
||||
}
|
||||
}
|
||||
printf("\n\nPassed div_3 testing\n");
|
||||
|
||||
/* test the DR reduction */
|
||||
printf("testing mp_dr_reduce...\n");
|
||||
for (cnt = 2; cnt < 32; cnt++) {
|
||||
printf("%d digit modulus\n", cnt);
|
||||
mp_grow(&a, cnt);
|
||||
mp_zero(&a);
|
||||
for (ix = 1; ix < cnt; ix++) {
|
||||
a.dp[ix] = MP_MASK;
|
||||
}
|
||||
a.used = cnt;
|
||||
a.dp[0] = 3;
|
||||
|
||||
mp_rand(&b, cnt - 1);
|
||||
mp_copy(&b, &c);
|
||||
|
||||
rr = 0;
|
||||
do {
|
||||
if (!(rr & 127)) {
|
||||
printf("%9lu\r", rr);
|
||||
fflush(stdout);
|
||||
}
|
||||
mp_sqr(&b, &b);
|
||||
mp_add_d(&b, 1, &b);
|
||||
mp_copy(&b, &c);
|
||||
|
||||
mp_mod(&b, &a, &b);
|
||||
mp_dr_reduce(&c, &a, (((mp_digit) 1) << DIGIT_BIT) - a.dp[0]);
|
||||
|
||||
if (mp_cmp(&b, &c) != MP_EQ) {
|
||||
printf("Failed on trial %lu\n", rr);
|
||||
exit(-1);
|
||||
|
||||
}
|
||||
} while (++rr < 500);
|
||||
printf("Passed DR test for %d digits\n", cnt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* test the mp_reduce_2k_l code */
|
||||
#if 0
|
||||
#if 0
|
||||
/* first load P with 2^1024 - 0x2A434 B9FDEC95 D8F9D550 FFFFFFFF FFFFFFFF */
|
||||
mp_2expt(&a, 1024);
|
||||
mp_read_radix(&b, "2A434B9FDEC95D8F9D550FFFFFFFFFFFFFFFF", 16);
|
||||
mp_sub(&a, &b, &a);
|
||||
#elif 1
|
||||
/* p = 2^2048 - 0x1 00000000 00000000 00000000 00000000 4945DDBF 8EA2A91D 5776399B B83E188F */
|
||||
mp_2expt(&a, 2048);
|
||||
mp_read_radix(&b,
|
||||
"1000000000000000000000000000000004945DDBF8EA2A91D5776399BB83E188F",
|
||||
16);
|
||||
mp_sub(&a, &b, &a);
|
||||
#endif
|
||||
|
||||
mp_todecimal(&a, buf);
|
||||
printf("p==%s\n", buf);
|
||||
/* now mp_reduce_is_2k_l() should return */
|
||||
if (mp_reduce_is_2k_l(&a) != 1) {
|
||||
printf("mp_reduce_is_2k_l() return 0, should be 1\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
mp_reduce_2k_setup_l(&a, &d);
|
||||
/* now do a million square+1 to see if it varies */
|
||||
mp_rand(&b, 64);
|
||||
mp_mod(&b, &a, &b);
|
||||
mp_copy(&b, &c);
|
||||
printf("testing mp_reduce_2k_l...");
|
||||
fflush(stdout);
|
||||
for (cnt = 0; cnt < (1UL << 20); cnt++) {
|
||||
mp_sqr(&b, &b);
|
||||
mp_add_d(&b, 1, &b);
|
||||
mp_reduce_2k_l(&b, &a, &d);
|
||||
mp_sqr(&c, &c);
|
||||
mp_add_d(&c, 1, &c);
|
||||
mp_mod(&c, &a, &c);
|
||||
if (mp_cmp(&b, &c) != MP_EQ) {
|
||||
printf("mp_reduce_2k_l() failed at step %lu\n", cnt);
|
||||
mp_tohex(&b, buf);
|
||||
printf("b == %s\n", buf);
|
||||
mp_tohex(&c, buf);
|
||||
printf("c == %s\n", buf);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
printf("...Passed\n");
|
||||
#endif
|
||||
|
||||
div2_n = mul2_n = inv_n = expt_n = lcm_n = gcd_n = add_n =
|
||||
sub_n = mul_n = div_n = sqr_n = mul2d_n = div2d_n = cnt = add_d_n =
|
||||
sub_d_n = 0;
|
||||
|
||||
/* force KARA and TOOM to enable despite cutoffs */
|
||||
KARATSUBA_SQR_CUTOFF = KARATSUBA_MUL_CUTOFF = 8;
|
||||
TOOM_SQR_CUTOFF = TOOM_MUL_CUTOFF = 16;
|
||||
|
||||
for (;;) {
|
||||
/* randomly clear and re-init one variable, this has the affect of triming the alloc space */
|
||||
switch (abs(rand()) % 7) {
|
||||
case 0:
|
||||
mp_clear(&a);
|
||||
mp_init(&a);
|
||||
break;
|
||||
case 1:
|
||||
mp_clear(&b);
|
||||
mp_init(&b);
|
||||
break;
|
||||
case 2:
|
||||
mp_clear(&c);
|
||||
mp_init(&c);
|
||||
break;
|
||||
case 3:
|
||||
mp_clear(&d);
|
||||
mp_init(&d);
|
||||
break;
|
||||
case 4:
|
||||
mp_clear(&e);
|
||||
mp_init(&e);
|
||||
break;
|
||||
case 5:
|
||||
mp_clear(&f);
|
||||
mp_init(&f);
|
||||
break;
|
||||
case 6:
|
||||
break; /* don't clear any */
|
||||
}
|
||||
|
||||
|
||||
printf
|
||||
("%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu/%4lu ",
|
||||
add_n, sub_n, mul_n, div_n, sqr_n, mul2d_n, div2d_n, gcd_n, lcm_n,
|
||||
expt_n, inv_n, div2_n, mul2_n, add_d_n, sub_d_n);
|
||||
fgets(cmd, 4095, stdin);
|
||||
cmd[strlen(cmd) - 1] = 0;
|
||||
printf("%s ]\r", cmd);
|
||||
fflush(stdout);
|
||||
if (!strcmp(cmd, "mul2d")) {
|
||||
++mul2d_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
sscanf(buf, "%d", &rr);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
|
||||
mp_mul_2d(&a, rr, &a);
|
||||
a.sign = b.sign;
|
||||
if (mp_cmp(&a, &b) != MP_EQ) {
|
||||
printf("mul2d failed, rr == %d\n", rr);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "div2d")) {
|
||||
++div2d_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
sscanf(buf, "%d", &rr);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
|
||||
mp_div_2d(&a, rr, &a, &e);
|
||||
a.sign = b.sign;
|
||||
if (a.used == b.used && a.used == 0) {
|
||||
a.sign = b.sign = MP_ZPOS;
|
||||
}
|
||||
if (mp_cmp(&a, &b) != MP_EQ) {
|
||||
printf("div2d failed, rr == %d\n", rr);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "add")) {
|
||||
++add_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
mp_copy(&a, &d);
|
||||
mp_add(&d, &b, &d);
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("add %lu failure!\n", add_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* test the sign/unsigned storage functions */
|
||||
|
||||
rr = mp_signed_bin_size(&c);
|
||||
mp_to_signed_bin(&c, (unsigned char *) cmd);
|
||||
memset(cmd + rr, rand() & 255, sizeof(cmd) - rr);
|
||||
mp_read_signed_bin(&d, (unsigned char *) cmd, rr);
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("mp_signed_bin failure!\n");
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
rr = mp_unsigned_bin_size(&c);
|
||||
mp_to_unsigned_bin(&c, (unsigned char *) cmd);
|
||||
memset(cmd + rr, rand() & 255, sizeof(cmd) - rr);
|
||||
mp_read_unsigned_bin(&d, (unsigned char *) cmd, rr);
|
||||
if (mp_cmp_mag(&c, &d) != MP_EQ) {
|
||||
printf("mp_unsigned_bin failure!\n");
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else if (!strcmp(cmd, "sub")) {
|
||||
++sub_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
mp_copy(&a, &d);
|
||||
mp_sub(&d, &b, &d);
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("sub %lu failure!\n", sub_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "mul")) {
|
||||
++mul_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
mp_copy(&a, &d);
|
||||
mp_mul(&d, &b, &d);
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("mul %lu failure!\n", mul_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "div")) {
|
||||
++div_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&d, buf, 64);
|
||||
|
||||
mp_div(&a, &b, &e, &f);
|
||||
if (mp_cmp(&c, &e) != MP_EQ || mp_cmp(&d, &f) != MP_EQ) {
|
||||
printf("div %lu %d, %d, failure!\n", div_n, mp_cmp(&c, &e),
|
||||
mp_cmp(&d, &f));
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
draw(&e);
|
||||
draw(&f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else if (!strcmp(cmd, "sqr")) {
|
||||
++sqr_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
mp_copy(&a, &c);
|
||||
mp_sqr(&c, &c);
|
||||
if (mp_cmp(&b, &c) != MP_EQ) {
|
||||
printf("sqr %lu failure!\n", sqr_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "gcd")) {
|
||||
++gcd_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
mp_copy(&a, &d);
|
||||
mp_gcd(&d, &b, &d);
|
||||
d.sign = c.sign;
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("gcd %lu failure!\n", gcd_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "lcm")) {
|
||||
++lcm_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
mp_copy(&a, &d);
|
||||
mp_lcm(&d, &b, &d);
|
||||
d.sign = c.sign;
|
||||
if (mp_cmp(&c, &d) != MP_EQ) {
|
||||
printf("lcm %lu failure!\n", lcm_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "expt")) {
|
||||
++expt_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&d, buf, 64);
|
||||
mp_copy(&a, &e);
|
||||
mp_exptmod(&e, &b, &c, &e);
|
||||
if (mp_cmp(&d, &e) != MP_EQ) {
|
||||
printf("expt %lu failure!\n", expt_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
draw(&e);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "invmod")) {
|
||||
++inv_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&c, buf, 64);
|
||||
mp_invmod(&a, &b, &d);
|
||||
mp_mulmod(&d, &a, &b, &e);
|
||||
if (mp_cmp_d(&e, 1) != MP_EQ) {
|
||||
printf("inv [wrong value from MPI?!] failure\n");
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
draw(&d);
|
||||
mp_gcd(&a, &b, &e);
|
||||
draw(&e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else if (!strcmp(cmd, "div2")) {
|
||||
++div2_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
mp_div_2(&a, &c);
|
||||
if (mp_cmp(&c, &b) != MP_EQ) {
|
||||
printf("div_2 %lu failure\n", div2_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "mul2")) {
|
||||
++mul2_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
mp_mul_2(&a, &c);
|
||||
if (mp_cmp(&c, &b) != MP_EQ) {
|
||||
printf("mul_2 %lu failure\n", mul2_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "add_d")) {
|
||||
++add_d_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
sscanf(buf, "%d", &ix);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
mp_add_d(&a, ix, &c);
|
||||
if (mp_cmp(&b, &c) != MP_EQ) {
|
||||
printf("add_d %lu failure\n", add_d_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
printf("d == %d\n", ix);
|
||||
return 0;
|
||||
}
|
||||
} else if (!strcmp(cmd, "sub_d")) {
|
||||
++sub_d_n;
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&a, buf, 64);
|
||||
fgets(buf, 4095, stdin);
|
||||
sscanf(buf, "%d", &ix);
|
||||
fgets(buf, 4095, stdin);
|
||||
mp_read_radix(&b, buf, 64);
|
||||
mp_sub_d(&a, ix, &c);
|
||||
if (mp_cmp(&b, &c) != MP_EQ) {
|
||||
printf("sub_d %lu failure\n", sub_d_n);
|
||||
draw(&a);
|
||||
draw(&b);
|
||||
draw(&c);
|
||||
printf("d == %d\n", ix);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,315 +0,0 @@
|
||||
#include <tommath.h>
|
||||
#include <time.h>
|
||||
|
||||
ulong64 _tt;
|
||||
|
||||
#ifdef IOWNANATHLON
|
||||
#include <unistd.h>
|
||||
#define SLEEP sleep(4)
|
||||
#else
|
||||
#define SLEEP
|
||||
#endif
|
||||
|
||||
|
||||
void ndraw(mp_int * a, char *name)
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
printf("%s: ", name);
|
||||
mp_toradix(a, buf, 64);
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
|
||||
static void draw(mp_int * a)
|
||||
{
|
||||
ndraw(a, "");
|
||||
}
|
||||
|
||||
|
||||
unsigned long lfsr = 0xAAAAAAAAUL;
|
||||
|
||||
int lbit(void)
|
||||
{
|
||||
if (lfsr & 0x80000000UL) {
|
||||
lfsr = ((lfsr << 1) ^ 0x8000001BUL) & 0xFFFFFFFFUL;
|
||||
return 1;
|
||||
} else {
|
||||
lfsr <<= 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* RDTSC from Scott Duplichan */
|
||||
static ulong64 TIMFUNC(void)
|
||||
{
|
||||
#if defined __GNUC__
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
unsigned long long a;
|
||||
__asm__ __volatile__("rdtsc\nmovl %%eax,%0\nmovl %%edx,4+%0\n"::
|
||||
"m"(a):"%eax", "%edx");
|
||||
return a;
|
||||
#else /* gcc-IA64 version */
|
||||
unsigned long result;
|
||||
__asm__ __volatile__("mov %0=ar.itc":"=r"(result)::"memory");
|
||||
|
||||
while (__builtin_expect((int) result == -1, 0))
|
||||
__asm__ __volatile__("mov %0=ar.itc":"=r"(result)::"memory");
|
||||
|
||||
return result;
|
||||
#endif
|
||||
|
||||
// Microsoft and Intel Windows compilers
|
||||
#elif defined _M_IX86
|
||||
__asm rdtsc
|
||||
#elif defined _M_AMD64
|
||||
return __rdtsc();
|
||||
#elif defined _M_IA64
|
||||
#if defined __INTEL_COMPILER
|
||||
#include <ia64intrin.h>
|
||||
#endif
|
||||
return __getReg(3116);
|
||||
#else
|
||||
#error need rdtsc function for this build
|
||||
#endif
|
||||
}
|
||||
|
||||
#define DO(x) x; x;
|
||||
//#define DO4(x) DO2(x); DO2(x);
|
||||
//#define DO8(x) DO4(x); DO4(x);
|
||||
//#define DO(x) DO8(x); DO8(x);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ulong64 tt, gg, CLK_PER_SEC;
|
||||
FILE *log, *logb, *logc, *logd;
|
||||
mp_int a, b, c, d, e, f;
|
||||
int n, cnt, ix, old_kara_m, old_kara_s;
|
||||
unsigned rr;
|
||||
|
||||
mp_init(&a);
|
||||
mp_init(&b);
|
||||
mp_init(&c);
|
||||
mp_init(&d);
|
||||
mp_init(&e);
|
||||
mp_init(&f);
|
||||
|
||||
srand(time(NULL));
|
||||
|
||||
|
||||
/* temp. turn off TOOM */
|
||||
TOOM_MUL_CUTOFF = TOOM_SQR_CUTOFF = 100000;
|
||||
|
||||
CLK_PER_SEC = TIMFUNC();
|
||||
sleep(1);
|
||||
CLK_PER_SEC = TIMFUNC() - CLK_PER_SEC;
|
||||
|
||||
printf("CLK_PER_SEC == %llu\n", CLK_PER_SEC);
|
||||
goto exptmod;
|
||||
log = fopen("logs/add.log", "w");
|
||||
for (cnt = 8; cnt <= 128; cnt += 8) {
|
||||
SLEEP;
|
||||
mp_rand(&a, cnt);
|
||||
mp_rand(&b, cnt);
|
||||
rr = 0;
|
||||
tt = -1;
|
||||
do {
|
||||
gg = TIMFUNC();
|
||||
DO(mp_add(&a, &b, &c));
|
||||
gg = (TIMFUNC() - gg) >> 1;
|
||||
if (tt > gg)
|
||||
tt = gg;
|
||||
} while (++rr < 100000);
|
||||
printf("Adding\t\t%4d-bit => %9llu/sec, %9llu cycles\n",
|
||||
mp_count_bits(&a), CLK_PER_SEC / tt, tt);
|
||||
fprintf(log, "%d %9llu\n", cnt * DIGIT_BIT, tt);
|
||||
fflush(log);
|
||||
}
|
||||
fclose(log);
|
||||
|
||||
log = fopen("logs/sub.log", "w");
|
||||
for (cnt = 8; cnt <= 128; cnt += 8) {
|
||||
SLEEP;
|
||||
mp_rand(&a, cnt);
|
||||
mp_rand(&b, cnt);
|
||||
rr = 0;
|
||||
tt = -1;
|
||||
do {
|
||||
gg = TIMFUNC();
|
||||
DO(mp_sub(&a, &b, &c));
|
||||
gg = (TIMFUNC() - gg) >> 1;
|
||||
if (tt > gg)
|
||||
tt = gg;
|
||||
} while (++rr < 100000);
|
||||
|
||||
printf("Subtracting\t\t%4d-bit => %9llu/sec, %9llu cycles\n",
|
||||
mp_count_bits(&a), CLK_PER_SEC / tt, tt);
|
||||
fprintf(log, "%d %9llu\n", cnt * DIGIT_BIT, tt);
|
||||
fflush(log);
|
||||
}
|
||||
fclose(log);
|
||||
|
||||
/* do mult/square twice, first without karatsuba and second with */
|
||||
multtest:
|
||||
old_kara_m = KARATSUBA_MUL_CUTOFF;
|
||||
old_kara_s = KARATSUBA_SQR_CUTOFF;
|
||||
for (ix = 0; ix < 2; ix++) {
|
||||
printf("With%s Karatsuba\n", (ix == 0) ? "out" : "");
|
||||
|
||||
KARATSUBA_MUL_CUTOFF = (ix == 0) ? 9999 : old_kara_m;
|
||||
KARATSUBA_SQR_CUTOFF = (ix == 0) ? 9999 : old_kara_s;
|
||||
|
||||
log = fopen((ix == 0) ? "logs/mult.log" : "logs/mult_kara.log", "w");
|
||||
for (cnt = 4; cnt <= 10240 / DIGIT_BIT; cnt += 2) {
|
||||
SLEEP;
|
||||
mp_rand(&a, cnt);
|
||||
mp_rand(&b, cnt);
|
||||
rr = 0;
|
||||
tt = -1;
|
||||
do {
|
||||
gg = TIMFUNC();
|
||||
DO(mp_mul(&a, &b, &c));
|
||||
gg = (TIMFUNC() - gg) >> 1;
|
||||
if (tt > gg)
|
||||
tt = gg;
|
||||
} while (++rr < 100);
|
||||
printf("Multiplying\t%4d-bit => %9llu/sec, %9llu cycles\n",
|
||||
mp_count_bits(&a), CLK_PER_SEC / tt, tt);
|
||||
fprintf(log, "%d %9llu\n", mp_count_bits(&a), tt);
|
||||
fflush(log);
|
||||
}
|
||||
fclose(log);
|
||||
|
||||
log = fopen((ix == 0) ? "logs/sqr.log" : "logs/sqr_kara.log", "w");
|
||||
for (cnt = 4; cnt <= 10240 / DIGIT_BIT; cnt += 2) {
|
||||
SLEEP;
|
||||
mp_rand(&a, cnt);
|
||||
rr = 0;
|
||||
tt = -1;
|
||||
do {
|
||||
gg = TIMFUNC();
|
||||
DO(mp_sqr(&a, &b));
|
||||
gg = (TIMFUNC() - gg) >> 1;
|
||||
if (tt > gg)
|
||||
tt = gg;
|
||||
} while (++rr < 100);
|
||||
printf("Squaring\t%4d-bit => %9llu/sec, %9llu cycles\n",
|
||||
mp_count_bits(&a), CLK_PER_SEC / tt, tt);
|
||||
fprintf(log, "%d %9llu\n", mp_count_bits(&a), tt);
|
||||
fflush(log);
|
||||
}
|
||||
fclose(log);
|
||||
|
||||
}
|
||||
exptmod:
|
||||
|
||||
{
|
||||
char *primes[] = {
|
||||
/* 2K large moduli */
|
||||
"179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586239334100047359817950870678242457666208137217",
|
||||
"32317006071311007300714876688669951960444102669715484032130345427524655138867890893197201411522913463688717960921898019494119559150490921095088152386448283120630877367300996091750197750389652106796057638384067568276792218642619756161838094338476170470581645852036305042887575891541065808607552399123930385521914333389668342420684974786564569494856176035326322058077805659331026192708460314150258592864177116725943603718461857357598351152301645904403697613233287231227125684710820209725157101726931323469678542580656697935045997268352998638099733077152121140120031150424541696791951097529546801429027668869927491725169",
|
||||
"1044388881413152506691752710716624382579964249047383780384233483283953907971557456848826811934997558340890106714439262837987573438185793607263236087851365277945956976543709998340361590134383718314428070011855946226376318839397712745672334684344586617496807908705803704071284048740118609114467977783598029006686938976881787785946905630190260940599579453432823469303026696443059025015972399867714215541693835559885291486318237914434496734087811872639496475100189041349008417061675093668333850551032972088269550769983616369411933015213796825837188091833656751221318492846368125550225998300412344784862595674492194617023806505913245610825731835380087608622102834270197698202313169017678006675195485079921636419370285375124784014907159135459982790513399611551794271106831134090584272884279791554849782954323534517065223269061394905987693002122963395687782878948440616007412945674919823050571642377154816321380631045902916136926708342856440730447899971901781465763473223850267253059899795996090799469201774624817718449867455659250178329070473119433165550807568221846571746373296884912819520317457002440926616910874148385078411929804522981857338977648103126085902995208257421855249796721729039744118165938433694823325696642096892124547425283",
|
||||
/* 2K moduli mersenne primes */
|
||||
"6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151",
|
||||
"531137992816767098689588206552468627329593117727031923199444138200403559860852242739162502265229285668889329486246501015346579337652707239409519978766587351943831270835393219031728127",
|
||||
"10407932194664399081925240327364085538615262247266704805319112350403608059673360298012239441732324184842421613954281007791383566248323464908139906605677320762924129509389220345773183349661583550472959420547689811211693677147548478866962501384438260291732348885311160828538416585028255604666224831890918801847068222203140521026698435488732958028878050869736186900714720710555703168729087",
|
||||
"1475979915214180235084898622737381736312066145333169775147771216478570297878078949377407337049389289382748507531496480477281264838760259191814463365330269540496961201113430156902396093989090226259326935025281409614983499388222831448598601834318536230923772641390209490231836446899608210795482963763094236630945410832793769905399982457186322944729636418890623372171723742105636440368218459649632948538696905872650486914434637457507280441823676813517852099348660847172579408422316678097670224011990280170474894487426924742108823536808485072502240519452587542875349976558572670229633962575212637477897785501552646522609988869914013540483809865681250419497686697771007",
|
||||
"259117086013202627776246767922441530941818887553125427303974923161874019266586362086201209516800483406550695241733194177441689509238807017410377709597512042313066624082916353517952311186154862265604547691127595848775610568757931191017711408826252153849035830401185072116424747461823031471398340229288074545677907941037288235820705892351068433882986888616658650280927692080339605869308790500409503709875902119018371991620994002568935113136548829739112656797303241986517250116412703509705427773477972349821676443446668383119322540099648994051790241624056519054483690809616061625743042361721863339415852426431208737266591962061753535748892894599629195183082621860853400937932839420261866586142503251450773096274235376822938649407127700846077124211823080804139298087057504713825264571448379371125032081826126566649084251699453951887789613650248405739378594599444335231188280123660406262468609212150349937584782292237144339628858485938215738821232393687046160677362909315071",
|
||||
"190797007524439073807468042969529173669356994749940177394741882673528979787005053706368049835514900244303495954950709725762186311224148828811920216904542206960744666169364221195289538436845390250168663932838805192055137154390912666527533007309292687539092257043362517857366624699975402375462954490293259233303137330643531556539739921926201438606439020075174723029056838272505051571967594608350063404495977660656269020823960825567012344189908927956646011998057988548630107637380993519826582389781888135705408653045219655801758081251164080554609057468028203308718724654081055323215860189611391296030471108443146745671967766308925858547271507311563765171008318248647110097614890313562856541784154881743146033909602737947385055355960331855614540900081456378659068370317267696980001187750995491090350108417050917991562167972281070161305972518044872048331306383715094854938415738549894606070722584737978176686422134354526989443028353644037187375385397838259511833166416134323695660367676897722287918773420968982326089026150031515424165462111337527431154890666327374921446276833564519776797633875503548665093914556482031482248883127023777039667707976559857333357013727342079099064400455741830654320379350833236245819348824064783585692924881021978332974949906122664421376034687815350484991",
|
||||
|
||||
/* DR moduli */
|
||||
"14059105607947488696282932836518693308967803494693489478439861164411992439598399594747002144074658928593502845729752797260025831423419686528151609940203368612079",
|
||||
"101745825697019260773923519755878567461315282017759829107608914364075275235254395622580447400994175578963163918967182013639660669771108475957692810857098847138903161308502419410142185759152435680068435915159402496058513611411688900243039",
|
||||
"736335108039604595805923406147184530889923370574768772191969612422073040099331944991573923112581267542507986451953227192970402893063850485730703075899286013451337291468249027691733891486704001513279827771740183629161065194874727962517148100775228363421083691764065477590823919364012917984605619526140821797602431",
|
||||
"38564998830736521417281865696453025806593491967131023221754800625044118265468851210705360385717536794615180260494208076605798671660719333199513807806252394423283413430106003596332513246682903994829528690198205120921557533726473585751382193953592127439965050261476810842071573684505878854588706623484573925925903505747545471088867712185004135201289273405614415899438276535626346098904241020877974002916168099951885406379295536200413493190419727789712076165162175783",
|
||||
"542189391331696172661670440619180536749994166415993334151601745392193484590296600979602378676624808129613777993466242203025054573692562689251250471628358318743978285860720148446448885701001277560572526947619392551574490839286458454994488665744991822837769918095117129546414124448777033941223565831420390846864429504774477949153794689948747680362212954278693335653935890352619041936727463717926744868338358149568368643403037768649616778526013610493696186055899318268339432671541328195724261329606699831016666359440874843103020666106568222401047720269951530296879490444224546654729111504346660859907296364097126834834235287147",
|
||||
"1487259134814709264092032648525971038895865645148901180585340454985524155135260217788758027400478312256339496385275012465661575576202252063145698732079880294664220579764848767704076761853197216563262660046602703973050798218246170835962005598561669706844469447435461092542265792444947706769615695252256130901271870341005768912974433684521436211263358097522726462083917939091760026658925757076733484173202927141441492573799914240222628795405623953109131594523623353044898339481494120112723445689647986475279242446083151413667587008191682564376412347964146113898565886683139407005941383669325997475076910488086663256335689181157957571445067490187939553165903773554290260531009121879044170766615232300936675369451260747671432073394867530820527479172464106442450727640226503746586340279816318821395210726268291535648506190714616083163403189943334431056876038286530365757187367147446004855912033137386225053275419626102417236133948503",
|
||||
"1095121115716677802856811290392395128588168592409109494900178008967955253005183831872715423151551999734857184538199864469605657805519106717529655044054833197687459782636297255219742994736751541815269727940751860670268774903340296040006114013971309257028332849679096824800250742691718610670812374272414086863715763724622797509437062518082383056050144624962776302147890521249477060215148275163688301275847155316042279405557632639366066847442861422164832655874655824221577849928863023018366835675399949740429332468186340518172487073360822220449055340582568461568645259954873303616953776393853174845132081121976327462740354930744487429617202585015510744298530101547706821590188733515880733527449780963163909830077616357506845523215289297624086914545378511082534229620116563260168494523906566709418166011112754529766183554579321224940951177394088465596712620076240067370589036924024728375076210477267488679008016579588696191194060127319035195370137160936882402244399699172017835144537488486396906144217720028992863941288217185353914991583400421682751000603596655790990815525126154394344641336397793791497068253936771017031980867706707490224041075826337383538651825493679503771934836094655802776331664261631740148281763487765852746577808019633679",
|
||||
|
||||
/* generic unrestricted moduli */
|
||||
"17933601194860113372237070562165128350027320072176844226673287945873370751245439587792371960615073855669274087805055507977323024886880985062002853331424203",
|
||||
"2893527720709661239493896562339544088620375736490408468011883030469939904368086092336458298221245707898933583190713188177399401852627749210994595974791782790253946539043962213027074922559572312141181787434278708783207966459019479487",
|
||||
"347743159439876626079252796797422223177535447388206607607181663903045907591201940478223621722118173270898487582987137708656414344685816179420855160986340457973820182883508387588163122354089264395604796675278966117567294812714812796820596564876450716066283126720010859041484786529056457896367683122960411136319",
|
||||
"47266428956356393164697365098120418976400602706072312735924071745438532218237979333351774907308168340693326687317443721193266215155735814510792148768576498491199122744351399489453533553203833318691678263241941706256996197460424029012419012634671862283532342656309677173602509498417976091509154360039893165037637034737020327399910409885798185771003505320583967737293415979917317338985837385734747478364242020380416892056650841470869294527543597349250299539682430605173321029026555546832473048600327036845781970289288898317888427517364945316709081173840186150794397479045034008257793436817683392375274635794835245695887",
|
||||
"436463808505957768574894870394349739623346440601945961161254440072143298152040105676491048248110146278752857839930515766167441407021501229924721335644557342265864606569000117714935185566842453630868849121480179691838399545644365571106757731317371758557990781880691336695584799313313687287468894148823761785582982549586183756806449017542622267874275103877481475534991201849912222670102069951687572917937634467778042874315463238062009202992087620963771759666448266532858079402669920025224220613419441069718482837399612644978839925207109870840278194042158748845445131729137117098529028886770063736487420613144045836803985635654192482395882603511950547826439092832800532152534003936926017612446606135655146445620623395788978726744728503058670046885876251527122350275750995227",
|
||||
"11424167473351836398078306042624362277956429440521137061889702611766348760692206243140413411077394583180726863277012016602279290144126785129569474909173584789822341986742719230331946072730319555984484911716797058875905400999504305877245849119687509023232790273637466821052576859232452982061831009770786031785669030271542286603956118755585683996118896215213488875253101894663403069677745948305893849505434201763745232895780711972432011344857521691017896316861403206449421332243658855453435784006517202894181640562433575390821384210960117518650374602256601091379644034244332285065935413233557998331562749140202965844219336298970011513882564935538704289446968322281451907487362046511461221329799897350993370560697505809686438782036235372137015731304779072430260986460269894522159103008260495503005267165927542949439526272736586626709581721032189532726389643625590680105784844246152702670169304203783072275089194754889511973916207",
|
||||
"1214855636816562637502584060163403830270705000634713483015101384881871978446801224798536155406895823305035467591632531067547890948695117172076954220727075688048751022421198712032848890056357845974246560748347918630050853933697792254955890439720297560693579400297062396904306270145886830719309296352765295712183040773146419022875165382778007040109957609739589875590885701126197906063620133954893216612678838507540777138437797705602453719559017633986486649523611975865005712371194067612263330335590526176087004421363598470302731349138773205901447704682181517904064735636518462452242791676541725292378925568296858010151852326316777511935037531017413910506921922450666933202278489024521263798482237150056835746454842662048692127173834433089016107854491097456725016327709663199738238442164843147132789153725513257167915555162094970853584447993125488607696008169807374736711297007473812256272245489405898470297178738029484459690836250560495461579533254473316340608217876781986188705928270735695752830825527963838355419762516246028680280988020401914551825487349990306976304093109384451438813251211051597392127491464898797406789175453067960072008590614886532333015881171367104445044718144312416815712216611576221546455968770801413440778423979",
|
||||
NULL
|
||||
};
|
||||
log = fopen("logs/expt.log", "w");
|
||||
logb = fopen("logs/expt_dr.log", "w");
|
||||
logc = fopen("logs/expt_2k.log", "w");
|
||||
logd = fopen("logs/expt_2kl.log", "w");
|
||||
for (n = 0; primes[n]; n++) {
|
||||
SLEEP;
|
||||
mp_read_radix(&a, primes[n], 10);
|
||||
mp_zero(&b);
|
||||
for (rr = 0; rr < (unsigned) mp_count_bits(&a); rr++) {
|
||||
mp_mul_2(&b, &b);
|
||||
b.dp[0] |= lbit();
|
||||
b.used += 1;
|
||||
}
|
||||
mp_sub_d(&a, 1, &c);
|
||||
mp_mod(&b, &c, &b);
|
||||
mp_set(&c, 3);
|
||||
rr = 0;
|
||||
tt = -1;
|
||||
do {
|
||||
gg = TIMFUNC();
|
||||
DO(mp_exptmod(&c, &b, &a, &d));
|
||||
gg = (TIMFUNC() - gg) >> 1;
|
||||
if (tt > gg)
|
||||
tt = gg;
|
||||
} while (++rr < 10);
|
||||
mp_sub_d(&a, 1, &e);
|
||||
mp_sub(&e, &b, &b);
|
||||
mp_exptmod(&c, &b, &a, &e); /* c^(p-1-b) mod a */
|
||||
mp_mulmod(&e, &d, &a, &d); /* c^b * c^(p-1-b) == c^p-1 == 1 */
|
||||
if (mp_cmp_d(&d, 1)) {
|
||||
printf("Different (%d)!!!\n", mp_count_bits(&a));
|
||||
draw(&d);
|
||||
exit(0);
|
||||
}
|
||||
printf("Exponentiating\t%4d-bit => %9llu/sec, %9llu cycles\n",
|
||||
mp_count_bits(&a), CLK_PER_SEC / tt, tt);
|
||||
fprintf(n < 4 ? logd : (n < 9) ? logc : (n < 16) ? logb : log,
|
||||
"%d %9llu\n", mp_count_bits(&a), tt);
|
||||
}
|
||||
}
|
||||
fclose(log);
|
||||
fclose(logb);
|
||||
fclose(logc);
|
||||
fclose(logd);
|
||||
|
||||
log = fopen("logs/invmod.log", "w");
|
||||
for (cnt = 4; cnt <= 128; cnt += 4) {
|
||||
SLEEP;
|
||||
mp_rand(&a, cnt);
|
||||
mp_rand(&b, cnt);
|
||||
|
||||
do {
|
||||
mp_add_d(&b, 1, &b);
|
||||
mp_gcd(&a, &b, &c);
|
||||
} while (mp_cmp_d(&c, 1) != MP_EQ);
|
||||
|
||||
rr = 0;
|
||||
tt = -1;
|
||||
do {
|
||||
gg = TIMFUNC();
|
||||
DO(mp_invmod(&b, &a, &c));
|
||||
gg = (TIMFUNC() - gg) >> 1;
|
||||
if (tt > gg)
|
||||
tt = gg;
|
||||
} while (++rr < 1000);
|
||||
mp_mulmod(&b, &c, &a, &d);
|
||||
if (mp_cmp_d(&d, 1) != MP_EQ) {
|
||||
printf("Failed to invert\n");
|
||||
return 0;
|
||||
}
|
||||
printf("Inverting mod\t%4d-bit => %9llu/sec, %9llu cycles\n",
|
||||
mp_count_bits(&a), CLK_PER_SEC / tt, tt);
|
||||
fprintf(log, "%d %9llu\n", cnt * DIGIT_BIT, tt);
|
||||
}
|
||||
fclose(log);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Walk through source, add labels and make classes
|
||||
#
|
||||
#use strict;
|
||||
|
||||
my %deplist;
|
||||
|
||||
#open class file and write preamble
|
||||
open(CLASS, ">tommath_class.h") or die "Couldn't open tommath_class.h for writing\n";
|
||||
print CLASS "#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))\n#if defined(LTM2)\n#define LTM3\n#endif\n#if defined(LTM1)\n#define LTM2\n#endif\n#define LTM1\n\n#if defined(LTM_ALL)\n";
|
||||
|
||||
foreach my $filename (glob "bn*.c") {
|
||||
my $define = $filename;
|
||||
|
||||
print "Processing $filename\n";
|
||||
|
||||
# convert filename to upper case so we can use it as a define
|
||||
$define =~ tr/[a-z]/[A-Z]/;
|
||||
$define =~ tr/\./_/;
|
||||
print CLASS "#define $define\n";
|
||||
|
||||
# now copy text and apply #ifdef as required
|
||||
my $apply = 0;
|
||||
open(SRC, "<$filename");
|
||||
open(OUT, ">tmp");
|
||||
|
||||
# first line will be the #ifdef
|
||||
my $line = <SRC>;
|
||||
if ($line =~ /include/) {
|
||||
print OUT $line;
|
||||
} else {
|
||||
print OUT "#include <tommath.h>\n#ifdef $define\n$line";
|
||||
$apply = 1;
|
||||
}
|
||||
while (<SRC>) {
|
||||
if (!($_ =~ /tommath\.h/)) {
|
||||
print OUT $_;
|
||||
}
|
||||
}
|
||||
if ($apply == 1) {
|
||||
print OUT "#endif\n";
|
||||
}
|
||||
close SRC;
|
||||
close OUT;
|
||||
|
||||
unlink($filename);
|
||||
rename("tmp", $filename);
|
||||
}
|
||||
print CLASS "#endif\n\n";
|
||||
|
||||
# now do classes
|
||||
|
||||
foreach my $filename (glob "bn*.c") {
|
||||
open(SRC, "<$filename") or die "Can't open source file!\n";
|
||||
|
||||
# convert filename to upper case so we can use it as a define
|
||||
$filename =~ tr/[a-z]/[A-Z]/;
|
||||
$filename =~ tr/\./_/;
|
||||
|
||||
print CLASS "#if defined($filename)\n";
|
||||
my $list = $filename;
|
||||
|
||||
# scan for mp_* and make classes
|
||||
while (<SRC>) {
|
||||
my $line = $_;
|
||||
while ($line =~ m/(fast_)*(s_)*mp\_[a-z_0-9]*/) {
|
||||
$line = $';
|
||||
# now $& is the match, we want to skip over LTM keywords like
|
||||
# mp_int, mp_word, mp_digit
|
||||
if (!($& eq "mp_digit") && !($& eq "mp_word") && !($& eq "mp_int")) {
|
||||
my $a = $&;
|
||||
$a =~ tr/[a-z]/[A-Z]/;
|
||||
$a = "BN_" . $a . "_C";
|
||||
if (!($list =~ /$a/)) {
|
||||
print CLASS " #define $a\n";
|
||||
}
|
||||
$list = $list . "," . $a;
|
||||
}
|
||||
}
|
||||
}
|
||||
@deplist{$filename} = $list;
|
||||
|
||||
print CLASS "#endif\n\n";
|
||||
close SRC;
|
||||
}
|
||||
|
||||
print CLASS "#ifdef LTM3\n#define LTM_LAST\n#endif\n#include <tommath_superclass.h>\n#include <tommath_class.h>\n#else\n#define LTM_LAST\n#endif\n";
|
||||
close CLASS;
|
||||
|
||||
#now let's make a cool call graph...
|
||||
|
||||
open(OUT,">callgraph.txt");
|
||||
$indent = 0;
|
||||
foreach (keys %deplist) {
|
||||
$list = "";
|
||||
draw_func(@deplist{$_});
|
||||
print OUT "\n\n";
|
||||
}
|
||||
close(OUT);
|
||||
|
||||
sub draw_func()
|
||||
{
|
||||
my @funcs = split(",", $_[0]);
|
||||
if ($list =~ /@funcs[0]/) {
|
||||
return;
|
||||
} else {
|
||||
$list = $list . @funcs[0];
|
||||
}
|
||||
if ($indent == 0) { }
|
||||
elsif ($indent >= 1) { print OUT "| " x ($indent - 1) . "+--->"; }
|
||||
print OUT @funcs[0] . "\n";
|
||||
shift @funcs;
|
||||
my $temp = $list;
|
||||
foreach my $i (@funcs) {
|
||||
++$indent;
|
||||
draw_func(@deplist{$i});
|
||||
--$indent;
|
||||
}
|
||||
$list = $temp;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
256-bits (k = 36113) = 115792089237316195423570985008687907853269984665640564039457584007913129603823
|
||||
512-bits (k = 38117) = 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006045979
|
||||
@@ -1,75 +0,0 @@
|
||||
/* Makes safe primes of a 2k nature */
|
||||
#include <tommath.h>
|
||||
#include <time.h>
|
||||
|
||||
int sizes[] = {256, 512, 768, 1024, 1536, 2048, 3072, 4096};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buf[2000];
|
||||
int x, y;
|
||||
mp_int q, p;
|
||||
FILE *out;
|
||||
clock_t t1;
|
||||
mp_digit z;
|
||||
|
||||
mp_init_multi(&q, &p, NULL);
|
||||
|
||||
out = fopen("2kprime.1", "w");
|
||||
for (x = 0; x < (int)(sizeof(sizes) / sizeof(sizes[0])); x++) {
|
||||
top:
|
||||
mp_2expt(&q, sizes[x]);
|
||||
mp_add_d(&q, 3, &q);
|
||||
z = -3;
|
||||
|
||||
t1 = clock();
|
||||
for(;;) {
|
||||
mp_sub_d(&q, 4, &q);
|
||||
z += 4;
|
||||
|
||||
if (z > MP_MASK) {
|
||||
printf("No primes of size %d found\n", sizes[x]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (clock() - t1 > CLOCKS_PER_SEC) {
|
||||
printf("."); fflush(stdout);
|
||||
// sleep((clock() - t1 + CLOCKS_PER_SEC/2)/CLOCKS_PER_SEC);
|
||||
t1 = clock();
|
||||
}
|
||||
|
||||
/* quick test on q */
|
||||
mp_prime_is_prime(&q, 1, &y);
|
||||
if (y == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* find (q-1)/2 */
|
||||
mp_sub_d(&q, 1, &p);
|
||||
mp_div_2(&p, &p);
|
||||
mp_prime_is_prime(&p, 3, &y);
|
||||
if (y == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* test on q */
|
||||
mp_prime_is_prime(&q, 3, &y);
|
||||
if (y == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (y == 0) {
|
||||
++sizes[x];
|
||||
goto top;
|
||||
}
|
||||
|
||||
mp_toradix(&q, buf, 10);
|
||||
printf("\n\n%d-bits (k = %lu) = %s\n", sizes[x], z, buf);
|
||||
fprintf(out, "%d-bits (k = %lu) = %s\n", sizes[x], z, buf); fflush(out);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/* Makes safe primes of a DR nature */
|
||||
#include <tommath.h>
|
||||
|
||||
int sizes[] = { 1+256/DIGIT_BIT, 1+512/DIGIT_BIT, 1+768/DIGIT_BIT, 1+1024/DIGIT_BIT, 1+2048/DIGIT_BIT, 1+4096/DIGIT_BIT };
|
||||
int main(void)
|
||||
{
|
||||
int res, x, y;
|
||||
char buf[4096];
|
||||
FILE *out;
|
||||
mp_int a, b;
|
||||
|
||||
mp_init(&a);
|
||||
mp_init(&b);
|
||||
|
||||
out = fopen("drprimes.txt", "w");
|
||||
for (x = 0; x < (int)(sizeof(sizes)/sizeof(sizes[0])); x++) {
|
||||
top:
|
||||
printf("Seeking a %d-bit safe prime\n", sizes[x] * DIGIT_BIT);
|
||||
mp_grow(&a, sizes[x]);
|
||||
mp_zero(&a);
|
||||
for (y = 1; y < sizes[x]; y++) {
|
||||
a.dp[y] = MP_MASK;
|
||||
}
|
||||
|
||||
/* make a DR modulus */
|
||||
a.dp[0] = -1;
|
||||
a.used = sizes[x];
|
||||
|
||||
/* now loop */
|
||||
res = 0;
|
||||
for (;;) {
|
||||
a.dp[0] += 4;
|
||||
if (a.dp[0] >= MP_MASK) break;
|
||||
mp_prime_is_prime(&a, 1, &res);
|
||||
if (res == 0) continue;
|
||||
printf("."); fflush(stdout);
|
||||
mp_sub_d(&a, 1, &b);
|
||||
mp_div_2(&b, &b);
|
||||
mp_prime_is_prime(&b, 3, &res);
|
||||
if (res == 0) continue;
|
||||
mp_prime_is_prime(&a, 3, &res);
|
||||
if (res == 1) break;
|
||||
}
|
||||
|
||||
if (res != 1) {
|
||||
printf("Error not DR modulus\n"); sizes[x] += 1; goto top;
|
||||
} else {
|
||||
mp_toradix(&a, buf, 10);
|
||||
printf("\n\np == %s\n\n", buf);
|
||||
fprintf(out, "%d-bit prime:\np == %s\n\n", mp_count_bits(&a), buf); fflush(out);
|
||||
}
|
||||
}
|
||||
fclose(out);
|
||||
|
||||
mp_clear(&a);
|
||||
mp_clear(&b);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
DR safe primes for 28-bit digits.
|
||||
|
||||
224-bit prime:
|
||||
p == 26959946667150639794667015087019630673637144422540572481103341844143
|
||||
|
||||
532-bit prime:
|
||||
p == 14059105607947488696282932836518693308967803494693489478439861164411992439598399594747002144074658928593502845729752797260025831423419686528151609940203368691747
|
||||
|
||||
784-bit prime:
|
||||
p == 101745825697019260773923519755878567461315282017759829107608914364075275235254395622580447400994175578963163918967182013639660669771108475957692810857098847138903161308502419410142185759152435680068435915159402496058513611411688900243039
|
||||
|
||||
1036-bit prime:
|
||||
p == 736335108039604595805923406147184530889923370574768772191969612422073040099331944991573923112581267542507986451953227192970402893063850485730703075899286013451337291468249027691733891486704001513279827771740183629161065194874727962517148100775228363421083691764065477590823919364012917984605619526140821798437127
|
||||
|
||||
1540-bit prime:
|
||||
p == 38564998830736521417281865696453025806593491967131023221754800625044118265468851210705360385717536794615180260494208076605798671660719333199513807806252394423283413430106003596332513246682903994829528690198205120921557533726473585751382193953592127439965050261476810842071573684505878854588706623484573925925903505747545471088867712185004135201289273405614415899438276535626346098904241020877974002916168099951885406379295536200413493190419727789712076165162175783
|
||||
|
||||
2072-bit prime:
|
||||
p == 542189391331696172661670440619180536749994166415993334151601745392193484590296600979602378676624808129613777993466242203025054573692562689251250471628358318743978285860720148446448885701001277560572526947619392551574490839286458454994488665744991822837769918095117129546414124448777033941223565831420390846864429504774477949153794689948747680362212954278693335653935890352619041936727463717926744868338358149568368643403037768649616778526013610493696186055899318268339432671541328195724261329606699831016666359440874843103020666106568222401047720269951530296879490444224546654729111504346660859907296364097126834834235287147
|
||||
|
||||
3080-bit prime:
|
||||
p == 1487259134814709264092032648525971038895865645148901180585340454985524155135260217788758027400478312256339496385275012465661575576202252063145698732079880294664220579764848767704076761853197216563262660046602703973050798218246170835962005598561669706844469447435461092542265792444947706769615695252256130901271870341005768912974433684521436211263358097522726462083917939091760026658925757076733484173202927141441492573799914240222628795405623953109131594523623353044898339481494120112723445689647986475279242446083151413667587008191682564376412347964146113898565886683139407005941383669325997475076910488086663256335689181157957571445067490187939553165903773554290260531009121879044170766615232300936675369451260747671432073394867530820527479172464106442450727640226503746586340279816318821395210726268291535648506190714616083163403189943334431056876038286530365757187367147446004855912033137386225053275419626102417236133948503
|
||||
|
||||
4116-bit prime:
|
||||
p == 1095121115716677802856811290392395128588168592409109494900178008967955253005183831872715423151551999734857184538199864469605657805519106717529655044054833197687459782636297255219742994736751541815269727940751860670268774903340296040006114013971309257028332849679096824800250742691718610670812374272414086863715763724622797509437062518082383056050144624962776302147890521249477060215148275163688301275847155316042279405557632639366066847442861422164832655874655824221577849928863023018366835675399949740429332468186340518172487073360822220449055340582568461568645259954873303616953776393853174845132081121976327462740354930744487429617202585015510744298530101547706821590188733515880733527449780963163909830077616357506845523215289297624086914545378511082534229620116563260168494523906566709418166011112754529766183554579321224940951177394088465596712620076240067370589036924024728375076210477267488679008016579588696191194060127319035195370137160936882402244399699172017835144537488486396906144217720028992863941288217185353914991583400421682751000603596655790990815525126154394344641336397793791497068253936771017031980867706707490224041075826337383538651825493679503771934836094655802776331664261631740148281763487765852746577808019633679
|
||||
@@ -1,9 +0,0 @@
|
||||
300-bit prime:
|
||||
p == 2037035976334486086268445688409378161051468393665936250636140449354381298610415201576637819
|
||||
|
||||
540-bit prime:
|
||||
p == 3599131035634557106248430806148785487095757694641533306480604458089470064537190296255232548883112685719936728506816716098566612844395439751206810991770626477344739
|
||||
|
||||
780-bit prime:
|
||||
p == 6359114106063703798370219984742410466332205126109989319225557147754704702203399726411277962562135973685197744935448875852478791860694279747355800678568677946181447581781401213133886609947027230004277244697462656003655947791725966271167
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
CFLAGS += -Wall -W -Wshadow -O3 -fomit-frame-pointer -funroll-loops -I../
|
||||
|
||||
# default lib name (requires install with root)
|
||||
# LIBNAME=-ltommath
|
||||
|
||||
# libname when you can't install the lib with install
|
||||
LIBNAME=../libtommath.a
|
||||
|
||||
#provable primes
|
||||
pprime: pprime.o
|
||||
$(CC) pprime.o $(LIBNAME) -o pprime
|
||||
|
||||
# portable [well requires clock()] tuning app
|
||||
tune: tune.o
|
||||
$(CC) tune.o $(LIBNAME) -o tune
|
||||
|
||||
# same app but using RDTSC for higher precision [requires 80586+], coff based gcc installs [e.g. ming, cygwin, djgpp]
|
||||
tune86: tune.c
|
||||
nasm -f coff timer.asm
|
||||
$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86
|
||||
|
||||
# for cygwin
|
||||
tune86c: tune.c
|
||||
nasm -f gnuwin32 timer.asm
|
||||
$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86
|
||||
|
||||
#make tune86 for linux or any ELF format
|
||||
tune86l: tune.c
|
||||
nasm -f elf -DUSE_ELF timer.asm
|
||||
$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86l
|
||||
|
||||
# spits out mersenne primes
|
||||
mersenne: mersenne.o
|
||||
$(CC) mersenne.o $(LIBNAME) -o mersenne
|
||||
|
||||
# fines DR safe primes for the given config
|
||||
drprime: drprime.o
|
||||
$(CC) drprime.o $(LIBNAME) -o drprime
|
||||
|
||||
# fines 2k safe primes for the given config
|
||||
2kprime: 2kprime.o
|
||||
$(CC) 2kprime.o $(LIBNAME) -o 2kprime
|
||||
|
||||
mont: mont.o
|
||||
$(CC) mont.o $(LIBNAME) -o mont
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.log *.o *.obj *.exe pprime tune mersenne drprime tune86 tune86l mont 2kprime pprime.dat \
|
||||
*.da *.dyn *.dpi *~
|
||||
@@ -1,67 +0,0 @@
|
||||
CC = icc
|
||||
|
||||
CFLAGS += -I../
|
||||
|
||||
# optimize for SPEED
|
||||
#
|
||||
# -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
|
||||
# -ax? specifies make code specifically for ? but compatible with IA-32
|
||||
# -x? specifies compile solely for ? [not specifically IA-32 compatible]
|
||||
#
|
||||
# where ? is
|
||||
# K - PIII
|
||||
# W - first P4 [Williamette]
|
||||
# N - P4 Northwood
|
||||
# P - P4 Prescott
|
||||
# B - Blend of P4 and PM [mobile]
|
||||
#
|
||||
# Default to just generic max opts
|
||||
CFLAGS += -O3 -xP -ip
|
||||
|
||||
# default lib name (requires install with root)
|
||||
# LIBNAME=-ltommath
|
||||
|
||||
# libname when you can't install the lib with install
|
||||
LIBNAME=../libtommath.a
|
||||
|
||||
#provable primes
|
||||
pprime: pprime.o
|
||||
$(CC) pprime.o $(LIBNAME) -o pprime
|
||||
|
||||
# portable [well requires clock()] tuning app
|
||||
tune: tune.o
|
||||
$(CC) tune.o $(LIBNAME) -o tune
|
||||
|
||||
# same app but using RDTSC for higher precision [requires 80586+], coff based gcc installs [e.g. ming, cygwin, djgpp]
|
||||
tune86: tune.c
|
||||
nasm -f coff timer.asm
|
||||
$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86
|
||||
|
||||
# for cygwin
|
||||
tune86c: tune.c
|
||||
nasm -f gnuwin32 timer.asm
|
||||
$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86
|
||||
|
||||
#make tune86 for linux or any ELF format
|
||||
tune86l: tune.c
|
||||
nasm -f elf -DUSE_ELF timer.asm
|
||||
$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86l
|
||||
|
||||
# spits out mersenne primes
|
||||
mersenne: mersenne.o
|
||||
$(CC) mersenne.o $(LIBNAME) -o mersenne
|
||||
|
||||
# fines DR safe primes for the given config
|
||||
drprime: drprime.o
|
||||
$(CC) drprime.o $(LIBNAME) -o drprime
|
||||
|
||||
# fines 2k safe primes for the given config
|
||||
2kprime: 2kprime.o
|
||||
$(CC) 2kprime.o $(LIBNAME) -o 2kprime
|
||||
|
||||
mont: mont.o
|
||||
$(CC) mont.o $(LIBNAME) -o mont
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.log *.o *.obj *.exe pprime tune mersenne drprime tune86 tune86l mont 2kprime pprime.dat *.il
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user