Compare commits

..
927 Commits
Author SHA1 Message Date
dgp 7e4f45ab42 merge 8.7 2019-04-12 19:12:34 +00:00
jan.nijtmans 71ae5810dc Merge 8.6 2019-04-11 20:37:37 +00:00
jan.nijtmans 7df97e9292 Only use special mp_sqrt() code when double format/tommath format are exactly what's expected. Otherwise, use original always-working tommath code.
Simplify overflow check in bignum expononent code, not using bignums where it's not necessary. 
Don't overallocate bignums when using wideint's only.
2019-04-11 20:09:27 +00:00
sebres 9f9c9efac0 merge 8.6 (conflicts resolved, changes on tests/cmdMZ.test in [4cb9044dfa] reverted - timerate is supported in 8.7) 2019-04-11 09:52:20 +00:00
sebres 417474f1fd merge 8.5 2019-04-09 19:39:08 +00:00
sebres 6fb4854406 closes [940ce8f958] - tests/cmdMZ.test: avoid import timerate to global NS in tests (e. g. using tcltest -singleproc 1 -file 'cmdMZ* namespace*') 2019-04-09 19:37:55 +00:00
sebres 817da23169 merge 8.5 2019-04-09 10:33:59 +00:00
sebres f2c8c6c408 closes [1e5e25cf2b] - tests/cmdMZ.test: fixed NRT-related sleeps (and time-related corner cases and test expectations);
todo: rewrite several tests if monotonic clock is provided resp. command "after" gets microsecond accuracy (RFE [fdfbd5e10] gets merged)
2019-04-09 10:31:36 +00:00
dkf 747b668676 Clarified some documentation 2019-04-09 09:18:59 +00:00
dkf d96dda52c4 Added missing test case 2019-04-09 09:11:31 +00:00
jan.nijtmans 869730bf85 Merge 8.6 2019-04-09 08:46:04 +00:00
jan.nijtmans e4912abbd2 Add --disable-shared builds on win32/win64 (mingw-w64) 2019-04-09 08:42:37 +00:00
andy 9b1a75a1cc Correct minor documentation typo 2019-04-09 03:11:14 +00:00
jan.nijtmans 6ed025f0c6 Fix clang compiler warning in tclZlib.c. Clear execute bit in two encodings 2019-04-08 21:25:33 +00:00
jan.nijtmans 1749b4cc87 Add test-cases for win32/win64 --disable-shared, and put standard --enable-threads 2019-04-08 19:31:10 +00:00
sebres 0305f67f88 merge bug-45b9faf103f2, fewer destructive TclObjLookupVarEx, closes [45b9faf103f2] 2019-04-08 15:35:29 +00:00
sebres 3a8a841386 closes [45b9faf103f2] (tclVar cached lookup): fixes segfaulting if variable released before set; partially revert [4100488a3ca38abf] 2019-04-08 15:03:13 +00:00
pooryorick c1de90d70a Improve test for last commit fixing [45b9faf103f2]. 2019-04-08 13:38:19 +00:00
pooryorick f4882bb16f Fix for [45b9faf103f2], [try] interaction with local variable names produces
segmentation fault.
2019-04-08 13:01:18 +00:00
jan.nijtmans 81bc53def9 Merge 8.7, and fix test-case set-old-8.6 2019-04-07 14:45:57 +00:00
jan.nijtmans 00c94ffc5d Merge 8.6 2019-04-05 21:15:01 +00:00
jan.nijtmans 96bf31bbbd Take over recent improvements from libtommath after version 1.1.0. 2019-04-05 20:56:24 +00:00
jan.nijtmans 0dfee54d3f Merge libtommath 2019-04-05 17:00:45 +00:00
jan.nijtmans 689987ea92 Take over improvements from libtommath's development branch (which will appear in next version).
- More efficient MP_SET_XLONG() macro.
- New internal macro's IS_ZERO/IS_EVEN/IS_ODD
- Changed signature for XMALLOC/XREALLOC/XFREE
2019-04-05 16:58:41 +00:00
jan.nijtmans b1266f39d8 Relax timing for some socket tests a little bit. Hopefully this fixes the spurious hangs on Travis builds there. 2019-04-05 16:46:14 +00:00
jan.nijtmans 68d03f6af8 merge-mark 2019-04-02 18:23:43 +00:00
jan.nijtmans 9d183921c9 Fix gcc warning on 32-bit platforms 2019-04-02 18:21:09 +00:00
jan.nijtmans 384b9de6bb Modify testbytestring such that is only produces pure byte-arrays, if not it errors out.
Modify Tcl_NewIntObj/Tcl_NewBooleanObj -> Tcl_NewWideIntObj. Less references to "long" datatype.
2019-04-01 19:36:20 +00:00
sebres fef5802d1e merge 8.6 (merge-point only, no functional changes) 2019-04-01 14:30:13 +00:00
sebres 95068d8d48 merge 8.6 2019-04-01 14:24:48 +00:00
sebres b938ddd055 integrate sebres-8-6-tommath-1-1 - cherry-picking of several optimizations and simplifications of 8.7 (tommath 1.1), well-arranged branching of long/wide/bignum base and exponent cases, test-cases extended to cover all this branches and edge cases. 2019-04-01 14:22:08 +00:00
sebres 2b8e087252 merge 8.5 2019-04-01 14:00:42 +00:00
sebres 01dccf28f9 closes [1a3fa1232e306a44], test case cmdMZ-6.5 fixed to cover float value by iteration per second 2019-04-01 13:53:54 +00:00
sebres 89fee22341 timerate: avoid divide by zero by no iterations in measurement cycle (e. g. count is 0) 2019-04-01 13:51:46 +00:00
dkf 88de9d25c6 Added tests 2019-03-31 14:05:55 +00:00
dkf fd5560d08a Doc for [array value] 2019-03-31 13:43:23 +00:00
dkf b6f978fdf7 Implementation of [array value] 2019-03-31 11:59:45 +00:00
jan.nijtmans 0817b5a4ef Merge 8.6 2019-03-28 21:21:49 +00:00
jan.nijtmans abf9722f42 Turn KARATSUBA_MUL_CUTOFF (insize libtommath) et al into a #define in stead of exported int symbols. 2019-03-28 20:59:03 +00:00
jan.nijtmans 74e4654447 Make Tcl_StringMatch() into a wrapper macro around Tcl_StringCaseMatch() 2019-03-27 23:48:10 +00:00
jan.nijtmans e30b6432e1 Merge 8.6 2019-03-27 20:21:58 +00:00
jan.nijtmans d74f47cb2a merge-mark 2019-03-27 20:14:37 +00:00
jan.nijtmans 230de714e7 Update TZ info to tzdata2019a 2019-03-27 20:13:25 +00:00
jan.nijtmans 9535d1ecdc Document maximum value for right argument of '**' operator.
Adapt test-cases to test for exactly one more than this maximum value.
Make sure that the maximum is the same for DIGIT_BIT > 28.
Change macro's for mp_iseven()/mp_isodd() so they don't depend on value of DIGIT_BIT any more.
2019-03-27 20:05:26 +00:00
José Ignacio Marín 40c2f59cf4 Update TZ info to tzdata2019a. 2019-03-26 22:23:57 +00:00
José Ignacio Marín 9eb32ba719 Update TZ info to tzdata2019a. 2019-03-26 22:23:23 +00:00
jan.nijtmans 2d46cfab69 Additional protection for ridiculously big exponents, in case libtommath is compiled with DIGIT_BIT=60 in stead of 28. 2019-03-26 16:22:22 +00:00
jan.nijtmans 6c1d937172 merge-mark 2019-03-25 21:52:34 +00:00
jan.nijtmans 6d27f27fe6 Eliminate all usage of mp_iszero/mp_iseven/mp_isodd/mp_isneg from libtommath: In the upcoming new version those will become real functions, causing possible binary incompatibility. This change makes Tcl independant from libtommath's changes. 2019-03-25 21:50:34 +00:00
jan.nijtmans d64266c046 Since only bytes 0xF0 - 0xF4 can be the first byte of a valid 4-byte UTF-8 byte sequence, account for that in Tcl_UtfCharComplete(). 2019-03-24 16:50:24 +00:00
jan.nijtmans aaf56c8086 Since only bytes 0xF0 - 0xF4 can be the first byte of a valid 4-byte UTF-8 byte sequence, account for that in Tcl_UtfCharComplete(). Only effective when TCL_UTF_MAX>3 2019-03-24 16:46:27 +00:00
jan.nijtmans f080055506 Since only bytes 0xF0 - 0xF4 can be the first byte of a valid 4-byte UTF-8 byte sequence, account for that in Tcl_UtfCharComplete(). Only effective when TCL_UTF_MAX>3 2019-03-24 16:43:41 +00:00
jan.nijtmans 0f1fe8880d Make all internal small buffer related to Tcl_UtfBackslash() length 4, not TCL_UTF_MAX: For TCL_UTF_MAX=6 it was overkill, for TCL_UTF_MAX=3 not enough.
Prove that this works by adding a Travis CI build configuration using TCL_UTF_MAX=3
2019-03-24 13:02:45 +00:00
jan.nijtmans af74f1af12 Add some test-cases with longer backslash sequences, to test for internal buffer overflows. 2019-03-22 20:44:36 +00:00
pooryorick 69c460065e lots of changes to the "info" page. Replace "command procedure" with "routine"
in Tcl.n.
2019-03-22 15:08:06 +00:00
pooryorick 079965ccb5 Make the html target work under more circumstances. 2019-03-22 15:05:51 +00:00
jan.nijtmans 7afcb333c4 Add entry for 元号 (or NewEra placeholder) to Unicode tables. Since Tcl doesn't do rendering, this prepares Tcl for the expected may 1 event. See: [http://blog.unicode.org/2018/09/new-japanese-era.html] 2019-03-21 20:10:24 +00:00
jan.nijtmans c4f3c560ab Add entry for 元号 (or NewEra placeholder) to Unicode tables. Since Tcl doesn't do rendering, this prepares Tcl for the expected may 1 event. See: [http://blog.unicode.org/2018/09/new-japanese-era.html] 2019-03-21 20:09:25 +00:00
jan.nijtmans 2c246b85fa Add entry for 元号 (or NewEra placeholder) to Unicode tables. Since Tcl doesn't do rendering, this prepares Tcl for the expected may 1 event. See: [http://blog.unicode.org/2018/09/new-japanese-era.html] 2019-03-21 20:06:39 +00:00
jan.nijtmans 9d9c83fd39 Remove incorrect comment.
Simplify handling of last bytes in Tcl_UniCharToUtfDString(), since TclUtfToUniChar() already turns out to handle cp1252 fall-back correctly.
2019-03-21 19:56:55 +00:00
jan.nijtmans f9944f5235 Fix outdated comment 2019-03-21 07:45:32 +00:00
jan.nijtmans d8ec6222e8 Fix Tcl_UtfToUniCharDString() function, handling invalid byte at the end of the string: Not quite correct for bytes between 0x80-0x9F, according to TIP 2019-03-20 22:45:51 +00:00
jan.nijtmans 04ea3b8bff Comment Comment Tcl_UniCharToUtf() better, what happens handling surrogates. Add type cast in tclUtf.c, making actual check clearer 2019-03-18 22:32:37 +00:00
jan.nijtmans ec4d7da07d enlarge a few small buffers, which could overflow using Unicode characters > /UFFFF. Eliminate some end-of-line spacing 2019-03-18 22:14:24 +00:00
jan.nijtmans c92353bea9 For Tcl >= 8.7, always compile-in the extended Unicode tables, no matter the value of TCL_UTF_MAX. Do this in all Tcl versions, in order to prevent merge conflicts in future Unicode table updates. 2019-03-17 22:16:41 +00:00
jan.nijtmans c73dcaad20 For Tcl >= 8.7, always compile-in the extended Unicode tables, no matter the value of TCL_UTF_MAX. Do this in all Tcl versions, in order to prevent merge conflicts in future Unicode table updates. 2019-03-17 22:15:36 +00:00
jan.nijtmans d164d828d7 For Tcl >= 8.7, always compile-in the extended Unicode tables, no matter the value of TCL_UTF_MAX. Do this in all Tcl versions, in order to prevent merge conflicts in future Unicode table updates. 2019-03-17 22:13:34 +00:00
jan.nijtmans 2ff70c01f6 Eliminate usage of mp_isneg(), just check bignum->sign directly (as libtommath itself does)
Make TclInitBugnumFromLong() a static function in stubtable only, as it isn't used by Tcl anymore.
2019-03-15 20:52:25 +00:00
jan.nijtmans d7fe4af621 Make internal libtommath stub entries deprecated: Those are not supposed to be called in extensions 2019-03-14 19:52:55 +00:00
jan.nijtmans 8e7a963f7f Change TCHAR -> WCHAR in many places, since that's what it is since Windows NT 2019-03-11 20:32:48 +00:00
jan.nijtmans 3e3f2b1354 Improve parsing of -xchar option for serial channels: Allow full 8-bit range (correct UTF-8 handling), and let UNIX/win32 produce the same error-message in case of char > 0xFF 2019-03-11 20:30:28 +00:00
jan.nijtmans cda174b1aa Fix [590e687905]: utf-1.11 test-case fails 2019-03-11 20:25:57 +00:00
jan.nijtmans 934e6a9837 re-implemente changes in win/tclWinFile.c (handling -DTCL_UTF_MAX=6) using 3 new utility functions. This allows to re-use code in more places: cleaner implementation more future-proof. 2019-03-10 20:18:48 +00:00
jan.nijtmans 2b821c69de Make -DTCL_UTF_MAX=6-build work on win32. Add travis builds to prove it. 2019-03-08 21:27:42 +00:00
jan.nijtmans 2cba0bf573 Use mp_get_bit() instead of mp_iseven()/mp_isodd(): Those latter functions are macro's currently, but will be real function in next libtommath. Bad idea for Tcl to depend on ... 2019-03-08 19:54:37 +00:00
jan.nijtmans eb0e31e945 Code cleanup: less (size_t) casts 2019-03-08 19:51:26 +00:00
dgp 3e074a01a2 merge 8.6 2019-03-08 14:47:45 +00:00
dgp df5dff9008 [39fed4dae5] Make sure return value from Tcl_PkgRequire*() survives long enough
for caller to use it.
2019-03-08 14:46:26 +00:00
sebres 2680fee6ce merge 8.5 (perf-test) 2019-03-08 04:42:42 +00:00
sebres 2d4e87b986 fixed mistake ($howmuch is substituted in tests and can be larger as last event index created by too small measurement time). 2019-03-08 04:35:41 +00:00
dgp c5abbcaaf4 In the 8.6.* releases, Tcl_GetStringResult() still passes through interp->result.
Have to ask specifically for the string rep of the value we want.
2019-03-07 22:13:25 +00:00
jan.nijtmans 42e81a69ad Fixes for TCL_UTF_MAX=6, (gcc compiler warnings). Also make everything work on win32/win64. Patch adapted from Androwish (thanks, Werner!) 2019-03-07 22:02:41 +00:00
jan.nijtmans 1bbb597217 Fix gcc compiler warning 2019-03-07 21:59:22 +00:00
dgp 15ff4cc2de Integrate the test, which seems to indicate the bug fix doesn't work.
More to come....
2019-03-07 20:24:53 +00:00
dgp 68061dfef2 Merge forward to demonstrate the test fails after the bug arrived. 2019-03-07 20:05:01 +00:00
dgp 781c32ac29 [39fed4dae5] Proposed test 2019-03-07 20:02:09 +00:00
apnadkarni 1763220f4e (core-8-6-branch merge)
Fix automatic pkgIndex generation for multiplatform installs.
2019-03-07 14:17:38 +00:00
apnadkarni d37dcc7d71 Fix automatic pkgIndex generation for multiplatform installs 2019-03-07 14:12:44 +00:00
jan.nijtmans efadd7170e Merge 8.6. Remove unneeded code from init.tcl 2019-03-07 08:31:44 +00:00
jan.nijtmans 65baf6c706 Fix some gcc/MSVC (harmless) compiler warnings. Remove some unnecessary end-of-line spacing 2019-03-07 08:00:29 +00:00
jan.nijtmans fa0f595cf9 Fix [9471e6e304]: InitWinEnv not thread safe 2019-03-07 07:58:39 +00:00
sebres 3e2014216a part of [db95e7a61e] reverted for consistency reasons: unsupported namespace is exported in previous versions (so this is more compatible to 8.5/8.6). 2019-03-06 12:25:11 +00:00
apnadkarni fa78a0da14 V1.3. PLATFORM_IDENTIFY, MULTIPLATFORM_INSTALL macro, optionally copy PDBs.
The PLATFORM_IDENTIFY macro matches the output of Tcl's platform::identify and is meant to permit extensions to pick a platform-specific directory for binaries.

MULTIPLATFORM_INSTALL can be set by extensions to install into a platform specific subdirectory as returned by the platform::identify Tcl command. The default automatic pkgIndex.tcl is modified accordingly.

If OPTS=pdbs is set, the default install target will also copy PDBS.
2019-03-06 11:26:29 +00:00
apnadkarni 1d47b2fc79 V1.3. PLATFORM_IDENTIFY, MULTIPLATFORM_INSTALL macro, optionally copy PDBs.
The PLATFORM_IDENTIFY macro matches the output of Tcl's platform::identify
and is meant to permit extensions to pick a platform-specific directory for
binaries.

MULTIPLATFORM_INSTALL can be set by extensions to install into a platform
specific subdirectory as returned by the platform::identify Tcl command.
The default automatic pkgIndex.tcl is modified accordingly.

If OPTS=pdbs is set, the default install target will also copy PDBS.
2019-03-06 06:26:36 +00:00
dgp 7ca040ad88 [39fed4dae5] Minimal fix for volatile lifetime of string returned by
Tcl_PkgRequire().

We need a test for this ticket to go in the test suite.
2019-03-06 01:42:13 +00:00
jan.nijtmans 58bdb3f389 Remove double macro's. Resolve quotes in travis configuration: it doesn't work 2019-03-05 19:58:33 +00:00
sebres b930511d5b integrate dgp-sebres-timerate-review: no functional changes (already backported) 2019-03-05 18:02:33 +00:00
sebres a3ad83e5f8 timerate is supported in 8.7 2019-03-05 17:39:05 +00:00
sebres df27b4e4e0 merge 8.6 (TIP#527, New measurement facilities in TCL: New command timerate, performance test suite) 2019-03-05 17:34:31 +00:00
sebres 78000f7f87 integrate sebres-8-6-timerate, merge 8.5 (TIP#527, New measurement facilities in TCL: New command timerate, performance test suite) 2019-03-05 16:59:41 +00:00
sebres bc27eb2430 merge sebres-8-5-timerate (TIP#527 - New measurement facilities in TCL: New command timerate, performance test suite) 2019-03-05 16:25:17 +00:00
sebres d9929185f3 merge updated 8.5-timerate branch 2019-03-05 16:13:23 +00:00
sebres 2e2fdf481a extended performance test-suite, since max-count is implemented in timerate, usage ::tclTestPerf::_test_run ?-no-result? reptime lst ?outcmd?;
update timer-event.perf.tcl for better readability (covering execution in multiple iterations now regarding max-count, so provides more precise result now);
removed unused test-cases here (new cases of event-perf-branch only).
2019-03-05 15:46:31 +00:00
sebres 1568393cf3 back-porting other performance test (timer-event.perf.tcl) from event-perf-branch 2019-03-05 12:58:11 +00:00
sebres 6d9266494b back-porting test-performance suite and clock.perf.tcl from clock-speedup branch 2019-03-05 12:56:22 +00:00
sebres b424e06193 helper to import timerate on demand in unknown/autoload proceeding. 2019-03-05 11:28:54 +00:00
sebres 00f20c7d65 regarding the TIP#527, timerate shall be placed into ::tcl::unsupported in versions prior to 8.7 2019-03-05 11:22:30 +00:00
sebres e50b8ab068 highlighting 2019-03-05 10:07:53 +00:00
sebres 18c4dc903a amend: html-code order changed 2019-03-04 20:50:39 +00:00
sebres ecc6d3264b tools/tcltk-man2html: html-code for micro (sec) character 2019-03-04 20:40:54 +00:00
sebres a548454c57 re-integrates the changes from the TIP#527 description into the manpage 2019-03-04 20:39:09 +00:00
jan.nijtmans 10591b96c8 Various tommath/numeric related optimizations:
- Remove the DD_STEEL formatter: it isn't used anywhere in Tcl, and not recommended.
- Remove double limit-checks, which are already done inside mp_to_unsigned_bin_n()
2019-03-02 18:15:36 +00:00
jan.nijtmans c561b0e117 Add build with -DTCL_UTF_MAX=6 to travis CI. Also fix 2 gcc compiler-warnings occurring with -DTCL_UTF_MAX=6 2019-03-02 17:21:43 +00:00
jan.nijtmans d0eefe67c8 Minor optimization in UTF-8 handling, and add some comments describing how Tcl_UniCharToUtf() handles surrogates. 2019-03-02 16:52:42 +00:00
jan.nijtmans 0801e742ab Fix some "scan.test" test-cases when TCL_UTF_MAX=4. Wrongly resolved merge-conflict in previous cherry-pick merge. 2019-03-02 16:35:26 +00:00
jan.nijtmans 2d96b842de Merge 8.6 (one forgotten adaptation of surrogate handling, only compiled on Cygwin) 2019-03-02 16:08:40 +00:00
jan.nijtmans bfaca50963 Backport [bd94500678e837d7] from 8.7, preventing endless loops in UTF-8 conversions when handling surrogates. Only effective when compiling with -DTCL_UTF_MAX=4|6 (default: 3). Meant for benefit of Androwish. 2019-03-02 16:04:59 +00:00
jan.nijtmans 921a0bbbfb More use of TclHasIntRep() macro. Add vfs build director to fossil ignore-glob 2019-03-01 21:05:25 +00:00
jan.nijtmans 5a0260cbcc Update Unicode tables to version 12.0 2019-03-01 21:01:46 +00:00
dgp 420d238d70 A confusion about signed vs unsigned comparision caused Tcl_UtfToUniChar()
to return the wrong answer (contents of random memory) for each single byte
UTF-8 in the input. This commit fixes that bug. More commentary on 
https://core.tcl-lang.org/tcl/tktview/bd94500678
2019-03-01 20:24:31 +00:00
jan.nijtmans cc3041cee0 Update all internal tables to Unicode 12.0 2019-03-01 20:11:33 +00:00
jan.nijtmans 809bbc79fb Update internal tables to Unicode 12.0 2019-03-01 20:10:43 +00:00
jan.nijtmans 050b6c3d5f Fix [bd94500678e837d7]: SEGFAULT by conversion of unicode (out of BMP) to byte-array 2019-02-27 21:29:43 +00:00
jan.nijtmans f04b875d88 More use of (efficient) TclHasIntRep() macro. Also eliminate many (size_t) and (unsigned) type-casts, which don't make sense any more. 2019-02-27 08:34:05 +00:00
jan.nijtmans 4fdbe79875 Merge 8.6 2019-02-25 21:13:48 +00:00
jan.nijtmans a29e4e5b15 Merge 8.5 2019-02-25 21:12:53 +00:00
jan.nijtmans 57d9952ece Finish complete fix, all corner-cases correct now. Also spurious UTF-8 testcase failure (as seen on travis) fixed now. 2019-02-25 21:10:33 +00:00
dgp cbd7fd7dec New internal macro TclHasIntRep() to re-encapsulate the typePtr field. 2019-02-25 19:50:43 +00:00
dgp 1eba3f12e0 merge 8.7 2019-02-25 17:06:38 +00:00
jan.nijtmans 82c3e7df6d Move from trusty -> xenal for travis builds. Also add build on Mojave (xcode 10.2) 2019-02-24 18:40:32 +00:00
jan.nijtmans 9acb35c45d Merge 8.6 2019-02-24 17:19:09 +00:00
jan.nijtmans dc75a4866c Merge 8.5 2019-02-24 17:15:51 +00:00
jan.nijtmans 6806ca9630 No longer run socket test-cases on travis with OSX: There are too many random failures/hangups. 2019-02-24 17:05:14 +00:00
dgp 68c0005c84 Revert recent commit that breaks the encapsulation interface of TIP 445.
That encapsulation was put in place to support feature evolution such as
that in the dgp-properbytearry branch, which is now a nightmare of merge
conflicts.

TIP 445 was approved. Please respect it. Where it needs revision or improvement
let's work together to TIP those changes.
2019-02-22 17:32:49 +00:00
jan.nijtmans e15d1f5f79 Merge 8.7 2019-02-19 20:21:32 +00:00
jan.nijtmans b752d879c7 Merge 8.6 2019-02-19 20:16:25 +00:00
jan.nijtmans 886343e50b Fix some comments: "upper" -> "high" (when talking about surrogates) 2019-02-19 20:12:06 +00:00
jan.nijtmans 9589c85462 Minor optimizations 2019-02-19 19:38:10 +00:00
jan.nijtmans 2473a591bf Proposed fix for [bd94500678]: SEGFAULT by conversion of unicode (out of BMP) to byte-array. 2019-02-18 20:48:59 +00:00
jan.nijtmans 52ed230e6f Merge 8.6 2019-02-18 20:39:48 +00:00
jan.nijtmans d273753223 Don't use TclUniCharIsSpace() in command-line handling: the windows command-line is not aware of Unicode spaces, only ASCII ones. 2019-02-18 20:38:23 +00:00
dgp 5fd6fc8ae4 Improve portability of path constructions. 2019-02-14 19:34:39 +00:00
sebres fc24d0b9cf small amend unfolding list "$tcl_library/http" (previously it was result of glob) 2019-02-14 10:56:48 +00:00
sebres 85b1f06c9c closes [b322938e08]: fix several zipfs-tests searching for single "http" directory in (compressed) tcl-library. 2019-02-14 10:42:49 +00:00
sebres b24cecb582 merge 8-5-timerate (?max-count?, break possibility, diverse fixes) + windows time-calibration cycle optimization [f6637d3dd8] (clock ticks never backwards, more precise and smooth drifting) 2019-02-13 02:57:07 +00:00
sebres 963cceee57 timerate documentation extended 2019-02-13 01:22:07 +00:00
sebres 5add43aac8 timerate: extended with ?max-count? optional parameter, code review and more tests 2019-02-13 01:10:16 +00:00
sergey.brester 2d41d8b6e2 small amend (correct wrong utf-8 prevention for micro sign in RE of check test-case) 2019-02-12 20:40:12 +00:00
sergey.brester f7183b361e few test cases for timerate command 2019-02-12 20:37:11 +00:00
sergey.brester e0587d1564 fixes estimated time of too short execution considering calibrated overhead (it is 0us and not 1us, example: timerate {break} with and without calibration) 2019-02-12 19:46:29 +00:00
sergey.brester 6a355b11a6 timerate: allow break from measurement cycle (usable to provide conditional stop possibility inside timerate) 2019-02-12 19:38:46 +00:00
sergey.brester 1890d482a7 cherrypick [8ad25ef9eb] from 8.6 - timerate: added dynamic factor by threshold calculation (avoid growing of the execution time if iterations are not consistent, e. g. wax continuously on time) 2019-02-12 19:35:37 +00:00
sergey.brester 9a62e42dd6 merge 8.5 (note: to avoid too many conflicts, merged using fossil merge --baseline 0055a16a8b core-8-5-branch) 2019-02-12 18:41:24 +00:00
jan.nijtmans e66cb0c31e Convert Tcl_BacktroundError() into a macro, so we can deprecate the stub entry for it.
Add -Wpointer-arith warning to CFLAGS
2019-02-09 21:05:49 +00:00
sebres 4b4a960bfb timerate: added dynamic factor by threshold calculation (avoid growing of the execution time if iterations are not consistent, e. g. wax continuously on time) 2019-02-07 21:20:52 +00:00
sergey.brester 0a876f8e00 merge 8.6(.9), conflicts resolved 2019-02-07 15:45:42 +00:00
sebres 445aa5833b tests/httpcookie.test: apply "-load" option for this test (in order to provide/overwrite library/path to fit correct sqlite3 library for the test) 2019-02-06 18:29:37 +00:00
sebres 9d568b1bdd fixes segfault [bd94500678]: Tcl_UtfToUniChar/TclUtfToUniChar could don't advance source pointer in case it produce high surrogate, so it should be repeated with the same value of ch (returned previously), in order to generate low surrogate hereafter (and to avoid endless cycle). 2019-02-05 21:59:46 +00:00
sebres 73b6b4eab6 optimize WidePwrSmallExpon (exponent is <= 16), this will huge decrease assembled code on x86 (113 vs 220 instructions) 2019-02-04 15:14:58 +00:00
sebres 0fcfbd81df code review 2019-02-04 14:40:04 +00:00
sebres cf1edde4f6 cherry pick of [238bd4d2c053540c]..[31dd092df4b57fdb]: More simplifications in tclExecute.c (INST_EXPON), much more and well-arranged branching of long/wide/bignum base and exponent cases, test-cases extended to cover all this branches and edge cases. 2019-02-04 12:24:58 +00:00
sebres 08d4e75deb partial cherry pick of [e8e92eb381d689ab]: One more libtommath function, mp_tc_div_2d, which simplifies code. 2019-02-04 09:40:27 +00:00
sebres bcd9ec5103 partial cherry pick of [c5c83014d6]: Many simplifications in tclExecute.c, now that libtommath provides new functions mp_tc_and, mp_tc_or and mp_tc_xor 2019-02-04 09:21:25 +00:00
jan.nijtmans 3106f9a695 merge-mark 2019-02-01 20:02:00 +00:00
jan.nijtmans 04ed7f99da Update libtommath to latest stable release (1.1.0) 2019-02-01 20:00:04 +00:00
sebres 9a35ff9fad merge 8.6 (regression fix [e3f481f187], conflicts resolved) 2019-02-01 16:06:53 +00:00
sebres 997b332284 speedup "process.test" using signal (via file delete) for the child-process it could exit immediatelly (to avoid sleep and time-related issues). 2019-02-01 15:56:18 +00:00
sebres 99be2974c3 merge fix [e3f481f187] regression to lookup non-ASCII proc/lambda formal arguments (TclCreateProc/TclPushVarName) 2019-02-01 13:20:57 +00:00
jan.nijtmans 09eafa22a7 fix [f559bbde4e]: TclInt.h: tclUnixPort.h:162:13: fatal error: ../compat/unistd.h: No such file or directory 2019-01-31 22:42:14 +00:00
jan.nijtmans d0613a0556 Make TclIsPureByteArray() a macro, since it's only doing a single compare. Other internal simplifications/code duplication. No functional change, only optimizations 2019-01-31 22:23:15 +00:00
jan.nijtmans 4c3bb3d6ba Merge 8.6 2019-01-31 21:08:40 +00:00
jan.nijtmans 3aabb2ae35 Fix [0238027108]: Tcl_ParseArgsObjv TCL_ARGV_CONSTANT documentation error 2019-01-31 21:01:25 +00:00
sebres 272e429c2c TclPushVarName: rewritten iterators over token-strings considering utf-8 multi-bytes. 2019-01-31 16:22:45 +00:00
sebres fc5dc8e811 code review with small amend (note nameLength is number of bytes, the argument may be utf-8 as well as not necessarily a NTS, so access of char after end may cause segfault). 2019-01-31 12:52:56 +00:00
sebres 8a8e70d5a6 fixes utf-8 compatibility of proc/lambda arguments (regression on compiled locals/variables containing utf-8 characters) - CompiledLocal::nameLength is length in bytes not in chars everywhere in tcl;
simplest example:
  % apply {{€} { set "€" }} 1; # or apply [list \u20ac { set \u20ac }] 1
  can't read "€": no such variable
2019-01-30 20:32:18 +00:00
jan.nijtmans 2f4e9acf95 Fix for [f559bbde4e] (even though that's not really a bug) 2019-01-28 22:20:40 +00:00
jan.nijtmans 7518a795db Merge libtommath v1.1.0 2019-01-28 22:03:10 +00:00
jan.nijtmans 0f79f6ed15 Merge libtommath v1.1.0 2019-01-28 21:54:39 +00:00
jan.nijtmans 7cb32717a9 Update to libtommath v1.1.0 2019-01-28 21:53:18 +00:00
jan.nijtmans af3406f86c New internal macro TclFetchIntRep, which is faster than Tcl_FetchIntRep.
But ... don't use this function when the result is only compared to NULL: that's just overkill.
2019-01-28 21:34:29 +00:00
sebres 4247e597c6 merge 8.6 ([4ee9b4f3e965a7da5133] was already fixed in 8.7, so no functional changes here) 2019-01-28 16:19:27 +00:00
sebres 3621a3fd74 merge 8.5 2019-01-28 16:15:07 +00:00
sebres 1dec12d618 fixes [4ee9b4f3e965a7da5133]: result of command time overflows by single iteration longer as 35 minutes (uses wide-int instead of int as result now). 2019-01-28 16:12:56 +00:00
pooryorick 0f700f0067 Remove unnecessary inclusion of tclPort.h in tclIntDecls.h 2019-01-26 20:58:24 +00:00
jan.nijtmans a6393381ec Merge 8.6. Also reduce tclCharTypeTable[] to 256 entries, as this table is always addressed with unsigned chars now.
Eliminate some useless end-of-line spacing that slipped in.
2019-01-26 17:08:06 +00:00
jan.nijtmans fa64afb29a Replace isspace() -> TclIsSpaceProc() _everywhere_.
Change TclIsSpaceProc() and TclIsBareWord so it works with both signed and unsigned characters. Actually, this is not a signature change, as "char" arguments are enlarged to "int" by the C-compiler anyway.
2019-01-26 16:50:21 +00:00
dkf d53b2ae83f Do not assume that literals have a non-NULL bytes field; user code could purge it. 2019-01-25 14:17:56 +00:00
dkf 5f4d728863 Do not assume that literals have a non-NULL bytes field; user code could purge it. 2019-01-25 13:58:07 +00:00
dkf 523ea309ce Do not assume that literals have a non-NULL bytes field; user code could purge it. 2019-01-25 13:43:59 +00:00
sebres 4a9e46ab99 renumeration of test 2019-01-25 13:05:55 +00:00
sebres 2eaeb73742 more tests for INST_EXPON: base -1, big exponent (odd/even). 2019-01-25 13:03:19 +00:00
sebres e3c456752e More simplifications in tclExecute.c (INST_EXPON), much more and well-arranged branching of wide/bignum base and exponent cases, test-cases extended to cover all this branches and edge cases. 2019-01-25 12:45:28 +00:00
jan.nijtmans 25a1f3d894 One more libtommath function, mp_tc_div_2d, which simplifies code. Some more code readability improvements. 2019-01-22 21:44:27 +00:00
jan.nijtmans 90153d0224 Many simplifications in tclExecute.c, now that libtommath provides new functions mp_tc_and, mp_tc_or and mp_tc_xor 2019-01-22 18:09:26 +00:00
jan.nijtmans d093125a6e Merge 8.6 2019-01-22 16:57:00 +00:00
jan.nijtmans c1065a28f9 Remove some mac OSX pre-10.4 stuff, which is outdated: current build doesn't support this anymore 2019-01-22 16:52:56 +00:00
jan.nijtmans dfb0ed4215 Update included libtommath to v1.1.0-rc4 2019-01-22 16:37:28 +00:00
jan.nijtmans d6f67fed94 Merge libtommath v1.1.0-rc4 2019-01-22 16:29:54 +00:00
jan.nijtmans 3cf1eb2c23 Update to libtommath v1.1.0-rc4 2019-01-22 16:26:59 +00:00
sebres 5560716098 fixes creation of libtcl.vfs using links, if ln-command does not support "-t" option (avoids error "ln: illegal option -- t" and fallback to copy) 2019-01-21 13:08:52 +00:00
sebres 8f8efbe011 avoid additional in-between path-segment "." in zip, some zip-programs (inclusive minizip) will insert this if used as path-parameter to compress 2019-01-21 02:21:11 +00:00
sebres 6c7d5918b3 speed up build process (preparing zip - creating of libtcl.vfs/tcl_library directory), use "ln" instead of "cp" if possible 2019-01-21 01:49:57 +00:00
jan.nijtmans 3dd30ce854 Clamp output of TclIndexDecode() between -1 (TCL_INDEX_NONE) and INT_MAX. Use this to produce slightly better error-message for lsort -index 2019-01-18 22:18:06 +00:00
jan.nijtmans 257a102789 Slightly more efficient TclGetIntForIndexM macro, compared to previous commit 2019-01-17 21:38:01 +00:00
jan.nijtmans 00f134d99d More TIP #502 optimizations and improvements, preparing further for the road to Tcl 9.
No longer use INT_MAX for TCL_INDEX_AFTER, because INT_MAX can be a normal index in Tcl 9. 
TclGetIntForIndex now clips between -1 and INT_MAX. In Tcl 9 size_t will be used for the index data type.
2019-01-16 19:43:32 +00:00
sebres 1b13dffa8c merge 8.6, conflicts resolved in win/Makefile.in (fixed auto-path and load tcltests for ROOT_DIR/tests) 2019-01-14 19:59:19 +00:00
sebres 4aca9276df normalize package provide for tcltests 0.1 (declaration moved from pkgIndex.tcl to package source) 2019-01-14 19:51:02 +00:00
sebres 2916e34116 fCmd-9.4.a: restore constraint for winXP (mistakenly removed, should replace 8.6th constraint "win2000orXP" as "winXP", similar to test fCmd-9.6.a) 2019-01-14 19:48:14 +00:00
sebres ae312970b6 mingw/win-autoconf build: provide tcltest-executable (for consistency reasons); normalizes loading packages calls in test-suite, added build of helpers tcltest (tcltest.cmd) to start tcl-test suite (with all dependencies/facilities) from shell 2019-01-14 17:04:24 +00:00
sebres 6933dc6991 win: allows testchmod to reset DELETE DACL-mask (repaired several tests winFCmd-6.*, winFCmd-9.3, that should catch EACCESS) 2019-01-14 10:00:46 +00:00
sebres 0e3cc87362 minor optimization: check length instead of content - don't touch other memory (so potentially fewer cpu-cache washout's) 2019-01-14 08:55:49 +00:00
jan.nijtmans 4249bc4671 Merge 8.6 2019-01-13 15:43:53 +00:00
jan.nijtmans 631a3b78cb Slightly simpler test for empty string, still covering all cases. Also prepare testpurebytesobj for strings >2G 2019-01-13 15:37:42 +00:00
sebres ae556e2203 provided test-cases covering crash fixed by [58c46e74b931d3a1], as well as new test-facility "testpurebytesobj" allowing creation pure bytes object without internal representations (NULL). 2019-01-11 16:29:24 +00:00
jan.nijtmans 73442469a2 Fix crash reported by reported by François Vogel related to: [cc1e91552c0ca1817292d951f8c694b28c2b2251|cc1e91552c] 2019-01-11 14:35:40 +00:00
sebres 6504b376c3 merge 8.6 (regression bug-[cc1e91552c], etc) 2019-01-09 10:10:12 +00:00
sebres 4693981b23 closes [cc1e91552c]: fixes lrange instruction on empty not canonical list (and acc. within expansion also) 2019-01-09 10:01:35 +00:00
sebres cc6df875d6 fixed missing dependency in test-cases "*io-60.1" (constraint-related) - missed load of tcltest-library in sub-process 2019-01-08 18:15:30 +00:00
sebres 9ad3d4b7b1 amend to [a87460dbd4], added clean-up to avoid error {can't set "a(x)": variable isn't array} on next iteration of noComp loop. 2019-01-08 14:39:59 +00:00
sebres 97ef187e5b closes [cc1e91552c]: fixes lrange instruction on empty list, return original list only if it is canonical (otherwise new list object) 2019-01-08 13:35:03 +00:00
sebres 1d20d5be0d bug [cc1e91552c]: added test cases showing the regression (expansion & lrange) 2019-01-08 13:29:29 +00:00
sebres 8692d794c4 merge back after cherry-picking (no functional changes) 2019-01-07 01:15:02 +00:00
sebres b4745088b1 cherry-pick [3e4d907d8e] from 8.6: prevent buffer overrun in fast_s_mp_mul_digs(). 2019-01-07 01:11:32 +00:00
jan.nijtmans 3b1d9efc79 Merge 8.6 2019-01-04 22:37:44 +00:00
jan.nijtmans 9fd97a3b30 Merge 8.5 2019-01-04 22:36:15 +00:00
jan.nijtmans e0908c3226 Update TZ info to tzdata2018i. 2019-01-04 22:29:03 +00:00
jan.nijtmans 13ae5915d6 Fix signed<->unsigned comparsion warning (occurring in some gcc compilation flags).
Micro-optimization: Use char array in stead of const char pointer for static variable.
2019-01-04 22:23:27 +00:00
jan.nijtmans d1aae73bf3 Merge 8.6 2019-01-03 20:49:24 +00:00
jan.nijtmans 2593fcb11c Fix conflict with timezone() function in some MSVC versions 2019-01-03 20:48:38 +00:00
jan.nijtmans ae279a393f Fix conflict with timezone() function in some MSVC versions 2019-01-03 20:47:40 +00:00
José Ignacio Marín 9fe95e59fc Update TZ info to tzdata2018i. 2018-12-31 10:51:28 +00:00
José Ignacio Marín 5004f536d3 Update TZ info to tzdata2018i. 2018-12-31 10:50:48 +00:00
jan.nijtmans 0813e41bab Fix [44d382c51a848e6fbe7c9ee15e9386f1237660ee|44d382c51a84]: ZIP filesystem time stamp conversion wrong etc. 2018-12-30 23:59:46 +00:00
jan.nijtmans 899be54b87 Fix [3cf3a939d32707e100e06e23806e13569856286a|3cf3a939d3]: timezone deprecated in vc2017 2018-12-30 22:50:39 +00:00
jan.nijtmans a1351d366d Fix [3cf3a939d32707e100e06e23806e13569856286a|3cf3a939d3]: timezone deprecated in vc2017.
Also remove unix/config.status.lineno, which was -apparently - checked-in by accident in previous commit
2018-12-30 22:47:44 +00:00
jan.nijtmans 84425899dd Fix [3cf3a939d32707e100e06e23806e13569856286a|3cf3a939d3]: timezone deprecated in vc2017 2018-12-30 22:44:22 +00:00
José Ignacio Marín 905da2b593 Update TZ info to tzdata2018h. 2018-12-29 23:16:43 +00:00
José Ignacio Marín b5a9fff0ac Update TZ info to tzdata2018h. 2018-12-29 23:15:58 +00:00
sebres b226057ffc clock.test: resolve sporadic timing issues - "after 10" could cause pause >120ms on some platforms (especially on heavily loaded systems), so used average value of 5 measured intervals and real retrieved time as reference point 2018-12-29 10:03:33 +00:00
sebres a49d060935 merge 8.6 (merge point only, no functional changes) 2018-12-28 21:09:00 +00:00
sebres 211afcace9 prevent buffer overrun in fast_s_mp_mul_digs(), already fixed in newest libtommath versions. 2018-12-28 21:02:43 +00:00
sebres 13881cf3db win/Makefile.in: closes [0bcc43fa778517c4]: replace INSTALL_DATA_DIR (ported from unix-makefile) with MKDIR/chmod 2018-12-28 20:15:17 +00:00
sebres 6c43931970 merge 8.6 (resolved warnings) 2018-12-28 20:01:53 +00:00
sebres 0513ee0141 resolve warnings: array subscript -1 is below array bounds of 'void *[1]' [-Warray-bounds] if compiled with newest gcc 2018-12-28 19:54:42 +00:00
jan.nijtmans a0a457ef4c merge-mark 2018-12-20 20:05:05 +00:00
jan.nijtmans c00086981f New test-cases (backported from 8.7) adapted for pre-TIP-502 behavior 2018-12-20 20:04:01 +00:00
jan.nijtmans e0e776a57e Remove unused MODULE_SCOPE functions 2018-12-20 20:02:00 +00:00
jan.nijtmans 12f94f7a7a (cherry-pick) relax the timings of 2 tests, which incidentally fail on Travis CI.
Also backport a few new test-cases, adapted to match pre-TIP-502 behavior.
2018-12-20 08:06:20 +00:00
jan.nijtmans b143bb3fdd Internal minor optimization of TIP #502 implementation. No difference in any outcome. 2018-12-18 20:01:12 +00:00
jan.nijtmans 05a370b2d2 Merge 8.6 2018-12-18 19:54:55 +00:00
jan.nijtmans 878077e3b0 Merge 8.5 2018-12-18 19:52:19 +00:00
jan.nijtmans 4b795b56c8 No need for latest "rvm" any more in osx builds (now even gives an error)
Remove unused/empty header-file
2018-12-18 19:49:09 +00:00
dkf f55b154644 Why are we using rvm? Why? 2018-12-14 13:12:17 +00:00
jan.nijtmans 9c5dc4c207 Fix 2 TIP #502 corner-cases. Those corner-cases where (probably) always wrong on 32-bit systems, but now we have a TIP describing how it's expected to behave!
Thanks to Emiliano for noticing and reporting it. Added 6 test-cases for completeness, 2 of them failed before this fix.
Also optimize TclStringLast() a bit, implementing the pre-condition tests as in TclStringFirst().
2018-12-13 20:01:34 +00:00
jan.nijtmans 1961633531 If compiled with -DTCL_NO_DEPRECATED, remove Tcl_NewIntObj/Tcl_NewLongObj/Tcl_DbNewLongObj from stub table, as they will be gone in 9.0 (converted to a macro)
Use Tcl_WideInt's directly in more places, diminishing the possibility of inadvent overflow.
2018-12-12 19:38:33 +00:00
jan.nijtmans 00268d4ae6 Better use of Tcl_WideInt in stead of long, sometimes 2018-12-11 19:43:11 +00:00
jan.nijtmans 416725e464 Fix executable flags of 3 test-files 2018-12-08 17:33:58 +00:00
jan.nijtmans a7858d818d If compiled with -DTCL_NO_DEPRECATED, remove the Tcl_SetIntObj/Tcl_SetLongObj entries from stub table: Since they are gone in Tcl 9.0 2018-12-02 20:02:41 +00:00
jan.nijtmans e2bde4d007 Merge 8.6 2018-11-29 21:34:26 +00:00
jan.nijtmans b3f8bdaff2 relax the timings of 2 tests, which incidentally fail on Travis CI 2018-11-29 21:06:45 +00:00
dkf 72fca75fb1 Make the type casting in TclSpellFix less horrific. It's still bad, but it is no longer ghastly. 2018-11-28 11:37:03 +00:00
jan.nijtmans 8f18fa7c78 Make TclFreeObj MODULE_SCOPE, so the only way to access it is through the stub table, for backwards-compatible stub-enabled extensions 2018-11-27 22:52:04 +00:00
jan.nijtmans 8c642fb171 Fix [df6a91b5c616c3dc126cee700e159b997467465]: build failure (ticket fails to mention that this only happens with TCL_MEM_DEBUG defined) 2018-11-25 19:46:41 +00:00
jan.nijtmans c6328d793c Slightly better than previous commit: In case of a version conflict, ignore pkgIndex file. Otherwise report the error normally 2018-11-25 17:29:56 +00:00
jan.nijtmans 9fccec3f94 If a pkgIndex file is encountered which produces an error, continue. This shoud fix the Travis build for 9.0 (But same fix should be in 8.7 as well) 2018-11-24 14:59:04 +00:00
jan.nijtmans bf8595e255 re-generate configure script 2018-11-24 09:02:05 +00:00
jan.nijtmans 8653af3a2e comment typo's 2018-11-24 09:00:26 +00:00
sebres d1e9efc1de make: better algo to wrap to absolute zip-path (for systems resp. toolchains without readlink/realpath), e. g. avoid xcode/macosx build error "readlink: illegal option -- m" 2018-11-23 19:59:12 +00:00
sebres 813764c458 make/configure review: normalizes the latest fixes across unix/win 2018-11-23 11:59:53 +00:00
sebres a694d92cbd unix build (if ZIPFS_BUILD): fixed relative path to zip-program (in case of minizip), ignore possible zip-error by adjust sfx process (similar to [057d2b674d]). 2018-11-22 23:17:11 +00:00
sebres 1c22d353a9 win/mingw build (if ZIPFS_BUILD): ignore following zip-error by adjust sfx process:
zip error: Zip file structure invalid (tcl87.dll)
dll is loadable and contains zip archive (openable with zip and zipfs with tcl_library is available), so ignores return code of `zip -A`, just write it (as warning) now, and continue build process.
2018-11-22 22:14:24 +00:00
sebres cae3501f7a fixes typo in [e108e6b947], test added to cover this case 2018-11-22 18:30:49 +00:00
sebres c2ce99823e merge 8.6 2018-11-22 14:44:48 +00:00
sebres 5c59a6a505 fixed typo in prepro #ifdef unix || __APPLE__ 2018-11-22 14:44:16 +00:00
sebres 1cf15d2b4d merge 8.6 2018-11-22 14:16:51 +00:00
sebres fb0f0b6c37 merge 8.5: fixes segfault [7a9dc52b29] and wrong normalization (inside TclJoinPath) for pure relative path-segments; test-cases extended and several windows-related are fixed. 2018-11-22 13:58:37 +00:00
sebres e4f3ce78e3 win/Makefile.in (mingw/gcc toolchains): fixes make mode "tcltest" - added dependencies to build tcl (dlls) also. 2018-11-22 12:58:16 +00:00
sebres dccc93bfb8 fixes segfault [7a9dc52b29] and wrong normalization (inside TclJoinPath) for pure relative path-segments;
test-cases extended and several windows-related are fixed.
2018-11-22 12:48:42 +00:00
sebres a89cd349f1 prepare merge: TclJoinPath is in internal API (MODULE_SCOPE) since 8.6 and static (used locally in tclPathObj) in 8.5 2018-11-22 12:45:04 +00:00
jan.nijtmans a27b613909 Make encodings work again ;-( 2018-11-22 09:26:08 +00:00
jan.nijtmans 0e7af6107e Merge 8.6
In addition, tclWinSerial.c: Change back two internal variables from size_t -> int, shouldn't have been done here.
2018-11-22 08:03:24 +00:00
jan.nijtmans f49b401512 typo, which caused travis build to fail. 2018-11-22 07:40:12 +00:00
hypnotoad 3c7c613ec1 Added a wrapper script for native builds to utilize Tcl to generate a VFS to attach
to executables or dynamic libraries
2018-11-21 13:06:52 +00:00
sebres e02fb5a67b win: repair test command "testchmod": correct load module (ADVAPI32 for x86/x64) and fix readonly mask (don't deny DELETE mask, test cleanup should be able to delete entry) 2018-11-21 10:00:54 +00:00
jan.nijtmans 3a4b0be0b1 TIP #512 documentation: Indicate which functions cannot be called through the stub table any more. 2018-11-21 07:40:13 +00:00
jan.nijtmans e9c1676826 Fix windows build with Visual Studio 2018-11-21 07:36:27 +00:00
hypnotoad fcfb05f5d3 Further refinements for the fix for bug [4e812aadae68af384605a5e78845abe40206fbe9]
Moved the package manifest for the /library file system out of init.tcl file
and into a new file "manifest.txt". If a VFS is populating tcl_library via
a file copy it will rename that file to pkgIndex.tcl, which will allow all
of the packages the core distributes in this way to be available via the standard
package discovery mechanism (as tcl_library is already in the auto_path of an
unmodified tcl interpreter. And if you've modified the tcl interpreter, you
probably know better anyway.

Probably...)
2018-11-21 00:40:32 +00:00
sebres 8c233c93c1 win: fixed pwd-related test-cases in winPipe.test: several test-cases expect current directory equals [temporaryDirectory] 2018-11-20 20:56:50 +00:00
sebres 0e5ff41021 win: fixes case sensitivity of glob test cases (winFile-2.*): current directory can be different as [temporaryDirectory] (if parameter -tmpdir specified). 2018-11-20 20:23:22 +00:00
sebres 23102369d1 refactoring normalize in case of second path starting with tilde (~/~foo) - force second path as relative by join (provide normalize flag for TclJoinPath);
test cases extended
2018-11-20 20:11:02 +00:00
jan.nijtmans 1c46dc5929 Actually, it turns out that platform, platform::shell and tcltest have the same problem ... 2018-11-20 19:15:39 +00:00
jan.nijtmans fcf70e503f Fix [4e812aadae68af384605]: package require msgcat fails 2018-11-20 19:07:34 +00:00
sebres 1aa5869ece fixes segfault [7a9dc52b29]: unexpected decrement of the ref-count after TclJoinPath 2018-11-20 18:02:32 +00:00
dkf e537ff7be6 More coverity issues 2018-11-20 13:51:38 +00:00
hypnotoad e39bbfbe99 Carrying the previous checkin over to the Windows Makefile 2018-11-19 23:53:14 +00:00
hypnotoad 52768f711a Fix for ticket [9cc1db9fb675bf64dfc775372fab1f697e46bb44] 2018-11-19 23:49:56 +00:00
dgp 1fae54c8c0 merge 8.6 2018-11-16 20:37:09 +00:00
dgp 35299947e3 merge release 2018-11-16 20:26:14 +00:00
dgp 38f743a2c7 [00d04c4f12] Repair broken edge cases in [binary encode base64]. 2018-11-16 18:45:59 +00:00
dgp 4a6019f7a6 [00d04c4f12] Repair broken edge cases in [binary encode base64]. 2018-11-16 18:38:35 +00:00
dkf fa3d7ed178 Clear up a bunch of small issues found by Coverity analysis. 2018-11-16 13:45:26 +00:00
sebres d1e5b0f72f fixes segfault [00d04c4f12], unfulfilled base64 (strict and non-strict mode, etc). 2018-11-15 22:31:39 +00:00
sebres dca8be01de test cases for decode base64, bug [00d04c4f12], unfulfilled base64 (strict and non-strict mode, etc). 2018-11-15 22:18:29 +00:00
jan.nijtmans 511765faae Add entry for Tcl_StaticPackage in internal stub table, since the public one is deprecated and will be removed in 9.0
Clean-up a lot of type-casts, which are not necessary any more.
2018-11-15 19:13:55 +00:00
dgp 3046c87be9 merge 8.6 2018-11-15 17:29:38 +00:00
dgp f2d42d756e merge release 2018-11-15 16:55:13 +00:00
dgp 8d9924c328 merge 8.6 2018-11-15 16:53:00 +00:00
dgp 54488f1714 close fork 2018-11-15 16:35:58 +00:00
dgp 5b4a1fcaf3 merge 8.5 2018-11-15 16:34:44 +00:00
dkf e348eadefd Stop more crashes on Travis 2018-11-15 10:23:31 +00:00
jan.nijtmans b3d56cb364 Another attempt to fix Travis build: making the build robust against older zlib.h header file 2018-11-15 08:34:59 +00:00
jan.nijtmans 65ae2c205e Merge 8.6 2018-11-15 08:07:26 +00:00
jan.nijtmans 5e8ed94397 Make Tcl_WinTCharToUtf/Tcl_WinUtfToTChar work (again) with TCL_UTF_MAX=6. No effect when TCL_UTF_MAX=3|4 2018-11-15 08:05:23 +00:00
jan.nijtmans 0eccb10a23 Implement TIP #512: No stub for Tcl_SetExitProc() 2018-11-15 07:51:01 +00:00
jan.nijtmans b16a1198d9 Workaround for crypt.h, when used in combination with older zlib library. Should make Travis build work again 2018-11-14 07:39:45 +00:00
dkf 4402274b45 Make socket tests less likely to hang on OSX 2018-11-14 03:31:58 +00:00
dkf 237b0edf0d merge 8.6 to get Travis fixes 2018-11-12 09:53:47 +00:00
dkf 77a9cc76b1 Properly switch on running tests on Travis. CI builds now debugged. 2018-11-12 09:51:45 +00:00
dkf fc38a30572 Cleaner way of writing environment variables 2018-11-12 09:49:24 +00:00
dkf fa2ceeffff Make cookiejar tests skip gracefully 2018-11-12 09:48:17 +00:00
dkf 18b503297b Fix brokenness in GNUmakefile 2018-11-12 09:26:25 +00:00
dkf 44fd5b0f83 Fix builds on Travis. 2018-11-11 16:55:53 +00:00
dkf 13f704914a Clean up Travis config now that it passes 2018-11-11 15:07:12 +00:00
dkf 3166f1ad45 merge 8.6 2018-11-10 10:22:19 +00:00
dkf b82e966961 Build instructions tinkering 2018-11-10 09:55:31 +00:00
dkf 6fe99b6e66 Tracking down test failures 2018-11-10 09:39:35 +00:00
dkf cbbc8d66b8 Make the macosx build able to succeed 2018-11-10 07:29:08 +00:00
dgp 4dc3934516 update changes 2018-11-09 19:14:07 +00:00
dgp bd29989aab policyAllow is also a cookiejar method; make tests account for it. 2018-11-09 19:05:44 +00:00
dgp 3416e2d194 Don't make tests depend on third party error messages we do not control. 2018-11-09 19:03:05 +00:00
dgp 730f1c88eb silence compiler warning 2018-11-09 16:48:57 +00:00
dgp d16fc1a584 [35a8f1c04a] Fix bad lengths when creating string rep of some lists. 2018-11-09 16:42:37 +00:00
dgp 563ffe0ad3 Merge and adapt 8.6 2018-11-09 16:16:17 +00:00
dgp 5deb25bc9b merge 8.5 2018-11-09 16:03:22 +00:00
dgp 0f4e877214 [35a8f1c04a] Fix bad lengths when creating string rep of some lists. 2018-11-09 16:00:57 +00:00
dgp 4df4dafad6 Additional test 2018-11-09 15:47:37 +00:00
dgp 83ec300abd Revise bug fix to support (length == 0) correctly.
Added comments and improved safety in caller.
2018-11-09 15:39:26 +00:00
sebres ddae61a859 closes [35a8f1c04a]: minimalist fix - beware of discrepancy between TclScanElement and TclConvertElement (prefer braces considering TCL_DONT_QUOTE_HASH in case of first list element) 2018-11-09 14:19:08 +00:00
sebres 75399e97a8 test case to cover bug [35a8f1c04a] 2018-11-09 14:13:15 +00:00
dgp 13446e004a typo 2018-11-08 17:32:28 +00:00
dgp 4930197d21 merge mark 2018-11-08 17:09:42 +00:00
dgp 008a36f3e4 merge mark 2018-11-08 17:07:01 +00:00
dgp dc53840e35 [86d249bcba] Make sure that tcltest::runAllTests actually returns 1 on failure
Repairs TIP 525 implementation.
2018-11-08 17:06:02 +00:00
dgp 5471354571 [86d249bcba] Make sure that tcltest::runAllTests actually returns 1 on failure.
Repairs TIP 525 Implementation.
2018-11-08 17:05:00 +00:00
dkf 7d16c9044e TESTBUGFIX: The C locale is more commonly based on UTF-8 than it used to be. 2018-11-08 10:40:31 +00:00
dkf 155f409a38 Merge the Travis build rules more properly 2018-11-07 19:22:20 +00:00
dkf 20c06fad80 merge 8.6 branch 2018-11-07 19:04:53 +00:00
dkf 4abbc2cf7d merge 8.6 2018-11-07 18:59:11 +00:00
dkf a6d8a3e498 [86d249bcba] Make sure that tcltest::runAllTests actually returns 1 on failure 2018-11-07 18:56:14 +00:00
dkf c1c94e4437 [86d249bcba] Make sure that tcltest::runAllTests actually returns 1 on failure 2018-11-07 18:50:09 +00:00
dkf c5bbe85f29 Rebase of travis config 2018-11-07 13:25:45 +00:00
jan.nijtmans 29a883d89f Fix "executable" flag for many files (now really!) 2018-11-07 08:58:01 +00:00
dkf d6bc59fcc3 mark many files as not executable 2018-11-06 14:02:48 +00:00
dgp 3475b52b60 Implemen TIP 506 2018-11-06 12:13:15 +00:00
dgp efa3f28435 merge 8.7 2018-11-06 12:11:09 +00:00
dkf 931a2a1ad2 Implement TIP 524 2018-11-06 11:15:33 +00:00
dkf 3a8f5fae79 Implement TIP 523 2018-11-06 11:14:56 +00:00
dkf cef3740779 Implement TIP 519 2018-11-06 11:13:46 +00:00
dkf 4d25d5aefd Implement TIP 501 2018-11-06 11:12:05 +00:00
dkf 3c18b618a5 Added documentation 2018-11-06 10:08:11 +00:00
dkf 179e8f4df7 merge core-8-branch 2018-11-06 10:04:02 +00:00
dkf 2798a075ee Implement TIP 445 2018-11-06 09:51:55 +00:00
dkf 5429d6aeaf Implement TIP 406 2018-11-06 09:50:29 +00:00
dkf 1c2958d455 merge core-8-branch 2018-11-06 09:49:38 +00:00
dgp e2d299f771 Fixed memory leak in TclOO.c:ObjectNamespaceDeleted, object mixins and
object/class mutation.
2018-11-02 17:18:57 +00:00
jan.nijtmans 57f1472371 Merge 8.7 2018-11-02 07:26:17 +00:00
jan.nijtmans bea160e7f6 Start building this branch with Travis. See how far we get 2018-11-01 20:18:12 +00:00
pooryorick d739e9b6a8 Fixed memory leak in TclOO.c:ObjectNamespaceDeleted, object mixins and
object/class mutation.
2018-11-01 20:10:06 +00:00
dgp 2577d3bd45 make dist 2018-11-01 16:31:00 +00:00
dgp c65da32867 update changes 2018-11-01 15:26:12 +00:00
dgp ff9bd4ad1c merge 8.6 2018-11-01 14:50:31 +00:00
dgp 3788abb994 Eliminate fallback attempts when broken strtod() routines are detected.
This has long been creating more problems than it solves.
2018-11-01 14:48:36 +00:00
dgp a0c7ff582a Eliminate fallback attempts when broken strtod() routines are detected.
This has long been creating more problems than it solves.
2018-11-01 14:46:07 +00:00
jan.nijtmans b3dceb5360 Make MacOSX compile work (hopefully) and cross-compile on mingw-w64 (compile only, no unit-test yet) 2018-10-31 21:02:42 +00:00
jan.nijtmans 500a1629c4 Merge 8.6 2018-10-30 20:42:12 +00:00
jan.nijtmans 4c1c62892a Merge 8.5 2018-10-30 20:41:01 +00:00
jan.nijtmans 434a115a3c Add support for DragonFly 2018-10-30 20:40:03 +00:00
jan.nijtmans 74707353e8 Add support for TIP #494 to registry and dde. Only effective when compiled against Tcl 9.0 headers. This way we can keep the source-code for those extensions 100% equal in all branches.
Work-around for gcc warning in tclWinFile.c. Discovered by Travis CI.
2018-10-30 20:39:24 +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 820cc5a23d Work started eliminating long outdated compat routines that now cause
cross-compiling failure far more often than they help porting to old broken
platforms.
2018-10-29 18:19:55 +00:00
dgp f7dfeb706f merge 8.7 2018-10-29 15:37:07 +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
dgp ccbbac847a update changes 2018-10-29 12:36:29 +00:00
dgp 8e4701fd31 merge 8.6 2018-10-29 12:28:15 +00:00
dkf de66468301 Documentation 2018-10-28 15:36:55 +00:00
dkf 56f89b9850 Test cases (and some fixes) 2018-10-28 12:48:53 +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
dkf af5d98388a Definition and introspection commands. 2018-10-28 08:22:21 +00:00
dkf fd15b04d3b merge core-8-branch 2018-10-27 22:12:00 +00:00
dkf 3dc41c544f Core machinery for implementing TIP 524; still needs user-facing access commands 2018-10-27 22:05:34 +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
dgp b28e8c3bd1 Draft implementation of TIP 506 - rebased to Tcl 8.7 2018-10-27 01:04:33 +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
pspjuth 63802cdd70 Simplify to only accept index arguemnts. No index list.
Added manual page.
2018-10-24 22:15:50 +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 f338047c19 merge 8.7 2018-10-24 02:00:15 +00:00
dgp 691b2ab5c4 update changes 2018-10-23 23:34:34 +00:00
dgp 352d056288 merge 8.6 2018-10-23 23:25:53 +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 231a11e2ce Merge 8.7 2018-10-23 19:39:00 +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
pspjuth 36f2cb4d7d Implement TIP 523, New lpop command 2018-10-22 18:43:47 +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
dgp 68cad4302a merge 8.6 2018-10-22 13:30:51 +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 37c458acb7 Remove unused variable 2018-10-21 10:01:04 +00:00
dkf 775ce545d2 More tests. Better implementation. 2018-10-21 09:57:43 +00:00
dkf 9b417d4592 Rebase on 8.7 2018-10-20 23:41:32 +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
jan.nijtmans d8decf16a5 Merge 8.7 2018-10-19 15:49:41 +00:00
dkf 74357f24f8 merge core-8-branch 2018-10-19 10:07:24 +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
jan.nijtmans 8bfcffa20a Merge 8.7 2018-10-18 21:54:37 +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
dgp 90221ac971 merge 8.7 2018-10-18 15:31:51 +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
dgp 4dbcfc37b3 typo 2018-10-15 12:49:56 +00:00
dkf f59c9faee2 Make it easier to extend cookiejar for policy reasons 2018-10-15 10:28:23 +00:00
dkf 94c0eede77 Fix up citations 2018-10-14 14:00:38 +00:00
dkf 61a92173cc Added more documentation. 2018-10-14 13:48:11 +00:00
dkf c393791ed5 Added documentation 2018-10-14 13:14:10 +00:00
dkf 239ba78ee4 Adapt the code to the fact that we don't need to stick to the BMP any more 2018-10-14 10:51:27 +00:00
dkf 359b371edd Move header parsing to where it belongs 2018-10-14 09:17:16 +00:00
dkf 67b4e0d544 merge core-8-branch 2018-10-14 09:04:11 +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
dgp 7c859988ba 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-11 17:47:05 +00:00
dgp a221655e1a More updates to changes file. 2018-10-11 17:17:37 +00:00
dgp af3a20ad4e 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-11 11:48:32 +00:00
dgp f4f6ef461b Update URLs. changes file WIP. 2018-10-11 11:31:29 +00:00
dkf 5719d6ca30 Put documented [zipfs find] in ensemble. Add examples to docs. 2018-10-11 07:24:40 +00:00
dgp d918760272 Backport test fix. 2018-10-10 23:04:25 +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 9e61a85e86 merge 8.6 2018-10-09 18:27:57 +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
dgp eec0f0f9da merge 8.6 2018-10-09 13:51:56 +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
dgp e13c5f55a1 merge 8.6 2018-10-05 19:40:55 +00:00
dgp c74364be4c Bump version numbers for 8.6.9 release. 2018-10-05 19:37:52 +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
jan.nijtmans eeead325b4 Merge 8.7 2018-08-08 07:01:46 +00:00
dgp 5a177e9aaf merge 8.7 2018-07-11 17:48:31 +00:00
dgp 9bd3b59e1d merge 8.7 2018-07-09 14:53:45 +00:00
jan.nijtmans 77bd578d9f TIP #512 implementation 2018-06-25 20:41:56 +00:00
dgp fd7ecfb877 missing parts 2018-06-14 18:39:34 +00:00
dgp d60637c153 Just the [timerate] command for separate review and performance baseline. 2018-06-05 20:16:30 +00:00
dgp f206e0fb4b merge 8.7 2018-06-05 17:26:37 +00:00
dgp 050e383cf2 merge 8.7 2018-06-04 13:08:54 +00:00
dgp 29bbdb74d3 merge 8.7 2018-06-04 13:07:15 +00:00
dgp 1545e31557 Rebase the sebres clock bounty work to the 8.7 branch. 2018-06-01 16:04:22 +00:00
sebres 71f7b946a6 amend to [98a00c62b4798792]: fixed sort of the tests 2018-05-30 11:49:19 +00:00
sebres 83a8197fe9 back-porting of tclclockmod done, merge current 8.6 2018-05-29 17:58:53 +00:00
sebres 153e32d613 fixed ticket [dc69e5ecf04313429fd202b1906cd85bb7888f95]: missing zones AKST/AKDT 2018-05-29 17:41:00 +00:00
sebres 1b580435fc forgotten flag "CLF_DAYOFWEEK" in one case, where day of week is set 2018-05-29 17:38:29 +00:00
sebres f185b8c243 revert explicit adding of validity mode suffix in all test-cases: used wrapper command "test" instead 2018-05-29 17:38:02 +00:00
sebres 991ad56e9c tests: sort test-files without extension (e. g. "clock" before "clock-ivm"). 2018-05-29 17:37:03 +00:00
sebres 371c0aec0b conditional test-call rewritten: realized via tests\clock-ivm.test to cover inverted default validation mode 2018-05-29 17:27:23 +00:00
sebres 2f35271c9d fixed week-based calculation if neither mmdd nor ddd available; 2018-05-29 17:26:12 +00:00
sebres 3cf665c0f5 validation rules: extended for day of year (and test covered now) 2018-05-29 17:25:48 +00:00
sebres ef90044383 amend after rebase to master: follow rename yyDayNumber to yyDayOfWeek 2018-05-29 17:24:41 +00:00
sebres 5fb141ae40 validation rules ready for scan/freescan; test cases extended; code review and clean-up;
running of test cases with and without validate.
2018-05-29 17:24:24 +00:00
sebres da19723bdc first simple validation rules introduced 2018-05-29 17:21:09 +00:00
sebres d1b1eb61ee try to re-implement validation rules for clock scan (option -valid 1|0), see http://core.tcl.tk/tcl/tktview?name=3475995 2018-05-29 17:20:36 +00:00
sebres bacdc67e69 Merge branch 'freescan_tz_fix' 2018-05-29 17:19:31 +00:00
sebres fc3ea33681 follow http://core.tcl.tk/tcl/info/a3463a55a6a27eed: Historical change affecting tests: Detroit did not observe Daylight Saving Time in 1967 2018-05-29 17:18:26 +00:00
sebres 86fa45a2d2 Fixed performance test-cases: several test-cases repaired to be feasible using original clock engine. 2018-05-29 17:16:56 +00:00
sebres e3d338650f fixed test-cases (regardless the current time zone) 2018-05-29 17:14:52 +00:00
sebres 88f8e603d9 FreeScan: rewritten lexer rules and some tokens for better space recognition; fewer conflicts (shift/reduce, reduce/reduce);
differentiate between TZ like "GMT+1" and relative offsets "GMT +1 day", etc.;
test-cases extended for new cases.
2018-05-29 17:14:36 +00:00
sebres 2c4913d479 Apply Flightaware DST fix 2018-05-29 17:13:50 +00:00
sebres 3681b8fdb5 try to fix GMT+0000, etc. **still wrong**, because of "GMT+1" and because of longest match "00:00 GMT +1000 days" (in this case "days" == "1 day")...
% clock scan "+1000 days" -base 100000000 -gmt 1
186364800
% clock scan "00:00 GMT +1000 days" -base 100000000 -gmt 1
100015200

% clock format [clock scan "GMT+10"]
Thu Sep 14 19:54:16 CEST 2017
% clock format [clock scan "GMT+1000"]
Thu Sep 14 10:04:20 CEST 2017
% clock format [clock scan "GMT+10"]
Thu Sep 14 19:54:23 CEST 2017
% clock format [clock scan "GMT-1000"]
Fri Sep 15 06:04:39 CEST 2017
%
2018-05-29 17:12:28 +00:00
sebres 9b3dad29d7 FreeScan: repair scanning date/time with TZ using '+', ex.: "31 Jan 14 23:59:59 +0100", additionally another TZ formats can be used now (token [zone] used instead of sequence '-' tNUMBER); test cases extended.
Closes http://core.tcl.tk/tcl/tktview?name=5019748c73
Cherry picked from fossil branch "sebres_clock_tz_fix", check-in [5f72c863f17145b4]
2018-05-29 17:11:52 +00:00
sebres 743a4fee3d replace unneeded calculation of seconds of day (already available in field secondOfDay) 2018-05-29 17:11:09 +00:00
sebres 35b9322dc3 fixed multi-threaded race condition, if the same format will be first time used by 2 threads simultaneously:
assign tokenized lists (scnTok/fmtTok) to format storage firstly if it get ready.
2018-05-29 17:10:51 +00:00
sebres a194fa9779 code review and cleanup (remove unused code) 2018-05-29 17:09:48 +00:00
sebres b8ef30620b code review and cleanup (remove unused code) 2018-05-29 17:04:51 +00:00
sebres 46c8ea3458 Added max permitted threshold (buffer size > result size) in percent, to directly return the buffer without reallocate (don't affect small formats with size < 80 (MIN_FMT_RESULT_BLOCK_ALLOC)) 2018-05-29 17:03:28 +00:00
sebres 10673db0ce further optimization: better cache for GMT-timezone + minimize (re)allocation of buffers 2018-05-29 17:02:57 +00:00
sebres 14c5c590e0 code review: micro optimizations 2018-05-29 17:01:00 +00:00
sebres 533ca10a79 generic\tclStrIdxTree.c: bug fix (lost abbreviation), if tree will be built from 2 lists, and the short form differentiate from long form ("jan." vs "january", note the dot-char), don't use longest form - should be split in 2 entries with common parent "jan".
Thus use simple case (don't split) only if found item is covered in full (e. g. "jan" vs "january", note without dot-char).
Test covered now (clock-29.181x, locale "fr") - `clock scan [clock format 0 -format {%a %d-%m-%Y} -locale fr] -format {%a %d-%m-%Y} -locale fr`
2018-05-29 16:59:22 +00:00
sebres 916a8e7276 performance: GetMonthDay re-implemented using most faster algorithm (without cycle). 2018-05-29 16:47:02 +00:00
sebres baa4ae5c90 try to resolve warnings by some forwards declarations: redefinition of typedef 'ClockScanToken' is a C11 feature [-Wtypedef-redefinition] 2018-05-29 16:45:56 +00:00
sebres ae8248cd39 fixed test case clock-0.1 "auto-loading of ensemble and stubs on demand" - makes no sense if tclclockmod loaded. 2018-05-29 16:45:07 +00:00
sebres 2293dabf3f Initialize prevf to fix (used before set) warning.
* Prevf doesn't get used at line 145 unless `prevItem != NULL` and prevf also gets set in the same block, so this is safe.
2018-05-29 16:42:27 +00:00
sebres 90c1f734c0 tests-perf\test-performance.tcl: ported from sebres-8-6-event-perf-branch (common test performance framework), removed from "tests-perf\clock.perf.tcl" and used as include. 2018-05-29 16:40:26 +00:00
dgp 2db0464fd9 merge 8.7 2018-05-24 12:46:07 +00:00
dgp 202eeb707c merge 8.7 2018-05-24 12:24:54 +00:00
dgp 2a340ce4c1 merge 8.7 2018-05-11 11:26:35 +00:00
dgp ae6192f9cb merge 8.7 2018-05-11 11:26:20 +00:00
dgp 4d9ba4a652 merge 8.7 2018-04-25 13:02:35 +00:00
dgp 9ff5b7077a Plug memory leak handling circular path values. 2018-04-25 11:09:53 +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 7234985a63 merge 8.7 2018-04-07 17:07:26 +00:00
dgp 434c0fa7fb Merge 8.7. Update two macros to TIP 445. 2018-04-06 19:14:48 +00:00
dgp 3fe69cba13 merge 8.7 2018-03-30 19:51:05 +00:00
dgp 27f230c6bf merge 8.7 2018-03-30 19:37:21 +00:00
dgp a3204f806c Rebase TIP 502 draft implementation. 2018-03-30 12:32:22 +00:00
dgp be8b7d25f6 merge 8.7 2018-03-15 14:23:18 +00:00
dgp 0bef3861ff merge 8.7 2018-03-11 22:42:27 +00:00
dgp dc5861414a merge 8.7 2018-03-10 15:55:38 +00:00
dgp 3616fc519b merge 8.7 2018-03-06 13:50:45 +00:00
dgp bd9f2eb15d merge 8.7 2018-03-06 13:45:45 +00:00
dgp 1dbb35b63b merge 8.7 2018-03-05 17:18:14 +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 a9e916f1b9 merge 8.7 2018-02-23 18:01:26 +00:00
dgp c908681186 merge 8.7 2018-02-15 18:24:22 +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
dgp e239fa05dd merge 8.7 2018-02-14 14:52:18 +00:00
hypnotoad c5a85dbfdc Correcting the string tests 2018-02-13 19:22:31 +00:00
hypnotoad d49ccd64f2 Ok.. that was all it needed 2018-02-13 19:10:25 +00:00
hypnotoad 2815504547 Implemetation of tip 501.
Note: The build fails with:

bad stack depth computations: is 0, should be 1
Abort trap: 6

When "string is dict" is called
2018-02-13 18:55:31 +00:00
dgp 19d052ff26 merge 8.7 2018-02-09 18:45:02 +00:00
dgp 90806d3525 merge 8.7 2018-02-06 21:11:01 +00:00
dgp 24886887f9 merge 8.7 2018-01-29 15:36:13 +00:00
dgp c0012125d2 merge 8.7 2018-01-23 13:29:34 +00:00
dgp 896002d66a merge 8.7 2018-01-18 13:32:44 +00:00
dgp 4389db676e merge 8.7 2018-01-11 14:09:13 +00:00
dgp 1af6acb542 merge 8.7 2017-12-29 16:16:14 +00:00
dgp e9ccb8b496 merge 8.7 2017-12-27 14:09:06 +00:00
dgp 8ffa3470bb merge 8.7 2017-12-19 21:01:46 +00:00
dgp 77c0d1662a merge 8.7 2017-12-19 16:22:24 +00:00
dgp 8fa6374b22 merge 8.7 2017-12-06 21:00:51 +00:00
dgp adb60835f7 merge 8.7 2017-12-06 13:29:22 +00:00
dgp fb62f4567b merge 8.7 2017-12-06 13:16:33 +00:00
dgp 49e332ded2 merge 8.7 2017-11-30 17:52:09 +00:00
dgp 079887fe42 merge 8.7 2017-11-29 14:54:21 +00:00
dgp 8a227678b2 merge 8.7 2017-11-15 13:39:12 +00:00
dgp c7c8527ce3 merge 8.7 2017-11-14 18:52:42 +00:00
dgp 1462dc4b66 merge 8.7 2017-11-09 13:36:52 +00:00
dgp 0a2f847ac9 merge 8.7 2017-11-08 03:32:07 +00:00
dgp cc64de63b9 merge 8.7 2017-11-06 00:17:03 +00:00
dgp 0708073b35 merge 8.7 2017-11-03 19:15:00 +00:00
dgp f88eecc172 merge trunk 2017-10-30 12:03:14 +00:00
dgp f92a2c43b3 merge trunk 2017-10-30 03:35:23 +00:00
dgp 42ed459018 merge trunk 2017-10-27 13:12:21 +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
dgp 802b562cbf merge trunk 2017-10-20 12:44:00 +00:00
dgp 336cf18ae8 Merge core-8-6-branch (execpt file win/makefile.vc) 2017-10-20 12:36:40 +00:00
dgp 5e8c17ac4e merge trunk 2017-10-13 16:38:01 +00:00
dgp 22ef6f7e0d merge trunk 2017-10-12 12:37:39 +00:00
dgp de970528d7 More TIP 445 conversion of the "path" Tcl_ObjType. 2017-09-22 14:11:45 +00:00
dgp 2af8b0203e Partial conversion of the "path" Tcl_ObjType to TIP 445 contributed by
Cyan Ogilvie.  This reworking also eliminates circular references in
the "path" values.  Test suite indicates the change works.  Don't know
what, if anything, was lost compared to the original Darley design.
2017-09-22 13:32:31 +00:00
dgp 3bd15d3a70 merge trunk 2017-09-22 13:05:36 +00:00
dgp d67fcf3f9c merge trunk 2017-09-20 16:17:32 +00:00
dgp a65e5f86de merge trunk 2017-09-18 14:57:21 +00:00
dgp 8b268fb161 merge trunk 2017-09-18 11:59:56 +00:00
dgp 415a0e9de3 merge trunk 2017-09-14 14:12:26 +00:00
dgp 41765c8938 Rework [lset] internals to be sure outdated intreps get purged. 2017-09-12 17:01:55 +00:00
dgp de6b083f58 Make sure ListObjReplace invalidates outdated intreps. 2017-09-12 15:44:00 +00:00
dgp ed8604f566 Make sure ListObjAppendElement invalidates outdated intreps. 2017-09-12 15:18:46 +00:00
dgp bbcc51539b Revised dict value means we much invalidate existing intreps. 2017-09-12 13:23:40 +00:00
dgp b1dc2099c7 When we invalidate the string rep of a dict, that's a sign we need to
free all the intreps of that dict as well.
2017-09-12 13:22:46 +00:00
dgp 89524bf484 merge trunk 2017-09-11 12:02:49 +00:00
dgp 9b5022802e merge trunk 2017-09-05 12:41:30 +00:00
dgp d6ea58f110 merge trunk 2017-09-01 00:52:27 +00:00
dgp c53cfa6c6a merge trunk 2017-08-18 13:43:51 +00:00
andy 5381389cdd Merge trunk 2017-08-08 16:39:51 +00:00
sebres 08d9bb4c7c fixed overflow of year (resp. julianday), closes ticket [16e4fc3096]; test cases adjusted. 2017-08-08 15:19:18 +00:00
dgp e51352557d merge trunk 2017-08-04 13:25:25 +00:00
dgp 159d4b2635 merge trunk 2017-07-18 13:39:34 +00:00
dgp b16fb594ee merge trunk 2017-07-06 16:52:15 +00:00
dgp 23c0ba0065 merge trunk 2017-06-29 11:29:05 +00:00
dgp 2ebce7dad7 merge trunk 2017-06-26 20:14:14 +00:00
dgp a8960a0876 merge trunk 2017-06-22 13:45:53 +00:00
dgp 9bd337033d merge trunk 2017-06-19 17:37:33 +00:00
dgp cca5a0c27a merge trunk 2017-06-16 20:28:53 +00:00
jan.nijtmans b20173ba38 merge core-8-6-branch 2017-06-07 15:21:27 +00:00
sebres 12edf1f533 fixed wrong options suggestions by wrong args, like 'bad option "-base" ...' (for format) or 'bad option "-format" ...' (for add).
Note: sub-commands share common options table, because for the options often used the same literals (objects), so it avoids permanent "recompiling" of option object representation to indexType with another table.
2017-06-07 14:16:35 +00:00
jan.nijtmans 9e607ddb5a Clock options should be alphabetica (so "-base" first). Struct members should start with lowercase. 2017-06-07 12:38:39 +00:00
jan.nijtmans 33602d0a11 Fix LookupLastTransition() for behavior when tick < compVal, undo Tcl_EvalObjEx -> TclEvalObjEx change, eliminate two inline macro's which are only used once. Eliminate many unnecessary MODULE_SCOPE declarations (duplicated with header files) 2017-06-07 10:40:40 +00:00
jan.nijtmans 4b7fc1bb11 merge core-8-6-branch 2017-06-07 09:29:12 +00:00
dgp 9a51ddaa6e merge trunk 2017-06-06 13:48:14 +00:00
sebres e72c67b399 removing "-compile" option on ensembles - allow to compile tcl-internal ensembles within namespace "::tcl::*" (apparently only having map for sub-commands). 2017-06-02 22:43:57 +00:00
sebres b81fc4d41d restored lost documentation of "timerate" 2017-06-02 21:51:35 +00:00
sebres bfa8e4f4dc amend fix default locale, (fixed everywhere - no current locale anymore for default, avoid set it after clear caches, etc.) 2017-06-02 21:48:40 +00:00
sebres ed0399c961 unix/makefile: add header dependencies 2017-06-02 20:45:03 +00:00
sebres 68b7104563 extends performance test cases for converting between locales / TZ, for multiple switching between locales / TZ by scan and format, etc. 2017-06-02 20:10:43 +00:00
sebres 6c2d2971a2 fix default locale: differentiate between no locale specified or "C" (en) and current locale (corresponds system language, resp. env(LANG)) 2017-06-02 20:10:16 +00:00
sebres a592eefcbe [win32] repair clock using system timezone (default :localtime) resp. locale for windows (broken after removal of registry-fix in [848d01b6ef]) 2017-06-02 20:09:53 +00:00
sebres 2fce52b2ae close small performance degradation if alternate between two time zones (e. g. convert from one to another): additionally to last used cache also previously used time zone. 2017-06-02 20:09:25 +00:00
sebres 750bed46fd close small performance degradation if alternate between two locales (e. g. convert from one to another): additionally to last used cache also previously used locale. 2017-06-02 20:09:10 +00:00
sebres d48588c89c Removed public interface to create smart-pointer to dictionaries "dict smartref", common locales catalog rewritten to hold internally onetime referenced merged locales (even as smart-ref). 2017-06-02 20:08:55 +00:00
sebres d5552e2fbe [win32] repair clock test-cases for windows, using system locale / TZ :localtime (broken after removal of registry-fix in [848d01b6ef]) 2017-06-02 20:07:10 +00:00
sebres 0cdd360369 Move "timerate" functionality to "::tcl::unsupported".
This partially reverts commit [848d01b6ef].
2017-06-02 20:06:28 +00:00
jan.nijtmans 449ce271b1 merge-mark core-8-6-branch (no changes) 2017-06-02 11:11:20 +00:00
sebres 9011c35db1 missing static keyword for inline declarations 2017-06-02 06:53:35 +00:00
sebres ccbd8395f4 [win32] optimized calibration cycle (makes Tcl for windows "RTS" resp. NRT-capable):
- the clock ticks never backwards (avoid it by negative drifts using comparison of times before and after calibration);
- more precise, smooth/soft drifting (avoids too large drifts, already after 10 iterations the drift gets fewer as 0.1 microseconds);
- because of more accurate drifting (aspire to the smallest difference), we can prolong calibration interval (up to 10 seconds by small tdiff-value);

Closes ticket [b7b707a310ea42e9f1b29954ee8ca13ae91ccabe] "[win32] NRT-only - NativeGetTime backwards time-drifts bug"
2017-05-23 21:57:13 +00:00
dgp 25084ac51a merge trunk 2017-05-23 12:52:09 +00:00
dgp 4c1161c24a merge trunk 2017-05-19 13:00:32 +00:00
sebres 05d83f7b1a back-ported branch sebres-8-6-timerate (new command "timerate" for 8.5) 2017-05-16 12:41:01 +00:00
dgp 5a70bbe10b merge trunk 2017-05-15 18:18:12 +00:00
dgp 43e76a45e9 merge trunk 2017-05-08 16:14:10 +00:00
dgp e78b0c8945 merge trunk 2017-04-27 12:14:04 +00:00
dgp 7cfeb436e4 merge trunk 2017-04-21 12:44:30 +00:00
dgp 1212cb034f merge trunk 2017-04-17 12:42:47 +00:00
dgp 6c3fce3382 merge trunk 2017-04-12 13:36:47 +00:00
dgp bc2940927e merge trunk 2017-04-11 14:14:05 +00:00
dgp 5c21b9c7c7 merge trunk 2017-04-06 11:53:51 +00:00
dgp 2b692ce09c merge trunk 2017-03-31 12:08:18 +00:00
dgp d236581f7b merge trunk 2017-03-29 14:35:44 +00:00
dgp 555cf46f2a merge trunk 2017-03-21 14:30:29 +00:00
dgp 00a454298c merge trunk 2017-03-20 12:55:21 +00:00
dgp fb1a2c58dd merge trunk 2017-03-17 13:14:14 +00:00
dgp 40ee63b6ff merge trunk 2017-03-13 16:01:05 +00:00
dgp 38670f6730 merge trunk 2017-03-10 17:30:10 +00:00
dgp fd1058d488 merge trunk 2017-03-09 14:33:53 +00:00
dgp 16ad898a13 merge trunk 2017-03-06 17:48:27 +00:00
dgp 90fc87af1c merge trunk 2017-02-27 15:33:38 +00:00
dgp dc151ef624 merge trunk 2017-02-16 15:51:33 +00:00
dgp 37143a57b5 merge trunk 2017-02-09 13:59:22 +00:00
dgp 44b5581c48 merge trunk 2017-02-03 18:49:14 +00:00
dgp fde54630a5 merge trunk 2017-02-02 20:33:26 +00:00
dgp d72bb516ef merge trunk 2017-01-27 16:32:19 +00:00
dgp a316791c49 merge trunk 2017-01-23 16:39:06 +00:00
dgp 42e84df47a merge trunk 2017-01-13 16:21:50 +00:00
dgp abc071c974 merge trunk 2017-01-12 20:59:53 +00:00
dgp ee6c9c9f00 merge trunk 2016-12-23 15:21:22 +00:00
dgp bc213f0ba3 merge trunk 2016-12-19 18:43:49 +00:00
dgp 1e4644762a merge trunk 2016-12-02 19:01:40 +00:00
dgp 2efba704b3 merge trunk 2016-11-30 03:16:46 +00:00
dgp fd49860e24 merge trunk 2016-11-29 13:50:34 +00:00
dgp e615b54704 merge trunk 2016-11-28 16:08:33 +00:00
dgp e2d691eda8 merge trunk 2016-11-18 18:02:04 +00:00
dgp 16483765ba merge trunk 2016-11-16 15:04:10 +00:00
dgp 9b461748a0 merge trunk 2016-11-14 12:16:38 +00:00
dgp fbc3a63f6c merge trunk 2016-11-04 15:52:17 +00:00
dgp f2262dec1c merge trunk 2016-11-01 16:18:43 +00:00
dgp 506f1152a8 merge trunk 2016-10-21 13:12:33 +00:00
dgp 33d0dac397 merge trunk 2016-10-20 16:37:42 +00:00
dgp 4cb3305614 merge trunk 2016-10-14 19:54:55 +00:00
dgp 029c8634fd merge trunk 2016-10-13 17:04:50 +00:00
dgp 9fde0d3e5a Correct improper NULL return from initializing Tcl_InitStringRep(o, b, 0).
Go ahead and return pointer to space where 0 bytes can be written.
2016-10-12 17:31:48 +00:00
dgp aec96db016 Reduce direct use of the tclEmptyStringRep. 2016-10-12 16:58:20 +00:00
dgp e97fab49d3 Purge another direct access to bytes field. 2016-10-12 15:14:51 +00:00
dgp eee33c1731 merge trunk 2016-10-12 14:11:39 +00:00
dgp ec7df3f449 Purge more direct accesses to bytes field. 2016-10-07 21:06:04 +00:00
dgp 7b2a90493f Use the new purity test. 2016-10-07 19:04:44 +00:00
dgp 3304a8bc1e merge trunk 2016-10-07 18:53:27 +00:00
dgp d0002e5394 New routine Tcl_HasStringRep() and first conversion of callers. 2016-10-07 16:36:42 +00:00
dgp 3119d45e4c merge trunk 2016-10-07 13:06:17 +00:00
dgp f87d2e5bb6 merge trunk 2016-10-04 18:29:23 +00:00
dgp ffc62d0068 merge trunk 2016-09-16 16:43:16 +00:00
dgp 07b7df0b0e merge trunk 2016-09-09 12:42:09 +00:00
dgp 227c81511f merge trunk 2016-09-08 03:29:09 +00:00
dgp bc8b826f65 merge trunk 2016-07-26 19:20:55 +00:00
dgp d7890f281b merge trunk 2016-07-20 21:31:04 +00:00
dgp 3e5f21836f Revise "parsedVarName" type to use proposed interfaces. 2016-07-20 19:47:31 +00:00
dgp 7d307a1ae7 merge trunk 2016-07-20 17:46:57 +00:00
dgp f989073e0d Merge trunk; silence compiler warning. 2016-07-20 16:36:25 +00:00
dgp 837e136aa6 merge trunk 2016-07-20 15:43:29 +00:00
dgp f211f9c476 Convert the "localVarName" type to the proposed interfaces. 2016-07-20 15:31:35 +00:00
dgp 43c2d3e981 merge trunk 2016-07-20 11:50:03 +00:00
dgp 15a1396579 merge trunk 2016-07-19 21:18:35 +00:00
dgp 40d62156ac Second half "chan" Tcl_ObjType conversion. Mistake avoided this time. 2016-07-18 21:53:51 +00:00
dgp df55f87e2d Half convert "chan" Tcl_ObjType to new interfaces. 2016-07-18 20:59:52 +00:00
dgp dbb5e86cde merge trunk 2016-07-18 17:33:54 +00:00
dgp d9dbe7bb1e merge trunk 2016-07-14 18:09:31 +00:00
dgp bb9fba63c4 Merge mark without merging. Reformatting conflicts with branch edit plans. 2016-07-14 10:55:21 +00:00
dgp 33458f6fe4 merge trunk 2016-07-13 19:25:32 +00:00
dgp 020fdb84f4 yup 2016-07-13 17:25:47 +00:00
dgp 059410842d another 2016-07-13 17:02:24 +00:00
dgp a13a688507 and another 2016-07-13 16:02:04 +00:00
dgp 792e537014 another one 2016-07-13 15:43:44 +00:00
dgp 9a0684671a More of the same. 2016-07-12 21:41:42 +00:00
dgp e2e1132eba Prefer removal of just known invalid interp over destruction of all intreps. 2016-07-12 21:38:25 +00:00
dgp ca5093b1ea Prefer removal of just known invalid intrep over destruction of all intreps. 2016-07-12 21:36:13 +00:00
dgp 694ffb7454 convert ensembleCmdType to new interfaces. 2016-07-12 21:32:25 +00:00
dgp d28c66ab23 merge trunk 2016-07-12 19:42:28 +00:00
dgp d5fb92d9a3 merge trunk 2016-07-11 22:04:34 +00:00
dgp 6abeee6109 merge trunk 2016-07-10 19:35:28 +00:00
dgp 3408cb4cab merge trunk 2016-07-09 17:21:31 +00:00
dgp 3f704efe4e merge trunk 2016-07-02 20:43:16 +00:00
dgp 7add065e0f merge trunk 2016-06-29 16:07:24 +00:00
dgp 3f1e1192cb merge trunk 2016-06-28 16:31:27 +00:00
dgp a9aed18760 merge trunk 2016-06-22 18:59:18 +00:00
dgp 50dbacbaf0 merge trunk 2016-06-17 03:06:17 +00:00
dgp cebf94f0db merge trunk 2016-06-03 13:31:52 +00:00
dgp c8d1b2568b merge trunk 2016-05-24 12:17:06 +00:00
dgp f707c50e9d merge trunk 2016-05-13 16:03:59 +00:00
dgp 6c3864d50e Revise encodingType to use proposed routines. 2016-05-10 17:22:14 +00:00
dgp 2c218563b3 merge trunk 2016-05-10 16:53:20 +00:00
dgp 0d83fc1704 More ByteCode revisions. 2016-04-30 17:47:40 +00:00
dgp 9f2bd1e80f typo 2016-04-29 20:34:29 +00:00
dgp c22277cf6a more revisions 2016-04-29 20:33:43 +00:00
dgp 2e23e829d9 Revise the "exprcode" Tcl_ObjType to proposed routines. 2016-04-29 20:20:33 +00:00
dgp be804ed5e6 Revise "assemblecode" Tcl_ObjType to proposed routines. 2016-04-29 20:04:12 +00:00
dgp 29704cd895 merge trunk 2016-04-29 19:32:20 +00:00
dgp 8819aab738 repair merge 2016-04-22 18:57:38 +00:00
dgp aeecfffbb1 merge trunk 2016-04-22 18:13:43 +00:00
dgp 712675a744 Revise "dictIterator" objType to use proposed routines. 2016-04-20 18:02:45 +00:00
dgp 53c50e58bf Use static name for a static struct. 2016-04-11 17:46:20 +00:00
dgp 5ebe18e5ec merge trunk 2016-04-11 17:34:04 +00:00
dgp a56a457941 merge trunk 2016-04-11 17:16:31 +00:00
dgp 2c83a6f53e Revise the "end-offset" objType to use proposed routines, and not export or
provide unneeded things.
2016-04-11 01:07:31 +00:00
dgp 22da94979e merge trunk 2016-04-08 16:12:45 +00:00
dgp 17cdd5f2d2 merge trunk 2016-04-08 12:43:07 +00:00
dgp 188ebe6ceb Revise the "TclOO method name" objType to use proposed routines. 2016-04-07 21:34:21 +00:00
dgp b42de3a4f3 Revise "levelReference" ObjType to use proposed routines. 2016-04-07 21:07:26 +00:00
dgp f51c126c9d merge trunk 2016-04-07 14:57:12 +00:00
dgp 9cf82aad7e close fork 2016-04-05 21:06:01 +00:00
dgp 99b30a2b32 merge trunk 2016-04-05 12:13:00 +00:00
dgp 08b6a144bd Revise the "procbody" Tcl_ObjType to use proposed routines. 2016-04-05 00:05:35 +00:00
dgp cf086db3f2 merge trunk 2016-04-04 22:01:45 +00:00
dgp 90bb5bf23c Use new routine TclGetLambdaFromObj to better isolate the "lambdaExpr" ObjType.
Then convert it to use the proposed routines.
2016-04-04 22:00:02 +00:00
dgp cbfce81f38 Use simple name for file static struct. 2016-04-04 19:41:07 +00:00
dgp 68e9e6b533 merge trunk 2016-04-04 18:28:13 +00:00
dgp 6661778d6e Revise "nsName" ObjType to use proposed routines. 2016-04-04 18:12:42 +00:00
dgp aec00dd13c Revise "instname" ObjType to use proposed routines 2016-04-04 17:43:32 +00:00
dgp e51db8046c Revise "regexp" Tcl_ObjType to use proposed routines. 2016-04-04 17:27:24 +00:00
dgp f28ed288b8 merge trunk 2016-04-04 16:38:32 +00:00
dgp 1dc5de0179 Revise "dict" Tcl_ObjType to use proposed routines. 2016-03-30 23:16:21 +00:00
dgp 0a4081dc57 Revise several ACCEPT_NAN stanzas. 2016-03-30 17:55:59 +00:00
dgp 7721fe8b51 Remove direct access to Tcl_Obj typePtr field that does nothing of any
obvious benefit.
2016-03-30 17:15:44 +00:00
dgp f324e94785 merge trunk: 2016-03-30 15:41:32 +00:00
dgp 30d0cf44cb Functional conversion of "list" Tcl_ObjType to proposed routines.
Not yet completely tidy and finished.
2016-03-29 20:07:42 +00:00
dgp 4a7725e917 merge trunk 2016-03-28 00:55:59 +00:00
dgp dcb52d2ea8 A few more easy conversions. 2016-03-27 17:07:50 +00:00
dgp e29e96a9e1 Conversion of "bytearray" Tcl_ObjType - much better this time. 2016-03-27 15:37:07 +00:00
dgp 25fa1a3a8c Revised design - have Tcl_FetchIntRep return a writable pointer. 2016-03-27 14:57:09 +00:00
dgp 6fd2ed3f11 Convert the "bytearray" Tcl_ObjType to use the proposed Tcl_ObjIntRep
manipulation routines.  This works, but requires too much ugliness.
The ugliness reveals that the interface needs some refinement, making
this a rejected branch of development.
2016-03-26 12:36:01 +00:00
dgp 0276b6e644 irPtr = NULL passed to Tcl_StoreIntRep clears out any value for typePtr. 2016-03-25 20:01:39 +00:00
dgp 3bd8840931 Get signatures in sync. 2016-03-25 19:56:56 +00:00
dgp 36cf99464d First demonstration conversion to the new intrep manipulation routines. 2016-03-25 14:01:00 +00:00
dgp f19cbcbff5 New routines Tcl_FetchIntRep() and Tcl_StoreIntRep(). 2016-03-25 13:06:53 +00:00
dgp c7039276a0 Create a type Tcl_ObjIntRep so we can pass intreps as arguments. 2016-03-25 12:24:04 +00:00
dgp 1f136d8cb6 merge trunk 2016-03-24 21:22:51 +00:00
dgp a5e1e1f33e Revise the "index" Tcl_ObjType to use the new routine. 2016-03-24 21:11:52 +00:00
dgp 1bebb796bb Revise the "instname" Tcl_ObjType to use the routines. 2016-03-24 20:33:27 +00:00
dgp a19375e928 oops 2016-03-24 20:17:52 +00:00
dgp 413706af15 Update Tcl_InitStringRep callers to handle OOM condition. 2016-03-24 20:15:01 +00:00
dgp 8370f3e275 Revise Tcl_InitStringRep() to do non-panic attempt at allocation.
Let caller decide how catastrophic it is.
Revise [string repeat] to use new routine.
2016-03-24 19:21:47 +00:00
dgp 959413c95a More purging of direct access to bytes field where it isn't important. 2016-03-24 15:01:43 +00:00
dgp 325b2f4ade Update more Tcl_ObjTypes to use Tcl_InitStringRep().
Adapt TclInitStringRep macro to accept TclInitStringRep(objptr, NULL, 0)
without warning -- requires outwitting compiler.
2016-03-24 14:40:35 +00:00
dgp 83ac8470a0 TclInitStringRep() already knows about tclEmptyStringRep. 2016-03-24 13:50:59 +00:00
dgp f6b543ae94 oops 2016-03-24 13:16:42 +00:00
dgp e9a10d7cda stay out of internals when nice interfaces are available. 2016-03-24 12:59:06 +00:00
dgp dc0adeafb4 Revised "end-offset" Tcl_ObjType to use new routine. 2016-03-24 12:51:49 +00:00
dgp 80bc5b30c2 Revise "osType" Tcl_ObjType to use new routine. 2016-03-24 01:50:58 +00:00
dgp 0412f3af19 Revise "ensembleCommand" Tcl_ObjType to use new routines. 2016-03-23 21:50:15 +00:00
dgp c79a28077f Convert "dict" Tcl_ObjType to use new routines. 2016-03-23 21:36:29 +00:00
dgp 6bd1189ac2 merge trunk 2016-03-23 15:21:35 +00:00
dgp 422d353b0a Tcl_InitStringRep() bug. Truncation assumed length == allocated. Wrong!
Convert "bytearray" Tcl_ObjType to used new facilities. No longer directly
refers to bytes or length fields, or any ckalloc of string rep.
2016-03-23 15:19:05 +00:00
dgp 847f2ba0d5 Revise Tcl_InitStringRep(); numBytes is unsigned. Only truncation permitted. 2016-03-23 14:10:39 +00:00
dgp cae0944eda Release memory after truncation. 2016-03-23 10:10:10 +00:00
dgp 37f5c2af03 Make sure no path emerges to write on tclEmptyStringRep. 2016-03-23 04:50:21 +00:00
dgp 95de12dbb4 Next step: new routine Tcl_InitStringRep() 2016-03-23 04:31:24 +00:00
dgp de712c24fb First simple step implementing TIP 445. 2016-03-22 23:45:12 +00:00
dkf 26f9497dd4 merge trunk 2014-07-18 12:22:17 +00:00
dkf dd1274d805 merge trunk 2014-05-31 20:47:23 +00:00
dkf 5587ec4f28 merge trunk 2014-04-20 15:29:12 +00:00
dkf 02e0c5c152 more tinkering 2014-04-20 15:28:24 +00:00
dkf c7e456e77d Limit number of cookies stored, deleting least recently used ones. 2014-04-01 08:18:41 +00:00
dkf e2eaca874e merge trunk 2014-03-31 08:09:20 +00:00
dkf 4fb87dc8de Better cookie option parsing that doesn't throw away critical information. 2014-03-31 08:08:01 +00:00
dkf 217acf1c4c merge trunk 2014-03-10 09:01:17 +00:00
dkf c60bcbe173 Reorganize log level management, start testing persistence, refactor code to not put so much in ::http namespace 2014-03-10 09:00:31 +00:00
dkf 666e80e5bd more checks of domain data loading 2014-03-05 22:28:12 +00:00
dkf 9597c478f9 safer setter mechanism 2014-03-04 08:11:02 +00:00
dkf 1575eb36c1 working towards a more consistent way of handling options in the cookiejar API 2014-03-03 23:22:12 +00:00
dkf b3e0829c50 start writing integration tests 2014-02-26 08:58:05 +00:00
dkf 403350cc99 more tests and some fixes 2014-02-25 09:10:52 +00:00
dkf a8069e81b7 more functional testing 2014-02-24 08:13:12 +00:00
dkf 11cd48efa3 merge trunk 2014-02-23 18:17:39 +00:00
dkf 96c666ffcf testing of the cookiejar implementation 2014-02-18 14:14:33 +00:00
dkf 9b6ba77224 extending the IDNA tests 2014-02-16 09:04:44 +00:00
dkf 1c6910c2ec add the test cases from RFC 3492 2014-02-15 10:02:43 +00:00
dkf 3557938100 more tests, now getting to the IDNA handling 2014-02-14 09:03:49 +00:00
dkf ffb8dbaeee more tests for the punycode engine 2014-02-13 09:04:23 +00:00
dkf 0cffbf8eb7 starting to write some tests 2014-02-09 12:56:24 +00:00
dkf 334a96f761 D'oh! 2014-02-09 12:41:05 +00:00
dkf 50cb73a76e update list of TLDs 2014-02-08 15:36:53 +00:00
dkf 35c72808bf merge trunk 2014-02-08 15:03:35 +00:00
dkf 859eff84db merge trunk 2013-04-05 08:46:23 +00:00
dkf 38dfb78b4e merge trunk 2013-01-08 20:31:35 +00:00
dkf a1db4012d9 merge trunk 2012-11-13 18:02:35 +00:00
dkf 3f0cb9473b merge trunk 2012-10-16 13:44:58 +00:00
dkf 2edb721609 separating out the IDNA handling code 2012-10-12 13:18:24 +00:00
dkf 82abe83414 reorganize the code so that the IDNA procs live with the punycode procs; correct some misleading (and misleadingly-placed) comments 2012-10-10 14:49:45 +00:00
dkf 1bf1abb40a merge trunk 2012-10-04 10:31:54 +00:00
dkf dd7b94054a merge trunk 2012-09-19 22:57:16 +00:00
dkf ea1ff58500 Fix the bugs in the punycode decoder 2012-09-18 10:15:30 +00:00
dkf 9bbbadaa57 adapt to 8.6 environment properly; still some bugs... 2012-09-17 14:44:23 +00:00
dkf 3c1c246415 merge trunk 2012-09-14 07:44:20 +00:00
dkf 52d39094e4 packing the code tighter, doing more explanatory comments 2012-09-11 10:37:10 +00:00
dkf 4aba0742ce merge trunk 2012-09-10 21:26:22 +00:00
dkf 6f1a0f1c60 loading of restricted domain list now believed to work 2012-09-10 21:24:34 +00:00
dkf 99359a48d9 Now, a working punycode engine 2012-09-10 11:00:59 +00:00
dkf ef405dbe9c working on handling punycoding of IDNAs 2012-09-09 12:02:38 +00:00
dkf ee1f2a2484 More improvements 2012-09-07 10:35:14 +00:00
dkf 9e6f2e579a improving the database, working towards a purging algorithm for session cookies 2012-09-07 07:13:44 +00:00
dkf ddb07346c0 Tidy up, making code be of higher general quality. 2012-09-06 19:18:37 +00:00
dkf 2d8bb440c9 merge trunk 2012-09-06 10:16:39 +00:00
dkf a23ee46c67 improve logging, correct 'secure' property handling, correct domain handling, simplify http<->cookiejar interface 2012-09-06 09:49:52 +00:00
dkf 8d9808cb4d closer to working 2012-09-05 10:24:05 +00:00
dkf fa56a98ba9 more realistic queries 2012-09-05 09:46:03 +00:00
dkf bb95c2d8e9 merge trunk 2012-09-04 21:26:21 +00:00
dkf 51e67d70c4 Improving the cookie lookup code to actually handle paths&domains 2012-09-04 21:24:43 +00:00
dkf bdafa7afcb Add package index entry. 2012-09-02 07:28:02 +00:00
dkf 51ab423164 merge trunk 2012-09-02 07:21:51 +00:00
dkf 94ad48ea87 merge trunk 2012-08-04 07:49:14 +00:00
dkf 99af655c4c some small tinkerings 2012-07-31 10:52:29 +00:00
dkf 4085af6b83 merge trunk 2012-07-20 08:23:20 +00:00
dkf db9c41f45c First attempt at a "bad cookie domain" detector, a critical security check. 2012-07-19 16:28:50 +00:00
dkf 03fec9c7fe merge trunk 2012-07-11 10:56:57 +00:00
dkf 06cfc731c6 Start of implementation of cookiejar package. Not yet working/finished. 2012-07-11 10:52:49 +00:00
dkf e6dbc77e0e merge trunk 2012-07-08 11:32:04 +00:00
dkf d321f40d3b merge trunk 2012-07-08 11:22:05 +00:00
dkf b9098ee927 Make the parsing work with Google. 2012-07-08 11:15:45 +00:00
dkf 0d4a963517 Starting work on support code for cookies. This adds a configurable interface
for plugging in a cookie manager (not enabled by default).
2012-07-07 12:34:39 +00:00
596 changed files with 43906 additions and 23078 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
+4
View File
@@ -19,14 +19,18 @@
*/tcltest*
*/versions.vc
*/version.vc
*/libtcl.vfs
*/libtcl_*.zip
html
libtommath/bn.ilg
libtommath/bn.ind
libtommath/pretty.build
libtommath/tommath.src
libtommath/*.log
libtommath/*.pdf
libtommath/*.pl
libtommath/*.sh
libtommath/doc/*
libtommath/tombc/*
libtommath/pre_gen/*
libtommath/pics/*
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tcl9</name>
<name>tcl8</name>
<comment></comment>
<projects>
</projects>
+297
View File
@@ -0,0 +1,297 @@
sudo: false
language: c
matrix:
include:
- os: linux
dist: xenial
compiler: clang
env:
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: clang
env:
- CFGOPT=--disable-shared
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc
env:
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc
env:
- CFGOPT=--disable-shared
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
env:
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc-6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- BUILD_DIR=unix
- os: linux
dist: xenial
compiler: gcc-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=6
- os: linux
dist: xenial
compiler: gcc-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=3
- os: linux
dist: xenial
compiler: gcc-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_NO_DEPRECATED=1
- os: osx
osx_image: xcode8
env:
- BUILD_DIR=unix
- os: osx
osx_image: xcode8
env:
- BUILD_DIR=macosx
- NO_DIRECT_CONFIGURE=1
- os: osx
osx_image: xcode9
env:
- BUILD_DIR=macosx
- NO_DIRECT_CONFIGURE=1
- os: osx
osx_image: xcode10.2
env:
- BUILD_DIR=macosx
- NO_DIRECT_CONFIGURE=1
### C builds not currently supported on Windows instances
# - os: windows
# env:
# - BUILD_DIR=win
### ... so proxy with a Mingw cross-compile
# Test with mingw-w64 (32 bit)
- os: linux
dist: xenial
compiler: i686-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64
- gcc-multilib
- wine
env:
- BUILD_DIR=win
- CFGOPT=--host=i686-w64-mingw32
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: i686-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64
- gcc-multilib
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=i686-w64-mingw32 --disable-shared"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: i686-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64
- gcc-multilib
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=6"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: i686-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64
- gcc-multilib
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=3"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: i686-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64
- gcc-multilib
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1"
- NO_DIRECT_TEST=1
# Test with mingw-w64 (64 bit)
- os: linux
dist: xenial
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=6"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=3"
- NO_DIRECT_TEST=1
- os: linux
dist: xenial
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
packages:
- gcc-mingw-w64-base
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- wine
env:
- BUILD_DIR=win
- CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
- NO_DIRECT_TEST=1
before_install:
- export ERROR_ON_FAILURES=1
- cd ${BUILD_DIR}
install:
- test -n "$NO_DIRECT_CONFIGURE" || ./configure ${CFGOPT}
script:
- make
# The styles=develop avoids some weird problems on OSX
- test -n "$NO_DIRECT_TEST" || make test styles=develop
+1 -1
View File
@@ -1,6 +1,6 @@
A NOTE ON THE CHANGELOG:
Starting in early 2011, Tcl source code has been under the management of
fossil, hosted at http://core.tcl.tk/tcl/ . Fossil presents a "Timeline"
fossil, hosted at https://core.tcl-lang.org/tcl/ . Fossil presents a "Timeline"
view of changes made that is superior in every way to a hand edited log file.
Because of this, many Tcl developers are now out of the habit of maintaining
this log file. You may still find useful things in it, but the Timeline is
+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>
+13 -13
View File
@@ -1,5 +1,5 @@
README: Tcl
This is the Tcl 9.0a0 source distribution.
This is the Tcl 8.7a2 source distribution.
http://sourceforge.net/projects/tcl/files/Tcl/
You can get any source release of Tcl from the URL above.
@@ -29,7 +29,7 @@ Tcl is maintained, enhanced, and distributed freely by the Tcl community.
Source code development and tracking of bug reports and feature requests
takes place at:
http://core.tcl.tk/
http://core.tcl-lang.org/
Tcl/Tk release and mailing list services are hosted by SourceForge:
@@ -37,7 +37,7 @@ Tcl/Tk release and mailing list services are hosted by SourceForge:
with the Tcl Developer Xchange hosted at:
http://www.tcl.tk/
http://www.tcl-lang.org/
Tcl is a freely available open source package. You can do virtually
anything you like with it, such as modifying it, redistributing it,
@@ -49,21 +49,21 @@ and selling it either in whole or in part. See the file
Extensive documentation is available at our website.
The home page for this release, including new features, is
http://www.tcl.tk/software/tcltk/9.0.html
http://www.tcl-lang.org/software/tcltk/8.7.html
Detailed release notes can be found at the file distributions page
by clicking on the relevant version.
http://sourceforge.net/projects/tcl/files/Tcl/
Information about Tcl itself can be found at
http://www.tcl.tk/about/
http://www.tcl-lang.org/about/
There have been many Tcl books on the market. Many are mentioned in the Wiki:
http://wiki.tcl.tk/_/ref?N=25206
http://wiki.tcl-lang.org/_/ref?N=25206
To view the complete set of reference manual entries for Tcl 9.0 online,
To view the complete set of reference manual entries for Tcl 8.7 online,
visit the URL:
http://www.tcl.tk/man/tcl9.0/
http://www.tcl-lang.org/man/tcl8.7/
2a. Unix Documentation
----------------------
@@ -101,7 +101,7 @@ There are brief notes in the unix/README, win/README, and macosx/README about
compiling on these different platforms. There is additional information
about building Tcl from sources at
http://www.tcl.tk/doc/howto/compile.html
http://www.tcl-lang.org/doc/howto/compile.html
4. Development tools
---------------------------
@@ -127,7 +127,7 @@ see the "Support and bug fixes" section below.
A Wiki-based open community site covering all aspects of Tcl/Tk is at:
http://wiki.tcl.tk/
http://wiki.tcl-lang.org/
It is dedicated to the Tcl programming language and its extensions. A
wealth of useful information can be found there. It contains code
@@ -153,7 +153,7 @@ We are very interested in receiving bug reports, patches, and suggestions
for improvements. We prefer that you send this information to us as
tickets entered into our tracker at:
http://core.tcl.tk/tcl/reportlist
http://core.tcl-lang.org/tcl/reportlist
We will log and follow-up on each bug, although we cannot promise a
specific turn-around time. Enhancements may take longer and may not happen
@@ -169,13 +169,13 @@ questions for which no one else is likely to know the answer. In addition,
see the following Web site for links to other organizations that offer
Tcl/Tk training:
http://wiki.tcl.tk/training
http://wiki.tcl-lang.org/training
9. Tracking Development
-----------------------
Tcl is developed in public. To keep an eye on how Tcl is changing, see
http://core.tcl.tk/
http://core.tcl-lang.org/
10. Thank You
-------------
+67 -1
View File
@@ -8831,6 +8831,70 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
--- Released 8.6.8, December 22, 2017 --- http://core.tcl.tk/tcl/ for details
2018-02-11 (enhance) stop blocking conversion of object to/from class (coulter)
2018-02-12 (enhance) NR-enable [package require] (coulter)
2018-02-14 (bug)[9fd5c6] crash in object deletion, test oo-11.5 (coulter)
2018-02-14 (bug)[3c32a3] crash deleting object with class mixed in (coulter)
2018-02-15 (platform) stop using -lieee, removed from glibc-2.27 (porter)
***POTENTIAL INCOMPATIBILITY for math programs that embed Tcl***
2018-02-23 (bug)[8e6a9a] bad binary [string match], test string-11.55 (porter)
2018-03-05 (bug)[1873ea] repair multi-thread std channel init (sebres)
2018-03-09 (bug)[db36fa] broken bytecode for index values (porter)
2018-03-13 (bug) broken compiled [string replace], test string-14.19 (porter)
2018-03-14 (bug) [string trim*] engine crashed on invalid UTF (sebres)
2018-04-17 (bug) missing trace in compiled [array set], test var-20.11 (porter)
2018-04-22 (bug)[46a241] crash in unset array with search, var-13.[23] (goth)
2018-04-30 (bug)[27b682] race made [file delete] raise "no such file" (sebres)
2018-06-04 (bug)[925643] 32/64 cleanup of filesystem DIR operations (sebres)
2018-06-18 (bug) leaks in TclSetEnv and env cache (coulter)
2018-06-24 (bug)[3592747] [yieldto] dying namespace, tailcall-14.1 (coulter)
2018-07-09 (bug)[270f78] race in [file mkdir] (sebres)
2018-07-12 (bug)[3f7af0] [file delete] raised "permission denied" (sebres)
2018-07-26 (bug)[d051b7] overflow crash in [format] (sebres)
2018-08-29 revised quoting of [exec] args in generated command line (sebres)
***POTENTIAL INCOMPATIBILITY***
2018-09-20 HTTP Keep-Alive with pipelined requests (nash)
=> http 2.9.0
2018-09-27 (new)[TIP 505] [lreplace] accepts all out of range indices (porter)
2018-10-04 (bug) Prevent crash from NULL keyName (nijtmans)
=> registry 1.3.3
2018-10-26 (enhance) advance dde version (nijtmans)
=> dde 1.4.1
2018-10-27 tzdata updated to Olson's tzdata2018g (jima)
2018-10-29 Update tcltest package for Travis support (fellows)
=> tcltest 2.5.0
2018-11-09 (bug)[35a8f1] overlong string length of some lists (owens)
2018-11-16 (bug)[00d04c] Repair [binary encode base64] (sebres)
- Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ -
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
@@ -8849,7 +8913,7 @@ in this changeset (new minor version) rather than bug fixes:
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
2016-11-25 [array named -regexp] supports backrefs (goth)
2016-11-25 [array names -regexp] supports backrefs (goth)
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
@@ -8884,3 +8948,5 @@ in this changeset (new minor version) rather than bug fixes:
2018-03-12 (TIP 499) custom locale preference list (oehlmann)
=> msgcat 1.7.0
- Released 8.7a3, Nov 30, 2018 --- http://core.tcl-lang.org/tcl/ for details -
-36
View File
@@ -1,36 +0,0 @@
/*
* fixstrtod.c --
*
* Source code for the "fixstrtod" procedure. This procedure is
* used in place of strtod under Solaris 2.4, in order to fix
* a bug where the "end" pointer gets set incorrectly.
*
* Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#undef strtod
/*
* Declare strtod explicitly rather than including stdlib.h, since in
* somes systems (e.g. SunOS 4.1.4) stdlib.h doesn't declare strtod.
*/
extern double strtod(char *, char **);
double
fixstrtod(
char *string,
char **endPtr)
{
double d;
d = strtod(string, endPtr);
if ((endPtr != NULL) && (*endPtr != string) && ((*endPtr)[-1] == 0)) {
*endPtr -= 1;
}
return d;
}
+2 -2
View File
@@ -28,7 +28,7 @@ opendir(
if ((fd = open(myname, 0, 0)) == -1) {
return NULL;
}
dirp = (DIR *) Tcl_Alloc(sizeof(DIR));
dirp = (DIR *) ckalloc(sizeof(DIR));
if (dirp == NULL) {
/* unreachable? */
close(fd);
@@ -106,5 +106,5 @@ closedir(
close(dirp->dd_fd);
dirp->dd_fd = -1;
dirp->dd_loc = 0;
Tcl_Free(dirp);
ckfree(dirp);
}
-1
View File
@@ -29,7 +29,6 @@ extern char * malloc(unsigned int numBytes);
extern void qsort(void *base, int n, int size, int (*compar)(
const void *element1, const void *element2));
extern char * realloc(char *ptr, unsigned int numBytes);
extern double strtod(const char *string, char **endPtr);
extern long strtol(const char *string, char **endPtr, int base);
extern unsigned long strtoul(const char *string, char **endPtr, int base);
-252
View File
@@ -1,252 +0,0 @@
/*
* strtod.c --
*
* Source code for the "strtod" library procedure.
*
* Copyright (c) 1988-1993 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0
#endif
static const int maxExponent = 511; /* Largest possible base 10 exponent. Any
* exponent larger than this will already
* produce underflow or overflow, so there's
* no need to worry about additional digits.
*/
static const double powersOf10[] = { /* Table giving binary powers of 10. Entry */
10., /* is 10^2^i. Used to convert decimal */
100., /* exponents into floating-point numbers. */
1.0e4,
1.0e8,
1.0e16,
1.0e32,
1.0e64,
1.0e128,
1.0e256
};
/*
*----------------------------------------------------------------------
*
* strtod --
*
* This procedure converts a floating-point number from an ASCII
* decimal representation to internal double-precision format.
*
* Results:
* The return value is the double-precision floating-point
* representation of the characters in string. If endPtr isn't
* NULL, then *endPtr is filled in with the address of the
* next character after the last one that was part of the
* floating-point number.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
double
strtod(
const char *string, /* A decimal ASCII floating-point number,
* optionally preceded by white space. Must
* have form "-I.FE-X", where I is the integer
* part of the mantissa, F is the fractional
* part of the mantissa, and X is the
* exponent. Either of the signs may be "+",
* "-", or omitted. Either I or F may be
* omitted, or both. The decimal point isn't
* necessary unless F is present. The "E" may
* actually be an "e". E and X may both be
* omitted (but not just one). */
char **endPtr) /* If non-NULL, store terminating character's
* address here. */
{
int sign, expSign = FALSE;
double fraction, dblExp;
const double *d;
register const char *p;
register int c;
int exp = 0; /* Exponent read from "EX" field. */
int fracExp = 0; /* Exponent that derives from the fractional
* part. Under normal circumstatnces, it is
* the negative of the number of digits in F.
* However, if I is very long, the last digits
* of I get dropped (otherwise a long I with a
* large negative exponent could cause an
* unnecessary overflow on I alone). In this
* case, fracExp is incremented one for each
* dropped digit. */
int mantSize; /* Number of digits in mantissa. */
int decPt; /* Number of mantissa digits BEFORE decimal
* point. */
const char *pExp; /* Temporarily holds location of exponent in
* string. */
/*
* Strip off leading blanks and check for a sign.
*/
p = string;
while (isspace(UCHAR(*p))) {
p += 1;
}
if (*p == '-') {
sign = TRUE;
p += 1;
} else {
if (*p == '+') {
p += 1;
}
sign = FALSE;
}
/*
* Count the number of digits in the mantissa (including the decimal
* point), and also locate the decimal point.
*/
decPt = -1;
for (mantSize = 0; ; mantSize += 1)
{
c = *p;
if (!isdigit(c)) {
if ((c != '.') || (decPt >= 0)) {
break;
}
decPt = mantSize;
}
p += 1;
}
/*
* Now suck up the digits in the mantissa. Use two integers to collect 9
* digits each (this is faster than using floating-point). If the mantissa
* has more than 18 digits, ignore the extras, since they can't affect the
* value anyway.
*/
pExp = p;
p -= mantSize;
if (decPt < 0) {
decPt = mantSize;
} else {
mantSize -= 1; /* One of the digits was the point. */
}
if (mantSize > 18) {
fracExp = decPt - 18;
mantSize = 18;
} else {
fracExp = decPt - mantSize;
}
if (mantSize == 0) {
fraction = 0.0;
p = string;
goto done;
} else {
int frac1, frac2;
frac1 = 0;
for ( ; mantSize > 9; mantSize -= 1) {
c = *p;
p += 1;
if (c == '.') {
c = *p;
p += 1;
}
frac1 = 10*frac1 + (c - '0');
}
frac2 = 0;
for (; mantSize > 0; mantSize -= 1) {
c = *p;
p += 1;
if (c == '.') {
c = *p;
p += 1;
}
frac2 = 10*frac2 + (c - '0');
}
fraction = (1.0e9 * frac1) + frac2;
}
/*
* Skim off the exponent.
*/
p = pExp;
if ((*p == 'E') || (*p == 'e')) {
p += 1;
if (*p == '-') {
expSign = TRUE;
p += 1;
} else {
if (*p == '+') {
p += 1;
}
expSign = FALSE;
}
if (!isdigit(UCHAR(*p))) {
p = pExp;
goto done;
}
while (isdigit(UCHAR(*p))) {
exp = exp * 10 + (*p - '0');
p += 1;
}
}
if (expSign) {
exp = fracExp - exp;
} else {
exp = fracExp + exp;
}
/*
* Generate a floating-point number that represents the exponent. Do this
* by processing the exponent one bit at a time to combine many powers of
* 2 of 10. Then combine the exponent with the fraction.
*/
if (exp < 0) {
expSign = TRUE;
exp = -exp;
} else {
expSign = FALSE;
}
if (exp > maxExponent) {
exp = maxExponent;
errno = ERANGE;
}
dblExp = 1.0;
for (d = powersOf10; exp != 0; exp >>= 1, ++d) {
if (exp & 01) {
dblExp *= *d;
}
}
if (expSign) {
fraction /= dblExp;
} else {
fraction *= dblExp;
}
done:
if (endPtr != NULL) {
*endPtr = (char *) p;
}
if (sign) {
return -fraction;
}
return fraction;
}
+1 -1
View File
@@ -53,7 +53,7 @@ strtol(
*/
p = string;
while (isspace(UCHAR(*p))) {
while (TclIsSpaceProc(*p)) {
p += 1;
}
+1 -1
View File
@@ -74,7 +74,7 @@ strtoul(
*/
p = string;
while (isspace(UCHAR(*p))) {
while (TclIsSpaceProc(*p)) {
p += 1;
}
if (*p == '-') {
-76
View File
@@ -1,76 +0,0 @@
/*
* unistd.h --
*
* Macros, constants and prototypes for Posix conformance.
*
* Copyright 1989 Regents of the University of California Permission to use,
* copy, modify, and distribute this software and its documentation for any
* purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies. The University of California makes
* no representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*/
#ifndef _UNISTD
#define _UNISTD
#include <sys/types.h>
#ifndef NULL
#define NULL 0
#endif
/*
* Strict POSIX stuff goes here. Extensions go down below, in the ifndef
* _POSIX_SOURCE section.
*/
extern void _exit(int status);
extern int access(const char *path, int mode);
extern int chdir(const char *path);
extern int chown(const char *path, uid_t owner, gid_t group);
extern int close(int fd);
extern int dup(int oldfd);
extern int dup2(int oldfd, int newfd);
extern int execl(const char *path, ...);
extern int execle(const char *path, ...);
extern int execlp(const char *file, ...);
extern int execv(const char *path, char **argv);
extern int execve(const char *path, char **argv, char **envp);
extern int execvpw(const char *file, char **argv);
extern pid_t fork(void);
extern char * getcwd(char *buf, size_t size);
extern gid_t getegid(void);
extern uid_t geteuid(void);
extern gid_t getgid(void);
extern int getgroups(int bufSize, int *buffer);
extern pid_t getpid(void);
extern uid_t getuid(void);
extern int isatty(int fd);
extern long lseek(int fd, long offset, int whence);
extern int pipe(int *fildes);
extern int read(int fd, char *buf, size_t size);
extern int setgid(gid_t group);
extern int setuid(uid_t user);
extern unsigned sleep(unsigned seconds);
extern char * ttyname(int fd);
extern int unlink(const char *path);
extern int write(int fd, const char *buf, size_t size);
#ifndef _POSIX_SOURCE
extern char * crypt(const char *, const char *);
extern int fchown(int fd, uid_t owner, gid_t group);
extern int flock(int fd, int operation);
extern int ftruncate(int fd, unsigned long length);
extern int ioctl(int fd, int request, ...);
extern int readlink(const char *path, char *buf, int bufsize);
extern int setegid(gid_t group);
extern int seteuidw(uid_t user);
extern int setreuid(int ruid, int euid);
extern int symlink(const char *, const char *);
extern int ttyslot(void);
extern int truncate(const char *path, unsigned long length);
extern int vfork(void);
#endif /* _POSIX_SOURCE */
#endif /* _UNISTD */
+2 -2
View File
@@ -100,7 +100,7 @@ waitpid(
} else {
prevPtr->nextPtr = waitPtr->nextPtr;
}
Tcl_Free(waitPtr);
ckfree(waitPtr);
return result;
}
@@ -156,7 +156,7 @@ waitpid(
goto waitAgain;
}
}
waitPtr = (WaitInfo *) Tcl_Alloc(sizeof(WaitInfo));
waitPtr = (WaitInfo *) ckalloc(sizeof(WaitInfo));
waitPtr->pid = result;
waitPtr->status = status;
waitPtr->nextPtr = deadList;
+6
View File
@@ -29,6 +29,12 @@
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
#ifdef Z_U4
typedef Z_U4 z_crc_t;
#else
typedef unsigned long z_crc_t;
#endif
/***********************************************************************
* Return the next byte in the pseudo-random sequence
*/
+1 -1
View File
@@ -97,7 +97,7 @@ void change_file_date(filename,dosdate,tmu_date)
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
CloseHandle(hFile);
#else
#ifdef unix || __APPLE__
#if defined(unix) || defined(__APPLE__)
struct utimbuf ut;
struct tm newdate;
newdate.tm_sec = tmu_date.tm_sec;
+3 -3
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)
@@ -92,7 +92,7 @@ uLong filetime(f, tmzip, dt)
return ret;
}
#else
#ifdef unix || __APPLE__
#if defined(unix) || defined(__APPLE__)
uLong filetime(f, tmzip, dt)
char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */
@@ -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);
+8 -3
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -30,6 +30,8 @@ int
.sp
\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR)
.sp
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
.sp
\fBTcl_GetErrorLine\fR(\fIinterp\fR)
.sp
\fBTcl_SetErrorLine\fR(\fIinterp, lineNum\fR)
@@ -58,10 +60,10 @@ unless \fIlength\fR is negative.
.AP Tcl_Obj *objPtr in
A message to be appended to the \fB\-errorinfo\fR return option
in the form of a Tcl_Obj value.
.AP size_t length in
.AP int length in
The number of bytes to copy from \fImessage\fR when
appending to the \fB\-errorinfo\fR return option.
If (size_t)-1, all bytes up to the first null byte are used.
If negative, all bytes up to the first null byte are used.
.AP Tcl_Obj *errorObjPtr in
The \fB\-errorcode\fR return option will be set to this value.
.AP char *element in
@@ -243,6 +245,9 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
record instead of a value. Otherwise, it is similar to
\fBTcl_SetObjErrorCode\fR in behavior.
.PP
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
instead of taking a variable number of arguments it takes an argument list.
.PP
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
of the \fB\-errorline\fR return option without the overhead of a full
call to \fBTcl_GetReturnOptions\fR. Likewise, \fBTcl_SetErrorLine\fR
+27 -8
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc \- allocate or free heap memory
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, ckalloc, ckfree, ckrealloc, attemptckalloc, attemptckrealloc \- allocate or free heap memory
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -19,14 +19,29 @@ char *
void
\fBTcl_Free\fR(\fIptr\fR)
.sp
void *
char *
\fBTcl_Realloc\fR(\fIptr, size\fR)
.sp
void *
char *
\fBTcl_AttemptAlloc\fR(\fIsize\fR)
.sp
void *
char *
\fBTcl_AttemptRealloc\fR(\fIptr, size\fR)
.sp
char *
\fBckalloc\fR(\fIsize\fR)
.sp
void
\fBckfree\fR(\fIptr\fR)
.sp
char *
\fBckrealloc\fR(\fIptr, size\fR)
.sp
char *
\fBattemptckalloc\fR(\fIsize\fR)
.sp
char *
\fBattemptckrealloc\fR(\fIptr, size\fR)
.SH ARGUMENTS
.AS char *size
.AP "unsigned int" size in
@@ -64,10 +79,14 @@ allocation fails, these functions will return NULL. Note that on some
platforms, but not all, attempting to allocate a zero-sized block of
memory will also cause these functions to return NULL.
.PP
When a module or Tcl itself is compiled with \fBTCL_MEM_DEBUG\fR defined,
the procedures \fBTcl_Alloc\fR, \fBTcl_Free\fR, \fBTcl_Realloc\fR,
\fBTcl_AttemptAlloc\fR, and \fBTcl_AttempRealloc\fR are implemented
as macros, redefined to be special debugging versions of these procedures.
The procedures \fBckalloc\fR, \fBckfree\fR, \fBckrealloc\fR,
\fBattemptckalloc\fR, and \fBattemptckrealloc\fR are implemented
as macros. Normally, they are synonyms for the corresponding
procedures documented on this page. When Tcl and all modules
calling Tcl are compiled with \fBTCL_MEM_DEBUG\fR defined, however,
these macros are redefined to be special debugging versions
of these procedures. To support Tcl's memory debugging within a
module, use the macros rather than direct calls to \fBTcl_Alloc\fR, etc.
.SH KEYWORDS
alloc, allocation, free, malloc, memory, realloc, TCL_MEM_DEBUG
+2 -1
View File
@@ -30,7 +30,8 @@ or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR
return with an appropriate message. The particular script
evaluation procedures of Tcl that act in the manner are
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR,
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR and \fBTcl_VarEval\fR.
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and
\fBTcl_VarEvalVA\fR.
.PP
However, if \fBTcl_AllowExceptions\fR is invoked immediately before
calling one of those a procedures, then arbitrary completion
+3 -3
View File
@@ -13,7 +13,7 @@ Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData \- manage associations o
.nf
\fB#include <tcl.h>\fR
.sp
void *
ClientData
\fBTcl_GetAssocData\fR(\fIinterp, key, delProcPtr\fR)
.sp
\fBTcl_SetAssocData\fR(\fIinterp, key, delProc, clientData\fR)
@@ -31,7 +31,7 @@ Procedure to call when \fIinterp\fR is deleted.
.AP Tcl_InterpDeleteProc **delProcPtr in
Pointer to location in which to store address of current deletion procedure
for association. Ignored if NULL.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value associated with the given key in this
interpreter. This data is owned by the caller.
.BE
@@ -64,7 +64,7 @@ the type \fBTcl_InterpDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_InterpDeleteProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
+2 -2
View File
@@ -30,7 +30,7 @@ int
.AS Tcl_AsyncHandler clientData
.AP Tcl_AsyncProc *proc in
Procedure to invoke to handle an asynchronous event.
.AP void *clientData in
.AP ClientData clientData in
One-word value to pass to \fIproc\fR.
.AP Tcl_AsyncHandler async in
Token for asynchronous event handler.
@@ -84,7 +84,7 @@ type \fBTcl_AsyncProc\fR:
.PP
.CS
typedef int \fBTcl_AsyncProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIcode\fR);
.CE
+47
View File
@@ -0,0 +1,47 @@
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Backslash \- parse a backslash sequence
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
char
\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
.SH ARGUMENTS
.AS char *countPtr out
.AP char *src in
Pointer to a string starting with a backslash.
.AP int *countPtr out
If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
in with number of characters in the backslash sequence, including
the backslash character.
.BE
.SH DESCRIPTION
.PP
The use of \fBTcl_Backslash\fR is deprecated in favor of
\fBTcl_UtfBackslash\fR.
.PP
This is a utility procedure provided for backwards compatibility with
non-internationalized Tcl extensions. It parses a backslash sequence and
returns the low byte of the Unicode character corresponding to the sequence.
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
characters in the backslash sequence.
.PP
See the Tcl manual entry for information on the valid backslash sequences.
All of the sequences described in the Tcl manual entry are supported by
\fBTcl_Backslash\fR.
.SH "SEE ALSO"
Tcl(n), Tcl_UtfBackslash(3)
.SH KEYWORDS
backslash, parse
+2 -2
View File
@@ -29,8 +29,8 @@ unsigned char *
.AP "const unsigned char" *bytes in
The array of bytes used to initialize or set a byte-array value. May be NULL
even if \fIlength\fR is non-zero.
.AP size_t length in
The length of the array of bytes.
.AP int length in
The length of the array of bytes. It must be >= 0.
.AP Tcl_Obj *objPtr in/out
For \fBTcl_SetByteArrayObj\fR, this points to the value to be converted to
byte-array type. For \fBTcl_GetByteArrayFromObj\fR and
+2 -2
View File
@@ -23,7 +23,7 @@ Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interp
Interpreter with which to associated callback.
.AP Tcl_InterpDeleteProc *proc in
Procedure to call when \fIinterp\fR is deleted.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -38,7 +38,7 @@ type \fBTcl_InterpDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_InterpDeleteProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
+1 -1
View File
@@ -30,7 +30,7 @@ ORed combination of flag bits that specify additional options.
For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently
supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and
\fBTCL_CANCEL_UNWIND\fR are currently supported.
.AP void *clientData in
.AP ClientData clientData in
Currently reserved for future use.
It should be set to NULL.
.BE
+1 -1
View File
@@ -32,7 +32,7 @@ Tcl_Channel
Interpreter for error reporting.
.AP "const Tcl_ChannelType" *typePtr in
The new channel I/O procedures to use for \fIchannel\fR.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to channel I/O procedures.
.AP int mask in
Conditions under which \fIchannel\fR will be used: OR-ed combination of
+7 -7
View File
@@ -41,12 +41,12 @@ Tcl_Object
int
\fBTcl_ObjectDeleted\fR(\fIobject\fR)
.sp
void *
ClientData
\fBTcl_ObjectGetMetadata\fR(\fIobject, metaTypePtr\fR)
.sp
\fBTcl_ObjectSetMetadata\fR(\fIobject, metaTypePtr, metadata\fR)
.sp
void *
ClientData
\fBTcl_ClassGetMetadata\fR(\fIclass, metaTypePtr\fR)
.sp
\fBTcl_ClassSetMetadata\fR(\fIclass, metaTypePtr, metadata\fR)
@@ -56,7 +56,7 @@ Tcl_ObjectMapMethodNameProc
.sp
\fBTcl_ObjectSetMethodNameMapper\fR(\fIobject\fR, \fImethodNameMapper\fR)
.SH ARGUMENTS
.AS void *metadata in/out
.AS ClientData metadata in/out
.AP Tcl_Interp *interp in/out
Interpreter providing the context for looking up or creating an object, and
into whose result error messages will be written on failure.
@@ -83,7 +83,7 @@ are not arguments to any constructors.
.AP Tcl_ObjectMetadataType *metaTypePtr in
The type of \fImetadata\fR being set with \fBTcl_ClassSetMetadata\fR or
retrieved with \fBTcl_ClassGetMetadata\fR.
.AP void *metadata in
.AP ClientData metadata in
An item of metadata to attach to the class, or NULL to remove the metadata
associated with a particular \fImetaTypePtr\fR.
.AP "Tcl_ObjectMapMethodNameProc" "methodNameMapper" in
@@ -171,7 +171,7 @@ a class or object.
.PP
.CS
typedef void \fBTcl_ObjectMetadataDeleteProc\fR(
void *\fImetadata\fR);
ClientData \fImetadata\fR);
.CE
.PP
The \fImetadata\fR argument gives the address of the metadata to be
@@ -184,8 +184,8 @@ associated with a class or object.
.CS
typedef int \fBTcl_CloneProc\fR(
Tcl_Interp *\fIinterp\fR,
void *\fIsrcMetadata\fR,
void **\fIdstMetadataPtr\fR);
ClientData \fIsrcMetadata\fR,
ClientData *\fIdstMetadataPtr\fR);
.CE
.PP
The \fIinterp\fR argument gives a place to write an error message when the
+19 -19
View File
@@ -17,7 +17,7 @@ Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChanne
Tcl_Channel
\fBTcl_CreateChannel\fR(\fItypePtr, channelName, instanceData, mask\fR)
.sp
void *
ClientData
\fBTcl_GetChannelInstanceData\fR(\fIchannel\fR)
.sp
const Tcl_ChannelType *
@@ -128,7 +128,7 @@ by any other channel. Can be NULL, in which case the channel is
created without a name. If the created channel is assigned to one
of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR),
the assigned channel name will be the name of the standard channel.
.AP void *instanceData in
.AP ClientData instanceData in
Arbitrary one-word value to be associated with this channel. This
value is passed to procedures in \fItypePtr\fR when they are invoked.
.AP int mask in
@@ -139,7 +139,7 @@ The channel to operate on.
.AP int direction in
\fBTCL_READABLE\fR means the input handle is wanted; \fBTCL_WRITABLE\fR
means the output handle is wanted.
.AP void **handlePtr out
.AP ClientData *handlePtr out
Points to the location where the desired OS-specific handle should be
stored.
.AP int size in
@@ -399,7 +399,7 @@ the generic layer to set blocking and nonblocking mode on the device.
.PP
.CS
typedef int \fBTcl_DriverBlockModeProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
int \fImode\fR);
.CE
.PP
@@ -434,7 +434,7 @@ closed. \fICloseProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverCloseProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
@@ -456,7 +456,7 @@ following prototype:
.PP
.CS
typedef int \fBTcl_DriverClose2Proc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIflags\fR);
.CE
@@ -487,7 +487,7 @@ internal buffer. \fIInputProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverInputProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
char *\fIbuf\fR,
int \fIbufSize\fR,
int *\fIerrorCodePtr\fR);
@@ -531,7 +531,7 @@ generic layer to transfer data from an internal buffer to the output device.
.PP
.CS
typedef int \fBTcl_DriverOutputProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
const char *\fIbuf\fR,
int \fItoWrite\fR,
int *\fIerrorCodePtr\fR);
@@ -570,7 +570,7 @@ prototype:
.PP
.CS
typedef int \fBTcl_DriverSeekProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
long \fIoffset\fR,
int \fIseekMode\fR,
int *\fIerrorCodePtr\fR);
@@ -600,7 +600,7 @@ following prototype:
.PP
.CS
typedef Tcl_WideInt \fBTcl_DriverWideSeekProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
Tcl_WideInt \fIoffset\fR,
int \fIseekMode\fR,
int *\fIerrorCodePtr\fR);
@@ -622,7 +622,7 @@ the generic layer to set a channel type specific option on a channel.
.PP
.CS
typedef int \fBTcl_DriverSetOptionProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoptionName\fR,
const char *\fInewValue\fR);
@@ -663,7 +663,7 @@ channel. \fIgetOptionProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverGetOptionProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoptionName\fR,
Tcl_DString *\fIoptionValue\fR);
@@ -701,7 +701,7 @@ notice events of interest on this channel.
.PP
.CS
typedef void \fBTcl_DriverWatchProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
int \fImask\fR);
.CE
.PP
@@ -732,9 +732,9 @@ the generic layer to retrieve a device-specific handle from the channel.
.PP
.CS
typedef int \fBTcl_DriverGetHandleProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
int \fIdirection\fR,
void **\fIhandlePtr\fR);
ClientData *\fIhandlePtr\fR);
.CE
.PP
\fIInstanceData\fR is the same as the value passed to
@@ -761,7 +761,7 @@ It should be set to NULL.
.PP
.CS
typedef int \fBTcl_DriverFlushProc\fR(
void *\fIinstanceData\fR);
ClientData \fIinstanceData\fR);
.CE
.PP
This value can be retrieved with \fBTcl_ChannelFlushProc\fR, which returns
@@ -776,7 +776,7 @@ that occur on the underlying (stacked) channel.
.PP
.CS
typedef int \fBTcl_DriverHandlerProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
int \fIinterestMask\fR);
.CE
.PP
@@ -805,7 +805,7 @@ might be maintaining using the calling thread as the associate. See
.PP
.CS
typedef void \fBTcl_DriverThreadActionProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
int \fIaction\fR);
.CE
.PP
@@ -822,7 +822,7 @@ length. It can be NULL.
.PP
.CS
typedef int \fBTcl_DriverTruncateProc\fR(
void *\fIinstanceData\fR,
ClientData \fIinstanceData\fR,
Tcl_WideInt \fIlength\fR);
.CE
.PP
+2 -2
View File
@@ -32,7 +32,7 @@ a zero value to temporarily disable an existing handler.
.AP Tcl_FileProc *proc in
Procedure to invoke whenever the channel indicated by \fIchannel\fR meets
the conditions specified by \fImask\fR.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -48,7 +48,7 @@ what it means for a channel to be readable or writable.
.PP
.CS
typedef void \fBTcl_ChannelProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
int \fImask\fR);
.CE
.PP
+2 -2
View File
@@ -26,7 +26,7 @@ void
The channel for which to create or delete a close callback.
.AP Tcl_CloseProc *proc in
The procedure to call as the callback.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -38,7 +38,7 @@ Arbitrary one-word value to pass to \fIproc\fR.
.PP
.CS
typedef void \fBTcl_CloseProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR is the same as the value provided in the call to
+3 -3
View File
@@ -25,7 +25,7 @@ Name of command.
.AP Tcl_CmdProc *proc in
Implementation of new command: \fIproc\fR will be called whenever
\fIcmdName\fR is invoked as a command.
.AP voie *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
@@ -75,7 +75,7 @@ and it returns NULL.
.PP
.CS
typedef int \fBTcl_CmdProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIargc\fR,
const char *\fIargv\fR[]);
@@ -131,7 +131,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_CmdDeleteProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
+2 -2
View File
@@ -29,7 +29,7 @@ a handler.
.AP Tcl_FileProc *proc in
Procedure to invoke whenever the file or device indicated
by \fIfile\fR meets the conditions specified by \fImask\fR.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -51,7 +51,7 @@ type \fBTcl_FileProc\fR:
.PP
.CS
typedef void \fBTcl_FileProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
int \fImask\fR);
.CE
.PP
+162
View File
@@ -0,0 +1,162 @@
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CreateMathFunc, Tcl_GetMathFuncInfo, Tcl_ListMathFuncs \- Define, query and enumerate math functions for expressions
.SH "NOTICE OF EVENTUAL DEPRECATION"
.PP
The \fBTcl_CreateMathFunc\fR and \fBTcl_GetMathFuncInfo\fR functions
are rendered somewhat obsolete by the ability to create functions for
expressions by placing commands in the \fBtcl::mathfunc\fR namespace,
as described in the \fBmathfunc\fR manual page; the API described on
this page is not expected to be maintained indefinitely.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
void
\fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR)
.sp
int
\fBTcl_GetMathFuncInfo\fR(\fIinterp, name, numArgsPtr, argTypesPtr, procPtr,
clientDataPtr\fR)
.sp
Tcl_Obj *
\fBTcl_ListMathFuncs\fR(\fIinterp, pattern\fR)
.SH ARGUMENTS
.AS Tcl_ValueType *clientDataPtr out
.AP Tcl_Interp *interp in
Interpreter in which new function will be defined.
.AP "const char" *name in
Name for new function.
.AP int numArgs in
Number of arguments to new function; also gives size of \fIargTypes\fR array.
.AP Tcl_ValueType *argTypes in
Points to an array giving the permissible types for each argument to
function.
.AP Tcl_MathProc *proc in
Procedure that implements the function.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR when it is invoked.
.AP int *numArgsPtr out
Points to a variable that will be set to contain the number of
arguments to the function.
.AP Tcl_ValueType **argTypesPtr out
Points to a variable that will be set to contain a pointer to an array
giving the permissible types for each argument to the function which
will need to be freed up using \fITcl_Free\fR.
.AP Tcl_MathProc **procPtr out
Points to a variable that will be set to contain a pointer to the
implementation code for the function (or NULL if the function is
implemented directly in bytecode).
.AP ClientData *clientDataPtr out
Points to a variable that will be set to contain the clientData
argument passed to \fITcl_CreateMathFunc\fR when the function was
created if the function is not implemented directly in bytecode.
.AP "const char" *pattern in
Pattern to match against function names so as to filter them (by
passing to \fITcl_StringMatch\fR), or NULL to not apply any filter.
.BE
.SH DESCRIPTION
.PP
Tcl allows a number of mathematical functions to be used in
expressions, such as \fBsin\fR, \fBcos\fR, and \fBhypot\fR.
These functions are represented by commands in the namespace,
\fBtcl::mathfunc\fR. The \fBTcl_CreateMathFunc\fR function is
an obsolete way for applications to add additional functions
to those already provided by Tcl or to replace existing functions.
It should not be used by new applications, which should create
math functions using \fBTcl_CreateObjCommand\fR to create a command
in the \fBtcl::mathfunc\fR namespace.
.PP
In the \fBTcl_CreateMathFunc\fR interface,
\fIName\fR is the name of the function as it will appear in expressions.
If \fIname\fR does not already exist in the \fB::tcl::mathfunc\fR
namespace, then a new command is created in that namespace.
If \fIname\fR does exist, then the existing function is replaced.
\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function.
Each entry in the \fIargTypes\fR array must be
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR, \fBTCL_WIDE_INT\fR,
or \fBTCL_EITHER\fR to indicate whether the corresponding argument must be an
integer, a double-precision floating value, a wide (64-bit) integer,
or any, respectively.
.PP
Whenever the function is invoked in an expression Tcl will invoke
\fIproc\fR. \fIProc\fR should have arguments and result that match
the type \fBTcl_MathProc\fR:
.PP
.CS
typedef int \fBTcl_MathProc\fR(
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
Tcl_Value *\fIargs\fR,
Tcl_Value *\fIresultPtr\fR);
.CE
.PP
When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR
arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR.
\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures,
which describe the actual arguments to the function:
.PP
.CS
typedef struct Tcl_Value {
Tcl_ValueType \fItype\fR;
long \fIintValue\fR;
double \fIdoubleValue\fR;
Tcl_WideInt \fIwideValue\fR;
} \fBTcl_Value\fR;
.CE
.PP
The \fItype\fR field indicates the type of the argument and is
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR.
It will match the \fIargTypes\fR value specified for the function unless
the \fIargTypes\fR value was \fBTCL_EITHER\fR. Tcl converts
the argument supplied in the expression to the type requested in
\fIargTypes\fR, if that is necessary.
Depending on the value of the \fItype\fR field, the \fIintValue\fR,
\fIdoubleValue\fR or \fIwideValue\fR
field will contain the actual value of the argument.
.PP
\fIProc\fR should compute its result and store it either as an integer
in \fIresultPtr->intValue\fR or as a floating value in
\fIresultPtr->doubleValue\fR.
It should set also \fIresultPtr->type\fR to one of
\fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR
to indicate which value was set.
Under normal circumstances \fIproc\fR should return \fBTCL_OK\fR.
If an error occurs while executing the function, \fIproc\fR should
return \fBTCL_ERROR\fR and leave an error message in the interpreter's result.
.PP
\fBTcl_GetMathFuncInfo\fR retrieves the values associated with
function \fIname\fR that were passed to a preceding
\fBTcl_CreateMathFunc\fR call. Normally, the return code is
\fBTCL_OK\fR but if the named function does not exist, \fBTCL_ERROR\fR
is returned and an error message is placed in the interpreter's
result.
.PP
If an error did not occur, the array reference placed in the variable
pointed to by \fIargTypesPtr\fR is newly allocated, and should be
released by passing it to \fBTcl_Free\fR. Some functions (the
standard set implemented in the core, and those defined by placing
commands in the \fBtcl::mathfunc\fR namespace) do not have
argument type information; attempting to retrieve values for
them causes a NULL to be stored in the variable pointed to by
\fIprocPtr\fR and the variable pointed to by \fIclientDataPtr\fR
will not be modified. The variable pointed to by \fInumArgsPointer\fR
will contain -1, and no argument types will be stored in the variable
pointed to by \fIargTypesPointer\fR.
.PP
\fBTcl_ListMathFuncs\fR returns a Tcl value containing a list of all
the math functions defined in the interpreter whose name matches
\fIpattern\fR. The returned value has a reference count of zero.
.SH "SEE ALSO"
expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
.SH KEYWORDS
expression, mathematical function
+11 -11
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
@@ -59,7 +59,7 @@ Name of command.
.AP Tcl_ObjCmdProc *proc in
Implementation of the new command: \fIproc\fR will be called whenever
\fIcmdName\fR is invoked as a command.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
@@ -102,7 +102,7 @@ and it returns NULL.
.PP
.CS
typedef int \fBTcl_ObjCmdProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]);
@@ -175,7 +175,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_CmdDeleteProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
@@ -217,11 +217,11 @@ A \fBTcl_CmdInfo\fR structure has the following fields:
typedef struct Tcl_CmdInfo {
int \fIisNativeObjectProc\fR;
Tcl_ObjCmdProc *\fIobjProc\fR;
void *\fIobjClientData\fR;
ClientData \fIobjClientData\fR;
Tcl_CmdProc *\fIproc\fR;
void *\fIclientData\fR;
ClientData \fIclientData\fR;
Tcl_CmdDeleteProc *\fIdeleteProc\fR;
void *\fIdeleteData\fR;
ClientData \fIdeleteData\fR;
Tcl_Namespace *\fInamespacePtr\fR;
} \fBTcl_CmdInfo\fR;
.CE
@@ -247,7 +247,7 @@ otherwise, this is a compatibility procedure
registered by \fBTcl_CreateObjCommand\fR
that simply calls the command's
value-based procedure after converting its string arguments to Tcl values.
The field \fIdeleteData\fR is the clientData value
The field \fIdeleteData\fR is the ClientData value
to pass to \fIdeleteProc\fR; it is normally the same as
\fIclientData\fR but may be set independently using the
\fBTcl_SetCommandInfo\fR procedure.
@@ -261,7 +261,7 @@ from \fBTcl_CreateObjCommand\fR in place of the command name. If the
and fills in the structure designated by \fIinfoPtr\fR.
.PP
\fBTcl_SetCommandInfo\fR is used to modify the procedures and
clientData values associated with a command.
ClientData values associated with a command.
Its \fIcmdName\fR argument is the name of a command in \fIinterp\fR.
\fIcmdName\fR may include \fB::\fR namespace qualifiers
to identify a command in a particular namespace.
@@ -277,9 +277,9 @@ copies the information from \fI*infoPtr\fR to Tcl's internal structure
for the command and returns 1.
.PP
Note that \fBTcl_SetCommandInfo\fR and
\fBTcl_SetCommandInfoFromToken\fR both allow the clientData for a
\fBTcl_SetCommandInfoFromToken\fR both allow the ClientData for a
command's deletion procedure to be given a different value than the
clientData for its command procedure.
ClientData for its command procedure.
.PP
Note that neither \fBTcl_SetCommandInfo\fR nor
\fBTcl_SetCommandInfoFromToken\fR will change a command's namespace.
+2 -2
View File
@@ -24,7 +24,7 @@ Tcl_TimerToken
How many milliseconds to wait before invoking \fIproc\fR.
.AP Tcl_TimerProc *proc in
Procedure to invoke after \fImilliseconds\fR have elapsed.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP Tcl_TimerToken token in
Token for previously created timer handler (the return value
@@ -51,7 +51,7 @@ the type \fBTcl_TimerProc\fR:
.PP
.CS
typedef void \fBTcl_TimerProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a
+6 -6
View File
@@ -41,7 +41,7 @@ details of the calling sequence.
.AP Tcl_CmdTraceProc *proc in
Procedure to call for each command that is executed. See below for
details on the calling sequence.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIobjProc\fR or \fIproc\fR.
.AP Tcl_CmdObjTraceDeleteProc *deleteProc in
Procedure to call when the trace is deleted. See below for details of
@@ -66,7 +66,7 @@ interpreter.
.PP
.CS
typedef int \fBTcl_CmdObjTraceProc\fR(
\fBvoid *\fR \fIclientData\fR,
\fBClientData\fR \fIclientData\fR,
\fBTcl_Interp\fR* \fIinterp\fR,
int \fIlevel\fR,
const char *\fIcommand\fR,
@@ -77,7 +77,7 @@ typedef int \fBTcl_CmdObjTraceProc\fR(
.PP
The \fIclientData\fR and \fIinterp\fR parameters are copies of the
corresponding arguments given to \fBTcl_CreateTrace\fR.
\fIclientData\fR typically points to an application-specific data
\fIClientData\fR typically points to an application-specific data
structure that describes what to do when \fIobjProc\fR is invoked. The
\fIlevel\fR parameter gives the nesting level of the command (1 for
top-level commands passed to \fBTcl_Eval\fR by the application, 2 for
@@ -144,7 +144,7 @@ When \fBTcl_DeleteTrace\fR is called, the interpreter invokes the
.PP
.CS
typedef void \fBTcl_CmdObjTraceDeleteProc\fR(
\fBvoid *\fR \fIclientData\fR);
\fBClientData\fR \fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter will be the same as the
@@ -160,12 +160,12 @@ match the type \fBTcl_CmdTraceProc\fR:
.PP
.CS
typedef void \fBTcl_CmdTraceProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIlevel\fR,
char *\fIcommand\fR,
Tcl_CmdProc *\fIcmdProc\fR,
void *\fIcmdClientData\fR,
ClientData \fIcmdClientData\fR,
int \fIargc\fR,
const char *\fIargv\fR[]);
.CE
+11 -5
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringTrunc, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -26,7 +26,7 @@ char *
.sp
\fBTcl_DStringEndSublist\fR(\fIdsPtr\fR)
.sp
size_t
int
\fBTcl_DStringLength\fR(\fIdsPtr\fR)
.sp
char *
@@ -34,6 +34,8 @@ char *
.sp
\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR)
.sp
\fBTcl_DStringTrunc\fR(\fIdsPtr, newLength\fR)
.sp
\fBTcl_DStringFree\fR(\fIdsPtr\fR)
.sp
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
@@ -47,10 +49,10 @@ Pointer to structure that is used to manage a dynamic string.
Pointer to characters to append to dynamic string.
.AP "const char" *element in
Pointer to characters to append as list element to dynamic string.
.AP size_t length in
Number of bytes from \fIbytes\fR to add to dynamic string. If (size_t)-1,
.AP int length in
Number of bytes from \fIbytes\fR to add to dynamic string. If -1,
add all characters up to null terminating character.
.AP size_t newLength in
.AP int newLength in
New length for dynamic string, not including null terminating
character.
.AP Tcl_Interp *interp in/out
@@ -126,6 +128,10 @@ caller to fill in the new space.
even if the string is truncated to zero length, so \fBTcl_DStringFree\fR
will still need to be called.
.PP
\fBTcl_DStringTrunc\fR changes the length of a dynamic string.
This procedure is now deprecated. \fBTcl_DStringSetLength\fR should
be used instead.
.PP
\fBTcl_DStringFree\fR should be called when you are finished using
the string. It frees up any memory that was allocated for the string
and reinitializes the string's value to an empty string.
+2 -2
View File
@@ -21,7 +21,7 @@ Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pendi
.AS Tcl_IdleProc clientData
.AP Tcl_IdleProc *proc in
Procedure to invoke.
.AP coid *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -43,7 +43,7 @@ type \fBTcl_IdleProc\fR:
.PP
.CS
typedef void \fBTcl_IdleProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
+3 -3
View File
@@ -43,7 +43,7 @@ is not defined, these functions are all no-ops.
\fBTcl_DumpActiveMemory\fR will output a list of all currently
allocated memory to the specified file. The information output for
each allocated block of memory is: starting and ending addresses
(excluding guard zone), size, source file where \fBTcl_Alloc\fR was
(excluding guard zone), size, source file where \fBckalloc\fR was
called to allocate the block and line number in that file. It is
especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
interpreter has been deleted.
@@ -55,8 +55,8 @@ by \fBTcl_Main\fR.
\fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
all currently allocated blocks of memory. Normally validation of a
block occurs when its freed, unless full validation is enabled, in
which case validation of all blocks occurs when \fBTcl_Alloc\fR and
\fBTcl_Free\fR are called. This function forces the validation to occur
which case validation of all blocks occurs when \fBckalloc\fR and
\fBckfree\fR are called. This function forces the validation to occur
at any point.
.SH "SEE ALSO"
+21 -6
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_WinTCharToUtf, Tcl_WinUtfToTChar, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath \- procedures for creating and using encodings
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_WinTCharToUtf, Tcl_WinUtfToTChar, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath, Tcl_GetDefaultEncodingDir, Tcl_SetDefaultEncodingDir \- procedures for creating and using encodings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -62,6 +62,12 @@ Tcl_Obj *
.sp
int
\fBTcl_SetEncodingSearchPath\fR(\fIsearchPath\fR)
.sp
const char *
\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR)
.sp
void
\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
.SH ARGUMENTS
.AS "const Tcl_EncodingType" *dstWrotePtr in/out
.AP Tcl_Interp *interp in
@@ -83,7 +89,7 @@ specified encoding that are to be converted to UTF-8. For the
UTF-8 characters to be converted to the specified encoding.
.AP "const TCHAR" *tsrc in
An array of Windows TCHAR characters to convert to UTF-8.
.AP size_t srcLen in
.AP int srcLen in
Length of \fIsrc\fR or \fItsrc\fR in bytes. If the length is negative, the
encoding-specific length of the string is used.
.AP Tcl_DString *dstPtr out
@@ -281,7 +287,7 @@ the encoding name to it. The \fBTcl_DStringValue\fR is returned.
\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list
consisting of the names of all the encodings that are currently defined
or can be dynamically loaded, searching the encoding path specified by
\fBTcl_SetEncodingSearchPath\fR. This procedure does not ensure that the
\fBTcl_SetDefaultEncodingDir\fR. This procedure does not ensure that the
dynamically-loadable encoding files contain valid data, but merely that they
exist.
.PP
@@ -308,7 +314,7 @@ typedef struct Tcl_EncodingType {
Tcl_EncodingConvertProc *\fItoUtfProc\fR;
Tcl_EncodingConvertProc *\fIfromUtfProc\fR;
Tcl_EncodingFreeProc *\fIfreeProc\fR;
void *\fIclientData\fR;
ClientData \fIclientData\fR;
int \fInullSize\fR;
} \fBTcl_EncodingType\fR;
.CE
@@ -339,7 +345,7 @@ type \fBTcl_EncodingConvertProc\fR:
.PP
.CS
typedef int \fBTcl_EncodingConvertProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
const char *\fIsrc\fR,
int \fIsrcLen\fR,
int \fIflags\fR,
@@ -371,7 +377,7 @@ The callback procedure \fIfreeProc\fR, if non-NULL, should match the type
.PP
.CS
typedef void \fBTcl_EncodingFreeProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
This \fIfreeProc\fR function is called when the encoding is deleted. The
@@ -396,6 +402,15 @@ are not verified as existing readable filesystem directories. When
searching for encoding data files takes place, and non-existent or
non-readable filesystem directories on the \fIsearchPath\fR are silently
ignored.
.PP
\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR
are obsolete interfaces best replaced with calls to
\fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR.
They are called to access and set the first element of the \fIsearchPath\fR
list. Since Tcl searches \fIsearchPath\fR for encoding data files in
list order, these routines establish the
.QW default
directory in which to find encoding data files.
.SH "ENCODING FILES"
Space would prohibit precompiling into Tcl every possible encoding
algorithm, so many encodings are stored on disk as dynamically-loadable
+19 -3
View File
@@ -10,7 +10,7 @@
.so man.macros
.BS
.SH NAME
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval \- execute Tcl scripts
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -38,6 +38,9 @@ int
.sp
int
\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fB(char *) NULL\fR)
.sp
int
\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
.SH ARGUMENTS
.AS Tcl_Interp **termPtr
.AP Tcl_Interp *interp in
@@ -64,6 +67,9 @@ first null byte are used.
Points to first byte of script to execute (null-terminated and UTF-8).
.AP char *part in
String forming part of a Tcl script.
.AP va_list argList in
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.BE
.SH DESCRIPTION
@@ -122,10 +128,16 @@ might be a UTF-8 special code. The string is parsed and executed directly
bytecodes. In situations where it is known that the script will never be
executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR.
\fBTcl_Eval\fR returns a completion code and result just like
\fBTcl_EvalObjEx\fR.
\fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before
Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to
\fIinterp->result\fR (use is deprecated) where it can be accessed directly.
This makes \fBTcl_Eval\fR somewhat slower than \fBTcl_EvalEx\fR, which
does not do the copy.
.PP
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
additional arguments \fInumBytes\fR and \fIflags\fR.
additional arguments \fInumBytes\fR and \fIflags\fR. For the
efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
over \fBTcl_Eval\fR.
.PP
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
@@ -141,6 +153,10 @@ It returns the result of the command and also modifies
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
of arguments. \fBTcl_VarEval\fR is now deprecated.
.PP
\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
instead of taking a variable number of arguments it takes an argument
list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated.
.SH "FLAG BITS"
.PP
+7 -4
View File
@@ -42,7 +42,7 @@ usually means that an error occurred.
Procedure to invoke before exiting application, or (for
\fBTcl_SetExitProc\fR) NULL to uninstall the current application exit
procedure.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
@@ -64,7 +64,7 @@ otherwise causes the application to terminate without calling
returns control to its caller.
If an application exit handler has been installed (see
\fBTcl_SetExitProc\fR), that handler is invoked with an argument
consisting of the exit status (cast to void *); the application
consisting of the exit status (cast to ClientData); the application
exit handler should not return control to Tcl.
.PP
\fBTcl_Finalize\fR is similar to \fBTcl_Exit\fR except that it does not
@@ -93,7 +93,7 @@ and freeing global memory.
.PP
.CS
typedef void \fBTcl_ExitProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a
@@ -133,7 +133,10 @@ installed, that exit handler takes over complete responsibility for
finalization of Tcl's subsystems via \fBTcl_Finalize\fR at an
appropriate time. The argument passed to \fIproc\fR when it is
invoked will be the exit status code (as passed to \fBTcl_Exit\fR)
cast to a void *value.
cast to a ClientData value.
.PP
\fBTcl_SetExitProc\fR can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.SH "SEE ALSO"
exit(n)
.SH KEYWORDS
+13 -13
View File
@@ -20,7 +20,7 @@ int
int
\fBTcl_FSUnregister\fR(\fIfsPtr\fR)
.sp
void *
ClientData
\fBTcl_FSData\fR(\fIfsPtr\fR)
.sp
void
@@ -125,7 +125,7 @@ Tcl_Obj *
int
\fBTcl_FSConvertToPathType\fR(\fIinterp, pathPtr\fR)
.sp
void *
ClientData
\fBTcl_FSGetInternalRep\fR(\fIpathPtr, fsPtr\fR)
.sp
Tcl_Obj *
@@ -212,7 +212,7 @@ this structure will be returned. This parameter may be NULL.
.AP Tcl_Interp *interp in
Interpreter to use either for results, evaluation, or reporting error
messages.
.AP void *clientData in
.AP ClientData clientData in
The native description of the path value to create.
.AP Tcl_Obj *firstPtr in
The first of two path values to compare. The value may be converted
@@ -249,7 +249,7 @@ Name of a procedure to look up in the file's symbol table
Filled with the init function for this code.
.AP Tcl_PackageInitProc **proc2Ptr out
Filled with the safe-init function for this code.
.AP void **clientDataPtr out
.AP ClientData *clientDataPtr out
Filled with the clientData value to pass to this code's unload
function when it is called.
.AP Tcl_LoadHandle *loadHandlePtr out
@@ -724,7 +724,7 @@ better functions to use for most purposes.
\fBTcl_FSGetTranslatedStringPath\fR does the same as
\fBTcl_FSGetTranslatedPath\fR, but returns a character string or NULL.
The string returned is dynamically allocated and owned by the caller,
which must store it or call \fBTcl_Free\fR to ensure it is freed. Again,
which must store it or call \fBckfree\fR to ensure it is freed. Again,
\fBTcl_FSGetNormalizedPath\fR or \fBTcl_FSGetNativePath\fR are usually
better functions to use for most purposes.
.PP
@@ -791,7 +791,7 @@ It returns one of \fBTCL_PATH_ABSOLUTE\fR, \fBTCL_PATH_RELATIVE\fR, or
.SS "PORTABLE STAT RESULT API"
.PP
\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system heap (which
may be deallocated by being passed to \fBTcl_Free\fR). This allows extensions to
may be deallocated by being passed to \fBckfree\fR). This allows extensions to
invoke \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR without being dependent on the
size of the buffer. That in turn depends on the flags used to build Tcl.
.PP
@@ -841,7 +841,7 @@ general that is not a good thing to do). \fBTCL_OK\fR will be returned.
the list of known filesystems, if it is known, and returns \fBTCL_OK\fR. If
the filesystem is not currently registered, \fBTCL_ERROR\fR is returned.
.PP
\fBTcl_FSData\fR will return the clientData associated with the given
\fBTcl_FSData\fR will return the ClientData associated with the given
filesystem, if that filesystem is registered. Otherwise it will
return NULL.
.PP
@@ -1018,7 +1018,7 @@ Tcl's internal list of known filesystems.
.CS
typedef int \fBTcl_FSPathInFilesystemProc\fR(
Tcl_Obj *\fIpathPtr\fR,
void **\fIclientDataPtr\fR);
ClientData *\fIclientDataPtr\fR);
.CE
.SS DUPINTERNALREPPROC
.PP
@@ -1028,8 +1028,8 @@ simply not copy the internal representation, which may then need to be
regenerated later.
.PP
.CS
typedef void *\fBTcl_FSDupInternalRepProc\fR(
void *\fIclientData\fR);
typedef ClientData \fBTcl_FSDupInternalRepProc\fR(
ClientData \fIclientData\fR);
.CE
.SS FREEINTERNALREPPROC
Free the internal representation. This must be implemented if internal
@@ -1038,7 +1038,7 @@ internal representation is generated), but may otherwise be NULL.
.PP
.CS
typedef void \fBTcl_FSFreeInternalRepProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.SS INTERNALTONORMALIZEDPROC
.PP
@@ -1049,7 +1049,7 @@ representation is the normalized path.
.PP
.CS
typedef Tcl_Obj *\fBTcl_FSInternalToNormalizedProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.SS CREATEINTERNALREPPROC
.PP
@@ -1060,7 +1060,7 @@ the \fITcl_FSPathInFilesystemProc\fR for this filesystem always
immediately creates an internal representation for paths it accepts.
.PP
.CS
typedef void *\fBTcl_FSCreateInternalRepProc\fR(
typedef ClientData \fBTcl_FSCreateInternalRepProc\fR(
Tcl_Obj *\fIpathPtr\fR);
.CE
.SS NORMALIZEPATHPROC
+3 -1
View File
@@ -58,6 +58,8 @@ internal full path name of the executable file as computed by
equivalent to the \fBinfo nameofexecutable\fR command. NULL
is returned if the internal full path name has not been
computed or unknown.
.PP
\fBTcl_FindExecutable\fR can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.SH KEYWORDS
binary, executable file
+5 -2
View File
@@ -64,9 +64,12 @@ if the first such characters are
then \fIsrc\fR is expected to be in octal form; otherwise,
if the first such characters are
.QW \fB0b\fR
then \fIsrc\fR is expected to be in binary form; otherwise,
if the first such character is
.QW \fB0\fR
then \fIsrc\fR
is expected to be in binary form; otherwise, \fIsrc\fR is
expected to be in decimal form.
is expected to be in octal form; otherwise, \fIsrc\fR
is expected to be in decimal form.
.PP
\fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point
number, which is: white space; a sign; a sequence of digits; a
+1 -1
View File
@@ -28,7 +28,7 @@ be used for reading.
.AP int checkUsage in
If non-zero, then an error will be generated if the file was not opened
for the access indicated by \fIwrite\fR.
.AP void **filePtr out
.AP ClientData *filePtr out
Points to word in which to store pointer to FILE structure for
the file given by \fIchanID\fR.
.BE
+4 -4
View File
@@ -27,13 +27,13 @@ Pointer to handler function replacing \fBTcl_GetTime\fR's access to the OS.
.AP Tcl_ScaleTimeProc scaleProc in
Pointer to handler function for the conversion of time delays in the
virtual domain to real-time.
.AP void *clientData in
.AP ClientData clientData in
Value passed through to the two handler functions.
.AP Tcl_GetTimeProc *getProcPtr out
Pointer to place the currently registered get handler function into.
.AP Tcl_ScaleTimeProc *scaleProcPtr out
Pointer to place the currently registered scale handler function into.
.AP void **clientDataPtr out
.AP ClientData *clientDataPtr out
Pointer to place the currently registered pass-through value into.
.BE
.SH DESCRIPTION
@@ -83,10 +83,10 @@ The signatures of the handler functions are as follows:
.CS
typedef void \fBTcl_GetTimeProc\fR(
Tcl_Time *\fItimebuf\fR,
void *\fIclientData\fR);
ClientData \fIclientData\fR);
typedef void \fBTcl_ScaleTimeProc\fR(
Tcl_Time *\fItimebuf\fR,
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fItimebuf\fR fields contain the time to manipulate, and the
+10 -4
View File
@@ -30,7 +30,7 @@ Tcl_HashEntry *
Tcl_HashEntry *
\fBTcl_FindHashEntry\fR(\fItablePtr, key\fR)
.sp
void *
ClientData
\fBTcl_GetHashValue\fR(\fIentryPtr\fR)
.sp
\fBTcl_SetHashValue\fR(\fIentryPtr, value\fR)
@@ -66,8 +66,9 @@ The word at \fI*newPtr\fR is set to 1 if a new entry was created
and 0 if there was already an entry for \fIkey\fR.
.AP Tcl_HashEntry *entryPtr in
Pointer to hash table entry.
.AP void *value in
New value to assign to hash table entry.
.AP ClientData value in
New value to assign to hash table entry. Need not have type
ClientData, but must fit in same space as ClientData.
.AP Tcl_HashSearch *searchPtr in
Pointer to record to use to keep track of progress in enumerating
all the entries in a hash table.
@@ -185,6 +186,11 @@ instead, it returns NULL as result.
.PP
\fBTcl_GetHashValue\fR and \fBTcl_SetHashValue\fR are used to
read and write an entry's value, respectively.
Values are stored and retrieved as type
.QW ClientData ,
which is
large enough to hold a pointer value. On almost all machines this is
large enough to hold an integer value too.
.PP
\fBTcl_GetHashKey\fR returns the key for a given hash table entry,
either as a pointer to a string, a one-word
@@ -223,7 +229,7 @@ overall information about a hash table, such as the number of
entries it contains, the number of buckets in its hash array,
and the utilization of the buckets.
It is the caller's responsibility to free the result string
by passing it to \fBTcl_Free\fR.
by passing it to \fBckfree\fR.
.PP
The header file \fBtcl.h\fR defines the actual data structures
used to implement hash tables.
+3 -3
View File
@@ -63,9 +63,9 @@ Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
.IP 3) 5
Link the extension with the Tcl stubs library instead of the standard
Tcl library. For example, to use the Tcl 9.0 ABI on Unix platforms,
the library name is \fIlibtclstub9.0.a\fR; on Windows platforms, the
library name is \fItclstub90.lib\fR.
Tcl library. For example, to use the Tcl 8.6 ABI on Unix platforms,
the library name is \fIlibtclstub8.6.a\fR; on Windows platforms, the
library name is \fItclstub86.lib\fR.
.PP
If the extension also requires the Tk API, it must also call
\fBTk_InitStubs\fR to initialize the Tk stubs interface and link
+13
View File
@@ -33,6 +33,19 @@ the pointer as described below is no longer supported. The supported
public routines \fBTcl_SetResult\fR, \fBTcl_GetResult\fR,
\fBTcl_SetErrorLine\fR, \fBTcl_GetErrorLine\fR must be used instead.
.PP
For legacy programs and extensions no longer being maintained, compiles
against the Tcl 8.6 header files are only possible with the compiler
directives
.CS
#define USE_INTERP_RESULT
.CE
and/or
.CS
#define USE_INTERP_ERRORLINE
.CE
depending on which fields of the \fBTcl_Interp\fR struct are accessed.
These directives may be embedded in code or supplied via compiler options.
.PP
The \fIresult\fR and \fIfreeProc\fR fields are used to return
results or error messages from commands.
This information is returned by command procedures back to \fBTcl_Eval\fR,
+3 -3
View File
@@ -83,7 +83,7 @@ the handler returns. Many handlers may be attached to the same
interpreter limit; their order of execution is not defined, and they
must be identified by \fIhandlerProc\fR and \fIclientData\fR when they
are deleted.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary pointer-sized word used to pass some context to the
\fIhandlerProc\fR function.
.AP Tcl_LimitHandlerDeleteProc *deleteProc in
@@ -162,7 +162,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_LimitHandlerProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
@@ -179,7 +179,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_LimitHandlerDeleteProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
A limit handler may be deleted using \fBTcl_LimitRemoveHandler\fR; the
+1 -1
View File
@@ -190,7 +190,7 @@ Tcl errors.
\fBTCL_LINK_STRING\fR
The C variable is of type \fBchar *\fR.
If its value is not NULL then it must be a pointer to a string
allocated with \fBTcl_Alloc\fR.
allocated with \fBTcl_Alloc\fR or \fBckalloc\fR.
Whenever the Tcl variable is modified the current C string will be
freed and new memory will be allocated to hold a copy of the variable's
new value.
+7 -7
View File
@@ -61,7 +61,7 @@ Tcl_Object
int
\fBTcl_ObjectContextSkippedArgs\fR(\fIcontext\fR)
.SH ARGUMENTS
.AS void *clientData in
.AS ClientData clientData in
.AP Tcl_Interp *interp in/out
The interpreter holding the object or class to create or update a method in.
.AP Tcl_Object object in
@@ -83,10 +83,10 @@ and \fBTCL_OO_METHOD_PRIVATE\fR for a private method.
.AP Tcl_MethodType *methodTypePtr in
A description of the type of the method to create, or the type of method to
compare against.
.AP void *clientData in
.AP ClientData clientData in
A piece of data that is passed to the implementation of the method without
interpretation.
.AP void **clientDataPtr out
.AP ClientData *clientDataPtr out
A pointer to a variable in which to write the \fIclientData\fR value supplied
when the method was created. If NULL, the \fIclientData\fR value will not be
retrieved.
@@ -213,7 +213,7 @@ Functions matching this signature are called when the method is invoked.
.PP
.CS
typedef int \fBTcl_MethodCallProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
Tcl_ObjectContext \fIobjectContext\fR,
int \fIobjc\fR,
@@ -234,7 +234,7 @@ through a new method being created or because the object or class is deleted.
.PP
.CS
typedef void \fBTcl_MethodDeleteProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument to a Tcl_MethodDeleteProc will be the same as
@@ -248,8 +248,8 @@ class is copied using \fBTcl_CopyObjectInstance\fR (or \fBoo::copy\fR).
.CS
typedef int \fBTcl_CloneProc\fR(
Tcl_Interp *\fIinterp\fR,
void *\fIoldClientData\fR,
void **\fInewClientDataPtr\fR);
ClientData \fIoldClientData\fR,
ClientData *\fInewClientDataPtr\fR);
.CE
.PP
The \fIinterp\fR argument gives a place to write an error message when the
+10 -10
View File
@@ -49,7 +49,7 @@ in the same way as the \fIproc\fR argument to \fBTcl_CreateObjCommand\fR(3)
(\fIq.v.\fR).
.AP Tcl_ObjCmdProc *nreProc in
Called instead of \fIproc\fR when a trampoline is already in use.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value passed to \fIproc\fR, \fInreProc\fR, \fIdeleteProc\fR
and \fIobjProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in/out
@@ -72,10 +72,10 @@ Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
the return code is TCL_OK.
.AP Tcl_NRPostProc *postProcPtr in
A function to push.
.AP void *data0 in
.AP void *data1 in
.AP void *data2 in
.AP void *data3 in
.AP ClientData data0 in
.AP ClientData data1 in
.AP ClientData data2 in
.AP ClientData data3 in
\fIdata0\fR through \fIdata3\fR are four one-word values that will be passed
to the function designated by \fIpostProcPtr\fR when it is invoked.
.BE
@@ -130,7 +130,7 @@ a message as the interpreter's result.
.CS
typedef int
\fBTcl_NRPostProc\fR(
\fBvoid *\fR \fIdata\fR[],
\fBClientData\fR \fIdata\fR[],
\fBTcl_Interp\fR *\fIinterp\fR,
int \fIresult\fR);
.CE
@@ -146,7 +146,7 @@ stack, to evalute a script:
.CS
int
\fITheCmdOldObjProc\fR(
void *clientData,
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -177,7 +177,7 @@ call \fITheCmdNRObjProc\fR:
.CS
int
\fITheCmdOldObjProc\fR(
void *clientData,
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -190,7 +190,7 @@ int
.CS
int
\fITheCmdNRObjProc\fR
void *clientData,
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -211,7 +211,7 @@ int
.CS
int
\fITheCmdNRPostProc\fR(
void *data[],
ClientData data[],
Tcl_Interp *interp,
int result)
{
+2 -2
View File
@@ -57,7 +57,7 @@ The interpreter in which the namespace exists and where name lookups
are performed. Also where error result messages are written.
.AP "const char" *name in
The name of the namespace or command to be created or accessed.
.AP void *clientData in
.AP ClientData clientData in
A context pointer by the creator of the namespace. Not interpreted by
Tcl at all.
.AP Tcl_NamespaceDeleteProc *deleteProc in
@@ -117,7 +117,7 @@ the global namespace.)
.PP
.CS
typedef void \fBTcl_NamespaceDeleteProc\fR(
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
\fBTcl_DeleteNamespace\fR deletes a namespace, calling the
+7 -7
View File
@@ -38,7 +38,7 @@ Tcl_ThreadId
void
\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR)
.sp
void *
ClientData
\fBTcl_InitNotifier\fR()
.sp
void
@@ -78,7 +78,7 @@ Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR.
Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for
events. Checks to see if any events have occurred and, if so,
queues them.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or
\fIdeleteProc\fR.
.AP "const Tcl_Time" *timePtr in
@@ -89,7 +89,7 @@ is NULL, it means there is no maximum wait time: wait forever if
necessary.
.AP Tcl_Event *evPtr in
An event to add to the event queue. The storage for the event must
have been allocated by the caller using \fBTcl_Alloc\fR.
have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR.
.AP Tcl_QueuePosition position in
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
@@ -230,7 +230,7 @@ the event source.
.PP
.CS
typedef void \fBTcl_EventSetupProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
int \fIflags\fR);
.CE
.PP
@@ -308,7 +308,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_EventCheckProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
int \fIflags\fR);
.CE
.PP
@@ -399,7 +399,7 @@ of window events.
When \fIproc\fR returns 1, \fBTcl_ServiceEvent\fR will remove the
event from the event queue and free its storage.
Note that the storage for an event must be allocated by
the event source (using \fBTcl_Alloc\fR)
the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR)
before calling \fBTcl_QueueEvent\fR, but it
will be freed by \fBTcl_ServiceEvent\fR, not by the event source.
.PP
@@ -428,7 +428,7 @@ queue. \fIProc\fR should match the following prototype:
.CS
typedef int \fBTcl_EventDeleteProc\fR(
Tcl_Event *\fIevPtr\fR,
void *\fIclientData\fR);
ClientData \fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
+2 -2
View File
@@ -111,9 +111,9 @@ which is defined as follows.
.PP
.CS
typedef struct Tcl_Obj {
size_t \fIrefCount\fR;
int \fIrefCount\fR;
char *\fIbytes\fR;
size_t \fIlength\fR;
int \fIlength\fR;
const Tcl_ObjType *\fItypePtr\fR;
union {
long \fIlongValue\fR;
+2 -2
View File
@@ -186,8 +186,8 @@ to be treated as conventional null character-terminated C strings.
These restrictions are easily met by using Tcl's internal UTF encoding
for the string representation, same as one would do for other
Tcl routines accepting string values as arguments.
Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR.
Note that \fIupdateStringProc\fRs must allocate
Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR
or \fBckalloc\fR. Note that \fIupdateStringProc\fRs must allocate
enough storage for the string's bytes and the terminating null byte.
.PP
The \fIupdateStringProc\fR for Tcl's built-in double type, for example,
+13 -13
View File
@@ -53,28 +53,28 @@ int
int
\fBTcl_Read\fR(\fIchannel, readBuf, bytesToRead\fR)
.sp
size_t
int
\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR)
.sp
size_t
int
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
.sp
size_t
int
\fBTcl_Ungets\fR(\fIchannel, input, inputLen, addAtEnd\fR)
.sp
size_t
int
\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR)
.sp
size_t
int
\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR)
.sp
size_t
int
\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
.sp
size_t
int
\fBTcl_ReadRaw\fR(\fIchannel, readBuf, bytesToRead\fR)
.sp
size_t
int
\fBTcl_WriteRaw\fR(\fIchannel, byteBuf, bytesToWrite\fR)
.sp
int
@@ -134,7 +134,7 @@ input of the invoking process; likewise for \fBTCL_STDOUT\fR and
redirect stdio handles to override the stdio handles for which
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it
is set, then such redirections cause an error.
.AP void *handle in
.AP ClientData handle in
Operating system specific handle for I/O to a file. For Unix this is a
file descriptor, for Windows it is a HANDLE.
.AP int readOrWrite in
@@ -154,7 +154,7 @@ from a procedure such as \fBTcl_OpenFileChannel\fR.
.AP Tcl_Obj *readObjPtr in/out
A pointer to a Tcl value in which to store the characters read from the
channel.
.AP size_t charsToRead in
.AP int charsToRead in
The number of characters to read from the channel. If the channel's encoding
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
channel.
@@ -163,7 +163,7 @@ If non-zero, data read from the channel will be appended to the value.
Otherwise, the data will replace the existing contents of the value.
.AP char *readBuf out
A buffer in which to store the bytes read from the channel.
.AP size_t bytesToRead in
.AP int bytesToRead in
The number of bytes to read from the channel. The buffer \fIreadBuf\fR must
be large enough to hold this many bytes.
.AP Tcl_Obj *lineObjPtr in/out
@@ -176,7 +176,7 @@ channel. Must have been initialized by the caller. The line read will be
appended to any data already in the dynamic string.
.AP "const char" *input in
The input to add to a channel buffer.
.AP size_t inputLen in
.AP int inputLen in
Length of the input
.AP int addAtEnd in
Flag indicating whether the input should be added to the end or
@@ -187,7 +187,7 @@ A pointer to a Tcl value whose contents will be output to the channel.
A buffer containing the characters to output to the channel.
.AP "const char" *byteBuf in
A buffer containing the bytes to output to the channel.
.AP size_t bytesToWrite in
.AP int bytesToWrite in
The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and
output to the channel.
.AP Tcl_WideInt offset in
+3 -3
View File
@@ -50,12 +50,12 @@ If nonzero, the client socket is connected asynchronously to the server.
.AP "unsigned int" flags in
ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional
informations about the socket being created.
.AP void *sock in
.AP ClientData sock in
Platform-specific handle for client TCP socket.
.AP Tcl_TcpAcceptProc *proc in
Pointer to a procedure to invoke each time a new connection is
accepted via the socket.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -127,7 +127,7 @@ the channel. \fIProc\fR must match the following prototype:
.PP
.CS
typedef void \fBTcl_TcpAcceptProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Channel \fIchannel\fR,
char *\fIhostName\fR,
int \fIport\fR);
+11 -1
View File
@@ -7,7 +7,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_Panic, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -16,6 +16,9 @@ void
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
.sp
void
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
.sp
void
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
void
@@ -88,6 +91,13 @@ the Tcl library, \fBTcl_Panic\fR is a public function and may be called
by any extension or application that wishes to abort the process and
have a panic message displayed the same way that panic messages from Tcl
will be displayed.
.PP
\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
taking a variable number of arguments it takes an argument list. This
function is deprecated and will be removed in Tcl 9.0.
.PP
This function can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.SH "SEE ALSO"
abort(3), printf(3), exec(n), format(n)
.SH KEYWORDS
+6 -6
View File
@@ -31,7 +31,7 @@ The array of arguments to be parsed.
Pointer to a variable that will hold the array of unprocessed arguments.
Should be NULL if no return of unprocessed arguments is required. If
\fIobjcPtr\fR is updated to a non-zero value, the array returned through this
must be deallocated using \fBTcl_Free\fR.
must be deallocated using \fBckfree\fR.
.BE
.SH DESCRIPTION
.PP
@@ -84,7 +84,7 @@ typedef struct {
void *\fIsrcPtr\fR;
void *\fIdstPtr\fR;
const char *\fIhelpStr\fR;
void *\fIclientData\fR;
ClientData \fIclientData\fR;
} \fBTcl_ArgvInfo\fR;
.CE
.PP
@@ -103,8 +103,8 @@ the argument's value. The following values are acceptable values for
\fBTCL_ARGV_CONSTANT\fR
.
The argument does not take any following value argument. If this argument is
present, the int pointed to by the \fIsrcPtr\fR field is copied to the
\fIdstPtr\fR field. The \fIclientData\fR field is ignored.
present, the \fIsrcPtr\fR field (casted to \fIint\fR) is copied to the variable
pointed to by the \fIdstPtr\fR field. The \fIclientData\fR field is ignored.
.TP
\fBTCL_ARGV_END\fR
.
@@ -127,7 +127,7 @@ have the following signature:
.PP
.CS
typedef int (\fBTcl_ArgvFuncProc\fR)(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Obj *\fIobjPtr\fR,
void *\fIdstPtr\fR);
.CE
@@ -149,7 +149,7 @@ function will have the following signature:
.PP
.CS
typedef int (\fBTcl_ArgvGenFuncProc\fR)(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIobjc\fR,
Tcl_Obj *const *\fIobjv\fR,
+21 -7
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokens, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -33,16 +33,20 @@ const char *
.sp
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
.sp
Tcl_Obj *
\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
.sp
int
\fBTcl_EvalTokensStandard\fR(\fIinterp, tokenPtr, numTokens\fR)
.SH ARGUMENTS
.AS Tcl_Interp *usedParsePtr out
.AP Tcl_Interp *interp out
For procedures other than \fBTcl_FreeParse\fR and
\fBTcl_EvalTokensStandard\fR, used only for error reporting;
For procedures other than \fBTcl_FreeParse\fR, \fBTcl_EvalTokens\fR
and \fBTcl_EvalTokensStandard\fR, used only for error reporting;
if NULL, then no error messages are left after errors.
For \fBTcl_EvalTokensStandard\fR, determines the context for evaluating
the script and also is used for error reporting; must not be NULL.
For \fBTcl_EvalTokens\fR and \fBTcl_EvalTokensStandard\fR,
determines the context for evaluating the
script and also is used for error reporting; must not be NULL.
.AP "const char" *start in
Pointer to first character in string to parse.
.AP int numBytes in
@@ -187,6 +191,16 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
some other integer value originating in an extension.
In addition, a result value or error message is left in \fIinterp\fR's
result; it can be retrieved using \fBTcl_GetObjResult\fR.
.PP
\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
the return convention used: it returns the result in a new Tcl_Obj.
The reference count of the value returned as result has been
incremented, so the caller must
invoke \fBTcl_DecrRefCount\fR when it is finished with the value.
If an error or other exception occurs while evaluating the tokens
(such as a reference to a non-existent variable) then the return value
is NULL and an error message is left in \fIinterp\fR's result. The use
of \fBTcl_EvalTokens\fR is deprecated.
.SH "TCL_PARSE STRUCTURE"
.PP
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
@@ -208,8 +222,8 @@ typedef struct Tcl_Parse {
typedef struct Tcl_Token {
int \fItype\fR;
const char *\fIstart\fR;
size_t \fIsize\fR;
size_t \fInumComponents\fR;
int \fIsize\fR;
int \fInumComponents\fR;
} \fBTcl_Token\fR;
.CE
.PP
+2 -2
View File
@@ -21,7 +21,7 @@ Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it
\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR)
.SH ARGUMENTS
.AS Tcl_FreeProc clientData
.AP void *clientData in
.AP ClientData clientData in
Token describing structure to be freed or reallocated. Usually a pointer
to memory for structure.
.AP Tcl_FreeProc *freeProc in
@@ -91,7 +91,7 @@ reasons, but the value is the same.
.PP
When the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR
refers to storage allocated and returned by a prior call to
\fBTcl_Alloc\fR or another function of the Tcl library,
\fBTcl_Alloc\fR, \fBckalloc\fR, or another function of the Tcl library,
then the \fIfreeProc\fR argument should be given the special value of
\fBTCL_DYNAMIC\fR.
.PP
+7 -2
View File
@@ -18,7 +18,10 @@ Tcl_PrintDouble \- Convert floating value to string
.SH ARGUMENTS
.AS Tcl_Interp *interp out
.AP Tcl_Interp *interp in
This argument is ignored.
Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
controlled the conversion. As of Tcl 8.0, this argument is ignored and
the conversion is controlled by the \fBtcl_precision\fR variable
that is now shared by all interpreters.
.AP double value in
Floating-point value to be converted.
.AP char *dst out
@@ -38,7 +41,9 @@ so that it does not look like an integer. Where \fB%g\fR would
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
.QW .0 .
.PP
The result will have the fewest digits needed to
If the \fBtcl_precision\fR value is non-zero, the result will have
precisely that many digits of significance. If the value is zero
(the default), the result will have the fewest digits needed to
represent the number in such a way that \fBTcl_NewDoubleObj\fR
will generate the same number when presented with the given string.
IEEE semantics of rounding to even apply to the conversion.
+1 -1
View File
@@ -31,7 +31,7 @@ the command at global level instead of the current stack level.
.SH DESCRIPTION
.PP
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event
on the history list and then execute it using \fBTcl_EvalObjEx\fR.
on the history list and then execute it using \fBTcl_EvalObjEx\fR
It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR,
as well as a result value containing additional information
(a result value or error message)
+1 -1
View File
@@ -29,7 +29,7 @@ New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
.PP
At any given time Tcl enforces a limit on the number of recursive
calls that may be active for \fBTcl_Eval\fR and related procedures
such as \fBTcl_EvalEx\fR.
such as \fBTcl_GlobalEval\fR.
Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with
an error.
By default the recursion limit is 1000.
+19 -1
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -26,6 +26,8 @@ const char *
.sp
\fBTcl_AppendResult\fR(\fIinterp, result, result, ... , \fB(char *) NULL\fR)
.sp
\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR)
.sp
\fBTcl_ResetResult\fR(\fIinterp\fR)
.sp
.VS 8.6
@@ -150,6 +152,9 @@ extensions.
Any number of \fIresult\fR arguments may be passed in a single
call; the last argument in the list must be a NULL pointer.
.PP
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
instead of taking a variable number of arguments it takes an argument list.
.PP
.VS 8.6
\fBTcl_TransferResult\fR moves a result from one interpreter to another,
optionally (dependent on the \fIresult\fR parameter) including the error
@@ -192,6 +197,19 @@ It also sets \fIinterp->freeProc\fR to zero, but does not
change \fIinterp->result\fR or clear error state.
\fBTcl_FreeResult\fR is most commonly used when a procedure
is about to replace one result value with another.
.SS "DIRECT ACCESS TO INTERP->RESULT"
.PP
It used to be legal for programs to
directly read and write \fIinterp->result\fR
to manipulate the interpreter result. The Tcl headers no longer
permit this access by default, and C code still doing this must
be updated to use supported routines \fBTcl_GetObjResult\fR,
\fBTcl_GetStringResult\fR, \fBTcl_SetObjResult\fR, and \fBTcl_SetResult\fR.
As a migration aid, access can be restored with the compiler directive
.CS
#define USE_INTERP_RESULT
.CE
but this is meant only to offer life support to otherwise dead code.
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
.PP
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
+5 -5
View File
@@ -20,16 +20,16 @@ int
char *
\fBTcl_Merge\fR(\fIargc, argv\fR)
.sp
size_t
int
\fBTcl_ScanElement\fR(\fIsrc, flagsPtr\fR)
.sp
size_t
int
\fBTcl_ScanCountedElement\fR(\fIsrc, length, flagsPtr\fR)
.sp
size_t
int
\fBTcl_ConvertElement\fR(\fIsrc, dst, flags\fR)
.sp
size_t
int
\fBTcl_ConvertCountedElement\fR(\fIsrc, length, dst, flags\fR)
.SH ARGUMENTS
.AS "const char *const" ***argvPtr out
@@ -55,7 +55,7 @@ String that is to become an element of a list.
.AP int *flagsPtr in
Pointer to word to fill in with information about \fIsrc\fR.
The value of *\fIflagsPtr\fR must be passed to \fBTcl_ConvertElement\fR.
.AP size_t length in
.AP int length in
Number of bytes in string \fIsrc\fR.
.AP char *dst in
Place to copy converted list element. Must contain enough characters
+3
View File
@@ -64,6 +64,9 @@ the event of an error it should set the interpreter's result to point to an
error message. The result or error from the initialization procedure will
be returned as the result of the \fBload\fR command that caused the
initialization procedure to be invoked.
.PP
This function can not be used in stub-enabled extensions. Its symbol
entry in the stub table is deprecated and it will be removed in Tcl 9.0.
.SH KEYWORDS
initialization procedure, package, static linking
.SH "SEE ALSO"
+18 -11
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -59,6 +59,9 @@ void
\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR)
.sp
void
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
.sp
void
\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
.sp
Tcl_Obj *
@@ -87,29 +90,29 @@ Tcl_Obj *
Points to the first byte of an array of UTF-8-encoded bytes
used to set or append to a string value.
This byte array may contain embedded null characters
unless \fInumChars\fR is (size_t)-1. (Applications needing null bytes
unless \fInumChars\fR is negative. (Applications needing null bytes
should represent them as the two-byte sequence \fI\e700\e600\fR, use
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
the string is a collection of uninterpreted bytes.)
.AP size_t length in
.AP int length in
The number of bytes to copy from \fIbytes\fR when
initializing, setting, or appending to a string value.
If (size_t)-1, all bytes up to the first null are used.
If negative, all bytes up to the first null are used.
.AP "const Tcl_UniChar" *unicode in
Points to the first byte of an array of Unicode characters
used to set or append to a string value.
This byte array may contain embedded null characters
unless \fInumChars\fR is negative.
.AP size_t numChars in
.AP int numChars in
The number of Unicode characters to copy from \fIunicode\fR when
initializing, setting, or appending to a string value.
If (size_t)-1, all characters up to the first null character are used.
.AP size_t index in
If negative, all characters up to the first null character are used.
.AP int index in
The index of the Unicode character to return.
.AP size_t first in
.AP int first in
The index of the first Unicode character in the Unicode range to be
returned as a new value.
.AP size_t last in
.AP int last in
The index of the last Unicode character in the Unicode range to be
returned as a new value.
.AP Tcl_Obj *objPtr in/out
@@ -124,7 +127,7 @@ Null-terminated string value to append to \fIobjPtr\fR.
.AP va_list argList in
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.AP size_t limit in
.AP int limit in
Maximum number of bytes to be appended.
.AP "const char" *ellipsis in
Suffix to append when the limit leads to string truncation.
@@ -137,7 +140,7 @@ Format control string including % conversion specifiers.
The number of elements to format or concatenate.
.AP Tcl_Obj *objv[] in
The array of values to format or concatenate.
.AP size_t newLength in
.AP int newLength in
New length for the string value of \fIobjPtr\fR, not including the
final null character.
.BE
@@ -244,6 +247,10 @@ values may contain internal null characters). Any number of
\fIstring\fR arguments may be provided, but the last argument
must be a NULL pointer to indicate the end of the list.
.PP
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
except that instead of taking a variable number of arguments it takes an
argument list.
.PP
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
except that it imposes a limit on how many bytes are appended.
This can be handy when the string to be appended might be
+6 -6
View File
@@ -34,7 +34,7 @@ and the Tcl \fBmemory\fR command can be used to validate and examine
memory usage.
.SH "GUARD ZONES"
.PP
When memory debugging is enabled, whenever a call to \fBTcl_Alloc\fR is
When memory debugging is enabled, whenever a call to \fBckalloc\fR is
made, slightly more memory than requested is allocated so the memory
debugging code can keep track of the allocated memory, and eight-byte
.QW "guard zones"
@@ -44,7 +44,7 @@ C #define \fBLOW_GUARD_SIZE\fR and #define \fBHIGH_GUARD_SIZE\fR
in the file \fIgeneric/tclCkalloc.c\fR \(em it can
be extended if you suspect large overwrite problems, at some cost in
performance.) A known pattern is written into the guard zones and, on
a call to \fBTcl_Free\fR, the guard zones of the space being freed are
a call to \fBckfree\fR, the guard zones of the space being freed are
checked to see if either zone has been modified in any way. If one
has been, the guard bytes and their new contents are identified, and a
.QW "low guard failed"
@@ -53,7 +53,7 @@ or
message is issued. The
.QW "guard failed"
message includes the address of the memory packet and
the file name and line number of the code that called \fBTcl_Free\fR.
the file name and line number of the code that called \fBckfree\fR.
This allows you to detect the common sorts of one-off problems, where
not enough space was allocated to contain the data written, for
example.
@@ -66,15 +66,15 @@ suspect (or know) that corruption is occurring before the Tcl
interpreter comes up far enough for you to issue commands, you can set
\fBMEM_VALIDATE\fR define, recompile tclCkalloc.c and rebuild Tcl.
This will enable memory validation from the first call to
\fBTcl_Alloc\fR, again, at a large performance impact.
\fBckalloc\fR, again, at a large performance impact.
.PP
If you are desperate and validating memory on every call to
\fBTcl_Alloc\fR and \fBTcl_Free\fR is not enough, you can explicitly call
\fBckalloc\fR and \fBckfree\fR is not enough, you can explicitly call
\fBTcl_ValidateAllMemory\fR directly at any point. It takes a \fIchar
*\fR and an \fIint\fR which are normally the filename and line number
of the caller, but they can actually be anything you want. Remember
to remove the calls after you find the problem.
.SH "SEE ALSO"
Tcl_Alloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
.SH KEYWORDS
memory, debug
+4 -4
View File
@@ -28,10 +28,10 @@ First, the Tcl interpreter breaks the command into \fIwords\fR
and performs substitutions as described below.
These substitutions are performed in the same way for all
commands.
Secondly, the first word is used to locate a command procedure to
carry out the command, then all of the words of the command are
passed to the command procedure.
The command procedure is free to interpret each of its words
Secondly, the first word is used to locate a routine to
carry out the command, and the remaining words of the command are
passed to that routine.
The routine is free to interpret each of its words
in any way it likes, such as an integer, variable name, list,
or Tcl script.
Different commands interpret their words differently.
+3 -3
View File
@@ -88,7 +88,7 @@ The initial value for the checksum algorithm.
.AP "unsigned char" *bytes in
An array of bytes to run the checksum algorithm over, or NULL to get the
recommended initial value for the checksum algorithm.
.AP size_t length in
.AP int length in
The number of bytes in the array.
.AP int mode in
What mode to operate the stream in. Should be either
@@ -107,8 +107,8 @@ if the currently compressed data must be made available for access using
into a state where the decompressor can recover from on corruption, or
\fBTCL_ZLIB_FINALIZE\fR to ensure that the stream is finished and that any
trailer demanded by the format is written.
.AP size_t count in
The maximum number of bytes to get from the stream, or (size_t)-1 to get all remaining
.AP int count in
The maximum number of bytes to get from the stream, or -1 to get all remaining
bytes from the stream's buffers.
.AP Tcl_Obj *compDict in
A byte array value that is the compression dictionary to use with the stream.
+2
View File
@@ -189,6 +189,8 @@ procedure (if any) returns. In non-interactive mode, after
\fBTcl_Main\fR evaluates the startup script, and the main loop
procedure (if any) returns, \fBTcl_Main\fR will also evaluate
the \fBexit\fR command.
.PP
This function can not be used in stub-enabled extensions.
.SH "SEE ALSO"
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
exit(n), encoding(n)
+3 -3
View File
@@ -67,7 +67,7 @@ Id of the thread waited upon.
.AP Tcl_ThreadCreateProc *proc in
This procedure will act as the \fBmain()\fR of the newly created
thread. The specified \fIclientData\fR will be its sole argument.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary information. Passed as sole argument to the \fIproc\fR.
.AP int stackSize in
The size of the stack given to the new thread.
@@ -208,7 +208,7 @@ value and then finishes.
.CS
static \fBTcl_ThreadCreateType\fR
MyThreadImplFunc(
void *clientData)
ClientData clientData)
{
int i, limit = (int) clientData;
for (i=0 ; i<limit ; i++) {
@@ -223,7 +223,7 @@ would do this:
.PP
.CS
int limit = 1000000000;
void *limitData = (void*)((intptr_t) limit);
ClientData limitData = (void*)((intptr_t) limit);
Tcl_ThreadId id; \fI/* holds identity of thread created */\fR
int result;
-6
View File
@@ -78,11 +78,5 @@ turns each character in the string into its lower-case equivalent.
turns the first character in the string into its title-case equivalent
and all following characters into their lower-case equivalents.
.SH BUGS
.PP
At this time, the case conversions are only defined for the ISO8859-1
characters. Unicode characters above 0x00ff are not modified by these
routines.
.SH KEYWORDS
utf, unicode, toupper, tolower, totitle, case
+5 -5
View File
@@ -13,7 +13,7 @@ Tcl_CommandTraceInfo, Tcl_TraceCommand, Tcl_UntraceCommand \- monitor renames an
.nf
\fB#include <tcl.h>\fR
.sp
void *
ClientData
\fBTcl_CommandTraceInfo(\fIinterp, cmdName, flags, proc, prevClientData\fB)\fR
.sp
int
@@ -32,9 +32,9 @@ OR'ed collection of the values \fBTCL_TRACE_RENAME\fR and
\fBTCL_TRACE_DELETE\fR.
.AP Tcl_CommandTraceProc *proc in
Procedure to call when specified operations occur to \fIcmdName\fR.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary argument to pass to \fIproc\fR.
.AP void *prevClientData in
.AP ClientData prevClientData in
If non-NULL, gives last value returned by \fBTcl_CommandTraceInfo\fR,
so this call will return information about next trace. If NULL, this
call will return information about first trace.
@@ -65,7 +65,7 @@ match the type \fBTcl_CommandTraceProc\fR:
.PP
.CS
typedef void \fBTcl_CommandTraceProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoldName\fR,
const char *\fInewName\fR,
@@ -74,7 +74,7 @@ typedef void \fBTcl_CommandTraceProc\fR(
.PP
The \fIclientData\fR and \fIinterp\fR parameters will have the same
values as those passed to \fBTcl_TraceCommand\fR when the trace was
created. \fIclientData\fR typically points to an application-specific
created. \fIClientData\fR typically points to an application-specific
data structure that describes what to do when \fIproc\fR is invoked.
\fIOldName\fR gives the name of the command being renamed, and
\fInewName\fR gives the name that the command is being renamed to (or
+9 -9
View File
@@ -24,13 +24,13 @@ int
.sp
\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
.sp
void *
ClientData
\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR
.sp
void *
ClientData
\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR
.SH ARGUMENTS
.AS void *prevClientData
.AS Tcl_VarTraceProc prevClientData
.AP Tcl_Interp *interp in
Interpreter containing variable.
.AP "const char" *varName in
@@ -46,7 +46,7 @@ Not all flags are used by all
procedures. See below for more information.
.AP Tcl_VarTraceProc *proc in
Procedure to invoke whenever one of the traced operations occurs.
.AP void *clientData in
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP "const char" *name1 in
Name of scalar or array variable (without array index).
@@ -54,7 +54,7 @@ Name of scalar or array variable (without array index).
For a trace on an element of an array, gives the index of the
element. For traces on scalar variables or on whole arrays,
is NULL.
.AP void *prevClientData in
.AP ClientData prevClientData in
If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or
\fBTcl_VarTraceInfo2\fR, so this call will return information about
next trace. If NULL, this call will return information about first
@@ -107,7 +107,7 @@ before an array set, but that will trigger write traces.
\fBTCL_TRACE_RESULT_DYNAMIC\fR
The result of invoking the \fIproc\fR is a dynamically allocated
string that will be released by the Tcl library via a call to
\fBTcl_Free\fR. Must not be specified at the same time as
\fBckfree\fR. Must not be specified at the same time as
\fBTCL_TRACE_RESULT_OBJECT\fR.
.TP
\fBTCL_TRACE_RESULT_OBJECT\fR
@@ -124,7 +124,7 @@ It should have arguments and result that match the type
.PP
.CS
typedef char *\fBTcl_VarTraceProc\fR(
void *\fIclientData\fR,
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
char *\fIname1\fR,
char *\fIname2\fR,
@@ -134,7 +134,7 @@ typedef char *\fBTcl_VarTraceProc\fR(
The \fIclientData\fR and \fIinterp\fR parameters will
have the same values as those passed to \fBTcl_TraceVar\fR when the
trace was created.
\fIclientData\fR typically points to an application-specific
\fIClientData\fR typically points to an application-specific
data structure that describes what to do when \fIproc\fR
is invoked.
\fIName1\fR and \fIname2\fR give the name of the traced variable
@@ -312,7 +312,7 @@ The return value must be a pointer to a static character string
containing an error message,
unless (\fIexactly\fR one of) the \fBTCL_TRACE_RESULT_DYNAMIC\fR and
\fBTCL_TRACE_RESULT_OBJECT\fR flags is set, which specify that the result is
either a dynamic string (to be released with \fBTcl_Free\fR) or a
either a dynamic string (to be released with \fBckfree\fR) or a
Tcl_Obj* (cast to char* and to be released with
\fBTcl_DecrRefCount\fR) containing the error message.
If a trace procedure returns an error, no further traces are
+22 -18
View File
@@ -31,19 +31,19 @@ int
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
.sp
int
\fBTcl_UniCharNcmp\fR(\fIucs, uct, uniLength\fR)
\fBTcl_UniCharNcmp\fR(\fIucs, uct, numChars\fR)
.sp
int
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, uniLength\fR)
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, numChars\fR)
.sp
int
\fBTcl_UniCharCaseMatch\fR(\fIuniStr, uniPattern, nocase\fR)
.sp
int
\fBTcl_UtfNcmp\fR(\fIcs, ct, length\fR)
\fBTcl_UtfNcmp\fR(\fIcs, ct, numChars\fR)
.sp
int
\fBTcl_UtfNcasecmp\fR(\fIcs, ct, length\fR)
\fBTcl_UtfNcasecmp\fR(\fIcs, ct, numChars\fR)
.sp
int
\fBTcl_UtfCharComplete\fR(\fIsrc, length\fR)
@@ -69,7 +69,7 @@ int
const char *
\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR)
.sp
size_t
int
\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR)
.SH ARGUMENTS
.AS "const Tcl_UniChar" *uniPattern in/out
@@ -94,16 +94,19 @@ A null-terminated Unicode string.
A null-terminated Unicode string.
.AP "const Tcl_UniChar" *uniPattern in
A null-terminated Unicode string.
.AP size_t length in
.AP int length in
The length of the UTF-8 string in bytes (not UTF-8 characters). If
(size_t)-1, all bytes up to the first null byte are used.
.AP size_t uniLength in
The length of the Unicode string in characters.
negative, all bytes up to the first null byte are used.
.AP int uniLength in
The length of the Unicode string in characters. Must be greater than or
equal to 0.
.AP "Tcl_DString" *dsPtr in/out
A pointer to a previously initialized \fBTcl_DString\fR.
.AP "unsigned long" numChars in
The number of characters to compare.
.AP "const char" *start in
Pointer to the beginning of a UTF-8 string.
.AP size_t index in
.AP int index in
The index of a character (not byte) in the UTF-8 string.
.AP int *readPtr out
If non-NULL, filled with the number of bytes in the backslash sequence,
@@ -129,10 +132,11 @@ represent one Unicode character in the UTF-8 representation.
.PP
\fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string
in starting at \fIbuf\fR. The return value is the number of bytes stored
in \fIbuf\fR. If ch is an upper surrogate (range U+D800 - U+DBFF), then
the return value will be 0 and nothing will be stored. If you still
want to produce UTF-8 output for it (even though knowing it's an illegal
code-point on its own), just call \fBTcl_UniCharToUtf\fR again using ch = -1.
in \fIbuf\fR. If ch is a high surrogate (range U+D800 - U+DBFF), then
the return value will be 1 and a single byte in the range 0xF0 - 0xF4
will be stored. If you still want to produce UTF-8 output for it (even
though knowing it's an illegal code-point on its own), just call
\fBTcl_UniCharToUtf\fR again specifying ch = -1.
.PP
\fBTcl_UtfToUniChar\fR reads one UTF-8 character starting at \fIsrc\fR
and stores it as a Tcl_UniChar in \fI*chPtr\fR. The return value is the
@@ -172,7 +176,7 @@ the number of Unicode characters (not bytes) in that string.
\fBTcl_UniCharNcmp\fR and \fBTcl_UniCharNcasecmp\fR correspond to
\fBstrncmp\fR and \fBstrncasecmp\fR, respectively, for Unicode characters.
They accept two null-terminated Unicode strings and the number of characters
to compare. Both strings are assumed to be at least \fIuniLength\fR characters
to compare. Both strings are assumed to be at least \fInumChars\fR characters
long. \fBTcl_UniCharNcmp\fR compares the two strings character-by-character
according to the Unicode character ordering. It returns an integer greater
than, equal to, or less than 0 if the first string is greater than, equal
@@ -186,7 +190,7 @@ be case sensitive and returns whether the string matches the pattern.
.PP
\fBTcl_UtfNcmp\fR corresponds to \fBstrncmp\fR for UTF-8 strings. It
accepts two null-terminated UTF-8 strings and the number of characters
to compare. (Both strings are assumed to be at least \fIlength\fR
to compare. (Both strings are assumed to be at least \fInumChars\fR
characters long.) \fBTcl_UtfNcmp\fR compares the two strings
character-by-character according to the Unicode character ordering.
It returns an integer greater than, equal to, or less than 0 if the
@@ -238,12 +242,12 @@ return value will be \fIstart\fR.
Pascal Ord() function. It returns the Tcl_UniChar represented at the
specified character (not byte) \fIindex\fR in the UTF-8 string
\fIsrc\fR. The source string must contain at least \fIindex\fR
characters.
characters. Behavior is undefined if a negative \fIindex\fR is given.
.PP
\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not
byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must
contain at least \fIindex\fR characters. This is equivalent to calling
\fBTcl_UtfNext\fR \fIindex\fR times. If \fIindex\fR is (size_t)-1,
\fBTcl_UtfNext\fR \fIindex\fR times. If a negative \fIindex\fR is given,
the return pointer points to the first character in the source string.
.PP
\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl
+35 -11
View File
@@ -25,6 +25,7 @@ out by the command.
The legal \fIoptions\fR (which may be abbreviated) are:
.TP
\fBarray anymore \fIarrayName searchId\fR
.
Returns 1 if there are any more elements left to be processed
in an array search, 0 if all elements have already been
returned.
@@ -37,10 +38,10 @@ with an empty name, since the return value from
has been completed.
.TP
\fBarray default \fIsubcommand arrayName args...\fR
.VS TIP508
.VS "8.7, TIP508"
Manages the default value of the array. Arrays initially have no default
value, but this command allows you to set one; the default value will be
returned when reading from an element of the array \farrayName\fR if the read
returned when reading from an element of the array \fIarrayName\fR if the read
would otherwise result in an error. Note that this may cause the \fBappend\fR,
\fBdict\fR, \fBincr\fR and \fBlappend\fR commands to change their behavior in
relation to non-existing array elements.
@@ -48,42 +49,43 @@ relation to non-existing array elements.
.PP
The \fIsubcommand\fR argument controls what exact operation will be performed
on the default value of \fIarrayName\fR. Supported \fIsubcommand\fRs are:
.VE TIP508
.VE "8.7, TIP508"
.TP
\fBarray default exists \fIarrayName\fR
.VS TIP508
.VS "8.7, TIP508"
This returns a boolean value indicating whether a default value has been set
for the array \fIarrayName\fR. Returns a false value if \fIarrayName\fR does
not exist. Raises an error if \fIarrayName\fR is an existing variable that is
not an array.
.VE TIP508
.VE "8.7, TIP508"
.TP
\fBarray default get \fIarrayName\fR
.VS TIP508
.VS "8.7, TIP508"
This returns the current default value for the array \fIarrayName\fR. Raises
an error if \fIarrayName\fR is an existing variable that is not an array, or
if \fIarrayName\fR is an array without a default value.
.VE TIP508
.VE "8.7, TIP508"
.TP
\fBarray default set \fIarrayName value\fR
.VS TIP508
.VS "8.7, TIP508"
This sets the default value for the array \fIarrayName\fR to \fIvalue\fR.
Returns the empty string. Raises an error if \fIarrayName\fR is an existing
variable that is not an array, or if \fIarrayName\fR is an illegal name for an
array. If \fIarrayName\fR does not currently exist, it is created as an empty
array as well as having its default value set.
.VE TIP508
.VE "8.7, TIP508"
.TP
\fBarray default unset \fIarrayName\fR
.VS TIP508
.VS "8.7, TIP508"
This removes the default value for the array \fIarrayName\fR and returns the
empty string. Does nothing if \fIarrayName\fR does not have a default
value. Raises an error if \fIarrayName\fR is an existing variable that is not
an array.
.VE TIP508
.VE "8.7, TIP508"
.RE
.TP
\fBarray donesearch \fIarrayName searchId\fR
.
This command terminates an array search and destroys all the
state associated with that search. \fISearchId\fR indicates
which search on \fIarrayName\fR to destroy, and must have
@@ -91,10 +93,12 @@ been the return value from a previous invocation of
\fBarray startsearch\fR. Returns an empty string.
.TP
\fBarray exists \fIarrayName\fR
.
Returns 1 if \fIarrayName\fR is an array variable, 0 if there
is no variable by that name or if it is a scalar variable.
.TP
\fBarray for {\fIkeyVariable valueVariable\fB} \fIarrayName body\fP
.VS "8.7, TIP421"
The first argument is a two element list of variable names for the
key and value of each entry in the array. The second argument is the
array name to iterate over. The third argument is the body to execute
@@ -102,8 +106,10 @@ for each key and value returned.
The ordering of the returned keys is undefined.
If an array element is deleted or a new array element is inserted during
the \fIarray for\fP process, the command will terminate with an error.
.VE "8.7, TIP421"
.TP
\fBarray get \fIarrayName\fR ?\fIpattern\fR?
.
Returns a list containing pairs of elements. The first
element in each pair is the name of an element in \fIarrayName\fR
and the second element of each pair is the value of the
@@ -120,6 +126,7 @@ returned are those that exist both before and after the call to
\fBarray get\fR.
.TP
\fBarray names \fIarrayName\fR ?\fImode\fR? ?\fIpattern\fR?
.
Returns a list containing the names of all of the elements in
the array that match \fIpattern\fR. \fIMode\fR may be one of
\fB\-exact\fR, \fB\-glob\fR, or \fB\-regexp\fR. If specified, \fImode\fR
@@ -134,6 +141,7 @@ in the array, or if \fIarrayName\fR is not the name of an array
variable, then an empty string is returned.
.TP
\fBarray nextelement \fIarrayName searchId\fR
.
Returns the name of the next element in \fIarrayName\fR, or
an empty string if all elements of \fIarrayName\fR have
already been returned in this search. The \fIsearchId\fR
@@ -145,6 +153,7 @@ then all searches are automatically terminated just as if
\fBarray nextelement\fR operations to fail for those searches.
.TP
\fBarray set \fIarrayName list\fR
.
Sets the values of one or more elements in \fIarrayName\fR.
\fIlist\fR must have a form like that returned by \fBarray get\fR,
consisting of an even number of elements.
@@ -156,11 +165,13 @@ and \fIlist\fR is empty,
\fIarrayName\fR is created with an empty array value.
.TP
\fBarray size \fIarrayName\fR
.
Returns a decimal string giving the number of elements in the
array.
If \fIarrayName\fR is not the name of an array then 0 is returned.
.TP
\fBarray startsearch \fIarrayName\fR
.
This command initializes an element-by-element search through the
array given by \fIarrayName\fR, such that invocations of the
\fBarray nextelement\fR command will return the names of the
@@ -177,18 +188,31 @@ over all but very large arrays. See the examples below for how to do
this.
.TP
\fBarray statistics \fIarrayName\fR
.
Returns statistics about the distribution of data within the hashtable
that represents the array. This information includes the number of
entries in the table, the number of buckets, and the utilization of
the buckets.
.TP
\fBarray unset \fIarrayName\fR ?\fIpattern\fR?
.
Unsets all of the elements in the array that match \fIpattern\fR (using the
matching rules of \fBstring match\fR). If \fIarrayName\fR is not the name
of an array variable or there are no matching elements in the array, no
error will be raised. If \fIpattern\fR is omitted and \fIarrayName\fR is
an array variable, then the command unsets the entire array.
The command always returns an empty string.
.TP
\fBarray value \fIarrayName elementName\fR ?\fIdefaultValue\fR? ?\IsaveInit\fR?
.VS "8.7, TIP224"
Reads the element called \fIelementName\fR of the array called
\fIarrayName\fR and returns the value it contains. If the element does not
exist, returns \fIdefaultValue\fR instead (this defaults to the empty
string), ignoring the array-level default set with \fBarray default\fR. If
\fIsaveInit\fR is specified, it must be a boolean value; if it is present and
true, and the element was not present in the array, the \fIdefaultValue\fR is
written to the element as well as being returned.
.VE "8.7, TIP224"
.SH EXAMPLES
.CS
\fBarray set\fR colorcount {
+60
View File
@@ -0,0 +1,60 @@
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH case n 7.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
case \- Evaluate one of several scripts, depending on a given value
.SH SYNOPSIS
\fBcase\fI string \fR?\fBin\fR? \fIpatList body \fR?\fIpatList body \fR...?
.sp
\fBcase\fI string \fR?\fBin\fR? {\fIpatList body \fR?\fIpatList body \fR...?}
.BE
.SH DESCRIPTION
.PP
\fINote: the \fBcase\fI command is obsolete and is supported only
for backward compatibility. At some point in the future it may be
removed entirely. You should use the \fBswitch\fI command instead.\fR
.PP
The \fBcase\fR command matches \fIstring\fR against each of
the \fIpatList\fR arguments in order.
Each \fIpatList\fR argument is a list of one or
more patterns. If any of these patterns matches \fIstring\fR then
\fBcase\fR evaluates the following \fIbody\fR argument
by passing it recursively to the Tcl interpreter and returns the result
of that evaluation.
Each \fIpatList\fR argument consists of a single
pattern or list of patterns. Each pattern may contain any of the wild-cards
described under \fBstring match\fR. If a \fIpatList\fR
argument is \fBdefault\fR, the corresponding body will be evaluated
if no \fIpatList\fR matches \fIstring\fR. If no \fIpatList\fR argument
matches \fIstring\fR and no default is given, then the \fBcase\fR
command returns an empty string.
.PP
Two syntaxes are provided for the \fIpatList\fR and \fIbody\fR arguments.
The first uses a separate argument for each of the patterns and commands;
this form is convenient if substitutions are desired on some of the
patterns or commands.
The second form places all of the patterns and commands together into
a single argument; the argument must have proper list structure, with
the elements of the list being the patterns and commands.
The second form makes it easy to construct multi-line case commands,
since the braces around the whole list make it unnecessary to include a
backslash at the end of each line.
Since the \fIpatList\fR arguments are in braces in the second form,
no command or variable substitutions are performed on them; this makes
the behavior of the second form different than the first form in some
cases.
.SH "SEE ALSO"
switch(n)
.SH KEYWORDS
case, match, regular expression
+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,
+217
View File
@@ -0,0 +1,217 @@
'\"
'\" Copyright (c) 2014-2018 Donal K. Fellows.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH "cookiejar" n 0.1 http "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
cookiejar \- Implementation of the Tcl http package cookie jar protocol
.SH SYNOPSIS
.nf
\fBpackage require\fR \fBcookiejar\fR ?\fB0.1\fR?
\fB::http::cookiejar configure\fR ?\fIoptionName\fR? ?\fIoptionValue\fR?
\fB::http::cookiejar create\fR \fIname\fR ?\fIfilename\fR?
\fB::http::cookiejar new\fR ?\fIfilename\fR?
\fIcookiejar\fR \fBdestroy\fR
\fIcookiejar\fR \fBforceLoadDomainData\fR
\fIcookiejar\fR \fBgetCookies\fR \fIprotocol host path\fR
\fIcookiejar\fR \fBstoreCookie\fR \fIoptions\fR
\fIcookiejar\fR \fBlookup\fR ?\fIhost\fR? ?\fIkey\fR?
.fi
.SH DESCRIPTION
.PP
The cookiejar package provides an implementation of the http package's cookie
jar protocol using an SQLite database. It provides one main command,
\fB::http::cookiejar\fR, which is a TclOO class that should be instantiated to
create a cookie jar that manages a particular HTTP session.
.PP
The database management policy can be controlled at the package level by the
\fBconfigure\fR method on the \fB::http::cookiejar\fR class object:
.TP
\fB::http::cookiejar configure\fR ?\fIoptionName\fR? ?\fIoptionValue\fR?
.
If neither \fIoptionName\fR nor \fIoptionValue\fR are supplied, this returns a
copy of the configuration as a Tcl dictionary. If just \fIoptionName\fR is
supplied, just the value of the named option is returned. If both
\fIoptionName\fR and \fIoptionValue\fR are given, the named option is changed
to be the given value.
.RS
.PP
Supported options are:
.TP
\fB\-domainfile \fIfilename\fR
.
A file (defaulting to within the cookiejar package) with a description of the
list of top-level domains (e.g., \fB.com\fR or \fB.co.jp\fR). Such domains
\fImust not\fR accept cookies set upon them. Note that the list of such
domains is both security-sensitive and \fInot\fR constant and should be
periodically refetched. Cookie jars maintain their own cache of the domain
list.
.TP
\fB\-domainlist \fIurl\fR
.
A URL to fetch the list of top-level domains (e.g., \fB.com\fR or
\fB.co.jp\fR) from. Such domains \fImust not\fR accept cookies set upon
them. Note that the list of such domains is both security-sensitive and
\fInot\fR constant and should be periodically refetched. Cookie jars maintain
their own cache of the domain list.
.TP
\fB\-domainrefresh \fIintervalMilliseconds\fR
.
The number of milliseconds between checks of the \fI\-domainlist\fR for new
domains.
.TP
\fB\-loglevel \fIlevel\fR
.
The logging level of this package. The logging level must be (in order of
decreasing verbosity) one of \fBdebug\fR, \fBinfo\fR, \fBwarn\fR, or
\fBerror\fR.
.TP
\fB\-offline \fIflag\fR
.
Allows the cookie managment engine to be placed into offline mode. In offline
mode, the list of domains is read immediately from the file configured in the
\fB\-domainfile\fR option, and the \fB\-domainlist\fR option is not used; it
also makes the \fB\-domainrefresh\fR option be effectively ignored.
.TP
\fB\-purgeold \fIintervalMilliseconds\fR
.
The number of milliseconds between checks of the database for expired
cookies; expired cookies are deleted.
.TP
\fB\-retain \fIcookieCount\fR
.
The maximum number of cookies to retain in the database.
.TP
\fB\-vacuumtrigger \fIdeletionCount\fR
.
A count of the number of persistent cookie deletions to go between vacuuming
the database.
.RE
.PP
Cookie jar instances may be made with any of the standard TclOO instance
creation methods (\fBcreate\fR or \fBnew\fR).
.TP
\fB::http::cookiejar new\fR ?\fIfilename\fR?
.
If a \fIfilename\fR argument is provided, it is the name of a file containing
an SQLite database that will contain the persistent cookies maintained by the
cookie jar; the database will be created if the file does not already
exist. If \fIfilename\fR is not supplied, the database will be held entirely within
memory, which effectively forces all cookies within it to be session cookies.
.SS "INSTANCE METHODS"
.PP
The following methods are supported on the instances:
.TP
\fIcookiejar\fR \fBdestroy\fR
.
This is the standard TclOO destruction method. It does \fInot\fR delete the
SQLite database if it is written to disk. Callers are responsible for ensuring
that the cookie jar is not in use by the http package at the time of
destruction.
.TP
\fIcookiejar\fR \fBforceLoadDomainData\fR
.
This method causes the cookie jar to immediately load (and cache) the domain
list data. The domain list will be loaded from the \fB\-domainlist\fR
configured a the package level if that is enabled, and otherwise will be
obtained from the \fB\-domainfile\fR configured at the package level.
.TP
\fIcookiejar\fR \fBgetCookies\fR \fIprotocol host path\fR
.
This method obtains the cookies for a particular HTTP request. \fIThis
implements the http cookie jar protocol.\fR
.TP
\fIcookiejar\fR \fBpolicyAllow\fR \fIoperation domain path\fR
.
This method is called by the \fBstoreCookie\fR method to get a decision on
whether to allow \fIoperation\fR to be performed for the \fIdomain\fR and
\fIpath\fR. This is checked immediately before the database is updated but
after the built-in security checks are done, and should return a boolean
value; if the value is false, the operation is rejected and the database is
not modified. The supported \fIoperation\fRs are:
.RS
.TP
\fBdelete\fR
.
The \fIdomain\fR is seeking to delete a cookie.
.TP
\fBsession\fR
.
The \fIdomain\fR is seeking to create or update a session cookie.
.TP
\fBset\fR
.
The \fIdomain\fR is seeking to create or update a persistent cookie (with a
defined lifetime).
.PP
The default implementation of this method just returns true, but subclasses of
this class may impose their own rules.
.RE
.TP
\fIcookiejar\fR \fBstoreCookie\fR \fIoptions\fR
.
This method stores a single cookie from a particular HTTP response. Cookies
that fail security checks are ignored. \fIThis implements the http cookie jar
protocol.\fR
.TP
\fIcookiejar\fR \fBlookup\fR ?\fIhost\fR? ?\fIkey\fR?
.
This method looks a cookie by exact host (or domain) matching. If neither
\fIhost\fR nor \fIkey\fR are supplied, the list of hosts for which a cookie is
stored is returned. If just \fIhost\fR (which may be a hostname or a domain
name) is supplied, the list of cookie keys stored for that host is returned.
If both \fIhost\fR and \fIkey\fR are supplied, the value for that key is
returned; it is an error if no such host or key match exactly.
.SH "EXAMPLES"
.PP
The simplest way of using a cookie jar is to just permanently configure it at
the start of the application.
.PP
.CS
package require http
\fBpackage require cookiejar\fR
set cookiedb ~/.tclcookies.db
http::configure -cookiejar [\fBhttp::cookiejar new\fR $cookiedb]
# No further explicit steps are required to use cookies
set tok [http::geturl http://core.tcl.tk/]
.CE
.PP
To only allow a particular domain to use cookies, perhaps because you only
want to enable a particular host to create and manipulate sessions, create a
subclass that imposes that policy.
.PP
.CS
package require http
\fBpackage require cookiejar\fR
oo::class create MyCookieJar {
superclass \fBhttp::cookiejar\fR
method \fBpolicyAllow\fR {operation domain path} {
return [expr {$domain eq "my.example.com"}]
}
}
set cookiedb ~/.tclcookies.db
http::configure -cookiejar [MyCookieJar new $cookiedb]
# No further explicit steps are required to use cookies
set tok [http::geturl http://core.tcl.tk/]
.CE
.SH "SEE ALSO"
http(n), oo::class(n), sqlite3(n)
.SH KEYWORDS
cookie, internet, security policy, www
'\" Local Variables:
'\" mode: nroff
'\" fill-column: 78
'\" End:
+195 -81
View File
@@ -34,7 +34,11 @@ either the \fIdefScript\fR argument or by the \fIsubcommand\fR and following
\fIarg\fR arguments; when the second is present, it is exactly as if all the
arguments from \fIsubcommand\fR onwards are made into a list and that list is
used as the \fIdefScript\fR argument.
.SS "CONFIGURING CLASSES"
.PP
Note that the constructor for \fBoo::class\fR will call \fBoo::define\fR on
the script argument that it is provided. This is a convenient way to create
and define a class in one step.
.SH "CONFIGURING CLASSES"
.PP
The following commands are supported in the \fIdefScript\fR for
\fBoo::define\fR, each of which may also be used in the \fIsubcommand\fR form:
@@ -48,7 +52,7 @@ the \fBmethod\fR definition, below.
.RS
.PP
Class methods can be called on either the class itself or on the instances of
that class. When they are called, the current object (see the \fBself\R and
that class. When they are called, the current object (see the \fBsel\fR and
\fBmy\fR commands) is the class on which they are called or the class of the
instance on which they are called, depending on whether they are called on the
class or an instance of the class, respectively. If called on a subclass or
@@ -70,13 +74,11 @@ namespace of the constructor will be a namespace that is unique to the object
being constructed. Within the constructor, the \fBnext\fR command should be
used to call the superclasses' constructors. If \fIbodyScript\fR is the empty
string, the constructor will be deleted.
.TP
\fBdeletemethod\fI name\fR ?\fIname ...\fR?
.
This deletes each of the methods called \fIname\fR from a class. The methods
must have previously existed in that class. Does not affect the superclasses
of the class, nor does it affect the subclasses or instances of the class
(except when they have a call chain through the class being modified).
.RS
.PP
Classes do not need to have a constructor defined. If none is specified, the
superclass's constructor will be used instead.
.RE
.TP
\fBdestructor\fI bodyScript\fR
.
@@ -102,16 +104,6 @@ class being defined. Note that the methods themselves may be actually defined
by a superclass; subclass exports override superclass visibility, and may in
turn be overridden by instances.
.TP
\fBfilter\fR ?\fI\-slotOperation\fR? ?\fImethodName ...\fR?
.
This slot (see \fBSLOTTED DEFINITIONS\fR below)
sets or updates the list of method names that are used to guard whether
method call to instances of the class may be called and what the method's
results are. Each \fImethodName\fR names a single filtering method (which may
be exposed or not exposed); it is not an error for a non-existent method to be
named since they may be defined by subclasses.
By default, this slot works by appending.
.TP
\fBforward\fI name cmdName \fR?\fIarg ...\fR?
.
This creates or updates a forwarded method called \fIname\fR. The method is
@@ -140,7 +132,7 @@ where the current namespace is the instance namespace of the class object
itself. This is useful for setting up, e.g., class-scoped variables.
.VE TIP478
.TP
\fBmethod\fI name argList bodyScript\fR
\fBmethod\fI name \fR?\fIoption\fR? \fIargList bodyScript\fR
.
This creates or updates a method that is implemented as a procedure-like
script. The name of the method is \fIname\fR, the formal arguments to the
@@ -150,23 +142,20 @@ the body of the method is evaluated, the current namespace of the method will
be a namespace that is unique to the current object. The method will be
exported if \fIname\fR starts with a lower-case letter, and non-exported
otherwise; this behavior can be overridden via \fBexport\fR and
\fBunexport\fR.
\fBunexport\fR
.VS TIP519
or by specifying \fB\-export\fR, \fB\-private\fR or \fB\-unexport\fR in the
optional parameter \fIoption\fR.
.VE TIP519
.RS
.PP
.VS TIP500
If in a private definition context (see the \fBprivate\fR definition command,
below), this command creates private procedure-like methods.
below) or if the \fB\-private\fR flag is given for \fIoption\fR, this command
creates private procedure-like methods.
.VE TIP500
.RE
.TP
\fBmixin\fR ?\fI\-slotOperation\fR? ?\fIclassName ...\fR?
.
This slot (see \fBSLOTTED DEFINITIONS\fR below)
sets or updates the list of additional classes that are to be mixed into
all the instances of the class being defined. Each \fIclassName\fR argument
names a single class that is to be mixed in.
By default, this slot works by replacement.
.TP
\fBprivate \fIcmd arg...\fR
.TP
\fBprivate \fIscript\fR
@@ -186,16 +175,6 @@ context.
.RE
.VE TIP500
.TP
\fBrenamemethod\fI fromName toName\fR
.
This renames the method called \fIfromName\fR in a class to \fItoName\fR. The
method must have previously existed in the class, and \fItoName\fR must not
previously refer to a method in that class. Does not affect the superclasses
of the class, nor does it affect the subclasses or instances of the class
(except when they have a call chain through the class being modified). Does
not change the export status of the method; if it was exported before, it will
be afterwards.
.TP
\fBself\fI subcommand arg ...\fR
.TP
\fBself\fI script\fR
@@ -269,24 +248,79 @@ namespace has a unique prefix that makes accidental use from other classes
extremely unlikely.
.VE TIP500
.RE
.SS "CONFIGURING OBJECTS"
.SS "ADVANCED CLASS CONFIGURATION OPTIONS"
.PP
The following definitions are also supported, but are not required in simple
programs:
.TP
\fBdefinitionnamespace\fR ?\fIkind\fR? \fInamespaceName\fR
.VS TIP524
This allows control over what namespace will be used by the \fBoo::define\fR
and \fBoo::objdefine\fR commands to look up the definition commands they
use. When any object has a definition operation applied to it, \fIthe class that
it is an instance of\fR (and its superclasses and mixins) is consulted for
what definition namespace to use. \fBoo::define\fR gets the class definition
namespace, and \fB::oo::objdefine\fR gets the instance definition namespace,
but both otherwise use the identical lookup operation.
.RS
.PP
This sets the definition namespace of kind \fIkind\fR provided by the current
class to \fInamespaceName\fR. The \fInamespaceName\fR must refer to a
currently existing namespace, or must be the empty string (to stop the current
class from having such a namespace connected). The \fIkind\fR, if supplied,
must be either \fB\-class\fR (the default) or \fB\-instance\fR to specify the
whether the namespace for use with \fBoo::define\fR or \fBoo::objdefine\fR
respectively is being set.
.PP
The class \fBoo::object\fR has its instance namespace locked to
\fB::oo::objdefine\fR, and the class \fBoo::class\fR has its class namespace
locked to \fB::oo::define\fR. A consequence of this is that effective use of
this feature for classes requires the definition of a metaclass.
.RE
.VE TIP524
.TP
\fBdeletemethod\fI name\fR ?\fIname ...\fR?
.
This deletes each of the methods called \fIname\fR from a class. The methods
must have previously existed in that class. Does not affect the superclasses
of the class, nor does it affect the subclasses or instances of the class
(except when they have a call chain through the class being modified) or the
class object itself.
.TP
\fBfilter\fR ?\fI\-slotOperation\fR? ?\fImethodName ...\fR?
.
This slot (see \fBSLOTTED DEFINITIONS\fR below)
sets or updates the list of method names that are used to guard whether
method call to instances of the class may be called and what the method's
results are. Each \fImethodName\fR names a single filtering method (which may
be exposed or not exposed); it is not an error for a non-existent method to be
named since they may be defined by subclasses.
By default, this slot works by appending.
.TP
\fBmixin\fR ?\fI\-slotOperation\fR? ?\fIclassName ...\fR?
.
This slot (see \fBSLOTTED DEFINITIONS\fR below)
sets or updates the list of additional classes that are to be mixed into
all the instances of the class being defined. Each \fIclassName\fR argument
names a single class that is to be mixed in.
By default, this slot works by replacement.
.TP
\fBrenamemethod\fI fromName toName\fR
.
This renames the method called \fIfromName\fR in a class to \fItoName\fR. The
method must have previously existed in the class, and \fItoName\fR must not
previously refer to a method in that class. Does not affect the superclasses
of the class, nor does it affect the subclasses or instances of the class
(except when they have a call chain through the class being modified), or the
class object itself. Does
not change the export status of the method; if it was exported before, it will
be afterwards.
.SH "CONFIGURING OBJECTS"
.PP
The following commands are supported in the \fIdefScript\fR for
\fBoo::objdefine\fR, each of which may also be used in the \fIsubcommand\fR
form:
.TP
\fBclass\fI className\fR
.
This allows the class of an object to be changed after creation. Note that the
class's constructors are not called when this is done, and so the object may
well be in an inconsistent state unless additional configuration work is done.
.TP
\fBdeletemethod\fI name\fR ?\fIname ...\fR
.
This deletes each of the methods called \fIname\fR from an object. The methods
must have previously existed in that object. Does not affect the classes that
the object is an instance of.
.TP
\fBexport\fI name \fR?\fIname ...\fR?
.
This arranges for each of the named methods, \fIname\fR, to be exported
@@ -294,17 +328,6 @@ This arranges for each of the named methods, \fIname\fR, to be exported
being defined. Note that the methods themselves may be actually defined by a
class or superclass; object exports override class visibility.
.TP
\fBfilter\fR ?\fI\-slotOperation\fR? ?\fImethodName ...\fR?
.
This slot (see \fBSLOTTED DEFINITIONS\fR below)
sets or updates the list of method names that are used to guard whether a
method call to the object may be called and what the method's results are.
Each \fImethodName\fR names a single filtering method (which may be exposed or
not exposed); it is not an error for a non-existent method to be named. Note
that the actual list of filters also depends on the filters set upon any
classes that the object is an instance of.
By default, this slot works by appending.
.TP
\fBforward\fI name cmdName \fR?\fIarg ...\fR?
.
This creates or updates a forwarded object method called \fIname\fR. The
@@ -321,7 +344,7 @@ below), this command creates private forwarded methods.
.VE TIP500
.RE
.TP
\fBmethod\fI name argList bodyScript\fR
\fBmethod\fI name \fR?\fIoption\fR? \fIargList bodyScript\fR
.
This creates, updates or deletes an object method. The name of the method is
\fIname\fR, the formal arguments to the method (defined using the same format
@@ -329,12 +352,18 @@ as for the Tcl \fBproc\fR command) will be \fIargList\fR, and the body of the
method will be \fIbodyScript\fR. When the body of the method is evaluated, the
current namespace of the method will be a namespace that is unique to the
object. The method will be exported if \fIname\fR starts with a lower-case
letter, and non-exported otherwise.
letter, and non-exported otherwise;
.VS TIP519
this can be overridden by specifying \fB\-export\fR, \fB\-private\fR or
\fB\-unexport\fR in the optional parameter \fIoption\fR, or via the
\fBexport\fR and \fBunexport\fR definitions.
.VE TIP519
.RS
.PP
.VS TIP500
If in a private definition context (see the \fBprivate\fR definition command,
below), this command creates private procedure-like methods.
below) or if the \fB\-private\fR flag is given for \fIoption\fR, this command
creates private procedure-like methods.
.VE TIP500
.RE
.TP
@@ -363,19 +392,6 @@ difference in behavior when used in a private definition context.
.RE
.VE TIP500
.TP
\fBrenamemethod\fI fromName toName\fR
.
This renames the method called \fIfromName\fR in an object to \fItoName\fR.
The method must have previously existed in the object, and \fItoName\fR must
not previously refer to a method in that object. Does not affect the classes
that the object is an instance of. Does not change the export status of the
method; if it was exported before, it will be afterwards.
.TP
\fBself \fR
.VS TIP470
This gives the name of the object currently being configured.
.VE TIP470
.TP
\fBunexport\fI name \fR?\fIname ...\fR?
.
This arranges for each of the named methods, \fIname\fR, to be not exported
@@ -408,6 +424,50 @@ instance namespace has a unique prefix that makes accidental use from
superclass methods extremely unlikely.
.VE TIP500
.RE
.SS "ADVANCED OBJECT CONFIGURATION OPTIONS"
.PP
The following definitions are also supported, but are not required in simple
programs:
.TP
\fBclass\fI className\fR
.
This allows the class of an object to be changed after creation. Note that the
class's constructors are not called when this is done, and so the object may
well be in an inconsistent state unless additional configuration work is done.
.TP
\fBdeletemethod\fI name\fR ?\fIname ...\fR
.
This deletes each of the methods called \fIname\fR from an object. The methods
must have previously existed in that object (e.g., because it was created
through \fBoo::objdefine method\fR). Does not affect the classes that the
object is an instance of, or remove the exposure of those class-provided
methods in the instance of that class.
.TP
\fBfilter\fR ?\fI\-slotOperation\fR? ?\fImethodName ...\fR?
.
This slot (see \fBSLOTTED DEFINITIONS\fR below)
sets or updates the list of method names that are used to guard whether a
method call to the object may be called and what the method's results are.
Each \fImethodName\fR names a single filtering method (which may be exposed or
not exposed); it is not an error for a non-existent method to be named. Note
that the actual list of filters also depends on the filters set upon any
classes that the object is an instance of.
By default, this slot works by appending.
.TP
\fBrenamemethod\fI fromName toName\fR
.
This renames the method called \fIfromName\fR in an object to \fItoName\fR.
The method must have previously existed in the object, and \fItoName\fR must
not previously refer to a method in that object. Does not affect the classes
that the object is an instance of and cannot rename in an instance object the
methods provided by those classes (though a \fBoo::objdefine forward\fRed
method may provide an equivalent capability). Does not change the export
status of the method; if it was exported before, it will be afterwards.
.TP
\fBself \fR
.VS TIP470
This gives the name of the object currently being configured.
.VE TIP470
.SH "PRIVATE METHODS"
.VS TIP500
When a class or instance has a private method, that private method can only be
@@ -528,7 +588,7 @@ for reading from slots is via \fBinfo class\fR and \fBinfo object\fR).
.SH EXAMPLES
This example demonstrates how to use both forms of the \fBoo::define\fR and
\fBoo::objdefine\fR commands (they work in the same way), as well as
illustrating four of their subcommands.
illustrating four of the subcommands of them.
.PP
.CS
oo::class create c
@@ -659,6 +719,60 @@ $g update "emailaddress=admins"
\fI\(-> DB: update row ::oo::Obj125 with emailaddress=admins\fR
.CE
.VE TIP478
.PP
.VS TIP524
This example shows how to make a custom definition for a class. Note that it
explicitly includes delegation to the existing definition commands via
\fBnamespace path\fR.
.PP
.CS
namespace eval myDefinitions {
# Delegate to existing definitions where not overridden
namespace path \fB::oo::define\fR
# A custom type of method
proc exprmethod {name arguments body} {
tailcall \fBmethod\fR $name $arguments [list expr $body]
}
# A custom way of building a constructor
proc parameters args {
uplevel 1 [list \fBvariable\fR {*}$args]
set body [join [lmap a $args {
string map [list VAR $a] {
set [my varname VAR] [expr {double($VAR)}]
}
}] ";"]
tailcall \fBconstructor\fR $args $body
}
}
# Bind the namespace into a (very simple) metaclass for use
oo::class create exprclass {
\fBsuperclass\fR oo::class
\fBdefinitionnamespace\fR myDefinitions
}
# Use the custom definitions
exprclass create quadratic {
parameters a b c
exprmethod evaluate {x} {
($a * $x**2) + ($b * $x) + $c
}
}
# Showing the resulting class and object in action
quadratic create quad 1 2 3
for {set x 0} {$x <= 4} {incr x} {
puts [format "quad(%d) = %.2f" $x [quad evaluate $x]]
}
\fI\(-> quad(0) = 3.00\fR
\fI\(-> quad(1) = 6.00\fR
\fI\(-> quad(2) = 11.00\fR
\fI\(-> quad(3) = 18.00\fR
\fI\(-> quad(4) = 27.00\fR
.CE
.VE TIP524
.SH "SEE ALSO"
next(n), oo::class(n), oo::object(n)
.SH KEYWORDS
+5 -2
View File
@@ -50,7 +50,9 @@ An integer operand may be specified in decimal (the normal case, the optional
first two characters are \fB0d\fR), binary
(the first two characters are \fB0b\fR), octal
(the first two characters are \fB0o\fR), or hexadecimal
(the first two characters are \fB0x\fR) form.
(the first two characters are \fB0x\fR) form. For
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
interpreted as an octal integer even if the second character is not \fBo\fR.
A floating-point number may be specified in any of several
common decimal formats, and may use the decimal point \fB.\fR,
\fBe\fR or \fBE\fR for scientific notation, and
@@ -124,7 +126,8 @@ applied to integers.
.TP 20
\fB**\fR
.
Exponentiation. Valid for numeric operands.
Exponentiation. Valid for numeric operands. The maximum exponent value
that Tcl can handle if the first number is an integer > 1 is 268435455.
.TP 20
\fB*\0\0/\0\0%\fR
.
+113 -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
@@ -99,6 +99,15 @@ comma-separated list of mime type patterns that you are
willing to receive. For example,
.QW "image/gif, image/jpeg, text/*" .
.TP
\fB\-cookiejar\fR \fIcommand\fR
.VS TIP406
The cookie store for the package to use to manage HTTP cookies.
\fIcommand\fR is a command prefix list; if the empty list (the
default value) is used, no cookies will be sent by requests or stored
from responses. The command indicated by \fIcommand\fR, if supplied,
must obey the \fBCOOKIE JAR PROTOCOL\fR described below.
.VE TIP406
.TP
\fB\-pipeline\fR \fIboolean\fR
.
Specifies whether HTTP/1.1 transactions on a persistent socket will be
@@ -770,6 +779,108 @@ Subsequent GET and HEAD requests in a failed pipeline will also be retried.
that the retry is appropriate\fR - specifically, the application must know
that if the failed POST successfully modified the state of the server, a repeat POST
would have no adverse effect.
.VS TIP406
.SH "COOKIE JAR PROTOCOL"
.PP
Cookies are short key-value pairs used to implement sessions within the
otherwise-stateless HTTP protocol. (See RFC 6265 for details; Tcl does not
implement the Cookie2 protocol as that is rarely seen in the wild.)
.PP
Cookie storage managment commands \(em
.QW "cookie jars"
\(em must support these subcommands which form the HTTP cookie storage
management protocol. Note that \fIcookieJar\fR below does not have to be a
command name; it is properly a command prefix (a Tcl list of words that will
be expanded in place) and admits many possible implementations.
.PP
Though not formally part of the protocol, it is expected that particular
values of \fIcookieJar\fR will correspond to sessions; it is up to the caller
of \fB::http::config\fR to decide what session applies and to manage the
deletion of said sessions when they are no longer desired (which should be
when they not configured as the current cookie jar).
.TP
\fIcookieJar \fBgetCookies \fIprotocol host requestPath\fR
.
This command asks the cookie jar what cookies should be supplied for a
particular request. It should take the \fIprotocol\fR (typically \fBhttp\fR or
\fBhttps\fR), \fIhost\fR name and \fIrequestPath\fR (parsed from the \fIurl\fR
argument to \fB::http::geturl\fR) and return a list of cookie keys and values
that describe the cookies to supply to the remote host. The list must have an
even number of elements.
.RS
.PP
There should only ever be at most one cookie with a particular key for any
request (typically the one with the most specific \fIhost\fR/domain match and
most specific \fIrequestPath\fR/path match), but there may be many cookies
with different names in any request.
.RE
.TP
\fIcookieJar \fBstoreCookie \fIcookieDictionary\fR
.
This command asks the cookie jar to store a particular cookie that was
returned by a request; the result of this command is ignored. The cookie
(which will have been parsed by the http package) is described by a
dictionary, \fIcookieDictionary\fR, that may have the following keys:
.RS
.TP
\fBdomain\fR
.
This is always present. Its value describes the domain hostname \fIor
prefix\fR that the cookie should be returned for. The checking of the domain
against the origin (below) should be careful since sites that issue cookies
should only do so for domains related to themselves. Cookies that do not obey
a relevant origin matching rule should be ignored.
.TP
\fBexpires\fR
.
This is optional. If present, the cookie is intended to be a persistent cookie
and the value of the option is the Tcl timestamp (in seconds from the same
base as \fBclock seconds\fR) of when the cookie expires (which may be in the
past, which should result in the cookie being deleted immediately). If absent,
the cookie is intended to be a session cookie that should be not persisted
beyond the lifetime of the cookie jar.
.TP
\fBhostonly\fR
.
This is always present. Its value is a boolean that describes whether the
cookie is a single host cookie (true) or a domain-level cookie (false).
.TP
\fBhttponly\fR
.
This is always present. Its value is a boolean that is true when the site
wishes the cookie to only ever be used with HTTP (or HTTPS) traffic.
.TP
\fBkey\fR
.
This is always present. Its value is the \fIkey\fR of the cookie, which is
part of the information that must be return when sending this cookie back in a
future request.
.TP
\fBorigin\fR
.
This is always present. Its value describes where the http package believes it
received the cookie from, which may be useful for checking whether the
cookie's domain is valid.
.TP
\fBpath\fR
.
This is always present. Its value describes the path prefix of requests to the
cookie domain where the cookie should be returned.
.TP
\fBsecure\fR
.
This is always present. Its value is a boolean that is true when the cookie
should only used on requests sent over secure channels (typically HTTPS).
.TP
\fBvalue\fR
.
This is always present. Its value is the value of the cookie, which is part of
the information that must be return when sending this cookie back in a future
request.
.PP
Other keys may always be ignored; they have no meaning in this protocol.
.RE
.VE TIP406
.SH EXAMPLE
.PP
This example creates a procedure to copy a URL to a file while printing a
+88
View File
@@ -0,0 +1,88 @@
'\"
'\" Copyright (c) 2014-2018 Donal K. Fellows.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH "idna" n 0.1 http "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tcl::idna \- Support for normalization of Internationalized Domain Names
.SH SYNOPSIS
.nf
package require tcl::idna 1.0
\fBtcl::idna decode\fR \fIhostname\fR
\fBtcl::idna encode\fR \fIhostname\fR
\fBtcl::idna puny decode\fR \fIstring\fR ?\fIcase\fR?
\fBtcl::idna puny encode\fR \fIstring\fR ?\fIcase\fR?
\fBtcl::idna version\fR
.fi
.SH DESCRIPTION
This package provides an implementation of the punycode scheme used in
Internationalised Domain Names, and some access commands. (See RFC 3492 for a
description of punycode.)
.TP
\fBtcl::idna decode\fR \fIhostname\fR
.
This command takes the name of a host that potentially contains
punycode-encoded character sequences, \fIhostname\fR, and returns the hostname
as might be displayed to the user. Note that there are often UNICODE
characters that have extremely similar glyphs, so care should be taken with
displaying hostnames to users.
.TP
\fBtcl::idna encode\fR \fIhostname\fR
.
This command takes the name of a host as might be displayed to the user,
\fIhostname\fR, and returns the version of the hostname with characters not
permitted in basic hostnames encoded with punycode.
.TP
\fBtcl::idna puny\fR \fIsubcommand ...\fR
.
This command provides direct access to the basic punycode encoder and
decoder. It supports two \fIsubcommand\fRs:
.RS
.TP
\fBtcl::idna puny decode\fR \fIstring\fR ?\fIcase\fR?
.
This command decodes the punycode-encoded string, \fIstring\fR, and returns
the result. If \fIcase\fR is provided, it is a boolean to make the case be
folded to upper case (if \fIcase\fR is true) or lower case (if \fIcase\fR is
false) during the decoding process; if omitted, no case transformation is
applied.
.TP
\fBtcl::idna puny encode\fR \fIstring\fR ?\fIcase\fR?
.
This command encodes the string, \fIstring\fR, and returns the
punycode-encoded version of the string. If \fIcase\fR is provided, it is a
boolean to make the case be folded to upper case (if \fIcase\fR is true) or
lower case (if \fIcase\fR is false) during the encoding process; if omitted,
no case transformation is applied.
.RE
.TP
\fBtcl::idna version\fR
.
This returns the version of the \fBtcl::idna\fR package.
.SH "EXAMPLE"
.PP
This is an example of how punycoding of a string works:
.PP
.CS
package require tcl::idna
puts [\fBtcl::idna puny encode\fR "abc\(->def"]
# prints: \fIabcdef-kn2c\fR
puts [\fBtcl::idna puny decode\fR "abcdef-kn2c"]
# prints: \fIabc\(->def\fR
.CE
'\" TODO: show how it handles a real domain name
.SH "SEE ALSO"
http(n), cookiejar(n)
.SH KEYWORDS
internet, www
'\" Local Variables:
'\" mode: nroff
'\" fill-column: 78
'\" End:
+164 -236
View File
@@ -13,129 +13,102 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
info \- Return information about the state of the Tcl interpreter
info \- Information about the state of the Tcl interpreter
.SH SYNOPSIS
\fBinfo \fIoption \fR?\fIarg arg ...\fR?
.BE
.SH DESCRIPTION
.PP
This command provides information about various internals of the Tcl
interpreter.
The legal \fIoption\fRs (which may be abbreviated) are:
Available commands:
.TP
\fBinfo args \fIprocname\fR
.
Returns a list containing the names of the arguments to procedure
\fIprocname\fR, in order. \fIProcname\fR must be the name of a
Tcl command procedure.
Returns the names of the parameters to the procedure named \fIprocname\fR.
.TP
\fBinfo body \fIprocname\fR
.
Returns the body of procedure \fIprocname\fR. \fIProcname\fR must be
the name of a Tcl command procedure.
Returns the body of the procedure named \fIprocname\fR.
.TP
\fBinfo class\fI subcommand class\fR ?\fIarg ...\fR
.
Returns information about the class, \fIclass\fR. The \fIsubcommand\fRs are
described in \fBCLASS INTROSPECTION\fR below.
Returns information about the class named \fIclass\fR.
See \fBCLASS INTROSPECTION\fR below.
.TP
\fBinfo cmdcount\fR
.
Returns a count of the total number of commands that have been invoked
in this interpreter.
Returns the total number of commands evaluated in this interpreter.
.TP
\fBinfo cmdtype \fIcommandName\fR
.VS TIP426
Returns a description of the kind of command named by \fIcommandName\fR. The
supported types are:
Returns a the type of the command named \fIcommandName\fR.
Built-in types are:
.RS
.IP \fBalias\fR
Indicates that \fIcommandName\fR was created by \fBinterp alias\fR. Note that
safe interpreters can only see a subset of aliases (specifically those between
two commands within themselves).
\fIcommandName\fR was created by \fBinterp alias\fR.
In a safe interpreter an alias is only visible if both the alias and the
target are visible.
.IP \fBcoroutine\fR
Indicates that \fIcommandName\fR was created by \fBcoroutine\fR.
\fIcommandName\fR was created by \fBcoroutine\fR.
.IP \fBensemble\fR
Indicates that \fIcommandName\fR was created by \fBnamespace ensemble\fR.
\fIcommandName\fR was created by \fBnamespace ensemble\fR.
.IP \fBimport\fR
Indicates that \fIcommandName\fR was created by \fBnamespace import\fR.
\fIcommandName\fR was created by \fBnamespace import\fR.
.IP \fBnative\fR
Indicates that \fIcommandName\fR was created by the \fBTcl_CreateObjProc\fR
\fIcommandName\fR was created by the \fBTcl_CreateObjProc\fR
interface directly without further registration of the type of command.
.IP \fBobject\fR
Indicates that \fIcommandName\fR is the public command that represents an
\fIcommandName\fR is the public command that represents an
instance of \fBoo::object\fR or one of its subclasses.
.IP \fBprivateObject\fR
Indicates that \fIcommandName\fR is the private command (\fBmy\fR by default)
\fIcommandName\fR is the private command, \fBmy\fR by default,
that represents an instance of \fBoo::object\fR or one of its subclasses.
.IP \fBproc\fR
Indicates that \fIcommandName\fR was created by \fBproc\fR.
\fIcommandName\fR was created by \fBproc\fR.
.IP \fBslave\fR
Indicates that \fIcommandName\fR was created by \fBinterp create\fR.
\fIcommandName\fR was created by \fBinterp create\fR.
.IP \fBzlibStream\fR
Indicates that \fIcommandName\fR was created by \fBzlib stream\fR.
\fIcommandName\fR was created by \fBzlib stream\fR.
.PP
There may be other registered types as well; this is a set that is extensible
at the implementation level with \fBTcl_RegisterCommandTypeName\fR.
Other types may be also registered as well. See \fBTcl_RegisterCommandTypeName\fR.
.RE
.VE TIP426
.TP
\fBinfo commands \fR?\fIpattern\fR?
.
If \fIpattern\fR is not specified,
returns a list of names of all the Tcl commands visible
(i.e. executable without using a qualified name) to the current namespace,
including both the built-in commands written in C and
the command procedures defined using the \fBproc\fR command.
If \fIpattern\fR is specified,
only those names matching \fIpattern\fR are returned.
Matching is determined using the same rules as for \fBstring match\fR.
\fIpattern\fR can be a qualified name like \fBFoo::print*\fR.
That is, it may specify a particular namespace
using a sequence of namespace names separated by double colons (\fB::\fR),
and may have pattern matching special characters
at the end to specify a set of commands in that namespace.
If \fIpattern\fR is a qualified name,
the resulting list of command names has each one qualified with the name
of the specified namespace, and only the commands defined in the named
namespace are returned.
.\" Technically, most of this hasn't changed; that's mostly just the
.\" way it always worked. Hardly anyone knew that though.
Returns the names of all commands visible in the current namespace. If
\fIpattern\fR is given, returns only those names that match according to
\fBstring match\fR. Only the last component of \fIpattern\fR is a pattern.
Other components identify a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation.
.TP
\fBinfo complete \fIcommand\fR
.
Returns 1 if \fIcommand\fR is a complete Tcl command in the sense of
having no unclosed quotes, braces, brackets or array element names.
If the command does not appear to be complete then 0 is returned.
This command is typically used in line-oriented input environments
to allow users to type in commands that span multiple lines; if the
command is not complete, the script can delay evaluating it until additional
lines have been typed to complete the command.
Returns 1 if \fIcommand\fR is a complete command, and \fB0\fR otherwise.
Typically used in line-oriented input environments
to allow users to type in commands that span multiple lines.
.TP
\fBinfo coroutine\fR
.
Returns the name of the currently executing \fBcoroutine\fR, or the empty
string if either no coroutine is currently executing, or the current coroutine
has been deleted (but has not yet returned or yielded since deletion).
Returns the name of the current \fBcoroutine\fR, or the empty
string if there is no current coroutine or the current coroutine
has been deleted.
.TP
\fBinfo default \fIprocname arg varname\fR
\fBinfo default \fIprocname parameter varname\fR
.
\fIProcname\fR must be the name of a Tcl command procedure and \fIarg\fR
must be the name of an argument to that procedure. If \fIarg\fR
does not have a default value then the command returns \fB0\fR.
Otherwise it returns \fB1\fR and places the default value of \fIarg\fR
into variable \fIvarname\fR.
If the parameter \fIparameter\fR for the procedure named \fIprocname\fR has a
default value, stores that value in \fIvarname\fR and returns \fB1\fR.
Otherwise, returns \fB0\fR.
.TP
\fBinfo errorstack \fR?\fIinterp\fR?
.
Returns, in a form that is programmatically easy to parse, the function names
and arguments at each level from the call stack of the last error in the given
\fIinterp\fR, or in the current one if not specified.
Returns a description of the active command at each level for the
last error in the current interpreter, or in the interpreter named
\fIinterp\fR if given.
.RS
.PP
This form is an even-sized list alternating tokens and parameters. Tokens are
The description is a dictionary of tokens and parameters. Tokens are
currently either \fBCALL\fR, \fBUP\fR, or \fBINNER\fR, but other values may be
introduced in the future. \fBCALL\fR indicates a procedure call, and its
introduced in the future. \fBCALL\fR indicates a command call, and its
parameter is the corresponding \fBinfo level\fR \fB0\fR. \fBUP\fR indicates a
shift in variable frames generated by \fBuplevel\fR or similar, and applies to
the previous \fBCALL\fR item. Its parameter is the level offset. \fBINNER\fR
@@ -143,126 +116,103 @@ identifies the
.QW "inner context" ,
which is the innermost atomic command or bytecode instruction that raised the
error, along with its arguments when available. While \fBCALL\fR and \fBUP\fR
allow to follow complex call paths, \fBINNER\fR homes in on the offending
operation in the innermost procedure call, even going to sub-expression
provide a trail of the call path, \fBINNER\fR provides details of the offending
operation in the innermost procedure call, even to sub-expression
granularity.
.PP
This information is also present in the \fB\-errorstack\fR entry of the
options dictionary returned by 3-argument \fBcatch\fR; \fBinfo errorstack\fR
is a convenient way of retrieving it for uncaught errors at top-level in an
interactive \fBtclsh\fR.
interactive \fBinterpreter\fR.
.RE
.TP
\fBinfo exists \fIvarName\fR
.
Returns \fB1\fR if the variable named \fIvarName\fR exists in the
current context (either as a global or local variable) and has been
defined by being given a value, returns \fB0\fR otherwise.
Returns \fB1\fR if a variable named \fIvarName\fR is visible and has been
defined, and \fB0\fR otherwise.
.TP
\fBinfo frame\fR ?\fInumber\fR?
\fBinfo frame\fR ?\fIdepth\fR?
.
This command provides access to all frames on the stack, even those
hidden from \fBinfo level\fR. If \fInumber\fR is not specified, this
command returns a number giving the frame level of the command. This
is 1 if the command is invoked at top-level. If \fInumber\fR is
specified, then the result is a dictionary containing the location
information for the command at the \fInumber\fRed level on the stack.
Returns the depth of the call to \fBinfo frame\fR itself. Otherwise, returns a
dictionary describing the active command at the \fIdepth\fR, which counts all
commands visible to \fBinfo level\fR, plus commands that don't create a new
level, such as \fBeval\fR, \fBsource\fR, or \fIuplevel\fR. The frame depth is
always greater than the current level.
.RS
.PP
If \fInumber\fR is positive (> 0) then it selects a particular stack
level (1 refers to the outer-most active command, 2 to the command it
called, and so on, up to the current frame level which refers to
\fBinfo frame\fR itself); otherwise it gives a level relative to the
current command (0 refers to the current command, i.e., \fBinfo
frame\fR itself, -1 to its caller, and so on).
If \fIdepth\fR is greater than \fB0\fR it is the frame at that depth. Otherwise
it is the number of frames up from the current frame.
.PP
This is similar to how \fBinfo level\fR works, except that this
subcommand reports all frames, like \fBsource\fRd scripts,
\fBeval\fRs, \fBuplevel\fRs, etc.
.PP
Note that for nested commands, like
As with \fBinfo level\fR and error traces, for nested commands like
.QW "foo [bar [x]]" ,
only
.QW x
will be seen by an \fBinfo frame\fR invoked within
is seen by \fBinfo frame\fR invoked within
.QW x .
This is the same as for \fBinfo level\fR and error stack traces.
.PP
The result dictionary may contain the keys listed below, with the
specified meanings for their values:
The dictionary may contain the following keys:
.TP
\fBtype\fR
.
This entry is always present and describes the nature of the location
for the command. The recognized values are \fBsource\fR, \fBproc\fR,
Always present. Possible values are \fBsource\fR, \fBproc\fR,
\fBeval\fR, and \fBprecompiled\fR.
.RS
.TP
\fBsource\fR\0\0\0\0\0\0\0\0
.
means that the command is found in a script loaded by the \fBsource\fR
A script loaded via the \fBsource\fR
command.
.TP
\fBproc\fR\0\0\0\0\0\0\0\0
.
means that the command is found in dynamically created procedure body.
The body of a procedure that could not be traced back to a
line in a particular script.
.TP
\fBeval\fR\0\0\0\0\0\0\0\0
.
means that the command is executed by \fBeval\fR or \fBuplevel\fR.
The body of a script provided to \fBeval\fR or \fBuplevel\fR.
.TP
\fBprecompiled\fR\0\0\0\0\0\0\0\0
.
means that the command is found in a pre-compiled script (loadable by
the package \fBtbcload\fR), and no further information will be
available.
A pre-compiled script (loadable by the package
\fBtbcload\fR), and no further information is available.
.RE
.TP
\fBline\fR
.
This entry provides the number of the line the command is at inside of
the script it is a part of. This information is not present for type
\fBprecompiled\fR. For type \fBsource\fR this information is counted
relative to the beginning of the file, whereas for the last two types
the line is counted relative to the start of the script.
The line number of of the command inside its script. Not available for
\fBprecompiled\fR commands. When the type is \fBsource\fR, the line number is
relative to the beginning of the file, whereas for the last two types it is
relative to the start of the script.
.TP
\fBfile\fR
.
This entry is present only for type \fBsource\fR. It provides the
normalized path of the file the command is in.
For type \fBsource\fR, provides the normalized path of the file that contains
the command.
.TP
\fBcmd\fR
.
This entry provides the string representation of the command. This is
usually the unsubstituted form, however for commands which are a
canonically-constructed list (e.g., as produced by the \fBlist\fR command)
executed by \fBeval\fR it is the substituted form as they have no other
string representation. Care is taken that the canonicality property of
the latter is not spoiled.
The command before substitutions were performed.
.TP
\fBproc\fR
.
This entry is present only if the command is found in the body of a
regular Tcl procedure. It then provides the name of that procedure.
For type \fBprod\fR, the name of the procedure containing the command.
.TP
\fBlambda\fR
.
This entry is present only if the command is found in the body of an
anonymous Tcl procedure, i.e. a lambda. It then provides the entire
definition of the lambda in question.
For a command in a script evaluated as the body of an unnamed routine via the
\fBapply\fR command, the definition of that routine.
.TP
\fBlevel\fR
.
This entry is present only if the queried frame has a corresponding
frame returned by \fBinfo level\fR. It provides the index of this
frame, relative to the current level (0 and negative numbers).
For a frame that corresponds to a level, (to be determined).
.PP
A thing of note is that for procedures statically defined in files the
locations of commands in their bodies will be reported with type
\fBsource\fR and absolute line numbers, and not as type
\fBproc\fR. The same is true for procedures nested in statically
defined procedures, and literal eval scripts in files or statically
defined procedures.
When a command can be traced to its literal definition in some script, e.g.
procedures nested in statically defined procedures, and literal eval scripts in
files or statically defined procedures, its type is \fBsource\fR and its
location is the absolute line number in the script. Otherwise, its type is
\fBproc\fR and its location is its line number within the body of the
procedure.
.PP
In contrast, procedure definitions and \fBeval\fR within a dynamically
\fBeval\fRuated environment count line numbers relative to the start of
@@ -270,7 +220,7 @@ their script, even if they would be able to count relative to the
start of the outer dynamic script. That type of number usually makes
more sense.
.PP
A different way of describing this behaviour is that file based
A different way of describing this behaviour is that file-based
locations are tracked as deeply as possible, and where this is not
possible the lines are counted based on the smallest possible
\fBeval\fR or procedure body, as that scope is usually easier to find
@@ -284,152 +234,112 @@ counted relative to the start of each word (smallest scope)
.TP
\fBinfo functions \fR?\fIpattern\fR?
.
If \fIpattern\fR is not specified, returns a list of all the math
If \fIpattern\fR is not given, returns a list of all the math
functions currently defined.
If \fIpattern\fR is specified, only those functions whose name matches
\fIpattern\fR are returned. Matching is determined using the same
rules as for \fBstring match\fR.
If \fIpattern\fR is given, returns only those names that match
\fIpattern\fR according to \fBstring match\fR.
.TP
\fBinfo globals \fR?\fIpattern\fR?
.
If \fIpattern\fR is not specified, returns a list of all the names
If \fIpattern\fR is not given, returns a list of all the names
of currently-defined global variables.
Global variables are variables in the global namespace.
If \fIpattern\fR is specified, only those names matching \fIpattern\fR
If \fIpattern\fR is given, only those names matching \fIpattern\fR
are returned. Matching is determined using the same rules as for
\fBstring match\fR.
.TP
\fBinfo hostname\fR
.
Returns the name of the computer on which this invocation is being
executed.
Note that this name is not guaranteed to be the fully qualified domain
name of the host. Where machines have several different names (as is
Returns the name of the current host.
This name is not guaranteed to be the fully-qualified domain
name of the host. Where machines have several different names, as is
common on systems with both TCP/IP (DNS) and NetBIOS-based networking
installed,) it is the name that is suitable for TCP/IP networking that
installed, it is the name that is suitable for TCP/IP networking that
is returned.
.TP
\fBinfo level\fR ?\fInumber\fR?
\fBinfo level\fR ?\fIlevel\fR?
.
If \fInumber\fR is not specified, this command returns a number
giving the stack level of the invoking procedure, or 0 if the
command is invoked at top-level. If \fInumber\fR is specified,
then the result is a list consisting of the name and arguments for the
procedure call at level \fInumber\fR on the stack. If \fInumber\fR
is positive then it selects a particular stack level (1 refers
to the top-most active procedure, 2 to the procedure it called, and
so on); otherwise it gives a level relative to the current level
(0 refers to the current procedure, -1 to its caller, and so on).
See the \fBuplevel\fR command for more information on what stack
levels mean.
If \fInumber\fR is not given, the level this routine was called from.
Otherwise returns the complete command active at the given level. If
\fInumber\fR is greater than \fB0\fR, it is the desired level. Otherwise, it
is \fInumber\fR levels up from the current level. A complete command is the
words in the command, with all subsitutions performed, meaning that it is a
list. See \fBuplevel\fR for more information on levels.
.TP
\fBinfo library\fR
.
Returns the name of the library directory in which standard Tcl
scripts are stored.
This is actually the value of the \fBtcl_library\fR
variable and may be changed by setting \fBtcl_library\fR.
Returns the value of \fBtcl_library\fR, which is the name of the library
directory in which the scripts distributed with Tcl scripts are stored.
.TP
\fBinfo loaded \fR?\fIinterp\fR? ?\fIpackage\fR?
.
Returns the filename loaded as part of \fIpackage\fR. If \fIpackage\fR
is not specified, returns a list describing all of the packages
that have been loaded into \fIinterp\fR with the \fBload\fR command.
Each list element is a sub-list with two elements consisting of the
name of the file from which the package was loaded and the name of
the package.
For statically-loaded packages the file name will be an empty string.
If \fIinterp\fR is omitted then information is returned for all packages
loaded in any interpreter in the process.
To get a list of just the packages in the current interpreter, specify
an empty string for the \fIinterp\fR argument.
Returns the name of each file loaded in \fIinterp\fR va \fBload\fR as part of
\fIpackage\fR . If \fIpackage\fR is not given, returns a list where each item
is the name of the loaded file and the name of the package for which the file
was loaded. For a statically-loaded package the name of the file is the empty
string. For \fInterp\fR, the empty string is the current interpreter.
.TP
\fBinfo locals \fR?\fIpattern\fR?
.
If \fIpattern\fR is not specified, returns a list of all the names
of currently-defined local variables, including arguments to the
current procedure, if any.
Variables defined with the \fBglobal\fR, \fBupvar\fR and
\fBvariable\fR commands will not be returned.
If \fIpattern\fR is specified, only those names matching \fIpattern\fR
are returned. Matching is determined using the same rules as for
\fBstring match\fR.
If \fIpattern\fR is given, returns the name of each local variable matching
\fIpattern\fR according to \fBstring match\fR. Otherwise, returns the name of
each local variable. A variables defined with the \fBglobal\fR, \fBupvar\fR or
\fBvariable\fR is not local.
.TP
\fBinfo nameofexecutable\fR
.
Returns the full path name of the binary file from which the application
was invoked. If Tcl was unable to identify the file, then an empty
string is returned.
Returns the absolute pathname of the program for the current interpreter. If
such a file can not be identified an empty string is returned.
.TP
\fBinfo object\fI subcommand object\fR ?\fIarg ...\fR
.
Returns information about the object, \fIobject\fR. The \fIsubcommand\fRs are
described in \fBOBJECT INTROSPECTION\fR below.
Returns information about the object named \fIobject\fR. \fIsubcommand\fR is
described \fBOBJECT INTROSPECTION\fR below.
.TP
\fBinfo patchlevel\fR
.
Returns the value of the global variable \fBtcl_patchLevel\fR, which holds
the exact version of the Tcl library by default.
Returns the value of the global variable \fBtcl_patchLevel\fR, in which the
exact version of the Tcl library initially stored.
.TP
\fBinfo procs \fR?\fIpattern\fR?
.
If \fIpattern\fR is not specified, returns a list of all the
names of Tcl command procedures in the current namespace.
If \fIpattern\fR is specified,
only those procedure names in the current namespace
matching \fIpattern\fR are returned.
Matching is determined using the same rules as for
\fBstring match\fR.
If \fIpattern\fR contains any namespace separators, they are used to
select a namespace relative to the current namespace (or relative to
the global namespace if \fIpattern\fR starts with \fB::\fR) to match
within; the matching pattern is taken to be the part after the last
namespace separator.
Returns the names of all visible procedures. If \fIpattern\fR is given, returns
only those names that match according to \fBstring match\fR. Only the final
component in \fIpattern\fR is actually considered a pattern. Any qualifying
components simply select a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation.
.TP
\fBinfo script\fR ?\fIfilename\fR?
.
If a Tcl script file is currently being evaluated (i.e. there is a
call to \fBTcl_EvalFile\fR active or there is an active invocation
of the \fBsource\fR command), then this command returns the name
of the innermost file being processed. If \fIfilename\fR is specified,
then the return value of this command will be modified for the
duration of the active invocation to return that name. This is
useful in virtual file system applications.
Otherwise the command returns an empty string.
Returns the pathname of the innermost script currently being evaluated, or the
empty string if no pathname can be determined. If \fIfilename\fR is given,
sets the return value of any future calls to \fBinfo script\fR for the duration
of the innermost active script. This is useful in virtual file system
applications.
.TP
\fBinfo sharedlibextension\fR
.
Returns the extension used on this platform for the names of files
containing shared libraries (for example, \fB.so\fR under Solaris).
If shared libraries are not supported on this platform then an empty
string is returned.
Returns the extension used on this platform for names of shared libraries, e.g.
\fB.so\fR under Solaris. Returns the empty string if shared libraries are not
supported on this platform.
.TP
\fBinfo tclversion\fR
.
Returns the value of the global variable \fBtcl_version\fR, which holds the
major and minor version of the Tcl library by default.
Returns the value of the global variable \fBtcl_version\fR, in which the
major and minor version of the Tcl library are stored.
.TP
\fBinfo vars\fR ?\fIpattern\fR?
.
If \fIpattern\fR is not specified,
returns a list of all the names of currently-visible variables.
This includes locals and currently-visible globals.
If \fIpattern\fR is specified, only those names matching \fIpattern\fR
are returned. Matching is determined using the same rules as for
\fBstring match\fR.
\fIpattern\fR can be a qualified name like \fBFoo::option*\fR.
That is, it may specify a particular namespace
using a sequence of namespace names separated by double colons (\fB::\fR),
and may have pattern matching special characters
at the end to specify a set of variables in that namespace.
If \fIpattern\fR is a qualified name,
the resulting list of variable names
has each matching namespace variable qualified with the name
of its namespace.
Note that a currently-visible variable may not yet
.QW exist
if it has not
been set (e.g. a variable declared but not set by \fBvariable\fR).
If \fIpattern\fR is not given, returns the names of all visible variables. If
\fIpattern\fR is given, returns only those names that match according to
\fBstring match\fR. Only the last component of \fIpattern\fR is a pattern.
Other components identify a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation. When \fIpattern\fR is a qualified name,
results are fully qualified.
A variable that has declared but not yet defined is included in the results.
.SS "CLASS INTROSPECTION"
.PP
The following \fIsubcommand\fR values are supported by \fBinfo class\fR:
@@ -481,6 +391,24 @@ list; the first element is the list of arguments to the method in a form
suitable for passing to another call to \fBproc\fR or a method definition, and
the second element is the body of the method.
.TP
\fBinfo class definitionnamespace\fI class\fR ?\fIkind\fR?
.VS TIP524
This subcommand returns the definition namespace for \fIkind\fR definitions of
the class \fIclass\fR; the definition namespace only affects the instances of
\fIclass\fR, not \fIclass\fR itself. The \fIkind\fR can be either
\fB\-class\fR to return the definition namespace used for \fBoo::define\fR, or
\fB\-instance\fR to return the definition namespace used for
\fBoo::objdefine\fR; the \fB\-class\fR kind is default (though this is only
actually useful on classes that are subclasses of \fBoo::class\fR).
.RS
.PP
If \fIclass\fR does not provide a definition namespace of the given kind,
this command returns the empty string. In those circumstances, the
\fBoo::define\fR and \fBoo::objdefine\fR commands look up which definition
namespace to use using the class inheritance hierarchy.
.RE
.VE TIP524
.TP
\fBinfo class destructor\fI class\fR
.
This subcommand returns the body of the destructor of class \fIclass\fR. If no
@@ -505,7 +433,7 @@ instances to those that match it according to the rules of \fBstring match\fR.
.
This subcommand returns a list of all public (i.e. exported) methods of the
class called \fIclass\fR. Any of the following \fIoption\fRs may be
specified, controlling exactly which method names are returned:
given, controlling exactly which method names are returned:
.RS
.TP
\fB\-all\fR
@@ -582,7 +510,7 @@ This subcommand returns a list of all variables that have been declared for
the class named \fIclass\fR (i.e. that are automatically present in the
class's methods, constructor and destructor).
.VS TIP500
If the \fB\-private\fR option is specified, this lists the private variables
If the \fB\-private\fR option is given, this lists the private variables
declared instead.
.VE TIP500
.SS "OBJECT INTROSPECTION"
@@ -620,7 +548,7 @@ methods.
.TP
\fBinfo object class\fI object\fR ?\fIclassName\fR?
.
If \fIclassName\fR is unspecified, this subcommand returns class of the
If \fIclassName\fR is not given, this subcommand returns class of the
\fIobject\fR object. If \fIclassName\fR is present, this subcommand returns a
boolean value indicating whether the \fIobject\fR is of that class.
.TP
@@ -689,7 +617,7 @@ direct or indirect).
.
This subcommand returns a list of all public (i.e. exported) methods of the
object called \fIobject\fR. Any of the following \fIoption\fRs may be
specified, controlling exactly which method names are returned:
given, controlling exactly which method names are returned:
.RS
.TP
\fB\-all\fR
@@ -759,7 +687,7 @@ This subcommand returns a list of all variables that have been declared for
the object named \fIobject\fR (i.e. that are automatically present in the
object's methods).
.VS TIP500
If the \fB\-private\fR option is specified, this lists the private variables
If the \fB\-private\fR option is given, this lists the private variables
declared instead.
.VE TIP500
.TP
+2 -2
View File
@@ -201,7 +201,7 @@ slave interpreter identified by \fIpath\fR. If no arguments are
given, option and current setting are returned. If \fB\-frame\fR
is given, the debug setting is set to the given boolean if provided
and the current setting is returned.
This only effects the output of \fBinfo frame\fR, in that exact
This only affects the output of \fBinfo frame\fR, in that exact
frame-level information for command invocation at the bytecode level
is only captured with this setting on.
.RS
@@ -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
@@ -154,7 +154,7 @@ The following is a minimal extension:
.CS
#include <tcl.h>
#include <stdio.h>
static int fooCmd(void *clientData,
static int fooCmd(ClientData clientData,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) {
printf("called with %d arguments\en", objc);
return TCL_OK;
+96
View File
@@ -0,0 +1,96 @@
'\"
'\" Copyright (c) 2018 by Peter Spjuth. All rights reserved.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH lpop n 8.7 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lpop \- Get and remove an element in a list
.SH SYNOPSIS
\fBlpop \fIvarName ?index ...?\fR
.BE
.SH DESCRIPTION
.PP
The \fBlpop\fR command accepts a parameter, \fIvarName\fR, which
it interprets as the name of a variable containing a Tcl list.
It also accepts one or more \fIindices\fR into
the list. If no indices are presented, it defaults to "end".
.PP
When presented with a single index, the \fBlpop\fR command
addresses the \fIindex\fR'th element in it, removes if from the list
and returns the element.
.PP
If \fIindex\fR is negative or greater or equal than the number
of elements in \fI$varName\fR, then an error occurs.
.PP
The interpretation of each simple \fIindex\fR value is the same as
for the command \fBstring index\fR, supporting simple index
arithmetic and indices relative to the end of the list.
.PP
If additional \fIindex\fR arguments are supplied, then each argument is
used in turn to address an element within a sublist designated
by the previous indexing operation,
allowing the script to remove elements in sublists.
The command,
.PP
.CS
\fBlpop\fR a 1 2
.CE
.PP
gets and removes element 2 of sublist 1.
.PP
.SH EXAMPLES
.PP
In each of these examples, the initial value of \fIx\fR is:
.PP
.CS
set x [list [list a b c] [list d e f] [list g h i]]
\fI\(-> {a b c} {d e f} {g h i}\fR
.CE
.PP
The indicated value becomes the new value of \fIx\fR
(except in the last case, which is an error which leaves the value of
\fIx\fR unchanged.)
.PP
.CS
\fBlpop\fR x 0
\fI\(-> {d e f} {g h i}\fR
\fBlpop\fR x 2
\fI\(-> {a b c} {d e f}\fR
\fBlpop\fR x end
\fI\(-> {a b c} {d e f}\fR
\fBlpop\fR x end-1
\fI\(-> {a b c} {g h i}\fR
\fBlpop\fR x 2 1
\fI\(-> {a b c} {d e f} {g i}\fR
\fBlpop\fR x 2 3 j
\fI\(-> list index out of range\fR
.CE
.PP
In the following examples, the initial value of \fIx\fR is:
.PP
.CS
set x [list [list [list a b] [list c d]] \e
[list [list e f] [list g h]]]
\fI\(-> {{a b} {c d}} {{e f} {g h}}\fR
.CE
.PP
The indicated value becomes the new value of \fIx\fR.
.PP
.CS
\fBlpop\fR x 1 1 0
\fI\(-> {{a b} {c d}} {{e f} h}\fR
.CE
.SH "SEE ALSO"
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
lsort(n), lrange(n), lreplace(n), lset(n)
string(n)
.SH KEYWORDS
element, index, list, remove, pop, stack, queue
'\"Local Variables:
'\"mode: nroff
'\"End:
+4 -1
View File
@@ -106,7 +106,10 @@ of which work solely with floating-point numbers unless otherwise noted:
In addition to these predefined functions, applications may
define additional functions by using \fBproc\fR (or any other method,
such as \fBinterp alias\fR or \fBTcl_CreateObjCommand\fR) to define
new commands in the \fBtcl::mathfunc\fR namespace.
new commands in the \fBtcl::mathfunc\fR namespace. In addition, an
obsolete interface named \fBTcl_CreateMathFunc\fR() is available to
extensions that are written in C. The latter interface is not recommended
for new implementations.
.SS "DETAILED DEFINITIONS"
.TP
\fBabs \fIarg\fR
+5 -4
View File
@@ -151,10 +151,11 @@ is the same as
.QW "\fB** 2 [** 3 4]\fR" .
Each \fInumber\fR may be
any numeric value, though the second number must not be fractional if the
first is negative. If no arguments are given, the result will be one, and if
only one argument is given, the result will be that argument. The
result will have an integral value only when all arguments are
integral values.
first is negative. The maximum exponent value that Tcl can handle if the
first number is an integer > 1 is 268435455. If no arguments are given,
the result will be one, and if only one argument is given, the result will
be that argument. The result will have an integral value only when all
arguments are integral values.
.SS "COMPARISON OPERATORS"
.PP
The behaviors of the comparison operator commands (most of which operate
+16 -16
View File
@@ -25,7 +25,7 @@ Write a list of all currently allocated memory to the specified \fIfile\fR.
.TP
\fBmemory break_on_malloc\fR \fIcount\fR
.
After the \fIcount\fR allocations have been performed, \fBTcl_Alloc\fR
After the \fIcount\fR allocations have been performed, \fBckalloc\fR
outputs a message to this effect and that it is now attempting to enter
the C debugger. Tcl will then issue a \fISIGINT\fR signal against itself.
If you are running Tcl under a C debugger, it should then enter the debugger
@@ -35,8 +35,8 @@ command mode.
.
Returns a report containing the total allocations and frees since
Tcl began, the current packets allocated (the current
number of calls to \fBTcl_Alloc\fR not met by a corresponding call
to \fBTcl_Free\fR), the current bytes allocated, and the maximum number
number of calls to \fBckalloc\fR not met by a corresponding call
to \fBckfree\fR), the current bytes allocated, and the maximum number
of packets and bytes allocated.
.TP
\fBmemory init \fR[\fBon\fR|\fBoff\fR]
@@ -59,34 +59,34 @@ that memory is properly cleaned up during process exit.
.TP
\fBmemory tag\fR \fIstring\fR
.
Each packet of memory allocated by \fBTcl_Alloc\fR can have associated
Each packet of memory allocated by \fBckalloc\fR can have associated
with it a string-valued tag. In the lists of allocated memory generated
by \fBmemory active\fR and \fBmemory onexit\fR, the tag for each packet
is printed along with other information about the packet. The
\fBmemory tag\fR command sets the tag value for subsequent calls
to \fBTcl_Alloc\fR to be \fIstring\fR.
to \fBckalloc\fR to be \fIstring\fR.
.TP
\fBmemory trace \fR[\fBon\fR|\fBoff\fR]
.
Turns memory tracing on or off. When memory tracing is on, every call
to \fBTcl_Alloc\fR causes a line of trace information to be written to
\fIstderr\fR, consisting of the word \fITcl_Alloc\fR, followed by the
to \fBckalloc\fR causes a line of trace information to be written to
\fIstderr\fR, consisting of the word \fIckalloc\fR, followed by the
address returned, the amount of memory allocated, and the C filename
and line number of the code performing the allocation. For example:
.RS
.PP
.CS
Tcl_Alloc 40e478 98 tclProc.c 1406
ckalloc 40e478 98 tclProc.c 1406
.CE
.PP
Calls to \fBTcl_Free\fR are traced in the same manner.
Calls to \fBckfree\fR are traced in the same manner.
.RE
.TP
\fBmemory trace_on_at_malloc\fR \fIcount\fR
.
Enable memory tracing after \fIcount\fR \fBTcl_Alloc\fRs have been performed.
Enable memory tracing after \fIcount\fR \fBckalloc\fRs have been performed.
For example, if you enter \fBmemory trace_on_at_malloc 100\fR,
after the 100th call to \fBTcl_Alloc\fR, memory trace information will begin
after the 100th call to \fBckalloc\fR, memory trace information will begin
being displayed for all allocations and frees. Since there can be a lot
of memory activity before a problem occurs, judicious use of this option
can reduce the slowdown caused by tracing (and the amount of trace information
@@ -97,17 +97,17 @@ occurred since Tcl started is printed on a guard zone failure.
\fBmemory validate \fR[\fBon\fR|\fBoff\fR]
.
Turns memory validation on or off. When memory validation is enabled,
on every call to \fBTcl_Alloc\fR or \fBTcl_Free\fR, the guard zones are
on every call to \fBckalloc\fR or \fBckfree\fR, the guard zones are
checked for every piece of memory currently in existence that was
allocated by \fBTcl_Alloc\fR. This has a large performance impact and
allocated by \fBckalloc\fR. This has a large performance impact and
should only be used when overwrite problems are strongly suspected.
The advantage of enabling memory validation is that a guard zone
overwrite can be detected on the first call to \fBTcl_Alloc\fR or
\fBTcl_Free\fR after the overwrite occurred, rather than when the
overwrite can be detected on the first call to \fBckalloc\fR or
\fBckfree\fR after the overwrite occurred, rather than when the
specific memory with the overwritten guard zone(s) is freed, which may
occur long after the overwrite occurred.
.SH "SEE ALSO"
Tcl_Alloc, Tcl_Free, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG
ckalloc, ckfree, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG
.SH KEYWORDS
memory, debug
'\"Local Variables:

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