Compare commits

...
Author SHA1 Message Date
dkf 2fc7d70aae Handle global/namespace variables better. 2018-10-30 19:16:02 +00:00
dkf d25a1b6008 Tidy up further (comments, helper macros). More tests 2018-10-30 18:57:27 +00:00
dkf 8239b51d76 Neater magic 2018-10-30 18:04:02 +00:00
dkf ea40e19e74 Fix the branch; still needs cleaning up 2018-10-30 15:40:39 +00:00
dkf 15d3ad49dd merge core-8-branch 2018-10-30 15:07:34 +00:00
jan.nijtmans dbdd83e5d0 Fix compilation on Visual C++ 6.0, which doesn't have LLONG_MIN/LLONG_MAX 2018-10-29 19:57:29 +00:00
jan.nijtmans 538c6791ab merge-mark 2018-10-29 19:55:50 +00:00
jan.nijtmans 22a5d73ebf squelch some warnings on higher Visual Studio versions: we are not going to bother on this any more. 2018-10-29 19:54:58 +00:00
dgp 78ef9a971b merge mark 2018-10-29 14:39:22 +00:00
dgp ce6023fade [TIP 525] Backport package tcltest 2.5 2018-10-29 14:38:24 +00:00
dgp 4e9742386c merge mark 2018-10-29 14:10:33 +00:00
dgp 030a749dc8 close fork 2018-10-29 14:09:34 +00:00
dgp 2f4c1aecdb [TIP 525] Backport package tcltest 2.5 2018-10-29 14:00:48 +00:00
dgp b3291aebaa [TIP 525] Revise [tcltest::runAllTests] to return indicator of any failure. 2018-10-29 13:36:10 +00:00
dgp 569b59f564 [TIP 522] New option "-errorCode" to [tcltest::test] in tcltest 2.5 2018-10-29 13:19:39 +00:00
jan.nijtmans 1ff54c600e merge-mark 2018-10-28 10:07:04 +00:00
jan.nijtmans 1337738c22 Merge (on-purpose) fork, makeing the merge-mark easier 2018-10-28 10:05:42 +00:00
jan.nijtmans 96b9e6e871 Missing -DUNICODE in makefile.vc 2018-10-28 10:04:08 +00:00
jan.nijtmans 52c009322f put back Travis CI build. All merge-marks of previous commit change done. 2018-10-27 19:52:25 +00:00
jan.nijtmans fd54886393 Merge 8.6 2018-10-27 19:45:31 +00:00
jan.nijtmans 016dc0c5f0 merge-mark... well ... almost: Except for a missing <include> in tclWinDde.c 2018-10-27 19:43:31 +00:00
jan.nijtmans 97ed5b117d (temporary) backout [0386db909a]: Enable CI builds with Travis. This enables everything else to merge-marked to 8.6. Will put it back in the next commit 2018-10-27 19:36:22 +00:00
jan.nijtmans fbc8feeb40 Backport various minor issues from 8.6:
- gcc compiler warning in tclDate.c
- protect Tcl_UtfToUniCharDString() from ever reading more than "length" bytes from its input, not even in the case of invalid UTF-8. 
- update to latest tzdata
- fix 2 failing test-cases on MacOSX
2018-10-27 19:33:40 +00:00
José Ignacio Marín a870464cc5 Update TZ info to tzdata2018g. 2018-10-27 18:08:13 +00:00
José Ignacio Marín 5f392f74b6 Update TZ info to tzdata2018g. 2018-10-27 18:07:35 +00:00
jan.nijtmans fef802ea7a Update to latest tzdata (backported from 8.6) 2018-10-27 08:06:42 +00:00
jan.nijtmans d7a697aa50 Missed some version bumps in previous commit 2018-10-27 08:03:56 +00:00
jan.nijtmans 9654f8c692 tclWinDde.c: Backport version 1.4.1 from Tcl 8.6. 2018-10-27 07:53:45 +00:00
jan.nijtmans 7ecdd17b4d Merge 8.6 2018-10-26 19:01:57 +00:00
jan.nijtmans 125b29bfe3 tclWinReg.c: Code cleanup. Eliminate some unnecessary variables.
tclWinDde.c: Backport improvements (support for TCL_UTF_MAX=6) from androwish: Both androwish and tclsh (all versions) can now use the same dde.dll.
dde: bump version
2018-10-26 18:41:35 +00:00
jan.nijtmans c69ccc749e Backport "registry" version 1.3.3, so all active branches now have the same registry version.
(this commit must -eventually- be merge-marked to core-8-6-branch, since everything is there already)
2018-10-24 21:22:18 +00:00
dgp f44fb9b450 Request the tcltest version that provides the testing facilities used. 2018-10-24 14:33:54 +00:00
dgp 335774aef1 [d1d05d1c7a] Fix bug parsing end-$bignum
End deprecated acceptance of "e" and "en" as index value.
Streamline and comment for clarity and improved merging to tip-445 branch.
2018-10-23 23:23:42 +00:00
dgp cb2049e18e merge 8.7 2018-10-23 23:16:22 +00:00
dgp 6457b295e1 Streamline and comment combined routine. 2018-10-23 23:09:48 +00:00
pspjuth bf9af9a408 Cleanup 2018-10-23 21:06:30 +00:00
jan.nijtmans b7495e42ca Merge libtommath-no-stdint.h branch. Re-generated tclTomMath.h 2018-10-23 19:14:00 +00:00
dgp 7e4b0ec852 rework the logic a bit 2018-10-23 19:11:13 +00:00
dgp 9db751daeb End the deprecated practice of accepting "e" and "en" as valid index values. 2018-10-23 19:01:55 +00:00
dgp a883ddbe3e Refactor the SetEndOffsetFromAny() routine into its only caller. 2018-10-23 18:49:36 +00:00
jan.nijtmans 7e67cf48eb Branch [https://github.com/libtom/libtommath/commits/no-stdint-h] from libtommath, by karel-m. 2018-10-23 18:37:54 +00:00
dgp 4ad4d79d41 The "end-offset" type is unregistered. No need for a setFromAnyProc.
Remove and simplify.
2018-10-23 18:24:50 +00:00
dgp 90d55a9da9 merge 8.7 2018-10-23 17:58:35 +00:00
dkf 983b95bdbd Enable CI builds with Travis. 2018-10-23 11:14:13 +00:00
pspjuth 394e22ef5d Updated tests to exercise new feature. 2018-10-22 21:15:00 +00:00
jan.nijtmans 140cd14f15 formatting 2018-10-22 20:40:25 +00:00
pspjuth 5b1614f31a Documentation and revision bump for tip 522 2018-10-22 20:27:03 +00:00
dgp c4e867d8dd merge 8.7 2018-10-22 20:23:00 +00:00
jan.nijtmans 0748314c35 Merge changes in libtommath's latest "develop" branch 2018-10-22 20:12:18 +00:00
jan.nijtmans f8876cc390 Update libtommath to latest "develop" branch 2018-10-22 19:32:11 +00:00
jan.nijtmans 86013715f6 Missing ',' in documentation (discovered by MacOSX help processing). Some whitespacing 2018-10-22 18:36:42 +00:00
jan.nijtmans cee756478e Fix error-message on MacOS: the __LINKEDIT segment does not cover the end of the file.
Reason: We appended a zip-file to the end of the library, so during install "strip" doesn't work any more
2018-10-22 18:21:23 +00:00
jan.nijtmans 2517987176 Merge 8.6 2018-10-22 17:54:16 +00:00
jan.nijtmans 49cd80a29d Fix "registry" test-cases. Thanks to Harald Oehlmann for spotting this! 2018-10-22 17:48:40 +00:00
dkf c201290179 Expand the build matrix 2018-10-22 13:11:45 +00:00
pspjuth 8c05c20df4 Implement TIP 522, Test error codes with Tcltest 2018-10-22 05:56:37 +00:00
dkf 3ecac0e0ab merge fork 2018-10-22 05:14:54 +00:00
dkf e4c108f3d7 Make new notifier code match Engineering Manual guidelines better 2018-10-22 04:30:24 +00:00
jan.nijtmans d2c82fc45a Change PTR2INT and PTR2UINT macros's so they can handle long's and Tcl_WideInt's too, so no longer restricted to the "int" range. 2018-10-21 20:38:02 +00:00
dkf 7c2e55d3fd Squash warnings in the OSX notifier 2018-10-21 10:50:21 +00:00
dkf 0c78f5bbad Disable windows builds. Make test failures fatal. 2018-10-21 10:16:05 +00:00
dkf 2e0a0b5305 Remove old README 2018-10-20 18:02:45 +00:00
dkf 1caba8a761 Add local links 2018-10-20 16:47:29 +00:00
dkf 6efd8f71f2 formatting tweak 2018-10-20 16:44:51 +00:00
dkf e5cf3448bd formatting tweak 2018-10-20 12:54:28 +00:00
dkf ea29292705 formatting fix 2018-10-20 12:01:49 +00:00
dkf d32d625787 Travis CI build 2018-10-20 11:57:59 +00:00
dgp 50ae8fdcf6 [d1d05d1c7a] Tests and fix for bignums in end-offset index value parsing. 2018-10-19 19:18:30 +00:00
jan.nijtmans cb061edef8 Merge 8.6 2018-10-19 15:52:42 +00:00
jan.nijtmans 49aba3d99e Add support for "nostub" in genStubs.tcl. Not used by Tcl 8.6, but might be used by Tk 8.7 when linked against Tcl 8.6 2018-10-19 15:51:36 +00:00
dkf fca6e38924 merge core-8-6-branch 2018-10-19 10:06:23 +00:00
dkf 09446c7544 Added another test case. This one is OK. 2018-10-19 09:59:14 +00:00
dkf 8a4ad6884b Make the object mutation operation as unrestricted as possible. 2018-10-18 21:40:17 +00:00
dkf 2021349249 Make fundamental mutation work. MAGICAL MAGIC MAGICS MAGIC. Abracadabra. 2018-10-18 21:38:08 +00:00
José Ignacio Marín e7392a5c22 Update TZ info to tzdata2018f. 2018-10-18 18:24:50 +00:00
José Ignacio Marín 6b0dccd9d5 Update TZ info to tzdata2018f. 2018-10-18 18:23:50 +00:00
dkf e006418946 Tests for advanced object mutation issues. 2018-10-18 14:58:28 +00:00
jan.nijtmans 49ebd1264d Add -Wpointer-arith compiler flag to gcc 2018-10-17 22:37:43 +00:00
jan.nijtmans 94d07354ce Merge 8.6 2018-10-17 20:02:36 +00:00
jan.nijtmans 2881b5c3df Fix test-cases running on Windows 10: [string index $tcl_platform(osVersion) 0] doesn't give the correct answer then.
Also backport genStubs.tcl from 8.7: The "deprecated" mark is not used in Tcl 8.6, but it is used by Tk 8.7 when doing "make genstubs" against Tcl 8.6.
2018-10-17 19:55:17 +00:00
jan.nijtmans e0209e39ea Fix test-cases running on Windows 10: [string index $tcl_platform(osVersion) 0] doesn't give the correct answer then (it gives "1", but "10" was expected) 2018-10-17 19:51:47 +00:00
dgp e154c51512 merge 8.6 2018-10-17 16:24:16 +00:00
dgp e1196c53f2 Revert addition of "slowTest" as built-in constraint. (no TIP; no version bump).
Let the test file that needs the constraint define it with existing facilities.
2018-10-17 16:12:42 +00:00
dgp 56b431c4c2 Mark test macOSXFCmf-2.8 non-portable. It appears to pass when the older
HFS+ filesystem is in use, often on disk drives in older systems. It appears
to fail when APFS is in use, more typical on newer SSD storage.
2018-10-17 16:06:38 +00:00
dgp ac4291f473 Backport test fix. 2018-10-17 16:03:54 +00:00
dkf 2482413c83 Minor doc update 2018-10-12 18:45:54 +00:00
dkf de2192ab20 Turn [zipfs tcl_library] into more internal [tcl::zipfs::tcl_library_init]. It wasn't documented and isn't very useful outside of Tcl's startup code. 2018-10-12 18:44:25 +00:00
jan.nijtmans 7fcc213b7a TCL_NUMBER_WIDE is deprecated 2018-10-12 18:24:20 +00:00
jan.nijtmans 5aceb08fb4 Merge 8.6 2018-10-12 18:15:24 +00:00
jan.nijtmans 1d465c4012 TIP #502 implementation: Index value reform. 2018-10-12 18:14:51 +00:00
jan.nijtmans cc945fabb7 Fix test for UNICODE in win/tclAppInit.c. No longer check for "tclsh install", because tclsh is not compiled with that. Fix minizip.c compilation on systems without open64() 2018-10-12 17:54:42 +00:00
dkf 621251ae2e Added docs for [zipfs lmkimg] and [zipfs lmkzip] 2018-10-12 12:07:13 +00:00
dkf 13e35220c2 Better document how to package an executable script in a zipfs 2018-10-12 09:52:56 +00:00
dkf 45e6ca04f5 Document [zipfs canonical] and add examples of how to use passwords. 2018-10-12 07:36:19 +00:00
dkf 5719d6ca30 Put documented [zipfs find] in ensemble. Add examples to docs. 2018-10-11 07:24:40 +00:00
jan.nijtmans 58d332cff9 Use TCL_THREADS in stead of defined(TCL_THREADS) everywhere, otherwise it will give unexpected results with TCL_THREADS=0 2018-10-09 21:13:42 +00:00
jan.nijtmans 1f2c3cb141 isspace -> TclIsSpaceProc in various places.
Re-generate tclDate.c with Bision 3.1
2018-10-09 19:43:38 +00:00
jan.nijtmans 398efeba2d Fix test-case macOSXFCmd-4.1, by assuring the files are sorted alphabetically always. The file-sytem cannot be thrusted doing this. 2018-10-09 19:27:26 +00:00
dkf 0591917a06 Avoid making question marks bold or italic in docs UNLESS EXACTLY MEANINGFUL 2018-10-09 18:52:52 +00:00
dgp bbdb1f12a0 Use the 4 argument form of [makeFile]. 2018-10-09 18:24:57 +00:00
dkf fed4d43bd5 Balance the [makeFile/makeDirectory] and [removeFile/removeDirectory] calls (conditional now, so avoids warnings in filter/constraint cases). 2018-10-09 17:56:34 +00:00
dkf f9a4d9f781 Balance the [makeFile/makeDirectory] and [removeFile/removeDirectory] calls (conditional now, so avoids warnings in filter/constraint cases). 2018-10-09 17:55:20 +00:00
sebres 1a664df87f Balance the [makeFile/makeDirectory] and [removeFile/removeDirectory] calls (conditional now, so avoids warnings in filter/constraint cases). 2018-10-09 16:59:13 +00:00
dkf 77282aad96 Improve documentation of [tcl::process] 2018-10-09 08:21:32 +00:00
jan.nijtmans c9301353fc Tcl_GetStringFromObj -> Tcl_GetString 2018-10-08 22:32:08 +00:00
jan.nijtmans 4b7747b505 Fix MSVC warning: warning C4146: unary minus operator applied to unsigned type, result
still unsigned (hopefully)
2018-10-08 20:47:26 +00:00
jan.nijtmans e7a40e1084 TIP #514 implementation: Platform differences in handling int/wide 2018-10-08 19:08:14 +00:00
jan.nijtmans ee49fa81d9 Merge 8.6
Also fix startup problems on win32, when the encoding path contains invalid UTF-8 (reported by François Vogel)
Various other code cleanup, e.g. remove empty.zip file, as this didn't work quite as expected.
2018-10-08 18:34:09 +00:00
jan.nijtmans cc4dae5c0f Streamline: Tcl_WinTCharToUtf/Tcl_WinUtfToTChar(): Always initialize DString, and let it return NULL when imput is NULL. That's what seem to assume the callers. 2018-10-07 20:26:33 +00:00
dkf 3826a26f8a Centralise the de-fanging of standard ensembles in safe interpreters. Doing it right once is easier than repeating hacks... 2018-10-07 19:34:52 +00:00
dkf 045e0f533d Add better error reporting to zipfs. 2018-10-07 12:25:34 +00:00
jan.nijtmans 084fba1d17 \Merge 8.7 2018-09-28 19:59:40 +00:00
jan.nijtmans c414b83e0a Merge 8.7 2018-09-28 19:58:43 +00:00
jan.nijtmans 66dc9d1fbf Merge 8.7 2018-09-27 21:46:24 +00:00
jan.nijtmans e170502d63 Merge 8.7 2018-09-27 21:38:11 +00:00
dgp 71e4ddb74f merge 8.7 2018-09-25 13:31:19 +00:00
jan.nijtmans 4603752cef merge tip-515 branch 2018-09-22 13:37:28 +00:00
jan.nijtmans 1795b4118f merge tip-515 (which is pre-requisite for this TIP now) 2018-09-22 12:54:54 +00:00
jan.nijtmans b47bd89d44 TCL_NUMBER_WIDE -> TCL_NUMBER_INT. Two test-cases still failing 2018-09-08 21:49:09 +00:00
jan.nijtmans 33201eb14c Bring back test-cases closer to what they were 2018-09-08 21:34:48 +00:00
jan.nijtmans 079f1e33dc Merge TIP-515 branch, so part of the corrections in the TIP-514 implementation branch now moved to the TIP-515 implementation. 2018-09-08 21:29:40 +00:00
jan.nijtmans cf341f6a19 Merge 8.7 2018-09-05 08:07:25 +00:00
jan.nijtmans ce13b82329 Merge 8.7 2018-09-03 13:45:49 +00:00
jan.nijtmans 2afacbce95 Merge 8.7, and improve TIP implementation (using utility function in more places) 2018-08-30 21:28:51 +00:00
jan.nijtmans c8e7bb7653 Fix compilation on 32-bit platforms, and fix unit-tests in this environment 2018-08-29 19:30:37 +00:00
jan.nijtmans eeebae7172 Now, restore wide(), but make int() the same as entier(). Add new utility function. 2018-08-28 22:28:50 +00:00
jan.nijtmans 80d62f0547 improved reange checking (also for the Tcl 9.0 proposal). Make platform test platform 32/64-bit independant 2018-08-21 21:36:03 +00:00
jan.nijtmans e588745d77 Re-base branch "all-wideint" to core-8-branch. Still WIP 2018-08-19 09:33:34 +00:00
jan.nijtmans b3fc99501e Still WIP. All test-cases pass now in 32-bit 2018-08-19 09:13:16 +00:00
jan.nijtmans c475df7cfb Undo various test-case changes, in order to prove platform compatibility 2018-08-16 18:54:44 +00:00
jan.nijtmans 51ce0579e8 Few more test-cases 2018-08-16 18:13:31 +00:00
jan.nijtmans 57102e40e9 Experiment, resolving platform differences at script level. Don't look ... 2018-08-16 18:03:27 +00:00
jan.nijtmans afc4e512cb Merge 8.7. Also provide a new function for handling ByteArrays 2018-08-14 07:27:38 +00:00
dgp 29bbdb74d3 merge 8.7 2018-06-04 13:07:15 +00:00
dgp 202eeb707c merge 8.7 2018-05-24 12:24:54 +00:00
dgp ae6192f9cb merge 8.7 2018-05-11 11:26:20 +00:00
dgp 351c77bca3 silence compiler warning 2018-04-24 14:02:49 +00:00
dgp c1555b7cfd merge 8.7 2018-04-24 13:59:43 +00:00
dgp 48ed067359 merge 8.7 2018-04-07 17:12:14 +00:00
dgp 3fe69cba13 merge 8.7 2018-03-30 19:51:05 +00:00
dgp a3204f806c Rebase TIP 502 draft implementation. 2018-03-30 12:32:22 +00:00
dgp 3616fc519b merge 8.7 2018-03-06 13:50:45 +00:00
dgp 5fd49d1907 Merge 8.7; avoid checkin converting TclGetNumberFromObj to TclParseNumber. 2018-03-05 16:09:08 +00:00
dgp 7024801722 merge 8.7 2018-03-01 20:20:55 +00:00
dgp 40dfdbd929 Avoid full list conversion when we can cheaply discover a multi-element list
is not possible.
2018-03-01 19:30:15 +00:00
dgp 0cb6effe14 Continue consistent use of LLONG_MIN and LLONG_MAX. 2018-03-01 04:19:37 +00:00
dgp a0c07fcf28 merge 8.7 2018-03-01 04:13:47 +00:00
dgp 221f1bc18e Use mp_isneg() as appropriate. 2018-02-28 13:40:36 +00:00
dgp c0c1cce296 merge 8.7 2018-02-28 13:38:01 +00:00
dgp a628ce605f merge 8.7 2018-02-27 23:17:17 +00:00
dgp 3607c177d9 Don't save indices with values outside the int range in bytecode. 2018-02-27 22:35:24 +00:00
dgp e1efe253d2 Much more progress expanding the vocabulary of index values, and getting
results that make more intuitive sense.  Still a few TODOs and tests to update.
2018-02-27 18:20:44 +00:00
dgp 544d338e0e Work In Progress on index value reform -- not working. 2018-02-27 13:13:11 +00:00
dgp 3b3a5ff07f Better range checking in "string index". Add test-case to prove point.
This opens a large discussion on what the right valid range for index
values should be and what overflow behavior should be. New branch opened
to answer those questions completely.
2018-02-15 17:24:40 +00:00
jan.nijtmans 67e505d2ab First implementation of [http://core.tcl.tk/tips/doc/trunk/tip/481.md|TIP #481]: Extend size range of various Tcl_Get*() functions 2017-10-27 08:45:13 +00:00
mlafon 36da2eea0e Add [info linkedname] introspection command 2017-05-04 22:27:23 +00:00
256 changed files with 5454 additions and 4359 deletions
-1
View File
@@ -4,7 +4,6 @@ compat/zlib/win64/zdll.lib
compat/zlib/win64/zlib1.dll
compat/zlib/win64/libz.dll.a
compat/zlib/zlib.3.pdf
tools/empty.zip
*.bmp
*.gif
*.png
-19
View File
@@ -1,19 +0,0 @@
compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
compat/zlib/contrib/vstudio/readme.txt
compat/zlib/contrib/vstudio/*/zlib.rc
compat/zlib/win32/*.txt
compat/zlib/win64/*.txt
libtommath/*.dsp
libtommath/*.sln
libtommath/*.vcproj
tools/tcl.hpj.in
tools/tcl.wse.in
win/buildall.vc.bat
win/coffbase.txt
win/makefile.vc
win/rules.vc
win/rules-ext.vc
win/targets.vc
win/tcl.dsp
win/tcl.dsw
win/tcl.hpj.in
+1 -1
View File
@@ -1426,7 +1426,7 @@
initialization assumptions of the TIP 280 code in CompileWord().
* generic/tclCompExpr.c: Suppress the attempt to convert to
numeric when pre-compiling a constant expresion indicates an error.
numeric when pre-compiling a constant expression indicates an error.
2007-08-22 Miguel Sofer <msofer@users.sf.net>
+2 -2
View File
@@ -27,7 +27,7 @@
#endif
#endif
#ifdef __APPLE__
#if defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
@@ -359,7 +359,7 @@ void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, i
void addPathToZip(zipFile zf, const char *filenameinzip, const char *password, int opt_exclude_path,int opt_compress_level) {
tinydir_dir dir;
int i;
char *newname[512];
char newname[512];
tinydir_open_sorted(&dir, filenameinzip);
+1 -1
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_GetCommandInfoFromToken, Tcl_SetCommandInfo, Tcl_SetCommandInfoFromToken, Tcl_GetCommandName, Tcl_GetCommandFullName, Tcl_GetCommandFromObj Tcl_RegisterCommandTypeName, Tcl_GetCommandTypeName \- implement new commands in C
Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_GetCommandInfoFromToken, Tcl_SetCommandInfo, Tcl_SetCommandInfoFromToken, Tcl_GetCommandName, Tcl_GetCommandFullName, Tcl_GetCommandFromObj, Tcl_RegisterCommandTypeName, Tcl_GetCommandTypeName \- implement new commands in C
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
+16 -10
View File
@@ -886,40 +886,46 @@ The \fIinputString\fR argument consists of zero or more specifications of the
following form:
.TP
\fItime\fR
A time of day, which is of the form: \fBhh?:mm?:ss?? ?meridian? ?zone?\fR
or \fBhhmm ?meridian? ?zone?\fR
If no meridian is specified, \fBhh\fR is interpreted on
.
A time of day, which is of the form:
.QW "\fIhh\fR?\fB:\fImm\fR?\fB:\fIss\fR?? ?\fImeridian\fR? ?\fIzone\fR?"
or
.QW "\fBhhmm \fR?\fBmeridian\fR? ?\fBzone\fR?" .
If no \fImeridian\fR is specified, \fIhh\fR is interpreted on
a 24-hour clock.
.TP
\fIdate\fR
.
A specific month and day with optional year. The
acceptable formats are
.QW "\fBmm/dd\fR?\fB/yy\fR?" ,
.QW "\fBmonthname dd\fR?\fB, yy\fR?" ,
.QW "\fBday, dd monthname \fR?\fByy\fR?" ,
.QW "\fBdd monthname yy\fR" ,
.QW "?\fBCC\fR?\fByymmdd\fR" ,
.QW "\fImm\fB/\fIdd\fR?\fB/\fIyy\fR?" ,
.QW "\fImonthname dd\fR?\fB, \fIyy\fR?" ,
.QW "\fIday\fB, \fIdd monthname \fR?\fIyy\fR?" ,
.QW "\fIdd monthname yy\fR" ,
.QW "?\fICC\fR?\fIyymmdd\fR" ,
and
.QW "\fBdd-monthname-\fR?\fBCC\fR?\fByy\fR" .
.QW "\fIdd\fB-\fImonthname\fB-\fR?\fICC\fR?\fIyy\fR" .
The default year is the current year. If the year is less
than 100, we treat the years 00-68 as 2000-2068 and the years 69-99
as 1969-1999. Not all platforms can represent the years 38-70, so
an error may result if these years are used.
.TP
\fIISO 8601 point-in-time\fR
.
An ISO 8601 point-in-time specification, such as
.QW \fICCyymmdd\fBT\fIhhmmss\fR,
where \fBT\fR is the literal
.QW T ,
.QW "\fICCyymmdd hhmmss\fR" ,
or
.QW \fICCyymmdd\fBT\fIhh:mm:ss\fR .
.QW \fICCyymmdd\fBT\fIhh\fB:\fImm\fB:\fIss\fR .
Note that only these three formats are accepted.
The command does \fInot\fR accept the full range of point-in-time
specifications specified in ISO8601. Other formats can be recognized by
giving an explicit \fB\-format\fR option to the \fBclock scan\fR command.
.TP
\fIrelative time\fR
.
A specification relative to the current time. The format is \fBnumber
unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR,
\fBmonth\fR, \fBweek\fR, \fBday\fR,
+2 -2
View File
@@ -13,10 +13,10 @@
.SH NAME
http \- Client-side implementation of the HTTP/1.1 protocol
.SH SYNOPSIS
\fBpackage require http ?2.8?\fR
\fBpackage require http\fI ?\fB2.8\fR?
.\" See Also -useragent option documentation in body!
.sp
\fB::http::config ?\fI\-option value\fR ...?
\fB::http::config\fR ?\fI\-option value\fR ...?
.sp
\fB::http::geturl \fIurl\fR ?\fI\-option value\fR ...?
.sp
+17
View File
@@ -330,6 +330,23 @@ scripts are stored.
This is actually the value of the \fBtcl_library\fR
variable and may be changed by setting \fBtcl_library\fR.
.TP
\fBinfo linkedname \fIvarname\fR
.VS TIP471
Returns the name of the variable that link variable \fIvarname\fR is
ultimately linked to. This will be a fully qualified name if the variable
ultimately linked to is in a namespace (including the global namespace). Array
elements will be indicated by having
.QW \fB(\fR ,
the name of the element, and
.QW \fB)\fR
appended.
.RS
.PP
Link variables are (usually) local variables created by \fBupvar\fR,
\fBglobal\fR, \fBnamespace upvar\fR, and \fBvariable\fR.
.RE
.VE TIP471
.TP
\fBinfo loaded \fR?\fIinterp\fR? ?\fIpackage\fR?
.
Returns the filename loaded as part of \fIpackage\fR. If \fIpackage\fR
+1 -1
View File
@@ -236,7 +236,7 @@ attempts are silently ignored. This is needed to maintain the
consistency of the underlying interpreter's state.
.RE
.TP
\fBinterp\fR \fBdelete \fR?\fIpath ...?\fR
\fBinterp\fR \fBdelete \fR?\fIpath ...\fR?
.
Deletes zero or more interpreters given by the optional \fIpath\fR
arguments, and for each interpreter, it also deletes its slaves. The
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
lindex \- Retrieve an element from a list
.SH SYNOPSIS
\fBlindex \fIlist ?index ...?\fR
\fBlindex \fIlist\fR ?\fIindex ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -12,7 +12,7 @@
platform \- System identification support code and utilities
.SH SYNOPSIS
.nf
\fBpackage require platform ?1.0.10?\fR
\fBpackage require platform\fR ?\fB1.0.10\fR?
.sp
\fBplatform::generic\fR
\fBplatform::identify\fR
+1 -1
View File
@@ -12,7 +12,7 @@
platform::shell \- System identification support code and utilities
.SH SYNOPSIS
.nf
\fBpackage require platform::shell ?1.1.4?\fR
\fBpackage require platform::shell\fR ?\fB1.1.4\fR?
.sp
\fBplatform::shell::generic \fIshell\fR
\fBplatform::shell::identify \fIshell\fR
+6 -6
View File
@@ -12,9 +12,9 @@
tcl::prefix \- facilities for prefix matching
.SH SYNOPSIS
.nf
\fB::tcl::prefix all\fR \fItable\fR \fIstring\fR
\fB::tcl::prefix longest\fR \fItable\fR \fIstring\fR
\fB::tcl::prefix match\fR \fI?option ...?\fR \fItable\fR \fIstring\fR
\fB::tcl::prefix all\fR \fItable string\fR
\fB::tcl::prefix longest\fR \fItable string\fR
\fB::tcl::prefix match\fR ?\fIoption ...\fR? \fItable string\fR
.fi
.BE
.SH DESCRIPTION
@@ -22,17 +22,17 @@ tcl::prefix \- facilities for prefix matching
This document describes commands looking up a prefix in a list of strings.
The following commands are supported:
.TP
\fB::tcl::prefix all\fR \fItable\fR \fIstring\fR
\fB::tcl::prefix all\fR \fItable string\fR
.
Returns a list of all elements in \fItable\fR that begin with the prefix
\fIstring\fR.
.TP
\fB::tcl::prefix longest\fR \fItable\fR \fIstring\fR
\fB::tcl::prefix longest\fR \fItable string\fR
.
Returns the longest common prefix of all elements in \fItable\fR that
begin with the prefix \fIstring\fR.
.TP
\fB::tcl::prefix match\fR ?\fIoptions\fR? \fItable\fR \fIstring\fR
\fB::tcl::prefix match\fR ?\fIoptions\fR? \fItable string\fR
.
If \fIstring\fR equals one element in \fItable\fR or is a prefix to exactly
one element, the matched element is returned. If not, the result depends
+54 -35
View File
@@ -16,11 +16,31 @@ tcl::process \- Subprocess management
.SH DESCRIPTION
.PP
This command provides a way to manage subprocesses created by the \fBopen\fR
and \fBexec\fR commands. The legal \fIoptions\fR (which may be abbreviated) are:
and \fBexec\fR commands, as identified by the process identifiers (PIDs) of
those subprocesses. The legal \fIoptions\fR (which may be abbreviated) are:
.TP
\fB::tcl::process autopurge\fR ?\fIflag\fR?
.
Automatic purge facility. If \fIflag\fR is specified as a boolean value then
it activates or deactivate autopurge. In all cases it returns the current
status as a boolean value. When autopurge is active,
\fBTcl_ReapDetachedProcs\fR is called each time the \fBexec\fR command is
executed or a pipe channel created by \fBopen\fR is closed. When autopurge is
inactive, \fB::tcl::process\fR purge must be called explicitly. By default
autopurge is active.
.TP
\fB::tcl::process list\fR
.
Returns the list of subprocess PIDs.
Returns the list of subprocess PIDs. This includes all currently executing
subprocesses and all terminated subprocesses that have not yet had their
corresponding process table entries purged.
.TP
\fB::tcl::process purge\fR ?\fIpids\fR?
.
Cleans up all data associated with terminated subprocesses. If \fIpids\fR is
specified as a list of PIDs then the command only cleanup data for the matching
subprocesses if they exist, and raises an error otherwise. If a process listed is
still active, this command does nothing to that process.
.TP
\fB::tcl::process status\fR ?\fIswitches\fR? ?\fIpids\fR?
.
@@ -29,62 +49,48 @@ Returns a dictionary mapping subprocess PIDs to their respective status. If
status of the matching subprocesses if they exist, and raises an error
otherwise. For active processes, the status is an empty value. For terminated
processes, the status is a list with the following format:
.QW "{code ?\fImsg errorCode\fR?}" ,
.QW "\fB{\fIcode\fR ?\fImsg errorCode\fR?\fB}\fR" ,
where:
.RS
.TP
\fBcode\fR\0
\fIcode\fR\0
.
is a standard Tcl return code,
is a standard Tcl return code, i.e., \fB0\fR for TCL_OK and \fB1\fR
for TCL_ERROR,
.TP
\fBmsg\fR\0
\fImsg\fR\0
.
is the human-readable error message,
.TP
\fBerrorCode\fR\0
\fIerrorCode\fR\0
.
uses the same format as the \fBerrorCode\fR global variable
.RE
.PP
Note that \fBmsg\fR and \fBerrorCode\fR are only present for abnormally
terminated processes (i.e. those where \fBcode\fR is nonzero). Under the hood
this command calls \fBTcl_WaitPid\fR with the \fBWNOHANG\fR flag set for
terminated processes (i.e. those where the \fIcode\fR is nonzero). Under the
hood this command calls \fBTcl_WaitPid\fR with the \fBWNOHANG\fR flag set for
non-blocking behavior, unless the \fB\-wait\fR switch is set (see below).
.RS
.PP
Additionally, \fB::tcl::process status\fR accepts the following switches:
.TP
\fB\-wait\fR\0
.
By default the command returns immediately (the underlying \fBTcl_WaitPid\fR is
called with the \fBWNOHANG\fR flag set) unless this switch is set. If \fBpids\fR
called with the \fBWNOHANG\fR flag set) unless this switch is set. If \fIpids\fR
is specified as a list of PIDs then the command waits until the status of the
matching subprocesses are available. If \fBpids\fR is not specified then it
waits for all known subprocesses.
matching subprocesses are available. If \fIpids\fR was not specified, this
command will wait for all known subprocesses.
.TP
\fB\-\|\-\fR
.
Marks the end of switches. The argument following this one will
be treated as the first \fIarg\fR even if it starts with a \fB\-\fR.
.RE
.TP
\fB::tcl::process purge ?\fIpids\fR?
.
Cleans up all data associated with terminated subprocesses. If \fBpids\fR is
specified as a list of PIDs then the command only cleanup data for the matching
subprocesses if they exist, and raises an error otherwise. If the process is
still active then it does nothing.
.TP
\fB::tcl::process autopurge ?\fIflag\fR?
.
Automatic purge facility. If \fBflag\fR is specified as a boolean value then it
activates or deactivate autopurge. In all cases it returns the current status as
a boolean value. When autopurge is active, \fBTcl_ReapDetachedProcs\fR is called
each time the exec command is executed or a pipe channel created by open is
closed. When autopurge is inactive, \fB::tcl::process\fR purge must be called
explicitly. By default autopurge is active.
.RE
.SH "EXAMPLES"
.PP
These show the use of \fB::tcl::process\fR. Some of the results from
\fB::tcl::process status\fR are split over multiple lines for readability.
.PP
.CS
\fB::tcl::process autopurge\fR
\fI\(-> true\fR
@@ -102,7 +108,12 @@ set pid2 [pid $chan]
\fI\(-> 123 456 789 1011\fR
\fB::tcl::process status\fR
\fI\(-> 123 0 456 {1 "child killed: write on pipe with no readers" {CHILDKILLED 456 SIGPIPE "write on pipe with no readers"}} 789 {1 "child suspended: background tty read" {CHILDSUSP 789 SIGTTIN "background tty read"}} 1011 {}\fR
\fI\(-> 123 0
456 {1 "child killed: write on pipe with no readers" {
CHILDKILLED 456 SIGPIPE "write on pipe with no readers"}}
789 {1 "child suspended: background tty read" {
CHILDSUSP 789 SIGTTIN "background tty read"}}
1011 {}\fR
\fB::tcl::process status\fR 123
\fI\(-> 123 0\fR
@@ -111,10 +122,17 @@ set pid2 [pid $chan]
\fI\(-> 1011 {}\fR
\fB::tcl::process status\fR -wait
\fI\(-> 123 0 456 {1 "child killed: write on pipe with no readers" {CHILDKILLED 456 SIGPIPE "write on pipe with no readers"}} 789 {1 "child suspended: background tty read" {CHILDSUSP 789 SIGTTIN "background tty read"}} 1011 {1 "child process exited abnormally" {CHILDSTATUS 1011 -1}}\fR
\fI\(-> 123 0
456 {1 "child killed: write on pipe with no readers" {
CHILDKILLED 456 SIGPIPE "write on pipe with no readers"}}
789 {1 "child suspended: background tty read" {
CHILDSUSP 789 SIGTTIN "background tty read"}}
1011 {1 "child process exited abnormally" {
CHILDSTATUS 1011 -1}}\fR
\fB::tcl::process status\fR 1011
\fI\(-> 1011 {1 "child process exited abnormally" {CHILDSTATUS 1011 -1}}\fR
\fI\(-> 1011 {1 "child process exited abnormally" {
CHILDSTATUS 1011 -1}}\fR
\fB::tcl::process purge\fR
exec command1 1 2 3 &
@@ -123,7 +141,8 @@ exec command1 1 2 3 &
\fI\(-> 1213\fR
.CE
.SH "SEE ALSO"
exec(n), open(n), Tcl_DetachPids(3), Tcl_WaitPid(3), Tcl_ReapDetachedProcs(3)
exec(n), open(n), pid(n),
Tcl_DetachPids(3), Tcl_WaitPid(3), Tcl_ReapDetachedProcs(3)
.SH "KEYWORDS"
background, child, detach, process, wait
'\" Local Variables:
+1 -1
View File
@@ -12,7 +12,7 @@
.SH NAME
string \- Manipulate strings
.SH SYNOPSIS
\fBstring \fIoption arg \fR?\fIarg ...?\fR
\fBstring \fIoption arg \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
+12 -2
View File
@@ -8,7 +8,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH "tcltest" n 2.3 tcltest "Tcl Bundled Packages"
.TH "tcltest" n 2.5 tcltest "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
@@ -16,7 +16,7 @@
tcltest \- Test harness support code and utilities
.SH SYNOPSIS
.nf
\fBpackage require tcltest\fR ?\fB2.3\fR?
\fBpackage require tcltest\fR ?\fB2.5\fR?
\fBtcltest::test \fIname description\fR ?\fI\-option value ...\fR?
\fBtcltest::test \fIname description\fR ?\fIconstraints\fR? \fIbody result\fR
@@ -454,6 +454,7 @@ The valid options for \fBtest\fR are summarized:
?\fB\-output \fIexpectedOutput\fR?
?\fB\-errorOutput \fIexpectedError\fR?
?\fB\-returnCodes \fIcodeList\fR?
?\fB\-errorCode \fIexpectedErrorCode\fR?
?\fB\-match \fImode\fR?
.CE
.PP
@@ -577,6 +578,15 @@ return codes known to \fBreturn\fR, in both numeric and symbolic
form, including extended return codes, are acceptable elements in
the \fIexpectedCodeList\fR. Default value is
.QW "\fBok return\fR" .
.TP
\fB\-errorCode \fIexpectedErrorCode\fR
.
The optional \fB\-errorCode\fR attribute supplies \fIexpectedErrorCode\fR,
a glob pattern that should match the error code reported from evaluation of the
\fB\-body\fR script. If evaluation of the \fB\-body\fR script returns
a code not matching \fIexpectedErrorCode\fR, the test fails. Default value is
.QW "\fB*\fR" .
If \fB\-returnCodes\fR does not include \fBerror\fR it is set to \fBerror\fR.
.PP
To pass, a test must successfully evaluate its \fB\-setup\fR, \fB\-body\fR,
and \fB\-cleanup\fR scripts. The return code of the \fB\-body\fR script and
+2 -1
View File
@@ -20,7 +20,8 @@ trace \- Monitor variable accesses, command usages and command executions
This command causes Tcl commands to be executed whenever certain operations are
invoked. The legal \fIoption\fRs (which may be abbreviated) are:
.TP
\fBtrace add \fItype name ops ?args?\fR
\fBtrace add \fItype name ops\fR ?\fIargs\fR?
.
Where \fItype\fR is \fBcommand\fR, \fBexecution\fR, or \fBvariable\fR.
.RS
.TP
+147 -30
View File
@@ -16,10 +16,13 @@ zipfs \- Mount and work with ZIP files within Tcl
.nf
\fBpackage require zipfs \fR?\fB1.0\fR?
.sp
\fBzipfs canonical\fR ?\fImntpnt\fR? \fIfilename\fR ?\fIZIPFS\fR?
\fBzipfs exists\fR \fIfilename\fR
\fBzipfs find\fR \fIdir\fR
\fBzipfs find\fR \fIdirectoryName\fR
\fBzipfs info\fR \fIfilename\fR
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? ?\fIpattern\fR?
\fBzipfs lmkimg\fR \fIoutfile inlist\fR ?\fIpassword infile\fR?
\fBzipfs lmkzip\fR \fIoutfile inlist\fR ?\fIpassword\fR?
\fBzipfs mkimg\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
\fBzipfs mkkey\fR \fIpassword\fR
\fBzipfs mkzip\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
@@ -27,21 +30,33 @@ zipfs \- Mount and work with ZIP files within Tcl
\fBzipfs root\fR
\fBzipfs unmount\fR \fImountpoint\fR
.fi
'\" The following subcommand is *UNDOCUMENTED*
'\" \fBzipfs mount_data\fR ?\fImountpoint\fR? ?\fIdata\fR?
.BE
.SH DESCRIPTION
.PP
The \fBzipfs\fR command (the sole public command provided by the built-in
package with the same name) provides Tcl with the ability to mount the
contents of a ZIP file as a virtual file system.
contents of a ZIP archive file as a virtual file system. ZIP archives support
simple encryption, sufficient to prevent casual inspection of their contents
but not able to prevent access by even a moderately determined attacker.
.TP
\fBzipfs canonical\fR ?\fImountpoint\fR? \fIfilename\fR ?\fIinZipfs\fR?
.
This takes the name of a file, \fIfilename\fR, and produces where it would be
mapped into a zipfs mount as its result. If specified, \fImountpoint\fR says
within which mount the mapping will be done; if omitted, the main root of the
zipfs system is used. The \fIinZipfs\fR argument is a an optional boolean
which controls whether to fully canonicalise the name; it defaults to true.
.TP
\fBzipfs exists\fR \fIfilename\fR
.
Return 1 if the given filename exists in the mounted zipfs and 0 if it does not.
.TP
\fBzipfs find\fR \fIdir\fR
\fBzipfs find\fR \fIdirectoryName\fR
.
Recursively lists files including and below the directory \fIdir\fR. The
result list consists of relative path names starting from the given
Recursively lists files including and below the directory \fIdirectoryName\fR.
The result list consists of relative path names starting from the given
directory. This command is also used by the \fBzipfs mkzip\fR and \fBzipfs
mkimg\fR commands.
.TP
@@ -63,7 +78,7 @@ Note: querying the mount point gives the start of the zip data as the offset
in (4), which can be used to truncate the zip information from an executable.
.RE
.TP
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? \fI?pattern?\fR
\fBzipfs list\fR ?(\fB\-glob\fR|\fB\-regexp\fR)? ?\fIpattern\fR?
.
Return a list of all files in the mounted zipfs, or just those matching
\fIpattern\fR (optionally controlled by the option parameters). The order of
@@ -79,6 +94,13 @@ in \fIzipfile\fR will appear to Tcl to be regular files at the mount point.
With no \fIzipfile\fR, returns the zipfile mounted at \fImountpoint\fR. With
no \fImountpoint\fR, return all zipfile/mount pairs. If \fImountpoint\fR is
specified as an empty string, mount on file path.
.PP
\fBNB:\fR because the current working directory is a concept maintained by the
operating system, using \fBcd\fR into a mounted archive will only work in the
current process, and then not entirely consistently (e.g., if a shared library
uses direct access to the OS rather than through Tcl's filesystem API, it will
not see the current directory as being inside the mount and will not be able
to access the files inside the mount).
.RE
.TP
\fBzipfs root\fR
@@ -97,40 +119,135 @@ Unmounts a previously mounted ZIP archive mounted to \fImountpoint\fR.
This package also provides several commands to aid the creation of ZIP
archives as Tcl applications.
.TP
\fBzipfs mkimg\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
.
Creates an image (potentially a new executable file) similar to \fBzipfs
mkzip\fR. If the \fIinfile\fR parameter is specified, this file is prepended
in front of the ZIP archive, otherwise the file returned by
\fBinfo nameofexecutable\fR (i.e., the executable file of the running process)
is used. If the \fIpassword\fR parameter is not empty, an obfuscated version
of that password is placed between the image and ZIP chunks of the output file
and the contents of the ZIP chunk are protected with that password.
.RS
.PP
Caution: highly experimental, not usable on Android, only partially tested on
Linux and Windows.
.RE
.TP
\fBzipfs mkkey\fR \fIpassword\fR
.
For the clear text \fIpassword\fR argument, an obfuscated string version is
returned with the same format used in the \fBzipfs mkimg\fR command.
.TP
\fBzipfs mkzip\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR?
.
Creates a ZIP archive file named \fIoutfile\fR from the contents of the input
directory \fIindir\fR (contained regular files only) with optional ZIP
password \fIpassword\fR. While processing the files below \fIindir\fR the
optional file name prefix given in \fIstrip\fR is stripped off the beginning
of the respective file name.
of the respective file name. When stripping, it is common to remove either
the whole source directory name or the name of its parent directory.
.RS
.PP
Caution: the choice of the \fIindir\fR parameter (less the optional stripped
prefix) determines the later root name of the archive's content.
\fBCaution:\fR the choice of the \fIindir\fR parameter (less the optional
stripped prefix) determines the later root name of the archive's content.
.RE
.TP
\fBzipfs mkimg\fR \fIoutfile indir\fR ?\fIstrip\fR? ?\fIpassword\fR? ?\fIinfile\fR?
.
Creates an image (potentially a new executable file) similar to \fBzipfs
mkzip\fR; see that command for a description of most parameters to this
command, as they behave identically here.
.RS
.PP
If the \fIinfile\fR parameter is specified, this file is prepended in front of
the ZIP archive, otherwise the file returned by \fBinfo nameofexecutable\fR
(i.e., the executable file of the running process) is used. If the
\fIpassword\fR parameter is not empty, an obfuscated version of that password
(see \fBzipfs mkkey\fR) is placed between the image and ZIP chunks of the
output file and the contents of the ZIP chunk are protected with that
password.
.PP
If there is a file, \fBmain.tcl\fR, in the root directory of the resulting
archive and the image file that the archive is attached to is a \fBtclsh\fR
(or \fBwish\fR) instance (true by default, but depends on your configuration),
then the resulting image is an executable that will \fBsource\fR the script in
that \fBmain.tcl\fR after mounting the ZIP archive, and will \fBexit\fR once
that script has been executed.
.PP
\fBCaution:\fR highly experimental, not usable on Android, only partially
tested on Linux and Windows.
.RE
.TP
\fBzipfs mkkey\fR \fIpassword\fR
.
Given the clear text \fIpassword\fR argument, an obfuscated string version is
returned with the same format used in the \fBzipfs mkimg\fR command.
.TP
\fBzipfs lmkimg\fR \fIoutfile inlist\fR ?\fIpassword infile\fR?
.
This command is like \fBzipfs mkimg\fR, but instead of an input directory,
\fIinlist\fR must be a Tcl list where the odd elements are the names of files
to be copied into the archive in the image, and the even elements are their
respective names within that archive.
.TP
\fBzipfs lmkzip\fR \fIoutfile inlist\fR ?\fIpassword\fR?
.
This command is like \fBzipfs mkzip\fR, but instead of an input directory,
\fIinlist\fR must be a Tcl list where the odd elements are the names of files
to be copied into the archive, and the even elements are their respective
names within that archive.
.SH "EXAMPLES"
.PP
Mounting an ZIP archive as an application directory and running code out of it
before unmounting it again:
.PP
.CS
set zip myApp.zip
set base [file join [\fbzipfs root\fR] myApp]
\fBzipfs mount\fR $base $zip
# $base now has the contents of myApp.zip
source [file join $base app.tcl]
# use the contents, load libraries from it, etc...
\fBzipfs unmount\fR $zip
.CE
.PP
Creating a ZIP archive, given that a directory exists containing the content
to put in the archive. Note that the source directory is given twice, in order
to strip the exterior directory name from each filename in the archive.
.PP
.CS
set sourceDirectory [file normalize myApp]
set targetZip myApp.zip
\fBzipfs mkzip\fR $targetZip $sourceDirectory $sourceDirectory
.CE
.PP
Encryption can be applied to ZIP archives by providing a password when
building the ZIP and when mounting it.
.PP
.CS
set zip myApp.zip
set sourceDir [file normalize myApp]
set password "hunter2"
set base [file join [\fbzipfs root\fR] myApp]
# Create with password
\fBzipfs mkzip\fR $targetZip $sourceDir $sourceDir $password
# Mount with password
\fBzipfs mount\fR $base $zip $password
.CE
.PP
When creating an executable image with a password, the password is placed
within the executable in a shrouded form so that the application can read
files inside the embedded ZIP archive yet casual inspection cannot read it.
.PP
.CS
set appDir [file normalize myApp]
set img "myApp.bin"
set password "hunter2"
# Create some simple content to define a basic application
file mkdir $appDir
set f [open $appDir/main.tcl]
puts $f {
puts "Hi. This is [info script]"
}
close $f
# Create the executable
\fBzipfs mkimg\fR $img $appDir $appDir $password
# Launch the executable, printing its output to stdout
exec $img >@stdout
# prints: \fIHi. This is //zipfs:/app/main.tcl\fR
.CE
.SH "SEE ALSO"
tclsh(1), file(n), zlib(n)
tclsh(1), file(n), zipfs(3), zlib(n)
.SH "KEYWORDS"
compress, filesystem, zip
'\" Local Variables:
+160 -27
View File
@@ -105,6 +105,7 @@ TCL_DECLARE_MUTEX(commandTypeLock);
* Static functions in this file:
*/
static Tcl_ObjCmdProc BadEnsembleSubcommand;
static char * CallCommandTraces(Interp *iPtr, Command *cmdPtr,
const char *oldName, const char *newName,
int flags);
@@ -125,7 +126,6 @@ static Tcl_ObjCmdProc ExprBinaryFunc;
static Tcl_ObjCmdProc ExprBoolFunc;
static Tcl_ObjCmdProc ExprCeilFunc;
static Tcl_ObjCmdProc ExprDoubleFunc;
static Tcl_ObjCmdProc ExprEntierFunc;
static Tcl_ObjCmdProc ExprFloorFunc;
static Tcl_ObjCmdProc ExprIntFunc;
static Tcl_ObjCmdProc ExprIsqrtFunc;
@@ -206,6 +206,24 @@ typedef struct {
* expansion for itself rather than needing the generic layer to take care of
* it for it. Defined in tclInt.h. */
/*
* The following struct states that the command it talks about (a subcommand
* of one of Tcl's built-in ensembles) is unsafe and must be hidden when an
* interpreter is made safe. (TclHideUnsafeCommands accesses an array of these
* structs.) Alas, we can't sensibly just store the information directly in
* the commands.
*/
typedef struct {
const char *ensembleNsName; /* The ensemble's name within ::tcl. NULL for
* the end of the list of commands to hide. */
const char *commandName; /* The name of the command within the
* ensemble. If this is NULL, we want to also
* make the overall command be hidden, an ugly
* hack because it is expected by security
* policies in the wild. */
} UnsafeEnsembleInfo;
/*
* The built-in commands, and the functions that implement them:
*/
@@ -306,6 +324,68 @@ static const CmdInfo builtInCmds[] = {
{NULL, NULL, NULL, NULL, 0}
};
/*
* Information about which pieces of ensembles to hide when making an
* interpreter safe:
*/
static const UnsafeEnsembleInfo unsafeEnsembleCommands[] = {
/* [encoding] has two unsafe commands. Assumed by older security policies
* to be overall unsafe; it isn't but... */
{"encoding", NULL},
{"encoding", "dirs"},
{"encoding", "system"},
/* [file] has MANY unsafe commands! Assumed by older security policies to
* be overall unsafe; it isn't but... */
{"file", NULL},
{"file", "atime"},
{"file", "attributes"},
{"file", "copy"},
{"file", "delete"},
{"file", "dirname"},
{"file", "executable"},
{"file", "exists"},
{"file", "extension"},
{"file", "isdirectory"},
{"file", "isfile"},
{"file", "link"},
{"file", "lstat"},
{"file", "mtime"},
{"file", "mkdir"},
{"file", "nativename"},
{"file", "normalize"},
{"file", "owned"},
{"file", "readable"},
{"file", "readlink"},
{"file", "rename"},
{"file", "rootname"},
{"file", "size"},
{"file", "stat"},
{"file", "tail"},
{"file", "tempfile"},
{"file", "type"},
{"file", "volumes"},
{"file", "writable"},
/* [info] has two unsafe commands */
{"info", "cmdtype"},
{"info", "nameofexecutable"},
/* [tcl::process] has ONLY unsafe commands! */
{"process", "list"},
{"process", "status"},
{"process", "purge"},
{"process", "autopurge"},
/* [zipfs] has MANY unsafe commands! */
{"zipfs", "lmkimg"},
{"zipfs", "lmkzip"},
{"zipfs", "mkimg"},
{"zipfs", "mkkey"},
{"zipfs", "mkzip"},
{"zipfs", "mount"},
{"zipfs", "mount_data"},
{"zipfs", "unmount"},
{NULL, NULL}
};
/*
* Math functions. All are safe.
*/
@@ -327,7 +407,7 @@ static const BuiltinFuncDef BuiltinFuncTable[] = {
{ "cos", ExprUnaryFunc, (ClientData) cos },
{ "cosh", ExprUnaryFunc, (ClientData) cosh },
{ "double", ExprDoubleFunc, NULL },
{ "entier", ExprEntierFunc, NULL },
{ "entier", ExprIntFunc, NULL },
{ "exp", ExprUnaryFunc, (ClientData) exp },
{ "floor", ExprFloorFunc, NULL },
{ "fmod", ExprBinaryFunc, (ClientData) fmod },
@@ -1135,6 +1215,7 @@ TclHideUnsafeCommands(
Tcl_Interp *interp) /* Hide commands in this interpreter. */
{
register const CmdInfo *cmdInfoPtr;
register const UnsafeEnsembleInfo *unsafePtr;
if (interp == NULL) {
return TCL_ERROR;
@@ -1144,11 +1225,82 @@ TclHideUnsafeCommands(
Tcl_HideCommand(interp, cmdInfoPtr->name, cmdInfoPtr->name);
}
}
TclMakeEncodingCommandSafe(interp); /* Ugh! */
TclMakeFileCommandSafe(interp); /* Ugh! */
for (unsafePtr = unsafeEnsembleCommands;
unsafePtr->ensembleNsName; unsafePtr++) {
if (unsafePtr->commandName) {
/*
* Hide an ensemble subcommand.
*/
Tcl_Obj *cmdName = Tcl_ObjPrintf("::tcl::%s::%s",
unsafePtr->ensembleNsName, unsafePtr->commandName);
Tcl_Obj *hideName = Tcl_ObjPrintf("tcl:%s:%s",
unsafePtr->ensembleNsName, unsafePtr->commandName);
if (TclRenameCommand(interp, TclGetString(cmdName),
"___tmp") != TCL_OK
|| Tcl_HideCommand(interp, "___tmp",
TclGetString(hideName)) != TCL_OK) {
Tcl_Panic("problem making '%s %s' safe: %s",
unsafePtr->ensembleNsName, unsafePtr->commandName,
Tcl_GetString(Tcl_GetObjResult(interp)));
}
Tcl_CreateObjCommand(interp, TclGetString(cmdName),
BadEnsembleSubcommand, (ClientData) unsafePtr, NULL);
TclDecrRefCount(cmdName);
TclDecrRefCount(hideName);
} else {
/*
* Hide an ensemble main command (for compatibility).
*/
if (Tcl_HideCommand(interp, unsafePtr->ensembleNsName,
unsafePtr->ensembleNsName) != TCL_OK) {
Tcl_Panic("problem making '%s' safe: %s",
unsafePtr->ensembleNsName,
Tcl_GetString(Tcl_GetObjResult(interp)));
}
}
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* BadEnsembleSubcommand --
*
* Command used to act as a backstop implementation when subcommands of
* ensembles are unsafe (the real implementations of the subcommands are
* hidden). The clientData is description of what was hidden.
*
* Results:
* A standard Tcl result (always a TCL_ERROR).
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
BadEnsembleSubcommand(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
const UnsafeEnsembleInfo *infoPtr = clientData;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"not allowed to invoke subcommand %s of %s",
infoPtr->commandName, infoPtr->ensembleNsName));
Tcl_SetErrorCode(interp, "TCL", "SAFE", "SUBCOMMAND", NULL);
return TCL_ERROR;
}
/*
*--------------------------------------------------------------
*
@@ -6620,7 +6772,7 @@ Tcl_ExprLongObj(
resultPtr = Tcl_NewBignumObj(&big);
/* FALLTHROUGH */
}
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
case TCL_NUMBER_BIG:
result = TclGetLongFromObj(interp, resultPtr, ptr);
break;
@@ -7596,7 +7748,7 @@ ExprAbsFunc(
return TCL_ERROR;
}
if (type == TCL_NUMBER_WIDE) {
if (type == TCL_NUMBER_INT) {
Tcl_WideInt l = *((const Tcl_WideInt *) ptr);
if (l > (Tcl_WideInt)0) {
@@ -7717,7 +7869,7 @@ ExprDoubleFunc(
}
static int
ExprEntierFunc(
ExprIntFunc(
ClientData clientData, /* Ignored. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
@@ -7772,25 +7924,6 @@ ExprEntierFunc(
return TCL_ERROR;
}
static int
ExprIntFunc(
ClientData clientData, /* Ignored. */
Tcl_Interp *interp, /* The interpreter in which to execute the
* function. */
int objc, /* Actual parameter count. */
Tcl_Obj *const *objv) /* Actual parameter vector. */
{
Tcl_WideInt wResult;
Tcl_Obj *objPtr;
if (ExprEntierFunc(NULL, interp, objc, objv) != TCL_OK) {
return TCL_ERROR;
}
objPtr = Tcl_GetObjResult(interp);
TclGetWideBitsFromObj(NULL, objPtr, &wResult);
Tcl_SetObjResult(interp, Tcl_NewLongObj((long)wResult));
return TCL_OK;
}
static int
ExprWideFunc(
ClientData clientData, /* Ignored. */
@@ -7801,7 +7934,7 @@ ExprWideFunc(
{
Tcl_WideInt wResult;
if (ExprEntierFunc(NULL, interp, objc, objv) != TCL_OK) {
if (ExprIntFunc(NULL, interp, objc, objv) != TCL_OK) {
return TCL_ERROR;
}
TclGetWideBitsFromObj(NULL, Tcl_GetObjResult(interp), &wResult);
+8 -8
View File
@@ -2483,8 +2483,8 @@ BinaryDecodeHex(
}
c = *data++;
if (!isxdigit((int) c)) {
if (strict || !isspace(c)) {
if (!isxdigit(UCHAR(c))) {
if (strict || !TclIsSpaceProc(c)) {
goto badChar;
}
i--;
@@ -2831,7 +2831,7 @@ BinaryDecodeUu(
if (lineLen < 0) {
c = *data++;
if (c < 32 || c > 96) {
if (strict || !isspace(c)) {
if (strict || !TclIsSpaceProc(c)) {
goto badUu;
}
i--;
@@ -2849,7 +2849,7 @@ BinaryDecodeUu(
d[i] = c = *data++;
if (c < 32 || c > 96) {
if (strict) {
if (!isspace(c)) {
if (!TclIsSpaceProc(c)) {
goto badUu;
} else if (c == '\n') {
goto shortUu;
@@ -2893,7 +2893,7 @@ BinaryDecodeUu(
} else if (c >= 32 && c <= 96) {
data--;
break;
} else if (strict || !isspace(c)) {
} else if (strict || !TclIsSpaceProc(c)) {
goto badUu;
}
} while (data < dataend);
@@ -3018,7 +3018,7 @@ BinaryDecode64(
if (c == '=' && i > 1) {
value <<= 6;
cut++;
} else if (!strict && isspace(c)) {
} else if (!strict && TclIsSpaceProc(c)) {
i--;
} else {
goto bad64;
@@ -3036,7 +3036,7 @@ BinaryDecode64(
} else if (c == '=') {
value <<= 6;
cut++;
} else if (strict || !isspace(c)) {
} else if (strict || !TclIsSpaceProc(c)) {
goto bad64;
} else {
i--;
@@ -3057,7 +3057,7 @@ BinaryDecode64(
goto bad64;
}
for (; data < dataend; data++) {
if (!isspace(*data)) {
if (!TclIsSpaceProc(*data)) {
goto bad64;
}
}
+30 -276
View File
@@ -46,9 +46,6 @@ struct ForeachState {
static int CheckAccess(Tcl_Interp *interp, Tcl_Obj *pathPtr,
int mode);
static int BadEncodingSubcommand(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int EncodingConvertfromObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -84,7 +81,6 @@ static Tcl_NRPostProc ForPostNextCallback;
static Tcl_NRPostProc ForeachLoopStep;
static Tcl_NRPostProc EvalCmdErrMsg;
static Tcl_ObjCmdProc BadFileSubcommand;
static Tcl_ObjCmdProc FileAttrAccessTimeCmd;
static Tcl_ObjCmdProc FileAttrIsDirectoryCmd;
static Tcl_ObjCmdProc FileAttrIsExecutableCmd;
@@ -536,122 +532,15 @@ TclInitEncodingCmd(
static const EnsembleImplMap encodingImplMap[] = {
{"convertfrom", EncodingConvertfromObjCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0},
{"convertto", EncodingConverttoObjCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0},
{"dirs", EncodingDirsObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"dirs", EncodingDirsObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 1},
{"names", EncodingNamesObjCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"system", EncodingSystemObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"system", EncodingSystemObjCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 1},
{NULL, NULL, NULL, NULL, NULL, 0}
};
return TclMakeEnsemble(interp, "encoding", encodingImplMap);
}
/*
*-----------------------------------------------------------------------------
*
* TclMakeEncodingCommandSafe --
*
* This function hides the unsafe 'dirs' and 'system' subcommands of
* the "encoding" Tcl command ensemble. It must be called only from
* TclHideUnsafeCommands.
*
* Results:
* A standard Tcl result
*
* Side effects:
* Adds commands to the table of hidden commands.
*
*-----------------------------------------------------------------------------
*/
int
TclMakeEncodingCommandSafe(
Tcl_Interp* interp) /* Tcl interpreter */
{
static const struct {
const char *cmdName;
int unsafe;
} unsafeInfo[] = {
{"convertfrom", 0},
{"convertto", 0},
{"dirs", 1},
{"names", 0},
{"system", 0},
{NULL, 0}
};
int i;
Tcl_DString oldBuf, newBuf;
Tcl_DStringInit(&oldBuf);
TclDStringAppendLiteral(&oldBuf, "::tcl::encoding::");
Tcl_DStringInit(&newBuf);
TclDStringAppendLiteral(&newBuf, "tcl:encoding:");
for (i=0 ; unsafeInfo[i].cmdName != NULL ; i++) {
if (unsafeInfo[i].unsafe) {
const char *oldName, *newName;
Tcl_DStringSetLength(&oldBuf, 17);
oldName = Tcl_DStringAppend(&oldBuf, unsafeInfo[i].cmdName, -1);
Tcl_DStringSetLength(&newBuf, 13);
newName = Tcl_DStringAppend(&newBuf, unsafeInfo[i].cmdName, -1);
if (TclRenameCommand(interp, oldName, "___tmp") != TCL_OK
|| Tcl_HideCommand(interp, "___tmp", newName) != TCL_OK) {
Tcl_Panic("problem making 'encoding %s' safe: %s",
unsafeInfo[i].cmdName,
Tcl_GetString(Tcl_GetObjResult(interp)));
}
Tcl_CreateObjCommand(interp, oldName, BadEncodingSubcommand,
(ClientData) unsafeInfo[i].cmdName, NULL);
}
}
Tcl_DStringFree(&oldBuf);
Tcl_DStringFree(&newBuf);
/*
* Ugh. The [encoding] command is now actually safe, but it is assumed by
* scripts that it is not, which messes up security policies.
*/
if (Tcl_HideCommand(interp, "encoding", "encoding") != TCL_OK) {
Tcl_Panic("problem making 'encoding' safe: %s",
Tcl_GetString(Tcl_GetObjResult(interp)));
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* BadEncodingSubcommand --
*
* Command used to act as a backstop implementation when subcommands of
* "encoding" are unsafe (the real implementations of the subcommands are
* hidden). The clientData is always the full official subcommand name.
*
* Results:
* A standard Tcl result (always a TCL_ERROR).
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
BadEncodingSubcommand(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
const char *subcommandName = (const char *) clientData;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"not allowed to invoke subcommand %s of encoding", subcommandName));
Tcl_SetErrorCode(interp, "TCL", "SAFE", "SUBCOMMAND", NULL);
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
@@ -1174,180 +1063,45 @@ TclInitFileCmd(
*/
static const EnsembleImplMap initMap[] = {
{"atime", FileAttrAccessTimeCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0},
{"attributes", TclFileAttrsCmd, NULL, NULL, NULL, 0},
{"atime", FileAttrAccessTimeCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 1},
{"attributes", TclFileAttrsCmd, NULL, NULL, NULL, 1},
{"channels", TclChannelNamesCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"copy", TclFileCopyCmd, NULL, NULL, NULL, 0},
{"delete", TclFileDeleteCmd, TclCompileBasicMin0ArgCmd, NULL, NULL, 0},
{"dirname", PathDirNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"executable", FileAttrIsExecutableCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"exists", FileAttrIsExistingCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"extension", PathExtensionCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"isdirectory", FileAttrIsDirectoryCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"isfile", FileAttrIsFileCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"copy", TclFileCopyCmd, NULL, NULL, NULL, 1},
{"delete", TclFileDeleteCmd, TclCompileBasicMin0ArgCmd, NULL, NULL, 1},
{"dirname", PathDirNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"executable", FileAttrIsExecutableCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"exists", FileAttrIsExistingCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"extension", PathExtensionCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"isdirectory", FileAttrIsDirectoryCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"isfile", FileAttrIsFileCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"join", PathJoinCmd, TclCompileBasicMin1ArgCmd, NULL, NULL, 0},
{"link", TclFileLinkCmd, TclCompileBasic1To3ArgCmd, NULL, NULL, 0},
{"lstat", FileAttrLinkStatCmd, TclCompileBasic2ArgCmd, NULL, NULL, 0},
{"mtime", FileAttrModifyTimeCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0},
{"mkdir", TclFileMakeDirsCmd, TclCompileBasicMin0ArgCmd, NULL, NULL, 0},
{"nativename", PathNativeNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"normalize", PathNormalizeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"owned", FileAttrIsOwnedCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"link", TclFileLinkCmd, TclCompileBasic1To3ArgCmd, NULL, NULL, 1},
{"lstat", FileAttrLinkStatCmd, TclCompileBasic2ArgCmd, NULL, NULL, 1},
{"mtime", FileAttrModifyTimeCmd, TclCompileBasic1Or2ArgCmd, NULL, NULL, 1},
{"mkdir", TclFileMakeDirsCmd, TclCompileBasicMin0ArgCmd, NULL, NULL, 1},
{"nativename", PathNativeNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"normalize", PathNormalizeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"owned", FileAttrIsOwnedCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"pathtype", PathTypeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"readable", FileAttrIsReadableCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"readlink", TclFileReadLinkCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"rename", TclFileRenameCmd, NULL, NULL, NULL, 0},
{"rootname", PathRootNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"readable", FileAttrIsReadableCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"readlink", TclFileReadLinkCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"rename", TclFileRenameCmd, NULL, NULL, NULL, 1},
{"rootname", PathRootNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"separator", FilesystemSeparatorCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"size", FileAttrSizeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"size", FileAttrSizeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"split", PathSplitCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"stat", FileAttrStatCmd, TclCompileBasic2ArgCmd, NULL, NULL, 0},
{"stat", FileAttrStatCmd, TclCompileBasic2ArgCmd, NULL, NULL, 1},
{"system", PathFilesystemCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"tail", PathTailCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"tempfile", TclFileTemporaryCmd, TclCompileBasic0To2ArgCmd, NULL, NULL, 0},
{"type", FileAttrTypeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"volumes", FilesystemVolumesCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"writable", FileAttrIsWritableCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"tail", PathTailCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"tempfile", TclFileTemporaryCmd, TclCompileBasic0To2ArgCmd, NULL, NULL, 1},
{"type", FileAttrTypeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{"volumes", FilesystemVolumesCmd, TclCompileBasic0ArgCmd, NULL, NULL, 1},
{"writable", FileAttrIsWritableCmd, TclCompileBasic1ArgCmd, NULL, NULL, 1},
{NULL, NULL, NULL, NULL, NULL, 0}
};
return TclMakeEnsemble(interp, "file", initMap);
}
/*
*----------------------------------------------------------------------
*
* TclMakeFileCommandSafe --
*
* This function hides the unsafe subcommands of the "file" Tcl command
* ensemble. It must only be called from TclHideUnsafeCommands.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* Adds commands to the table of hidden commands.
*
*----------------------------------------------------------------------
*/
int
TclMakeFileCommandSafe(
Tcl_Interp *interp)
{
static const struct {
const char *cmdName;
int unsafe;
} unsafeInfo[] = {
{"atime", 1},
{"attributes", 1},
{"channels", 0},
{"copy", 1},
{"delete", 1},
{"dirname", 1},
{"executable", 1},
{"exists", 1},
{"extension", 1},
{"isdirectory", 1},
{"isfile", 1},
{"join", 0},
{"link", 1},
{"lstat", 1},
{"mtime", 1},
{"mkdir", 1},
{"nativename", 1},
{"normalize", 1},
{"owned", 1},
{"pathtype", 0},
{"readable", 1},
{"readlink", 1},
{"rename", 1},
{"rootname", 1},
{"separator", 0},
{"size", 1},
{"split", 0},
{"stat", 1},
{"system", 0},
{"tail", 1},
{"tempfile", 1},
{"type", 1},
{"volumes", 1},
{"writable", 1},
{NULL, 0}
};
int i;
Tcl_DString oldBuf, newBuf;
Tcl_DStringInit(&oldBuf);
TclDStringAppendLiteral(&oldBuf, "::tcl::file::");
Tcl_DStringInit(&newBuf);
TclDStringAppendLiteral(&newBuf, "tcl:file:");
for (i=0 ; unsafeInfo[i].cmdName != NULL ; i++) {
if (unsafeInfo[i].unsafe) {
const char *oldName, *newName;
Tcl_DStringSetLength(&oldBuf, 13);
oldName = Tcl_DStringAppend(&oldBuf, unsafeInfo[i].cmdName, -1);
Tcl_DStringSetLength(&newBuf, 9);
newName = Tcl_DStringAppend(&newBuf, unsafeInfo[i].cmdName, -1);
if (TclRenameCommand(interp, oldName, "___tmp") != TCL_OK
|| Tcl_HideCommand(interp, "___tmp", newName) != TCL_OK) {
Tcl_Panic("problem making 'file %s' safe: %s",
unsafeInfo[i].cmdName,
Tcl_GetString(Tcl_GetObjResult(interp)));
}
Tcl_CreateObjCommand(interp, oldName, BadFileSubcommand,
(ClientData) unsafeInfo[i].cmdName, NULL);
}
}
Tcl_DStringFree(&oldBuf);
Tcl_DStringFree(&newBuf);
/*
* Ugh. The [file] command is now actually safe, but it is assumed by
* scripts that it is not, which messes up security policies. [Bug
* 3211758]
*/
if (Tcl_HideCommand(interp, "file", "file") != TCL_OK) {
Tcl_Panic("problem making 'file' safe: %s",
Tcl_GetString(Tcl_GetObjResult(interp)));
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* BadFileSubcommand --
*
* Command used to act as a backstop implementation when subcommands of
* "file" are unsafe (the real implementations of the subcommands are
* hidden). The clientData is always the full official subcommand name.
*
* Results:
* A standard Tcl result (always a TCL_ERROR).
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
BadFileSubcommand(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
const char *subcommandName = (const char *) clientData;
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"not allowed to invoke subcommand %s of file", subcommandName));
Tcl_SetErrorCode(interp, "TCL", "SAFE", "SUBCOMMAND", NULL);
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
+2 -1
View File
@@ -171,9 +171,10 @@ static const EnsembleImplMap defaultInfoMap[] = {
{"hostname", InfoHostnameCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"level", InfoLevelCmd, TclCompileInfoLevelCmd, NULL, NULL, 0},
{"library", InfoLibraryCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"linkedname", TclInfoLinkedNameCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
{"loaded", InfoLoadedCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"locals", TclInfoLocalsCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"nameofexecutable", InfoNameOfExecutableCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"nameofexecutable", InfoNameOfExecutableCmd, TclCompileBasic0ArgCmd, NULL, NULL, 1},
{"patchlevel", InfoPatchLevelCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0},
{"procs", InfoProcsCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
{"script", InfoScriptCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0},
+3 -8
View File
@@ -258,7 +258,7 @@ Tcl_RegexpObjCmd(
stringLength = Tcl_GetCharLength(objPtr);
if (startIndex) {
TclGetIntForIndexM(NULL, startIndex, stringLength, &offset);
TclGetIntForIndexM(interp, startIndex, stringLength, &offset);
Tcl_DecrRefCount(startIndex);
if (offset < 0) {
offset = 0;
@@ -582,7 +582,7 @@ Tcl_RegsubObjCmd(
if (startIndex) {
int stringLength = Tcl_GetCharLength(objv[1]);
TclGetIntForIndexM(NULL, startIndex, stringLength, &offset);
TclGetIntForIndexM(interp, startIndex, stringLength, &offset);
Tcl_DecrRefCount(startIndex);
if (offset < 0) {
offset = 0;
@@ -1623,10 +1623,6 @@ StringIsCmd(
chcomp = Tcl_UniCharIsGraph;
break;
case STR_IS_INT:
if (TCL_OK == TclGetIntFromObj(NULL, objPtr, &i)) {
break;
}
goto failedIntParse;
case STR_IS_ENTIER:
if ((objPtr->typePtr == &tclIntType) ||
(objPtr->typePtr == &tclBignumType)) {
@@ -1674,7 +1670,6 @@ StringIsCmd(
break;
}
failedIntParse:
string1 = TclGetStringFromObj(objPtr, &length1);
if (length1 == 0) {
if (strict) {
@@ -1849,7 +1844,7 @@ static int
UniCharIsHexDigit(
int character)
{
return (character >= 0) && (character < 0x80) && isxdigit(character);
return (character >= 0) && (character < 0x80) && isxdigit(UCHAR(character));
}
/*
+2 -5
View File
@@ -691,14 +691,11 @@ TclCompileStringIsCmd(
}
switch (t) {
case STR_IS_INT:
PUSH( "1");
OP( EQ);
break;
case STR_IS_WIDE:
PUSH( "2");
OP( LE);
break;
case STR_IS_INT:
case STR_IS_ENTIER:
PUSH( "3");
OP( LE);
@@ -1353,7 +1350,7 @@ static int
UniCharIsHexDigit(
int character)
{
return (character >= 0) && (character < 0x80) && isxdigit(character);
return (character >= 0) && (character < 0x80) && isxdigit(UCHAR(character));
}
StringClassDesc const tclStringClassTable[] = {
+1 -1
View File
@@ -1759,7 +1759,7 @@ ConvertTreeToTokens(
/*
* All the Tcl_Tokens allocated and filled belong to
* this subexpresion. The first token is the leading
* this subexpression. The first token is the leading
* TCL_TOKEN_SUB_EXPR token, and all the rest (one fewer)
* are its components.
*/
+953 -953
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1610,7 +1610,7 @@ Tcl_DisassembleObjCmd(
"BYTECODE", NULL);
return TCL_ERROR;
}
if (PTR2INT(clientData)) {
if (clientData) {
Tcl_SetObjResult(interp,
DisassembleByteCodeAsDicts(interp, codeObjPtr));
} else {
+1 -1
View File
@@ -2058,7 +2058,7 @@ LoadEscapeEncoding(
dataPtr->numSubTables =
Tcl_DStringLength(&escapeData) / sizeof(EscapeSubTable);
memcpy(dataPtr->subTables, Tcl_DStringValue(&escapeData),
(size_t) Tcl_DStringLength(&escapeData));
Tcl_DStringLength(&escapeData));
Tcl_DStringFree(&escapeData);
memset(dataPtr->prefixBytes, 0, sizeof(dataPtr->prefixBytes));
+37 -46
View File
@@ -500,7 +500,7 @@ VarHashCreateVar(
#define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \
(((objPtr)->typePtr == &tclIntType) \
? (*(tPtr) = TCL_NUMBER_WIDE, \
? (*(tPtr) = TCL_NUMBER_INT, \
*(ptrPtr) = (ClientData) \
(&((objPtr)->internalRep.wideValue)), TCL_OK) : \
((objPtr)->typePtr == &tclDoubleType) \
@@ -3620,7 +3620,7 @@ TEBCresume(
objPtr = varPtr->value.objPtr;
if (GetNumberFromObj(NULL, objPtr, &ptr, &type) == TCL_OK) {
if (type == TCL_NUMBER_WIDE) {
if (type == TCL_NUMBER_INT) {
Tcl_WideInt augend = *((const Tcl_WideInt *)ptr);
Tcl_WideInt sum = augend + increment;
@@ -3662,7 +3662,7 @@ TEBCresume(
TclSetIntObj(objPtr, w+increment);
}
goto doneIncr;
} /* end if (type == TCL_NUMBER_WIDE) */
} /* end if (type == TCL_NUMBER_INT) */
}
if (Tcl_IsShared(objPtr)) {
objPtr->refCount--; /* We know it's shared */
@@ -4761,7 +4761,7 @@ TEBCresume(
if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
&& (value2Ptr->typePtr != &tclListType)
&& (TclGetIntForIndexM(NULL , value2Ptr, objc-1,
&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
&index) == TCL_OK)) {
TclDecrRefCount(value2Ptr);
tosPtr--;
@@ -5631,22 +5631,13 @@ TEBCresume(
case INST_NUM_TYPE:
if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) {
type1 = 0;
} else if (type1 == TCL_NUMBER_WIDE) {
/* value is between WIDE_MIN and WIDE_MAX */
/* [string is integer] is -UINT_MAX to UINT_MAX range */
/* [string is wideinteger] is -UWIDE_MAX to UWIDE_MAX range */
int i;
if (Tcl_GetIntFromObj(NULL, OBJ_AT_TOS, &i) == TCL_OK) {
type1 = TCL_NUMBER_LONG;
}
} else if (type1 == TCL_NUMBER_BIG) {
/* value is an integer outside the WIDE_MIN to WIDE_MAX range */
/* [string is wideinteger] is -UWIDE_MAX to UWIDE_MAX range */
/* [string is wideinteger] is WIDE_MIN to WIDE_MAX range */
Tcl_WideInt w;
if (Tcl_GetWideIntFromObj(NULL, OBJ_AT_TOS, &w) == TCL_OK) {
type1 = TCL_NUMBER_WIDE;
type1 = TCL_NUMBER_INT;
}
}
TclNewIntObj(objResultPtr, type1);
@@ -5692,7 +5683,7 @@ TEBCresume(
compare = MP_EQ;
goto convertComparison;
}
if ((type1 == TCL_NUMBER_WIDE) && (type2 == TCL_NUMBER_WIDE)) {
if ((type1 == TCL_NUMBER_INT) && (type2 == TCL_NUMBER_INT)) {
w1 = *((const Tcl_WideInt *)ptr1);
w2 = *((const Tcl_WideInt *)ptr2);
compare = (w1 < w2) ? MP_LT : ((w1 > w2) ? MP_GT : MP_EQ);
@@ -5771,7 +5762,7 @@ TEBCresume(
* Check for common, simple case.
*/
if ((type1 == TCL_NUMBER_WIDE) && (type2 == TCL_NUMBER_WIDE)) {
if ((type1 == TCL_NUMBER_INT) && (type2 == TCL_NUMBER_INT)) {
w1 = *((const Tcl_WideInt *)ptr1);
w2 = *((const Tcl_WideInt *)ptr2);
@@ -6011,7 +6002,7 @@ TEBCresume(
* an external function.
*/
if ((type1 == TCL_NUMBER_WIDE) && (type2 == TCL_NUMBER_WIDE)) {
if ((type1 == TCL_NUMBER_INT) && (type2 == TCL_NUMBER_INT)) {
w1 = *((const Tcl_WideInt *)ptr1);
w2 = *((const Tcl_WideInt *)ptr2);
@@ -6154,7 +6145,7 @@ TEBCresume(
CACHE_STACK_INFO();
goto gotError;
}
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
w1 = *((const Tcl_WideInt *) ptr1);
if (Tcl_IsShared(valuePtr)) {
TclNewIntObj(objResultPtr, ~w1);
@@ -6191,7 +6182,7 @@ TEBCresume(
/* -NaN => NaN */
TRACE_APPEND(("%s\n", O2S(valuePtr)));
NEXT_INST_F(1, 0, 0);
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
w1 = *((const Tcl_WideInt *) ptr1);
if (w1 != WIDE_MIN) {
if (Tcl_IsShared(valuePtr)) {
@@ -7870,7 +7861,7 @@ ExecuteExtendedBinaryMathOp(
/* TODO: Attempts to re-use unshared operands on stack */
w2 = 0; /* silence gcc warning */
if (type2 == TCL_NUMBER_WIDE) {
if (type2 == TCL_NUMBER_INT) {
w2 = *((const Tcl_WideInt *)ptr2);
if (w2 == 0) {
return DIVIDED_BY_ZERO;
@@ -7883,7 +7874,7 @@ ExecuteExtendedBinaryMathOp(
return constants[0];
}
}
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
w1 = *((const Tcl_WideInt *)ptr1);
if (w1 == 0) {
@@ -7961,7 +7952,7 @@ ExecuteExtendedBinaryMathOp(
*/
switch (type2) {
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
invalid = (*((const Tcl_WideInt *)ptr2) < (Tcl_WideInt)0);
break;
case TCL_NUMBER_BIG:
@@ -7983,7 +7974,7 @@ ExecuteExtendedBinaryMathOp(
* Zero shifted any number of bits is still zero.
*/
if ((type1==TCL_NUMBER_WIDE) && (*((const Tcl_WideInt *)ptr1) == (Tcl_WideInt)0)) {
if ((type1==TCL_NUMBER_INT) && (*((const Tcl_WideInt *)ptr1) == (Tcl_WideInt)0)) {
return constants[0];
}
@@ -7996,7 +7987,7 @@ ExecuteExtendedBinaryMathOp(
* counterparts, leading to incorrect results.
*/
if ((type2 != TCL_NUMBER_WIDE)
if ((type2 != TCL_NUMBER_INT)
|| (*((const Tcl_WideInt *)ptr2) > INT_MAX)) {
/*
* Technically, we could hold the value (1 << (INT_MAX+1)) in
@@ -8029,7 +8020,7 @@ ExecuteExtendedBinaryMathOp(
* Quickly force large right shifts to 0 or -1.
*/
if ((type2 != TCL_NUMBER_WIDE)
if ((type2 != TCL_NUMBER_INT)
|| (*(const Tcl_WideInt *)ptr2 > INT_MAX)) {
/*
* Again, technically, the value to be shifted could be an
@@ -8040,7 +8031,7 @@ ExecuteExtendedBinaryMathOp(
*/
switch (type1) {
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
zero = (*(const Tcl_WideInt *)ptr1 > (Tcl_WideInt)0);
break;
case TCL_NUMBER_BIG:
@@ -8063,7 +8054,7 @@ ExecuteExtendedBinaryMathOp(
* Handle shifts within the native wide range.
*/
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
w1 = *(const Tcl_WideInt *)ptr1;
if ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideInt)) {
if (w1 >= (Tcl_WideInt)0) {
@@ -8240,7 +8231,7 @@ ExecuteExtendedBinaryMathOp(
BIG_RESULT(&bigResult);
}
if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE)) {
if ((type1 == TCL_NUMBER_INT) || (type2 == TCL_NUMBER_INT)) {
TclGetWideIntFromObj(NULL, valuePtr, &w1);
TclGetWideIntFromObj(NULL, value2Ptr, &w2);
@@ -8294,7 +8285,7 @@ ExecuteExtendedBinaryMathOp(
goto doubleResult;
}
w2 = 0;
if (type2 == TCL_NUMBER_WIDE) {
if (type2 == TCL_NUMBER_INT) {
w2 = *((const Tcl_WideInt *) ptr2);
if (w2 == 0) {
/*
@@ -8312,7 +8303,7 @@ ExecuteExtendedBinaryMathOp(
}
switch (type2) {
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
w2 = *((const Tcl_WideInt *)ptr2);
negativeExponent = (w2 < 0);
oddExponent = (int) (w2 & (Tcl_WideInt)1);
@@ -8326,11 +8317,11 @@ ExecuteExtendedBinaryMathOp(
break;
}
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
w1 = *((const Tcl_WideInt *)ptr1);
}
if (negativeExponent) {
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
switch (w1) {
case 0:
/*
@@ -8360,7 +8351,7 @@ ExecuteExtendedBinaryMathOp(
return constants[0];
}
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
switch (w1) {
case 0:
/*
@@ -8387,17 +8378,17 @@ ExecuteExtendedBinaryMathOp(
* which means the max exponent value is 2**28-1 = 0x0fffffff =
* 268435455, which fits into a signed 32 bit int which is within the
* range of the long int type. This means any numeric Tcl_Obj value
* not using TCL_NUMBER_WIDE type must hold a value larger than we
* not using TCL_NUMBER_INT type must hold a value larger than we
* accept.
*/
if (type2 != TCL_NUMBER_WIDE) {
if (type2 != TCL_NUMBER_INT) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"exponent too large", -1));
return GENERAL_ARITHMETIC_ERROR;
}
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
if (w1 == 2) {
/*
* Reduce small powers of 2 to shifts.
@@ -8421,7 +8412,7 @@ ExecuteExtendedBinaryMathOp(
goto overflowExpon;
}
}
if (type1 == TCL_NUMBER_WIDE) {
if (type1 == TCL_NUMBER_INT) {
w1 = *((const Tcl_WideInt *) ptr1);
} else {
goto overflowExpon;
@@ -8621,7 +8612,7 @@ ExecuteExtendedBinaryMathOp(
switch (opcode) {
case INST_ADD:
wResult = w1 + w2;
if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
if ((type1 == TCL_NUMBER_INT) || (type2 == TCL_NUMBER_INT))
{
/*
* Check for overflow.
@@ -8635,7 +8626,7 @@ ExecuteExtendedBinaryMathOp(
case INST_SUB:
wResult = w1 - w2;
if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
if ((type1 == TCL_NUMBER_INT) || (type2 == TCL_NUMBER_INT))
{
/*
* Must check for overflow. The macro tests for overflows
@@ -8758,7 +8749,7 @@ ExecuteExtendedUnaryMathOp(
switch (opcode) {
case INST_BITNOT:
if (type == TCL_NUMBER_WIDE) {
if (type == TCL_NUMBER_INT) {
w = *((const Tcl_WideInt *) ptr);
WIDE_RESULT(~w);
}
@@ -8771,7 +8762,7 @@ ExecuteExtendedUnaryMathOp(
switch (type) {
case TCL_NUMBER_DOUBLE:
DOUBLE_RESULT(-(*((const double *) ptr)));
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
w = *((const Tcl_WideInt *) ptr);
if (w != WIDE_MIN) {
WIDE_RESULT(-w);
@@ -8825,10 +8816,10 @@ TclCompareTwoNumbers(
(void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);
switch (type1) {
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
w1 = *((const Tcl_WideInt *)ptr1);
switch (type2) {
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
w2 = *((const Tcl_WideInt *)ptr2);
wideCompare:
return (w1 < w2) ? MP_LT : ((w1 > w2) ? MP_GT : MP_EQ);
@@ -8885,7 +8876,7 @@ TclCompareTwoNumbers(
d2 = *((const double *)ptr2);
doubleCompare:
return (d1 < d2) ? MP_LT : ((d1 > d2) ? MP_GT : MP_EQ);
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
w2 = *((const Tcl_WideInt *)ptr2);
d2 = (double) w2;
if (DBL_MANT_DIG > CHAR_BIT*sizeof(Tcl_WideInt)
@@ -8927,7 +8918,7 @@ TclCompareTwoNumbers(
case TCL_NUMBER_BIG:
Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
switch (type2) {
case TCL_NUMBER_WIDE:
case TCL_NUMBER_INT:
compare = mp_cmp_d(&big1, 0);
mp_clear(&big1);
return compare;
+1 -1
View File
@@ -897,7 +897,7 @@ TclDatelex(
location->first_column = yyInput - info->dateStart;
for ( ; ; ) {
while (isspace(UCHAR(*yyInput))) {
while (TclIsSpaceProc(UCHAR(*yyInput))) {
yyInput++;
}
+17 -12
View File
@@ -120,19 +120,19 @@ typedef int ptrdiff_t;
#if !defined(INT2PTR) && !defined(PTR2INT)
# if defined(HAVE_INTPTR_T) || defined(intptr_t)
# define INT2PTR(p) ((void *)(intptr_t)(p))
# define PTR2INT(p) ((int)(intptr_t)(p))
# define PTR2INT(p) ((intptr_t)(p))
# else
# define INT2PTR(p) ((void *)(p))
# define PTR2INT(p) ((int)(p))
# define PTR2INT(p) ((long)(p))
# endif
#endif
#if !defined(UINT2PTR) && !defined(PTR2UINT)
# if defined(HAVE_UINTPTR_T) || defined(uintptr_t)
# define UINT2PTR(p) ((void *)(uintptr_t)(p))
# define PTR2UINT(p) ((unsigned int)(uintptr_t)(p))
# define PTR2UINT(p) ((uintptr_t)(p))
# else
# define UINT2PTR(p) ((void *)(p))
# define PTR2UINT(p) ((unsigned int)(p))
# define PTR2UINT(p) ((unsigned long)(p))
# endif
#endif
@@ -235,6 +235,8 @@ typedef struct NamespacePathEntry NamespacePathEntry;
* field added at the end: in this way variables can find their namespace
* without having to copy a pointer in their struct: they can access it via
* their hPtr->tablePtr.
*
* Note that arrays further extend this. See ArrayVarHashTable in tclVar.c
*/
typedef struct TclVarHashTable {
@@ -2497,16 +2499,16 @@ typedef struct List {
#else
#define TclGetLongFromObj(interp, objPtr, longPtr) \
(((objPtr)->typePtr == &tclIntType \
&& (objPtr)->internalRep.wideValue >= -(Tcl_WideInt)(ULONG_MAX) \
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(ULONG_MAX)) \
&& (objPtr)->internalRep.wideValue >= (Tcl_WideInt)(LONG_MIN) \
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(LONG_MAX)) \
? ((*(longPtr) = (long)(objPtr)->internalRep.wideValue), TCL_OK) \
: Tcl_GetLongFromObj((interp), (objPtr), (longPtr)))
#endif
#define TclGetIntFromObj(interp, objPtr, intPtr) \
(((objPtr)->typePtr == &tclIntType \
&& (objPtr)->internalRep.wideValue >= -(Tcl_WideInt)(UINT_MAX) \
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(UINT_MAX)) \
&& (objPtr)->internalRep.wideValue >= (Tcl_WideInt)(INT_MIN) \
&& (objPtr)->internalRep.wideValue <= (Tcl_WideInt)(INT_MAX)) \
? ((*(intPtr) = (int)(objPtr)->internalRep.wideValue), TCL_OK) \
: Tcl_GetIntFromObj((interp), (objPtr), (intPtr)))
#define TclGetIntForIndexM(interp, objPtr, endValue, idxPtr) \
@@ -2709,8 +2711,11 @@ typedef struct ProcessGlobalValue {
*----------------------------------------------------------------------
*/
#define TCL_NUMBER_LONG 1
#define TCL_NUMBER_WIDE 2
#define TCL_NUMBER_INT 2
#if (TCL_MAJOR_VERSION < 9) && !defined(TCL_NO_DEPRECATED)
# define TCL_NUMBER_LONG 1 /* deprecated, not used any more */
# define TCL_NUMBER_WIDE TCL_NUMBER_INT /* deprecated */
#endif
#define TCL_NUMBER_BIG 3
#define TCL_NUMBER_DOUBLE 4
#define TCL_NUMBER_NAN 5
@@ -3057,6 +3062,8 @@ MODULE_SCOPE int TclInfoCoroutineCmd(ClientData dummy, Tcl_Interp *interp,
MODULE_SCOPE Tcl_Obj * TclInfoFrame(Tcl_Interp *interp, CmdFrame *framePtr);
MODULE_SCOPE int TclInfoGlobalsCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TclInfoLinkedNameCmd(ClientData dummy,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TclInfoLocalsCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TclInfoVarsCmd(ClientData dummy, Tcl_Interp *interp,
@@ -3360,7 +3367,6 @@ MODULE_SCOPE int TclNRAssembleObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE Tcl_Command TclInitEncodingCmd(Tcl_Interp *interp);
MODULE_SCOPE int TclMakeEncodingCommandSafe(Tcl_Interp *interp);
MODULE_SCOPE int Tcl_EofObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -3389,7 +3395,6 @@ MODULE_SCOPE int Tcl_FcopyObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE Tcl_Command TclInitFileCmd(Tcl_Interp *interp);
MODULE_SCOPE int TclMakeFileCommandSafe(Tcl_Interp *interp);
MODULE_SCOPE int Tcl_FileEventObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
+1 -1
View File
@@ -409,7 +409,7 @@ Tcl_Init(
" } else {\n"
" lappend scripts {::tcl::pkgconfig get scriptdir,runtime}\n"
" }\n"
" lappend scripts {zipfs tcl_library}\n"
" lappend scripts {::tcl::zipfs::tcl_library_init}\n"
" lappend scripts {\n"
"set parentDir [file dirname [file dirname [info nameofexecutable]]]\n"
"set grandParentDir [file dirname $parentDir]\n"
+63 -33
View File
@@ -59,7 +59,6 @@ static const struct {
* Function declarations for things defined in this file.
*/
static Class * AllocClass(Tcl_Interp *interp, Object *useThisObj);
static Object * AllocObject(Tcl_Interp *interp, const char *nameStr,
Namespace *nsPtr, const char *nsNameStr);
static int CloneClassMethod(Tcl_Interp *interp, Class *clsPtr,
@@ -84,8 +83,6 @@ static void ObjectNamespaceDeleted(ClientData clientData);
static void ObjectRenamedTrace(ClientData clientData,
Tcl_Interp *interp, const char *oldName,
const char *newName, int flags);
static void ReleaseClassContents(Tcl_Interp *interp,Object *oPtr);
static void DeleteDescendants(Tcl_Interp *interp,Object *oPtr);
static inline void RemoveClass(Class **list, int num, int idx);
static inline void RemoveObject(Object **list, int num, int idx);
static inline void SquelchCachedName(Object *oPtr);
@@ -451,10 +448,10 @@ InitClassSystemRoots(
/* Stand up a phony class for bootstrapping. */
fPtr->objectCls = &fakeCls;
/* referenced in AllocClass to increment the refCount. */
/* referenced in TclOOAllocClass to increment the refCount. */
fakeCls.thisPtr = &fakeObject;
fPtr->objectCls = AllocClass(interp,
fPtr->objectCls = TclOOAllocClass(interp,
AllocObject(interp, "object", (Namespace *)fPtr->ooNs, NULL));
/* Corresponding TclOODecrRefCount in KillFoudation */
AddRef(fPtr->objectCls->thisPtr);
@@ -470,7 +467,7 @@ InitClassSystemRoots(
fPtr->objectCls->thisPtr->flags |= ROOT_OBJECT;
fPtr->objectCls->flags |= ROOT_OBJECT;
fPtr->classCls = AllocClass(interp,
fPtr->classCls = TclOOAllocClass(interp,
AllocObject(interp, "class", (Namespace *)fPtr->ooNs, NULL));
/* Corresponding TclOODecrRefCount in KillFoudation */
AddRef(fPtr->classCls->thisPtr);
@@ -839,15 +836,15 @@ ObjectRenamedTrace(
/*
* ----------------------------------------------------------------------
*
* DeleteDescendants --
* TclOODeleteDescendants --
*
* Delete all descendants of a particular class.
*
* ----------------------------------------------------------------------
*/
static void
DeleteDescendants(
void
TclOODeleteDescendants(
Tcl_Interp *interp, /* The interpreter containing the class. */
Object *oPtr) /* The object representing the class. */
{
@@ -864,7 +861,8 @@ DeleteDescendants(
/* This condition also covers the case where mixinSubclassPtr ==
* clsPtr
*/
if (!Deleted(mixinSubclassPtr->thisPtr)) {
if (!Deleted(mixinSubclassPtr->thisPtr)
&& !(mixinSubclassPtr->thisPtr->flags & DONT_DELETE)) {
Tcl_DeleteCommandFromToken(interp,
mixinSubclassPtr->thisPtr->command);
}
@@ -883,8 +881,10 @@ DeleteDescendants(
if (clsPtr->subclasses.num > 0) {
while (clsPtr->subclasses.num > 0) {
subclassPtr = clsPtr->subclasses.list[clsPtr->subclasses.num-1];
if (!Deleted(subclassPtr->thisPtr) && !IsRoot(subclassPtr)) {
Tcl_DeleteCommandFromToken(interp, subclassPtr->thisPtr->command);
if (!Deleted(subclassPtr->thisPtr) && !IsRoot(subclassPtr)
&& !(subclassPtr->thisPtr->flags & DONT_DELETE)) {
Tcl_DeleteCommandFromToken(interp,
subclassPtr->thisPtr->command);
}
TclOORemoveFromSubclasses(subclassPtr, clsPtr);
}
@@ -906,7 +906,8 @@ DeleteDescendants(
* This condition also covers the case where instancePtr == oPtr
*/
if (!Deleted(instancePtr) && !IsRoot(instancePtr)) {
if (!Deleted(instancePtr) && !IsRoot(instancePtr) &&
!(instancePtr->flags & DONT_DELETE)) {
Tcl_DeleteCommandFromToken(interp, instancePtr->command);
}
TclOORemoveFromInstances(instancePtr, clsPtr);
@@ -922,7 +923,7 @@ DeleteDescendants(
/*
* ----------------------------------------------------------------------
*
* ReleaseClassContents --
* TclOOReleaseClassContents --
*
* Tear down the special class data structure, including deleting all
* dependent classes and objects.
@@ -930,8 +931,8 @@ DeleteDescendants(
* ----------------------------------------------------------------------
*/
static void
ReleaseClassContents(
void
TclOOReleaseClassContents(
Tcl_Interp *interp, /* The interpreter containing the class. */
Object *oPtr) /* The object representing the class. */
{
@@ -954,9 +955,6 @@ ReleaseClassContents(
} else if (IsRootObject(oPtr)) {
Tcl_Panic("deleting class structure for non-deleted %s",
"::oo::object");
} else {
Tcl_Panic("deleting class structure for non-deleted %s",
"general object");
}
}
@@ -1059,6 +1057,7 @@ ReleaseClassContents(
if (IsRootClass(oPtr) && !Deleted(fPtr->objectCls->thisPtr)) {
Tcl_DeleteCommandFromToken(interp, fPtr->objectCls->thisPtr->command);
}
oPtr->classPtr = NULL;
}
/*
@@ -1108,7 +1107,7 @@ ObjectNamespaceDeleted(
/* Let the dominoes fall */
if (oPtr->classPtr) {
DeleteDescendants(interp, oPtr);
TclOODeleteDescendants(interp, oPtr);
}
/*
@@ -1237,8 +1236,8 @@ ObjectNamespaceDeleted(
/*
* Because an object can be a class that is an instance of itself, the
* class object's class structure should only be cleaned after most of the
* cleanup on the object is done.
* class object's class structure should only be cleaned after most of
* the cleanup on the object is done.
*
* The class of objects needs some special care; if it is deleted (and
* we're not killing the whole interpreter) we force the delete of the
@@ -1253,7 +1252,7 @@ ObjectNamespaceDeleted(
}
if (oPtr->classPtr != NULL) {
ReleaseClassContents(interp, oPtr);
TclOOReleaseClassContents(interp, oPtr);
}
/*
@@ -1357,6 +1356,37 @@ TclOOAddToInstances(
AddRef(oPtr);
}
/*
* ----------------------------------------------------------------------
*
* TclOORemoveFromMixins --
*
* Utility function to remove a class from the list of mixins within an
* object.
*
* ----------------------------------------------------------------------
*/
int
TclOORemoveFromMixins(
Class *mixinPtr, /* The mixin to remove. */
Object *oPtr) /* The object (possibly) containing the
* reference to the mixin. */
{
int i, res = 0;
Class *mixPtr;
FOREACH(mixPtr, oPtr->mixins) {
if (mixinPtr == mixPtr) {
RemoveItem(Class, oPtr->mixins, i);
TclOODecrRefCount(mixPtr->thisPtr);
res++;
break;
}
}
return res;
}
/*
* ----------------------------------------------------------------------
*
@@ -1489,10 +1519,10 @@ TclOOAddToMixinSubs(
/*
* ----------------------------------------------------------------------
*
* AllocClass --
* TclOOAllocClass --
*
* Allocate a basic class. Does not add class to its
* class's instance list.
* Allocate a basic class. Does not add class to its class's instance
* list.
*
* ----------------------------------------------------------------------
*/
@@ -1516,8 +1546,8 @@ InitClassPath(
}
}
static Class *
AllocClass(
Class *
TclOOAllocClass(
Tcl_Interp *interp, /* Interpreter within which to allocate the
* class. */
Object *useThisObj) /* Object that is to act as the class
@@ -1758,13 +1788,13 @@ TclNewObjectInstanceCommon(
if (TclOOIsReachable(fPtr->classCls, classPtr)) {
/*
* Is a class, so attach a class structure. Note that the AllocClass
* function splices the structure into the object, so we don't have
* to. Once that's done, we need to repatch the object to have the
* right class since AllocClass interferes with that.
* Is a class, so attach a class structure. Note that the
* TclOOAllocClass function splices the structure into the object, so
* we don't have to. Once that's done, we need to repatch the object
* to have the right class since TclOOAllocClass interferes with that.
*/
AllocClass(interp, oPtr);
TclOOAllocClass(interp, oPtr);
TclOOAddToSubclasses(oPtr->classPtr, fPtr->objectCls);
} else {
oPtr->classPtr = NULL;
-1
View File
@@ -1704,7 +1704,6 @@ AddSimpleClassChainToCallContext(
if (flags & CONSTRUCTOR) {
AddMethodToCallChain(classPtr->constructorPtr, cbPtr, doneFilters,
filterDecl, flags);
} else if (flags & DESTRUCTOR) {
AddMethodToCallChain(classPtr->destructorPtr, cbPtr, doneFilters,
filterDecl, flags);
+31 -1
View File
@@ -1375,6 +1375,8 @@ TclOODefineClassObjCmd(
{
Object *oPtr;
Class *clsPtr;
Foundation *fPtr = TclOOGetFoundation(interp);
int wasClass, willBeClass;
/*
* Parse the context to get the object to operate on.
@@ -1410,12 +1412,20 @@ TclOODefineClassObjCmd(
if (clsPtr == NULL) {
return TCL_ERROR;
}
if (oPtr == clsPtr->thisPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"may not change classes into an instance of themselves", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL);
return TCL_ERROR;
}
/*
* Set the object's class.
*/
wasClass = (oPtr->classPtr != NULL);
willBeClass = (TclOOIsReachable(fPtr->classCls, clsPtr));
if (oPtr->selfCls != clsPtr) {
TclOORemoveFromInstances(oPtr, oPtr->selfCls);
TclOODecrRefCount(oPtr->selfCls->thisPtr);
@@ -1423,6 +1433,26 @@ TclOODefineClassObjCmd(
AddRef(oPtr->selfCls->thisPtr);
TclOOAddToInstances(oPtr, oPtr->selfCls);
/*
* Create or delete the class guts if necessary.
*/
if (wasClass && !willBeClass) {
/*
* This is the most global of all epochs. Bump it! No cache can be
* trusted!
*/
TclOORemoveFromMixins(oPtr->classPtr, oPtr);
oPtr->fPtr->epoch++;
oPtr->flags |= DONT_DELETE;
TclOODeleteDescendants(interp, oPtr);
oPtr->flags &= ~DONT_DELETE;
TclOOReleaseClassContents(interp, oPtr);
} else if (!wasClass && willBeClass) {
TclOOAllocClass(interp, oPtr);
}
if (oPtr->classPtr != NULL) {
BumpGlobalEpoch(interp, oPtr->classPtr);
} else {
+11
View File
@@ -242,6 +242,10 @@ typedef struct Object {
/* Object/class has (or had) private methods,
* and so shouldn't be cached so
* aggressively. */
#define DONT_DELETE 0x40000 /* Inhibit deletion of this object. Used
* during fundamental object type mutation to
* make sure that the object actually survives
* to the end of the operation. */
/*
* And the definition of a class. Note that every class also has an associated
@@ -526,6 +530,8 @@ MODULE_SCOPE int TclOO_Object_VarName(ClientData clientData,
MODULE_SCOPE void TclOOAddToInstances(Object *oPtr, Class *clsPtr);
MODULE_SCOPE void TclOOAddToMixinSubs(Class *subPtr, Class *mixinPtr);
MODULE_SCOPE void TclOOAddToSubclasses(Class *subPtr, Class *superPtr);
MODULE_SCOPE Class * TclOOAllocClass(Tcl_Interp *interp,
Object *useThisObj);
MODULE_SCOPE int TclNRNewObjectInstance(Tcl_Interp *interp,
Tcl_Class cls, const char *nameStr,
const char *nsNameStr, int objc,
@@ -540,6 +546,8 @@ MODULE_SCOPE int TclOODefineSlots(Foundation *fPtr);
MODULE_SCOPE void TclOODeleteChain(CallChain *callPtr);
MODULE_SCOPE void TclOODeleteChainCache(Tcl_HashTable *tablePtr);
MODULE_SCOPE void TclOODeleteContext(CallContext *contextPtr);
MODULE_SCOPE void TclOODeleteDescendants(Tcl_Interp *interp,
Object *oPtr);
MODULE_SCOPE void TclOODelMethodRef(Method *method);
MODULE_SCOPE CallContext *TclOOGetCallContext(Object *oPtr,
Tcl_Obj *methodNameObj, int flags,
@@ -567,7 +575,10 @@ MODULE_SCOPE int TclNRObjectContextInvokeNext(Tcl_Interp *interp,
MODULE_SCOPE void TclOONewBasicMethod(Tcl_Interp *interp, Class *clsPtr,
const DeclaredClassMethod *dcm);
MODULE_SCOPE Tcl_Obj * TclOOObjectName(Tcl_Interp *interp, Object *oPtr);
MODULE_SCOPE void TclOOReleaseClassContents(Tcl_Interp *interp,
Object *oPtr);
MODULE_SCOPE int TclOORemoveFromInstances(Object *oPtr, Class *clsPtr);
MODULE_SCOPE int TclOORemoveFromMixins(Class *mixinPtr, Object *oPtr);
MODULE_SCOPE int TclOORemoveFromMixinSubs(Class *subPtr,
Class *mixinPtr);
MODULE_SCOPE int TclOORemoveFromSubclasses(Class *subPtr,
+20 -10
View File
@@ -2516,7 +2516,7 @@ Tcl_GetIntFromObj(
if (TclGetLongFromObj(interp, objPtr, &l) != TCL_OK) {
return TCL_ERROR;
}
if ((ULONG_MAX > UINT_MAX) && ((l > UINT_MAX) || (l < -(long)UINT_MAX))) {
if ((ULONG_MAX > UINT_MAX) && ((l > UINT_MAX) || (l < INT_MIN))) {
if (interp != NULL) {
const char *s =
"integer value too large to represent as non-long integer";
@@ -2796,7 +2796,7 @@ Tcl_GetLongFromObj(
#else
if (objPtr->typePtr == &tclIntType) {
/*
* We return any integer in the range -ULONG_MAX to ULONG_MAX
* We return any integer in the range LONG_MIN to ULONG_MAX
* converted to a long, ignoring overflow. The rule preserves
* existing semantics for conversion of integers on input, but
* avoids inadvertent demotion of wide integers to 32-bit ones in
@@ -2805,7 +2805,7 @@ Tcl_GetLongFromObj(
Tcl_WideInt w = objPtr->internalRep.wideValue;
if (w >= -(Tcl_WideInt)(ULONG_MAX)
if (w >= (Tcl_WideInt)(LONG_MIN)
&& w <= (Tcl_WideInt)(ULONG_MAX)) {
*longPtr = (long) w;
return TCL_OK;
@@ -2843,11 +2843,16 @@ Tcl_GetLongFromObj(
value = (value << CHAR_BIT) | *bytes++;
}
if (big.sign) {
*longPtr = - (long) value;
if (value <= 1 + (unsigned long)LONG_MAX) {
*longPtr = - (long) value;
return TCL_OK;
}
} else {
*longPtr = (long) value;
if (value <= (unsigned long)ULONG_MAX) {
*longPtr = (long) value;
return TCL_OK;
}
}
return TCL_OK;
}
}
#ifndef TCL_WIDE_INT_IS_LONG
@@ -3082,11 +3087,16 @@ Tcl_GetWideIntFromObj(
value = (value << CHAR_BIT) | *bytes++;
}
if (big.sign) {
*wideIntPtr = - (Tcl_WideInt) value;
if (value <= 1 + ~(Tcl_WideUInt)WIDE_MIN) {
*wideIntPtr = - (Tcl_WideInt) value;
return TCL_OK;
}
} else {
*wideIntPtr = (Tcl_WideInt) value;
if (value <= (Tcl_WideUInt)WIDE_MAX) {
*wideIntPtr = (Tcl_WideInt) value;
return TCL_OK;
}
}
return TCL_OK;
}
}
if (interp != NULL) {
@@ -3626,7 +3636,7 @@ TclGetNumberFromObj(
return TCL_OK;
}
if (objPtr->typePtr == &tclIntType) {
*typePtr = TCL_NUMBER_WIDE;
*typePtr = TCL_NUMBER_INT;
*clientDataPtr = &objPtr->internalRep.wideValue;
return TCL_OK;
}
+1 -2
View File
@@ -932,8 +932,7 @@ Tcl_ScanObjCmd(
}
}
if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
sprintf(buf, "%" TCL_LL_MODIFIER "u",
(Tcl_WideUInt)wideValue);
sprintf(buf, "%" TCL_LL_MODIFIER "u", wideValue);
Tcl_SetStringObj(objPtr, buf, -1);
} else {
TclSetIntObj(objPtr, wideValue);
+13 -7
View File
@@ -230,6 +230,9 @@ Tcl_WinUtfToTChar(
Tcl_DString *dsPtr)
{
Tcl_DStringInit(dsPtr);
if (!string) {
return NULL;
}
return (char *)Tcl_UtfToUniCharDString(string, len, dsPtr);
}
@@ -239,12 +242,15 @@ Tcl_WinTCharToUtf(
int len,
Tcl_DString *dsPtr)
{
if (len > 0) {
len /= 2;
} else if (len == -1) {
len = wcslen((wchar_t *)string);
}
Tcl_DStringInit(dsPtr);
if (!string) {
return NULL;
}
if (len < 0) {
len = wcslen((wchar_t *)string);
} else {
len /= 2;
}
return Tcl_UniCharToUtfDString((Tcl_UniChar *)string, len, dsPtr);
}
@@ -258,7 +264,7 @@ static int exprInt(Tcl_Interp *interp, const char *expr, int *ptr){
long longValue;
int result = Tcl_ExprLong(interp, expr, &longValue);
if (result == TCL_OK) {
if ((longValue >= -(long)(UINT_MAX))
if ((longValue >= (long)(INT_MIN))
&& (longValue <= (long)(UINT_MAX))) {
*ptr = (int)longValue;
} else {
@@ -274,7 +280,7 @@ static int exprIntObj(Tcl_Interp *interp, Tcl_Obj*expr, int *ptr){
long longValue;
int result = Tcl_ExprLongObj(interp, expr, &longValue);
if (result == TCL_OK) {
if ((longValue >= -(long)(UINT_MAX))
if ((longValue >= (long)(INT_MIN))
&& (longValue <= (long)(UINT_MAX))) {
*ptr = (int)longValue;
} else {
+2 -2
View File
@@ -2394,7 +2394,7 @@ ExitProcOdd(
char buf[16 + TCL_INTEGER_SPACE];
size_t len;
sprintf(buf, "odd %d\n", PTR2INT(clientData));
sprintf(buf, "odd %" TCL_Z_MODIFIER "d\n", (size_t)PTR2INT(clientData));
len = strlen(buf);
if (len != (size_t) write(1, buf, len)) {
Tcl_Panic("ExitProcOdd: unable to write to stdout");
@@ -2408,7 +2408,7 @@ ExitProcEven(
char buf[16 + TCL_INTEGER_SPACE];
size_t len;
sprintf(buf, "even %d\n", PTR2INT(clientData));
sprintf(buf, "even %" TCL_Z_MODIFIER "d\n", (size_t)PTR2INT(clientData));
len = strlen(buf);
if (len != (size_t) write(1, buf, len)) {
Tcl_Panic("ExitProcEven: unable to write to stdout");
+54 -39
View File
@@ -9,8 +9,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://math.libtomcrypt.com
*/
#ifndef BN_H_
#define BN_H_
@@ -27,14 +25,20 @@ extern "C" {
#endif
/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
#if defined(_MSC_VER) || defined(__LLP64__)
#if defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)
# define MP_32BIT
#endif
/* detect 64-bit mode if possible */
#if defined(NEVER)
# if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT) || defined(_MSC_VER))
# define MP_64BIT
# if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
# if defined(__GNUC__)
/* we support 128bit integers only via: __attribute__((mode(TI))) */
# define MP_64BIT
# else
/* otherwise we fall back to MP_32BIT even on 64bit platforms */
# define MP_32BIT
# endif
# endif
#endif
@@ -48,11 +52,11 @@ extern "C" {
*/
#ifdef MP_8BIT
#ifndef MP_DIGIT_DECLARED
typedef uint8_t mp_digit;
typedef unsigned char mp_digit;
#define MP_DIGIT_DECLARED
#endif
#ifndef MP_WORD_DECLARED
typedef uint16_t mp_word;
typedef unsigned short mp_word;
#define MP_WORD_DECLARED
#endif
# define MP_SIZEOF_MP_DIGIT 1
@@ -61,11 +65,11 @@ typedef uint16_t mp_word;
# endif
#elif defined(MP_16BIT)
#ifndef MP_DIGIT_DECLARED
typedef uint16_t mp_digit;
typedef unsigned short mp_digit;
#define MP_DIGIT_DECLARED
#endif
#ifndef MP_WORD_DECLARED
typedef uint32_t mp_word;
typedef unsigned int mp_word;
#define MP_WORD_DECLARED
#endif
# define MP_SIZEOF_MP_DIGIT 2
@@ -75,31 +79,21 @@ typedef uint32_t mp_word;
#elif defined(MP_64BIT)
/* for GCC only on supported platforms */
#ifndef MP_DIGIT_DECLARED
typedef uint64_t mp_digit;
typedef unsigned long long mp_digit;
#define MP_DIGIT_DECLARED
#endif
# if defined(__GNUC__)
typedef unsigned long mp_word __attribute__((mode(TI)));
# else
/* it seems you have a problem
* but we assume you can somewhere define your own uint128_t */
#ifndef MP_WORD_DECLARED
typedef uint128_t mp_word;
#define MP_WORD_DECLARED
#endif
# endif
# define DIGIT_BIT 60
#else
/* this is the default case, 28-bit digits */
/* this is to make porting into LibTomCrypt easier :-) */
#ifndef MP_DIGIT_DECLARED
typedef uint32_t mp_digit;
typedef unsigned int mp_digit;
#define MP_DIGIT_DECLARED
#endif
#ifndef MP_WORD_DECLARED
typedef uint64_t mp_word;
typedef unsigned long long mp_word;
#define MP_WORD_DECLARED
#endif
@@ -116,23 +110,11 @@ typedef uint64_t mp_word;
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
#ifndef DIGIT_BIT
# define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
typedef uint_least32_t mp_min_u32;
typedef unsigned long mp_min_u32;
#else
typedef mp_digit mp_min_u32;
#endif
/* use arc4random on platforms that support it */
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
# define MP_GEN_RANDOM() arc4random()
# define MP_GEN_RANDOM_MAX 0xffffffffu
#endif
/* use rand() as fall-back if there's no better rand function */
#ifndef MP_GEN_RANDOM
# define MP_GEN_RANDOM() rand()
# define MP_GEN_RANDOM_MAX RAND_MAX
#endif
#define MP_DIGIT_BIT DIGIT_BIT
#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
#define MP_DIGIT_MAX MP_MASK
@@ -271,9 +253,9 @@ int mp_set_int(mp_int *a, unsigned long b);
int mp_set_long(mp_int *a, unsigned long b);
*/
/* set a platform dependent Tcl_WideUInt value */
/* set a platform dependent unsigned long long value */
/*
int mp_set_long_long(mp_int *a, Tcl_WideUInt b);
int mp_set_long_long(mp_int *a, unsigned long long b);
*/
/* get a 32-bit value */
@@ -286,9 +268,9 @@ unsigned long mp_get_int(const mp_int *a);
unsigned long mp_get_long(const mp_int *a);
*/
/* get a platform dependent Tcl_WideUInt value */
/* get a platform dependent unsigned long long value */
/*
Tcl_WideUInt mp_get_long_long(const mp_int *a);
unsigned long long mp_get_long_long(const mp_int *a);
*/
/* initialize and set a digit */
@@ -380,6 +362,14 @@ int mp_cnt_lsb(const mp_int *a);
int mp_rand(mp_int *a, int digits);
*/
#ifdef MP_PRNG_ENABLE_LTM_RNG
/* as last resort we will fall back to libtomcrypt's rng_get_bytes()
* in case you don't use libtomcrypt or use it w/o rng_get_bytes()
* you have to implement it somewhere else, as it's required */
extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
extern void (*ltm_rng_callback)(void);
#endif
/* ---> binary operations <--- */
/* c = a XOR b */
/*
@@ -396,8 +386,33 @@ int mp_or(const mp_int *a, const mp_int *b, mp_int *c);
int mp_and(const mp_int *a, const mp_int *b, mp_int *c);
*/
/* c = a XOR b (two complement) */
/*
int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c);
*/
/* c = a OR b (two complement) */
/*
int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c);
*/
/* c = a AND b (two complement) */
/*
int mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c);
*/
/* right shift (two complement) */
/*
int mp_tc_div_2d(const mp_int *a, int b, mp_int *c);
*/
/* ---> Basic arithmetic <--- */
/* b = ~a */
/*
int mp_complement(const mp_int *a, mp_int *b);
*/
/* b = -a */
/*
int mp_neg(const mp_int *a, mp_int *b);
+4 -4
View File
@@ -451,9 +451,9 @@ Tcl_UtfToUniCharDString(
if (Tcl_UtfCharComplete(p, end-p)) {
p += TclUtfToUniChar(p, &ch);
} else if ((unsigned)((UCHAR(*p)-0x80)) < (unsigned) 0x20) {
ch = (Tcl_UniChar) cp1252[UCHAR(*p)-0x80];
ch = (Tcl_UniChar) cp1252[UCHAR(*p++)-0x80];
} else {
ch = UCHAR(*p);
ch = UCHAR(*p++);
}
*w++ = ch;
}
@@ -783,8 +783,8 @@ Tcl_UniCharAtIndex(
*
* Returns a pointer to the specified character (not byte) position in
* the UTF-8 string. If TCL_UTF_MAX <= 4, characters > U+FFFF count as
* 2 positions, but then the pointer should never be placed between
* the two positions.
* 2 positions, but then the pointer should never be placed between
* the two positions.
*
* Results:
* As above.
+308 -189
View File
@@ -15,6 +15,7 @@
#include "tclInt.h"
#include "tclParse.h"
#include "tclStringTrim.h"
#include "tommath.h"
#include <math.h>
/*
@@ -107,11 +108,11 @@ static Tcl_ThreadDataKey precisionKey;
static void ClearHash(Tcl_HashTable *tablePtr);
static void FreeProcessGlobalValue(ClientData clientData);
static void FreeThreadHash(ClientData clientData);
static int GetEndOffsetFromObj(Tcl_Obj *objPtr, int endValue,
int *indexPtr);
static int GetEndOffsetFromObj(Tcl_Obj *objPtr,
Tcl_WideInt endValue, Tcl_WideInt *indexPtr);
static Tcl_HashTable * GetThreadHash(Tcl_ThreadDataKey *keyPtr);
static int SetEndOffsetFromAny(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static int GetWideForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr,
Tcl_WideInt endValue, Tcl_WideInt *widePtr);
static int FindElement(Tcl_Interp *interp, const char *string,
int stringLength, const char *typeStr,
const char *typeCode, const char **elementPtr,
@@ -124,7 +125,8 @@ static int FindElement(Tcl_Interp *interp, const char *string,
* stored directly in the wideValue, so no memory management is required
* for it. This is a caching intrep, keeping the result of a parse
* around. This type is only created from a pre-existing string, so an
* updateStringProc will never be called and need not exist.
* updateStringProc will never be called and need not exist. The type
* is unregistered, so has no need of a setFromAnyProc either.
*/
static const Tcl_ObjType endOffsetType = {
@@ -132,7 +134,7 @@ static const Tcl_ObjType endOffsetType = {
NULL, /* freeIntRepProc */
NULL, /* dupIntRepProc */
NULL, /* updateStringProc */
SetEndOffsetFromAny
NULL /* setFromAnyProc */
};
/*
@@ -3651,6 +3653,206 @@ TclFormatInt(
return numFormatted;
}
/*
*----------------------------------------------------------------------
*
* GetWideForIndex --
*
* This function produces a wide integer value corresponding to the
* index value held in *objPtr. The parsing supports all values
* recognized as any size of integer, and the syntaxes end[-+]$integer
* and $integer[-+]$integer. The argument endValue is used to give
* the meaning of the literal index value "end". Index arithmetic
* on arguments outside the wide integer range are only accepted
* when interp is a working interpreter, not NULL.
*
* Results:
* When parsing of *objPtr successfully recognizes an index value,
* TCL_OK is returned, and the wide integer value corresponding to
* the recognized index value is written to *widePtr. When parsing
* fails, TCL_ERROR is returned and error information is written to
* interp, if non-NULL.
*
* Side effects:
* The type of *objPtr may change.
*
*----------------------------------------------------------------------
*/
static int
GetWideForIndex(
Tcl_Interp *interp, /* Interpreter to use for error reporting. If
* NULL, then no error message is left after
* errors. */
Tcl_Obj *objPtr, /* Points to the value to be parsed */
Tcl_WideInt endValue, /* The value to be stored at *widePtr if
* objPtr holds "end".
* NOTE: this value may be negative. */
Tcl_WideInt *widePtr) /* Location filled in with a wide integer
* representing an index. */
{
ClientData cd;
const char *opPtr;
int numType, length, t1 = 0, t2 = 0;
int code = TclGetNumberFromObj(NULL, objPtr, &cd, &numType);
if (code == TCL_OK) {
if (numType == TCL_NUMBER_INT) {
/* objPtr holds an integer in the signed wide range */
*widePtr = (Tcl_WideInt)(*(Tcl_WideInt *)cd);
return TCL_OK;
}
if (numType == TCL_NUMBER_BIG) {
/* objPtr holds an integer outside the signed wide range */
/* Truncate to the signed wide range. */
if (mp_isneg((mp_int *)cd)) {
*widePtr = WIDE_MIN;
} else {
*widePtr = WIDE_MAX;
}
return TCL_OK;
}
/* Must be a double -> not a valid index */
goto parseError;
}
/* objPtr does not hold a number, check the end+/- format... */
if (GetEndOffsetFromObj(objPtr, endValue, widePtr) == TCL_OK) {
return TCL_OK;
}
/* If we reach here, the string rep of objPtr exists. */
/*
* The valid index syntax does not include any value that is
* a list of more than one element. This is necessary so that
* lists of index values can be reliably distinguished from any
* single index value.
*/
/*
* Quick scan to see if multi-value list is even possible.
* This relies on TclGetString() returning a NUL-terminated string.
*/
if ((TclMaxListLength(TclGetString(objPtr), -1, NULL) > 1)
/* If it's possible, do the full list parse. */
&& (TCL_OK == Tcl_ListObjLength(NULL, objPtr, &length))
&& (length > 1)) {
goto parseError;
}
/* Passed the list screen, so parse for index arithmetic expression */
if (TCL_OK == TclParseNumber(NULL, objPtr, NULL, NULL, -1, &opPtr,
TCL_PARSE_INTEGER_ONLY)) {
Tcl_WideInt w1=0, w2=0;
/* value starts with valid integer... */
if ((*opPtr == '-') || (*opPtr == '+')) {
/* ... value continues with [-+] ... */
/* Save first integer as wide if possible */
TclGetNumberFromObj(NULL, objPtr, &cd, &t1);
if (t1 == TCL_NUMBER_INT) {
w1 = (*(Tcl_WideInt *)cd);
}
if (TCL_OK == TclParseNumber(NULL, objPtr, NULL, opPtr + 1,
-1, NULL, TCL_PARSE_INTEGER_ONLY)) {
/* ... value concludes with second valid integer */
/* Save second integer as wide if possible */
TclGetNumberFromObj(NULL, objPtr, &cd, &t2);
if (t2 == TCL_NUMBER_INT) {
w2 = (*(Tcl_WideInt *)cd);
}
}
}
/* Clear invalid intreps left by TclParseNumber */
TclFreeIntRep(objPtr);
if (t1 && t2) {
/* We have both integer values */
if ((t1 == TCL_NUMBER_INT) && (t2 == TCL_NUMBER_INT)) {
/* Both are wide, do wide-integer math */
if (*opPtr == '-') {
if ((w2 == WIDE_MIN) && (interp != NULL)) {
goto extreme;
}
w2 = -w2;
}
if ((w1 ^ w2) < 0) {
/* Different signs, sum cannot overflow */
*widePtr = w1 + w2;
} else if (w1 >= 0) {
if (w1 < WIDE_MAX - w2) {
*widePtr = w1 + w2;
} else {
*widePtr = WIDE_MAX;
}
} else {
if (w1 > WIDE_MIN - w2) {
*widePtr = w1 + w2;
} else {
*widePtr = WIDE_MIN;
}
}
} else if (interp == NULL) {
/*
* We use an interp to do bignum index calculations.
* If we don't get one, call all indices with bignums errors,
* and rely on callers to handle it.
*/
return TCL_ERROR;
} else {
/*
* At least one is big, do bignum math. Little reason to
* value performance here. Re-use code. Parse has verified
* objPtr is an expression. Compute it.
*/
Tcl_Obj *sum;
extreme:
Tcl_ExprObj(interp, objPtr, &sum);
TclGetNumberFromObj(NULL, sum, &cd, &numType);
if (numType == TCL_NUMBER_INT) {
/* sum holds an integer in the signed wide range */
*widePtr = (Tcl_WideInt)(*(Tcl_WideInt *)cd);
} else {
/* sum holds an integer outside the signed wide range */
/* Truncate to the signed wide range. */
if (mp_isneg((mp_int *)cd)) {
*widePtr = WIDE_MIN;
} else {
*widePtr = WIDE_MAX;
}
}
Tcl_DecrRefCount(sum);
}
return TCL_OK;
}
}
/* Report a parse error. */
parseError:
if (interp != NULL) {
char * bytes = TclGetString(objPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer? or"
" end?[+-]integer?", bytes));
if (!strncmp(bytes, "end-", 4)) {
bytes += 4;
}
TclCheckBadOctal(interp, bytes);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL);
}
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
@@ -3687,76 +3889,19 @@ TclGetIntForIndex(
int *indexPtr) /* Location filled in with an integer
* representing an index. */
{
size_t length;
char *opPtr;
const char *bytes;
Tcl_WideInt wide;
if (TclGetIntFromObj(NULL, objPtr, indexPtr) == TCL_OK) {
return TCL_OK;
if (GetWideForIndex(interp, objPtr, endValue, &wide) == TCL_ERROR) {
return TCL_ERROR;
}
if (GetEndOffsetFromObj(objPtr, endValue, indexPtr) == TCL_OK) {
return TCL_OK;
if (wide < INT_MIN) {
*indexPtr = INT_MIN;
} else if (wide > INT_MAX) {
*indexPtr = INT_MAX;
} else {
*indexPtr = (int) wide;
}
bytes = TclGetString(objPtr);
length = objPtr->length;
/*
* Leading whitespace is acceptable in an index.
*/
while (length && TclIsSpaceProc(*bytes)) {
bytes++;
length--;
}
if (TclParseNumber(NULL, NULL, NULL, bytes, length, (const char **)&opPtr,
TCL_PARSE_INTEGER_ONLY | TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
int code, first, second;
char savedOp = *opPtr;
if ((savedOp != '+') && (savedOp != '-')) {
goto parseError;
}
if (TclIsSpaceProc(opPtr[1])) {
goto parseError;
}
*opPtr = '\0';
code = Tcl_GetInt(interp, bytes, &first);
*opPtr = savedOp;
if (code == TCL_ERROR) {
goto parseError;
}
if (TCL_ERROR == Tcl_GetInt(interp, opPtr+1, &second)) {
goto parseError;
}
if (savedOp == '+') {
*indexPtr = first + second;
} else {
*indexPtr = first - second;
}
return TCL_OK;
}
/*
* Report a parse error.
*/
parseError:
if (interp != NULL) {
bytes = TclGetString(objPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be integer?[+-]integer? or"
" end?[+-]integer?", bytes));
if (!strncmp(bytes, "end-", 4)) {
bytes += 4;
}
TclCheckBadOctal(interp, bytes);
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL);
}
return TCL_ERROR;
return TCL_OK;
}
/*
@@ -3779,122 +3924,91 @@ TclGetIntForIndex(
static int
GetEndOffsetFromObj(
Tcl_Obj *objPtr, /* Pointer to the object to parse */
int endValue, /* The value to be stored at "indexPtr" if
Tcl_WideInt endValue, /* The value to be stored at "indexPtr" if
* "objPtr" holds "end". */
int *indexPtr) /* Location filled in with an integer
Tcl_WideInt *widePtr) /* Location filled in with an integer
* representing an index. */
{
if (SetEndOffsetFromAny(NULL, objPtr) != TCL_OK) {
return TCL_ERROR;
}
Tcl_WideInt offset = 0; /* Offset in the "end-offset" expression */
/* TODO: Handle overflow cases sensibly */
*indexPtr = endValue + (int)objPtr->internalRep.wideValue;
return TCL_OK;
}
if (objPtr->typePtr != &endOffsetType) {
int length;
const char *bytes = TclGetStringFromObj(objPtr, &length);
/*
*----------------------------------------------------------------------
*
* SetEndOffsetFromAny --
*
* Look for a string of the form "end[+-]offset" and convert it to an
* internal representation holding the offset.
*
* Results:
* Returns TCL_OK if ok, TCL_ERROR if the string was badly formed.
*
* Side effects:
* If interp is not NULL, stores an error message in the interpreter
* result.
*
*----------------------------------------------------------------------
*/
static int
SetEndOffsetFromAny(
Tcl_Interp *interp, /* Tcl interpreter or NULL */
Tcl_Obj *objPtr) /* Pointer to the object to parse */
{
Tcl_WideInt offset; /* Offset in the "end-offset" expression */
register const char *bytes; /* String rep of the object */
int length; /* Length of the object's string rep */
/*
* If it's already the right type, we're fine.
*/
if (objPtr->typePtr == &endOffsetType) {
return TCL_OK;
}
/*
* Check for a string rep of the right form.
*/
bytes = TclGetStringFromObj(objPtr, &length);
if ((*bytes != 'e') || (strncmp(bytes, "end",
(size_t)((length > 3) ? 3 : length)) != 0)) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be end?[+-]integer?", bytes));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL);
}
return TCL_ERROR;
}
/*
* Convert the string rep.
*/
if (length <= 3) {
offset = 0;
} else if ((length > 4) && ((bytes[3] == '-') || (bytes[3] == '+'))) {
/*
* This is our limited string expression evaluator. Pass everything
* after "end-" to TclParseNumber.
*/
if (TclIsSpaceProc(bytes[4])) {
goto badIndexFormat;
}
if (TclParseNumber(NULL, objPtr, NULL, bytes+4, length-4, NULL,
TCL_PARSE_INTEGER_ONLY) != TCL_OK) {
if ((length < 3) || (length == 4)) {
/* Too short to be "end" or to be "end-$integer" */
return TCL_ERROR;
}
if (objPtr->typePtr != &tclIntType) {
goto badIndexFormat;
if ((*bytes != 'e') || (strncmp(bytes, "end", 3) != 0)) {
/* Value doesn't start with "end" */
return TCL_ERROR;
}
offset = objPtr->internalRep.wideValue;
if (bytes[3] == '-') {
/* TODO: Review overflow concerns here! */
offset = -offset;
}
} else {
/*
* Conversion failed. Report the error.
*/
if (length > 4) {
ClientData cd;
int t;
badIndexFormat:
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad index \"%s\": must be end?[+-]integer?", bytes));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL);
/* Parse for the "end-..." or "end+..." formats */
if ((bytes[3] != '-') && (bytes[3] != '+')) {
/* No operator where we need one */
return TCL_ERROR;
}
if (TclIsSpaceProc(bytes[4])) {
/* Space after + or - not permitted. */
return TCL_ERROR;
}
/* Parse the integer offset */
if (TCL_OK != TclParseNumber(NULL, objPtr, NULL,
bytes+4, length-4, NULL, TCL_PARSE_INTEGER_ONLY)) {
/* Not a recognized integer format */
return TCL_ERROR;
}
/* Got an integer offset; pull it from where parser left it. */
TclGetNumberFromObj(NULL, objPtr, &cd, &t);
if (t == TCL_NUMBER_BIG) {
/* Truncate to the signed wide range. */
if (mp_isneg((mp_int *)cd)) {
offset = (bytes[3] == '-') ? WIDE_MAX : WIDE_MIN;
} else {
offset = (bytes[3] == '-') ? WIDE_MIN : WIDE_MAX;
}
} else {
/* assert (t == TCL_NUMBER_INT); */
offset = (*(Tcl_WideInt *)cd);
if (bytes[3] == '-') {
offset = (offset == WIDE_MIN) ? WIDE_MAX : -offset;
}
}
}
return TCL_ERROR;
/* Success. Free the old internal rep and set the new one. */
TclFreeIntRep(objPtr);
objPtr->internalRep.wideValue = offset;
objPtr->typePtr = &endOffsetType;
}
/*
* The conversion succeeded. Free the old internal rep and set the new
* one.
*/
TclFreeIntRep(objPtr);
objPtr->internalRep.wideValue = offset;
objPtr->typePtr = &endOffsetType;
offset = objPtr->internalRep.wideValue;
if ((endValue ^ offset) < 0) {
/* Different signs, sum cannot overflow */
*widePtr = endValue + offset;
} else if (endValue >= 0) {
if (endValue < WIDE_MAX - offset) {
*widePtr = endValue + offset;
} else {
*widePtr = WIDE_MAX;
}
} else {
if (endValue > WIDE_MIN - offset) {
*widePtr = endValue + offset;
} else {
*widePtr = WIDE_MIN;
}
}
return TCL_OK;
}
@@ -3961,43 +4075,48 @@ TclIndexEncode(
int after, /* Value to return for index after end */
int *indexPtr) /* Where to write the encoded answer, not NULL */
{
int idx;
ClientData cd;
Tcl_WideInt wide;
int idx, numType, code = TclGetNumberFromObj(NULL, objPtr, &cd, &numType);
if (TCL_OK == TclGetIntFromObj(NULL, objPtr, &idx)) {
/* We parsed a value in the range INT_MIN...INT_MAX */
if ((code == TCL_OK) && (numType == TCL_NUMBER_INT)) {
/* We parsed a value in the range WIDE_MIN...WIDE_MAX */
wide = (*(Tcl_WideInt *)cd);
integerEncode:
if (idx < TCL_INDEX_START) {
if (wide < TCL_INDEX_START) {
/* All negative absolute indices are "before the beginning" */
idx = before;
} else if (idx == INT_MAX) {
} else if (wide >= INT_MAX) {
/* This index value is always "after the end" */
idx = after;
}
} else {
idx = (int) wide;
}
/* usual case, the absolute index value encodes itself */
} else if (TCL_OK == GetEndOffsetFromObj(objPtr, 0, &idx)) {
} else if (TCL_OK == GetEndOffsetFromObj(objPtr, 0, &wide)) {
/*
* We parsed an end+offset index value.
* idx holds the offset value in the range INT_MIN...INT_MAX.
* wide holds the offset value in the range WIDE_MIN...WIDE_MAX.
*/
if (idx > 0) {
if (wide > 0) {
/*
* All end+postive or end-negative expressions
* always indicate "after the end".
*/
idx = after;
} else if (idx < INT_MIN - TCL_INDEX_END) {
} else if (wide < INT_MIN - TCL_INDEX_END) {
/* These indices always indicate "before the beginning */
idx = before;
} else {
/* Encoded end-positive (or end+negative) are offset */
idx += TCL_INDEX_END;
idx = (int)wide + TCL_INDEX_END;
}
/* TODO: Consider flag to suppress repeated end-offset parse. */
} else if (TCL_OK == TclGetIntForIndexM(interp, objPtr, 0, &idx)) {
} else if (TCL_OK == GetWideForIndex(interp, objPtr, 0, &wide)) {
/*
* Only reach this case when the index value is a
* constant index arithmetic expression, and idx
* constant index arithmetic expression, and wide
* holds the result. Treat it the same as if it were
* parsed as an absolute integer value.
*/
@@ -4316,7 +4435,7 @@ TclGetProcessGlobalValue(
ckfree(pgvPtr->value);
pgvPtr->value = ckalloc(Tcl_DStringLength(&newValue) + 1);
memcpy(pgvPtr->value, Tcl_DStringValue(&newValue),
(size_t) Tcl_DStringLength(&newValue) + 1);
Tcl_DStringLength(&newValue) + 1);
Tcl_DStringFree(&newValue);
Tcl_FreeEncoding(pgvPtr->encoding);
pgvPtr->encoding = current;
+183 -29
View File
@@ -131,6 +131,7 @@ static const char *badNamespace = "parent namespace doesn't exist";
static const char *missingName = "missing variable name";
static const char *isArrayElement =
"name refers to an element in an array";
static const char *needVarLink = "variable isn't a link";
/*
* A test to see if we are in a call frame that has local variables. This is
@@ -165,17 +166,41 @@ typedef struct ArraySearch {
} ArraySearch;
/*
* TIP #508: [array default]
* TIP #471: [info linkedname] and TIP #508: [array default]
*
* The following structure extends the regular TclVarHashTable used by array
* variables to store their optional default value.
* variables to store a reference to the array and their optional default
* value.
*/
typedef struct ArrayVarHashTable {
TclVarHashTable table;
Tcl_Obj *defaultObj;
TclVarHashTable table; /* The base type, which itself extends
* Tcl_HashTable. */
Var *arrayPtr; /* Reference to the array for which this the
* contents of. */
Tcl_Obj *defaultObj; /* The default value of the array, or NULL if
* there is no default value. */
} ArrayVarHashTable;
/*
* Array access macros.
*
* ArrayToArrayTable goes from the *array* to its ArrayVarHashTable, whereas
* TclGeVarArrayTablePtr goes from an *element* of the array to the array's
* ArrayVarHashTable.
*/
#define ArrayToArrayTable(arrayPtr) \
((ArrayVarHashTable *) (arrayPtr)->value.tablePtr)
#define TclGetVarArrayTablePtr(varPtr) \
((ArrayVarHashTable *) (((VarInHash *) (varPtr))->entry.tablePtr))
#define TclGetVarArrayPtr(varPtr) \
(TclIsVarArrayElement(varPtr) \
? TclGetVarArrayTablePtr(varPtr)->arrayPtr \
: NULL)
/*
* Forward references to functions defined later in this file:
*/
@@ -227,6 +252,8 @@ static void SetArrayDefault(Var *arrayPtr, Tcl_Obj *defaultObj);
MODULE_SCOPE Var * TclLookupSimpleVar(Tcl_Interp *interp,
Tcl_Obj *varNamePtr, int flags, const int create,
const char **errMsgPtr, int *indexPtr);
MODULE_SCOPE int TclGetVarName(Tcl_Interp *interp, Var *varPtr,
Tcl_Obj *objPtr);
static Tcl_DupInternalRepProc DupLocalVarName;
static Tcl_FreeInternalRepProc FreeLocalVarName;
@@ -1106,6 +1133,81 @@ TclLookupArrayElement(
return varPtr;
}
/*
*----------------------------------------------------------------------
*
* TclGetVarName --
*
* Appends the name of a Tcl variable to the objPtr object.
*
* Results:
* Returns TCL_OK if the variable name was found, TCL_ERROR otherwise.
*
* Side effects:
* If found, the variable's name is appended to the string representation
* of objPtr.
*
*----------------------------------------------------------------------
*/
int
TclGetVarName(
Tcl_Interp *interp,
Var *varPtr,
Tcl_Obj *objPtr)
{
Interp *iPtr = (Interp *) interp;
CallFrame *varFramePtr;
Tcl_Obj *objNamePtr;
if (TclIsVarInHash(varPtr)) {
Var *arrayPtr;
int result = TCL_OK;
if (TclIsVarDeadHash(varPtr)) {
return TCL_ERROR;
}
objNamePtr = VarHashGetKey(varPtr);
arrayPtr = TclGetVarArrayPtr(varPtr);
if (arrayPtr) {
result = TclGetVarName(interp, arrayPtr, objPtr);
Tcl_AppendToObj(objPtr, "(", 1);
Tcl_AppendObjToObj(objPtr, objNamePtr);
Tcl_AppendToObj(objPtr, ")", 1);
} else {
Tcl_Namespace *nsPtr = (Tcl_Namespace*) TclGetVarNsPtr(varPtr);
if (nsPtr) {
Tcl_AppendToObj(objPtr, nsPtr->fullName, -1);
if (nsPtr != Tcl_GetGlobalNamespace(interp)) {
Tcl_AppendToObj(objPtr, "::", 2);
}
}
Tcl_AppendObjToObj(objPtr, objNamePtr);
}
return result;
}
/*
* Find varPtr in compiled locals from current or upper call frames.
*/
for (varFramePtr = iPtr->varFramePtr;
varFramePtr != NULL ;
varFramePtr = varFramePtr->callerVarPtr) {
int index = varPtr - varFramePtr->compiledLocals;
if (index >= 0 && index < varFramePtr->numCompiledLocals) {
objNamePtr = localName(varFramePtr, index);
Tcl_AppendObjToObj(objPtr, objNamePtr);
return TCL_OK;
}
}
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
@@ -1436,11 +1538,10 @@ TclPtrGetVarIdx(
* element of the array.
*/
ArrayVarHashTable *avhtPtr = (ArrayVarHashTable *)
((VarInHash *) varPtr)->entry.tablePtr;
ArrayVarHashTable *tablePtr = TclGetVarArrayTablePtr(varPtr);
if (avhtPtr->defaultObj) {
return avhtPtr->defaultObj;
if (tablePtr->defaultObj) {
return tablePtr->defaultObj;
}
}
@@ -3343,6 +3444,7 @@ ArrayPopulateSearch(
TclGetString(arrayNameObj));
Tcl_IncrRefCount(searchPtr->name);
}
/*
*----------------------------------------------------------------------
*
@@ -3362,7 +3464,6 @@ ArrayPopulateSearch(
*/
/* ARGSUSED */
static int
ArrayStartSearchCmd(
ClientData clientData,
@@ -4915,7 +5016,6 @@ Tcl_GetVariableFullName(
{
Interp *iPtr = (Interp *) interp;
register Var *varPtr = (Var *) variable;
Tcl_Obj *namePtr;
Namespace *nsPtr;
if (!varPtr || TclIsVarArrayElement(varPtr)) {
@@ -4934,19 +5034,7 @@ Tcl_GetVariableFullName(
Tcl_AppendToObj(objPtr, "::", 2);
}
}
if (TclIsVarInHash(varPtr)) {
if (!TclIsVarDeadHash(varPtr)) {
namePtr = VarHashGetKey(varPtr);
Tcl_AppendObjToObj(objPtr, namePtr);
}
} else if (iPtr->varFramePtr->procPtr) {
int index = varPtr - iPtr->varFramePtr->compiledLocals;
if (index >= 0 && index < iPtr->varFramePtr->numCompiledLocals) {
namePtr = localName(iPtr->varFramePtr, index);
Tcl_AppendObjToObj(objPtr, namePtr);
}
}
(void) TclGetVarName(interp, varPtr, objPtr);
}
/*
@@ -6280,6 +6368,74 @@ TclInfoGlobalsCmd(
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TclInfoLinkedNameCmd --
*
* Called to implement the "info linkedname" command that returns the
* name of a link variable. Handles the following syntax:
*
* info linkedname varname
*
* Results:
* Returns TCL_OK if successful and TCL_ERROR if there is an error.
*
* Side effects:
* Returns a result in the interpreter's result object. If there is an
* error, the result is an error message.
*
*----------------------------------------------------------------------
*/
int
TclInfoLinkedNameCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *varName, *objNamePtr;
Var *varPtr;
const char *errMsg;
int index;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "varname");
return TCL_ERROR;
}
varName = objv[1];
varPtr = TclLookupSimpleVar(interp, varName, TCL_AVOID_RESOLVERS,
/* create */ 0, &errMsg, &index);
if (varPtr && !TclIsVarLink(varPtr)) {
errMsg = needVarLink;
varPtr = NULL;
}
if (varPtr == NULL) {
TclObjVarErrMsg(interp, varName, NULL, "access", errMsg, -1);
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARLINK",
Tcl_GetString(varName), NULL);
return TCL_ERROR;
}
objNamePtr = Tcl_NewObj();
if (TclGetVarName(interp, varPtr->value.linkPtr, objNamePtr) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"unable to find linked name for \"%s\"",
Tcl_GetString(varName)));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARLINK",
Tcl_GetString(varName), NULL);
TclDecrRefCount(objNamePtr);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, objNamePtr);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
@@ -6769,6 +6925,7 @@ TclInitArrayVar(
arrayPtr->value.tablePtr = (TclVarHashTable *) tablePtr;
TclInitVarHashTable(arrayPtr->value.tablePtr, TclGetVarNsPtr(arrayPtr));
tablePtr->arrayPtr = arrayPtr;
/*
* Default value initialization.
@@ -6785,8 +6942,7 @@ static void
DeleteArrayVar(
Var *arrayPtr)
{
ArrayVarHashTable *tablePtr = (ArrayVarHashTable *)
arrayPtr->value.tablePtr;
ArrayVarHashTable *tablePtr = ArrayToArrayTable(arrayPtr);
/*
* Default value cleanup.
@@ -6810,8 +6966,7 @@ Tcl_Obj *
TclGetArrayDefault(
Var *arrayPtr)
{
ArrayVarHashTable *tablePtr = (ArrayVarHashTable *)
arrayPtr->value.tablePtr;
ArrayVarHashTable *tablePtr = ArrayToArrayTable(arrayPtr);
return tablePtr->defaultObj;
}
@@ -6825,8 +6980,7 @@ SetArrayDefault(
Var *arrayPtr,
Tcl_Obj *defaultObj)
{
ArrayVarHashTable *tablePtr = (ArrayVarHashTable *)
arrayPtr->value.tablePtr;
ArrayVarHashTable *tablePtr = ArrayToArrayTable(arrayPtr);
/*
* Increment/decrement refcount twice to ensure that the object is shared,
+317 -194
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -117,7 +117,7 @@ typedef struct {
z_stream outStream; /* Structure used by zlib for compression of
* output. */
char *inBuffer, *outBuffer; /* Working buffers. */
int inAllocated, outAllocated;
size_t inAllocated, outAllocated;
/* Sizes of working buffers. */
GzipHeader inHeader; /* Header read from input stream, when
* decompressing a gzip stream. */
@@ -1515,7 +1515,7 @@ Tcl_ZlibStreamGet(
Tcl_ListObjIndex(NULL, zshPtr->outData, 0, &itemObj);
itemPtr = Tcl_GetByteArrayFromObj(itemObj, &itemLen);
if (itemLen-zshPtr->outPos >= count-dataPos) {
unsigned len = count - dataPos;
size_t len = count - dataPos;
memcpy(dataPtr + dataPos, itemPtr + zshPtr->outPos, len);
zshPtr->outPos += len;
@@ -1524,7 +1524,7 @@ Tcl_ZlibStreamGet(
zshPtr->outPos = 0;
}
} else {
unsigned len = itemLen - zshPtr->outPos;
size_t len = itemLen - zshPtr->outPos;
memcpy(dataPtr + dataPos, itemPtr + zshPtr->outPos, len);
dataPos += len;
+2 -2
View File
@@ -1,7 +1,7 @@
if {([info commands ::tcl::pkgconfig] eq "")
|| ([info sharedlibextension] ne ".dll")} return
if {[::tcl::pkgconfig get debug]} {
package ifneeded dde 1.4.0 [list load [file join $dir tcldde14g.dll] dde]
package ifneeded dde 1.4.1 [list load [file join $dir tcldde14g.dll] dde]
} else {
package ifneeded dde 1.4.0 [list load [file join $dir tcldde14.dll] dde]
package ifneeded dde 1.4.1 [list load [file join $dir tcldde14.dll] dde]
}
+1 -1
View File
@@ -810,7 +810,7 @@ foreach {safe package version file} {
1 opt 0.4.7 {opt optparse.tcl}
0 platform 1.0.14 {platform platform.tcl}
0 platform::shell 1.1.4 {platform shell.tcl}
1 tcltest 2.4.1 {tcltest tcltest.tcl}
1 tcltest 2.5.0 {tcltest tcltest.tcl}
} {
if {$isafe && !$safe} continue
package ifneeded $package $version [list source [file join $dir {*}$file]]
+21 -26
View File
@@ -455,37 +455,35 @@ proc ::safe::InterpInit {
foreach {command alias} {
source AliasSource
load AliasLoad
encoding AliasEncoding
exit interpDelete
glob AliasGlob
} {
::interp alias $slave $command {} [namespace current]::$alias $slave
}
# UGLY POINT! These commands are safe (they're ensembles with unsafe
# subcommands), but is assumed to not be by existing policies so it is
# hidden by default. Hack it...
foreach command {encoding file} {
::interp alias $slave $command {} interp invokehidden $slave $command
}
# This alias lets the slave have access to a subset of the 'file'
# command functionality.
::interp expose $slave file
foreach subcommand {dirname extension rootname tail} {
::interp alias $slave ::tcl::file::$subcommand {} \
::safe::AliasFileSubcommand $slave $subcommand
}
foreach subcommand {
atime attributes copy delete executable exists isdirectory isfile
link lstat mtime mkdir nativename normalize owned readable readlink
rename size stat tempfile type volumes writable
} {
::interp alias $slave ::tcl::file::$subcommand {} \
::safe::BadSubcommand $slave file $subcommand
}
# Subcommand of 'encoding' that has special handling; [encoding system] is
# OK provided it has no other arguments passed to it.
::interp alias $slave ::tcl::encoding::system {} \
::safe::AliasEncodingSystem $slave
# Subcommands of info
foreach {subcommand alias} {
nameofexecutable AliasExeName
} {
::interp alias $slave ::tcl::info::$subcommand \
{} [namespace current]::$alias $slave
}
::interp alias $slave ::tcl::info::nameofexecutable {} \
::safe::AliasExeName $slave
# The allowed slave variables already have been set by Tcl_MakeSafe(3)
@@ -1027,16 +1025,13 @@ proc ::safe::BadSubcommand {slave command subcommand args} {
return -code error -errorcode {TCL SAFE SUBCOMMAND} $msg
}
# AliasEncoding is the target of the "encoding" alias in safe interpreters.
proc ::safe::AliasEncoding {slave option args} {
# Note that [encoding dirs] is not supported in safe slaves at all
set subcommands {convertfrom convertto names system}
# AliasEncodingSystem is the target of the "encoding system" alias in safe
# interpreters.
proc ::safe::AliasEncodingSystem {slave args} {
try {
set option [tcl::prefix match -error [list -level 1 -errorcode \
[list TCL LOOKUP INDEX option $option]] $subcommands $option]
# Special case: [encoding system] ok, but [encoding system foo] not
if {$option eq "system" && [llength $args]} {
# Must not pass extra arguments; safe slaves may not set the system
# encoding but they may read it.
if {[llength $args]} {
return -code error -errorcode {TCL WRONGARGS} \
"wrong # args: should be \"encoding system\""
}
@@ -1044,7 +1039,7 @@ proc ::safe::AliasEncoding {slave option args} {
Log $slave $msg
return -options $options $msg
}
tailcall ::interp invokehidden $slave encoding $option {*}$args
tailcall ::interp invokehidden $slave tcl:encoding:system
}
# Various minor hiding of platform features. [Bug 2913625]
+1 -1
View File
@@ -9,4 +9,4 @@
# full path name of this file's directory.
if {![package vsatisfies [package provide Tcl] 8.5-]} {return}
package ifneeded tcltest 2.4.1 [list source [file join $dir tcltest.tcl]]
package ifneeded tcltest 2.5.0 [list source [file join $dir tcltest.tcl]]
+32 -17
View File
@@ -22,7 +22,7 @@ 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.4.1
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]
@@ -1254,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
@@ -1845,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
@@ -1886,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
@@ -1896,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)} {
@@ -1905,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)]
@@ -1916,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} {
@@ -1948,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.
@@ -1980,7 +1986,7 @@ 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}]
@@ -2007,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
}
}
@@ -2016,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.
@@ -2059,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}]
@@ -2110,7 +2121,7 @@ proc tcltest::test {name description args} {
variable numTests
if {!($setupFailure || $cleanupFailure || $coreFailure
|| $outputFailure || $errorFailure || $codeFailure
|| $scriptFailure)} {
|| $errorCodeFailure || $scriptFailure)} {
if {$testLevel == 1} {
incr numTests(Passed)
if {[IsVerbose pass]} {
@@ -2163,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} {
@@ -2175,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" }
@@ -2190,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)"
}
}
}
@@ -2216,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} {
@@ -2726,7 +2741,7 @@ proc tcltest::GetMatchingDirectories {rootdir} {
# shell being tested
#
# Results:
# None.
# Whether there were any failures.
#
# Side effects:
# None.
@@ -2872,7 +2887,7 @@ proc tcltest::runAllTests { {shell ""} } {
puts [outputChannel] ""
puts [outputChannel] [string repeat ~ 44]
}
return
return [info exists testFileFailures]
}
#####################################################################
+55 -225
View File
@@ -2,229 +2,59 @@
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}
{1540598400 3600 0 +01}
}
+1
View File
@@ -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}
+43 -213
View File
@@ -3,217 +3,47 @@
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}
{1540598400 3600 0 +01}
}
+162 -162
View File
@@ -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}
}
+49 -19
View File
@@ -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}
}
+9 -9
View File
@@ -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}
}
+1 -1
View File
@@ -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}
}
+26 -17
View File
@@ -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}
}
+4 -4
View File
@@ -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
View File
@@ -68,4 +68,5 @@ set TZData(:Europe/Volgograd) {
{1288479600 10800 0 +03}
{1301180400 14400 0 +04}
{1414274400 10800 0 +03}
{1540681200 14400 0 +04}
}
+162 -162
View File
@@ -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
View File
@@ -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}
+3 -2
View File
@@ -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}
}
+4 -2
View File
@@ -4,9 +4,11 @@ This is the git repository for [LibTomMath](http://www.libtom.net/LibTomMath/),
## Build Status
master - [![Build Status - master](https://travis-ci.org/libtom/libtommath.png?branch=master)](https://travis-ci.org/libtom/libtommath)
master: [![Build Status](https://api.travis-ci.org/libtom/libtommath.png?branch=master)](https://travis-ci.org/libtom/libtommath)
develop - [![Build Status - develop](https://travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath)
develop: [![Build Status](https://api.travis-ci.org/libtom/libtommath.png?branch=develop)](https://travis-ci.org/libtom/libtommath)
API/ABI changes: [check here](https://abi-laboratory.pro/tracker/timeline/libtommath/)
## Summary
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_ERROR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
static const struct {
+9 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_FAST_MP_INVMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* computes the modular inverse via binary extended euclidean algorithm,
@@ -140,6 +138,14 @@ top:
goto LBL_ERR;
}
}
/* too big */
while (mp_cmp_mag(&D, b) != MP_LT) {
if ((res = mp_sub(&D, b, &D)) != MP_OKAY) {
goto LBL_ERR;
}
}
mp_exch(&D, c);
c->sign = neg;
res = MP_OKAY;
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* computes xR**-1 == x (mod N) via Montgomery Reduction
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_MUL_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* Fast (comba) multiplier
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* this is a modified version of fast_s_mul_digs that only produces
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* the jist of squaring...
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_2EXPT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* computes a = 2**b
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_ABS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* b = |a|
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_ADD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* high level addition (handles signs) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_ADD_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* single digit addition */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_ADDMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* d = a + b (mod c) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_AND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* AND two ints together */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CLAMP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* trim unused digits
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CLEAR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* clear one (frees) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CLEAR_MULTI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
#include <stdarg.h>
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CMP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* compare two ints (signed)*/
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CMP_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* compare a digit */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CMP_MAG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* compare maginitude of two ints (unsigned) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_CNT_LSB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
static const int lnz[16] = {
+26
View File
@@ -0,0 +1,26 @@
#include "tommath_private.h"
#ifdef BN_MP_COMPLEMENT_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.
*/
/* b = ~a */
int mp_complement(const mp_int *a, mp_int *b)
{
int res = mp_neg(a, b);
return (res == MP_OKAY) ? mp_sub_d(b, 1uL, b) : res;
}
#endif
/* ref: $Format:%D$ */
/* git commit: $Format:%H$ */
/* commit time: $Format:%ai$ */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_COPY_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* copy, b = a */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_COUNT_BITS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* returns the number of bits in an int */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DIV_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
#ifdef BN_MP_DIV_SMALL
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DIV_2_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* b = a/2 */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DIV_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* shift right by a certain bit count (store quotient in c, optional remainder in d) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DIV_3_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* divide by three (based on routine from MPI and the GMP manual) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DIV_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* single digit division (based on routine from MPI) */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DR_IS_MODULUS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* determines if a number is a valid DR modulus */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DR_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* reduce "x" in place modulo "n" using the Diminished Radix algorithm.
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_DR_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* determines the setup value */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_EXCH_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* swap the elements of two integers, for cases where you can't simply swap the
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_EXPORT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* based on gmp's mpz_export.
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_EXPT_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* wrapper function for mp_expt_d_ex() */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_EXPT_D_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/
/* calculate c = a**b using a square-multiply algorithm */
+1 -3
View File
@@ -1,4 +1,4 @@
#include <tommath_private.h>
#include "tommath_private.h"
#ifdef BN_MP_EXPTMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
@@ -11,8 +11,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tstdenis82@gmail.com, http://libtom.org
*/

Some files were not shown because too many files have changed in this diff Show More