Compare commits

...
Author SHA1 Message Date
jan.nijtmans 24a416ad38 Merge 8.7 2020-02-26 10:58:01 +00:00
jan.nijtmans 5c61b2bbdc Merge 8.6 2020-02-26 08:04:34 +00:00
jan.nijtmans 14276a3feb Make tclWinDde.c compilable with C++ compiler. dde -> 1.4.3
Make tclWinReg.c compilable with C++ compiler. registry -> 1.3.5
2020-02-26 07:58:38 +00:00
jan.nijtmans 9eeda3feb2 Make tclWinDde.c compilable with C++ compiler. dde -> 1.4.3
Make tclWinReg.c compilable with C++ compiler. registry -> 1.3.5
2020-02-26 07:51:52 +00:00
dkf 1eeefb073a Ensure that we release the correct references when an error occurs during setting a class's superclasses 2020-02-25 15:07:51 +00:00
jan.nijtmans f0ead2e309 merge-mark 2020-02-24 13:16:53 +00:00
jan.nijtmans 0c37363fff Correct ANSI prototype of TclNokia770Doubles() 2020-02-24 13:07:13 +00:00
jan.nijtmans c7814dd59f Merge 8.6 2020-02-24 12:18:31 +00:00
jan.nijtmans 730152b608 Merge 8.5 2020-02-24 12:01:04 +00:00
jan.nijtmans 904ba06b0a Add -Wpointer-arith warning to C-compile. Fix gcc(-9) warning. 2020-02-24 11:07:18 +00:00
dkf fc3487d2b2 typo fix 2020-02-22 12:34:14 +00:00
jan.nijtmans 5eb39e3973 Fix [da235271f1]: [info hostname] on Windows is limited to max NetBIOS name length 2020-02-21 09:25:03 +00:00
jan.nijtmans 5c1a56d36b Merge 8.6 2020-02-21 08:52:54 +00:00
jan.nijtmans 1fb8e115c4 Restore compatibility with older (mingw) Makefiles. Fix for [4b5deacc70]: undefined reference to `Tcl_SetStartupScript'. 2020-02-21 08:46:15 +00:00
sebres e2bcebca79 merge 8.5 2020-02-17 14:52:54 +00:00
sebres 471091f55a windows: avoid create of legacy error-vars on init phase (in fresh created interpreter) - no tcl_pkgPath variable on windows 2020-02-17 14:50:45 +00:00
jan.nijtmans 958180f361 Merge-mark 2020-02-14 09:23:42 +00:00
jan.nijtmans 5c380477df (cherry-pick): Fix travis build, due to the change of Windows image. 2020-02-14 09:21:44 +00:00
jan.nijtmans 8c3eb78cf7 Merge 8.7 2020-02-13 22:06:10 +00:00
jan.nijtmans 73cc9cd62f Merge 8.6 2020-02-12 13:18:27 +00:00
jan.nijtmans c11eec4d5d Fix travis build, due to the change of Windows image. 2020-02-12 13:12:08 +00:00
jan.nijtmans 0f3e54cedb Move build from xenial to bionic. Add Xcode11.3 build for MacOS (now that we are on it anyway) 2020-02-11 16:38:45 +00:00
jan.nijtmans 2a89abd783 Attempt to fix travis build. See: [https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098] 2020-02-11 15:59:38 +00:00
jan.nijtmans 55b841549a merge-mark 2020-02-05 16:41:25 +00:00
jan.nijtmans b1791f0b92 (cherry-pick): It appears that inttypes.h was introduced in Visual Studio 2013 2020-02-05 16:40:19 +00:00
jan.nijtmans 517974e23b Merge 8.6 2020-02-04 11:04:28 +00:00
jan.nijtmans 6f55ec4986 Clean up some usage of DBGX: It isn't used any more on UNIX 2020-02-04 11:03:12 +00:00
jan.nijtmans 225b4e7cc0 It appears that inttypes.h was introduced in Visual Studio 2013 2020-02-04 08:28:07 +00:00
jan.nijtmans 4ee1ddaeaa TclInitBignumFromWide(U)Int is not used any more. 2020-02-02 16:26:36 +00:00
jan.nijtmans f06c1e0ba4 Fix conflict between (unpatched) tommath.h and tcl.h. See also [https://github.com/libtom/libtommath/pull/473] 2020-02-02 15:24:58 +00:00
jan.nijtmans cac60f04fc Add 64-bit seek to the ZipChannel 2020-01-31 07:54:59 +00:00
sebres 944694962a merge 8.6 2020-01-30 15:44:23 +00:00
sebres 61962d02f5 merge 8.5 2020-01-30 15:39:56 +00:00
sebres f05d9af86d introduces new command and constraint testWithLimit (as include tests/internals.tcl) that can be used to test a code under restricted circumstances (e.g. limited address space) 2020-01-30 15:32:51 +00:00
jan.nijtmans c8c1298bb3 Merge 8.6 2020-01-30 13:54:01 +00:00
jan.nijtmans f58b90fb02 Reset WSAGetLastError()/errno always, even when this error is not reported due to the earlier error. 2020-01-30 13:52:58 +00:00
jan.nijtmans 64fdac4aec Merge 8.6 2020-01-30 13:21:38 +00:00
jan.nijtmans ee66478056 Simplify the use of HaveVersion() in Channel handling. Nothing functional, only code clean-up. 2020-01-30 13:04:12 +00:00
jan.nijtmans 56f2fc4f04 According to the [https://core.tcl-lang.org/tcl/artifact?udc=1&ln=469-471&name=5ac7827cd282bbda|documentation], close2Proc(...., 0) should operate the same as closeProc(). Fix the UNIX/Windows socket channels to behave like that. 2020-01-30 13:00:12 +00:00
sebres 782689d5eb small amend (comments only) 2020-01-29 17:02:16 +00:00
sebres 57321fa4a4 better test covering [5d989f9ba3] - limiting AS considers normal memory usage of process;
prepared for new common test-facility (test-with-limit) for resticted execution
2020-01-29 16:50:56 +00:00
jan.nijtmans 667676a551 Fix compiler warnings on Cygwin when using -DTCL_NO_DEPRECATED
Use TCL_CHANNEL_VERSION_5 in stead of TCL_CHANNEL_VERSION_3 in tclZlib.c
2020-01-29 13:02:06 +00:00
jan.nijtmans 7c48658c9f Fix install-libraries-zipfs-static target: On Windows INSTALL_DATA makes no sense. Reported by René Zaumseil. Thanks! 2020-01-27 10:31:36 +00:00
jan.nijtmans bfed58b030 TIP #559 follow-up: Make sure that if Tcl_FreeResult() is used in an extension compiled with -DTCL_NO_DEPRECATED, this results in a link error.
Do the same with deprecated funcions from other TIP's.
2020-01-25 14:51:08 +00:00
dgp e6800a165c Implement TIP 559 2020-01-24 16:44:25 +00:00
apnadkarni b20939682d Fix See also links in list commands 2020-01-23 15:40:08 +00:00
jan.nijtmans 05776cbb41 Merge 8.6 2020-01-23 13:14:09 +00:00
jan.nijtmans 92c8a53689 Better error-handling in some libtommath calls. 2020-01-23 12:55:41 +00:00
jan.nijtmans c15121ae96 Add error-handling to all libtommath function calls. Most likely not perfect (open for further improvements/review), but for sure better than no error-handling at all. 2020-01-23 10:33:37 +00:00
jan.nijtmans b9f442e8b2 Merge 8.6 2020-01-23 09:46:18 +00:00
jan.nijtmans ff928c6450 Merge 8.5 2020-01-23 08:33:22 +00:00
jan.nijtmans ad096310ec Last unused internal stub entry from 258 to 259. 2020-01-23 08:29:26 +00:00
jan.nijtmans e03aa95407 Merge 8.7. All calls using MP_WUR handled now. 2020-01-22 09:26:00 +00:00
dgp 5dab8a0c6b Implement TIP 543 2020-01-21 22:00:20 +00:00
jan.nijtmans 05ed23d325 Merge 8.7, more WIP 2020-01-21 16:05:02 +00:00
jan.nijtmans 220ee76c14 merge-mark 2020-01-21 08:49:21 +00:00
jan.nijtmans 0f71efe445 Don't run stack-3.1 test on OSX, it fail regulary. Don't really bother for Tcl 8.5 any more. 2020-01-21 08:48:17 +00:00
jan.nijtmans 7eeeb51309 Merge-mark 2020-01-20 15:28:38 +00:00
jan.nijtmans e403afa147 Now that TIP #538 is integrated, make rules.vc work for both 8.6 and 8.7 without changes. 2020-01-20 15:27:47 +00:00
jan.nijtmans a3906f4953 Don't deprecate Tcl_NewUnicodeObj/Tcl_SetUnicodeObj/Tcl_GetUnicodeFromObj, since that's not according to TIP #542. (Those are only deprecated when using TCL_UTF_MAX=4, not in the general case) 2020-01-20 14:35:25 +00:00
jan.nijtmans 12d3b15f30 Implementation of TIP #542: Support for switchable Full Unicode support 2020-01-20 12:18:34 +00:00
sebres 668c35bfc2 merge 8.6 2020-01-17 17:15:37 +00:00
sebres 33c6ac50b3 merge 8.5 (closes [5d989f9ba3]: avoid segfault by OOM if too many items to sort) 2020-01-17 17:08:18 +00:00
sebres a3728e6d82 small amend (skip messages, avoid output on interactive shell) 2020-01-17 16:40:37 +00:00
sebres 35ec25a6cf closes [5d989f9ba3]: avoid segfault by OOM if too many items to sort (would throw an error instead, and use system alloc for long elementArray due to size_t);
added test cases covering that (in child process with limited address space, if "prlimit" available)
2020-01-17 16:12:06 +00:00
dgp eb5163d9e8 merge 8.7 2020-01-17 15:37:22 +00:00
jan.nijtmans 3262fa4d4e Merge 8.7, more WIP 2020-01-17 10:43:44 +00:00
jan.nijtmans 37ad5db296 Merge 8.6 2020-01-17 08:54:21 +00:00
jan.nijtmans 9169847966 Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) 2020-01-17 08:53:29 +00:00
jan.nijtmans eb08a10e38 Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) 2020-01-17 08:51:38 +00:00
jan.nijtmans d59509dee2 Proposed fix for [8cd2fe7474]: "unload" command Bug (when handling multiple libs) 2020-01-16 14:16:48 +00:00
jan.nijtmans e446f6c309 Merge 8.7 2020-01-15 15:29:54 +00:00
jan.nijtmans 3101fc1da1 Merge-mark 8.6. Remove a few "break"'s added in the previous commit, because they are redundant. 2020-01-15 10:21:02 +00:00
jan.nijtmans 9a78221b8d A few more "break" statements, so any compiler knows these are no FALLTHROUGH situations. 2020-01-15 10:07:46 +00:00
jan.nijtmans 939c35f568 A few more "break" statements, so any compiler knows these are no FALLTHROUGH situations. 2020-01-14 09:09:50 +00:00
jan.nijtmans c6135def08 Attempt to resolve a conflict between (unmodified) tommath.h and tcl.h in the definition of mp_int. See: [https://github.com/libtom/libtommath/pull/473] 2020-01-13 21:46:18 +00:00
dgp 9b0b0dc37d Implement TIP 559 (deprecation part). 2020-01-13 17:00:21 +00:00
jan.nijtmans 41e035d59b Merge 8.6 2020-01-13 15:20:03 +00:00
jan.nijtmans 46a6094df7 Fix [cff53cf7d0]: Failed test oo-0.9 in file oo.test in Tcl8.6.10 2020-01-13 15:19:08 +00:00
jan.nijtmans a8e3a2a3a8 Merge 8.6 2020-01-13 12:47:13 +00:00
jan.nijtmans 6a4eb9df57 Add ${LDFLAGS} to MAKE_LIB. This handles the possibility of adding LDFLAGS=?? on the "configure" commandline. Suggested by Pietro Cerutti. Thanks! 2020-01-13 12:17:09 +00:00
jan.nijtmans f468073bd5 Merge 8.6 2020-01-13 10:44:25 +00:00
jan.nijtmans 997e0f3505 Fix [0b9332722a]: Support utf-8 on Windows console 2020-01-13 10:01:30 +00:00
jan.nijtmans f3070aa2fc Silence some gcc-9 compiler warnings. 2020-01-13 10:00:03 +00:00
dgp 31f988f9c8 merge 8.7 2020-01-10 17:40:34 +00:00
jan.nijtmans 8c3314fad9 More WIP 2020-01-10 16:00:03 +00:00
jan.nijtmans 2d27c96b7e tommath_private.h : Remove special C4146 handling: already done in tclWinPort.h too.
tcl.pc.in:  Make sure that libtommath >= 1.2.0
2020-01-10 15:18:36 +00:00
jan.nijtmans f608fa90db Put "-ltommath" in $MATH_LIBS in stead of $LIBS, so it won't be used by other checks in the configure script. Suggested by Pietro Cerutti. 2020-01-09 09:27:09 +00:00
jan.nijtmans 07829dc8b9 Put "-ltommath" in $MATH_LIBS in stead of $LIBS, so it won't be used by other checks in the configure script. Suggested by Pietro Cerutti. 2020-01-09 09:25:56 +00:00
jan.nijtmans cc211af4ea Start handling WUR (Warn Unused Result) in all tommath calls. WIP, not complete yet. 2020-01-09 09:20:57 +00:00
dgp f7076c6ce8 merge 8.7 2020-01-08 23:00:06 +00:00
dgp 8ef7bd41b6 Improvements to doc changes from TIPs 422 and 512. 2020-01-08 22:25:36 +00:00
dgp 0d799f84b3 s/in stead/instead/ 2020-01-08 21:40:10 +00:00
dgp d1f6dc44aa s/in stead/instead/ 2020-01-08 21:39:12 +00:00
dgp 6804338322 merge 8.6 2020-01-08 21:10:10 +00:00
dgp 780f439396 Remove another mention of interp->result. 2020-01-08 16:53:25 +00:00
dgp 0215962576 Revise documentation that refers to direct access to interp->result. 2020-01-08 14:23:06 +00:00
jan.nijtmans 0c195b760a Merge 8.6 2020-01-08 13:16:49 +00:00
jan.nijtmans 0df818c01f Use _copysign on Windows always (available from float.h). Use mp_iszero() whenever appropriate. 2020-01-08 12:51:29 +00:00
jan.nijtmans 3b3abe0ce1 Code cleanup (mostly comments, backported from 8.6). 2020-01-08 11:53:03 +00:00
jan.nijtmans 4afa382971 Merge 8.7 2020-01-07 15:44:16 +00:00
jan.nijtmans 0ba9e042a2 Merge 8.7 2020-01-07 15:22:06 +00:00
jan.nijtmans 14b5289e4a Merge 8.7 2020-01-07 15:20:49 +00:00
jan.nijtmans 49a7184962 Don't use "operator" as variable name, as it is a keyword in C++.
Add some break statements, so Tcl can be compiled warning-free with gcc-7's -Wimplicit-fallthrough
A few better indications of unused (dummy) functions parameters.
2020-01-07 14:42:15 +00:00
jan.nijtmans 7c23c57789 Some eol whitespace eliminations 2020-01-07 14:32:16 +00:00
jan.nijtmans 7d90738e3a One more place where the (deprecated) "unicode" encoding was still used. 2020-01-07 12:18:51 +00:00
jan.nijtmans d92cffaa0c Remove type-casts in many Tcl_LinkVar() calls, which is no longer necessary since 8.7.
Small missing piece in Tcl_LinkArray() implementation, handling (unsigned) longs on 64-bit platforms.
2020-01-07 09:24:19 +00:00
jan.nijtmans 0bf39185fb Fix test encoding-28.0, adapting for the correct number of available encodings 2020-01-07 08:35:34 +00:00
dgp 1923110631 one more 2020-01-06 20:24:25 +00:00
dgp c187695b61 Bring docs up to date with TIP 330 and TIP 336 changes already in Tcl 8.7 2020-01-06 20:12:32 +00:00
dgp edcdd9afe1 Missing bit of interp->result deprecation. 2020-01-06 18:07:43 +00:00
dgp f140e958c5 Remove "new in 8.6" marks from the docs in the 8.7 branch. 2020-01-06 17:26:05 +00:00
dgp b0db0ad956 remove 'new in 8.5' marks in docs 2020-01-06 17:17:58 +00:00
dgp 6dcb4cb65c Remove the "new in 8.5" markings from the 8.6 branch of docs. 2020-01-06 17:17:11 +00:00
jan.nijtmans 4c14bc7964 Fix typo: "==" -> "=" 2020-01-06 11:02:12 +00:00
jan.nijtmans b81709b80a Merge 8.7.
Don't think that ${LDFLAGS} should be part of MATH_LIBS: that should be arranged correctly in the Makefile by providing both LDFLAGS and MATH_LIBS to the command line.
2020-01-06 10:57:58 +00:00
jan.nijtmans 16deae9be1 Merge-mark 2020-01-06 10:50:18 +00:00
jan.nijtmans 8d01cecc9a (cherry-pick): Fix issue [9128866ec8448752] by adding Line Feed character to tis-620.enc. 2020-01-06 10:48:04 +00:00
jan.nijtmans 4bea353255 Merge 8.6 2020-01-06 10:40:14 +00:00
jan.nijtmans 2595be3dfe Merge 8.5 2020-01-06 10:34:16 +00:00
jan.nijtmans 1ccdd5f186 Don't assume/set LDFLAGS being "", it could be set on the "configure" command-line.
Remove "test-packages" test-target (which doesn't exist), but add "test-tcl" being the same as "test".
2020-01-06 10:28:28 +00:00
dgp b60f173c37 Tcl_TransferResult was new in 8.6, so mark the man page with that version. 2020-01-05 19:41:04 +00:00
dgp 3dae54c810 formatting typo and rewrite 2020-01-05 19:18:30 +00:00
dgp 5f46a6c4a7 Rewrite: lead paragraph with name of documented routine. 2020-01-05 19:16:33 +00:00
dgp a75f6ac8ce Fix documentation, comments, and argument names of Tcl_TransferResult(). 2020-01-05 19:03:12 +00:00
pooryorick ac2be8e353 Add a test for issue [9128866ec8], encoding fails to load 2020-01-04 17:21:53 +00:00
pooryorick 0cd25f6ca2 merge 8.6 2020-01-04 14:51:40 +00:00
pooryorick b873f56401 Fix issue [9128866ec8448752] by adding Line Feed character to tis-620.enc. 2020-01-04 14:34:36 +00:00
fvogel 0188ad7082 Restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 21:00:22 +00:00
fvogel 019eea55c0 Restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 20:56:46 +00:00
fvogel 158c112e03 Restore the build by providing a copysign replacement for old MSVC versions. 2020-01-02 20:56:20 +00:00
dgp 341619118a merge 8.7 2019-12-30 21:25:43 +00:00
dkf 30d15963da Fixed index line 2019-12-30 16:24:29 +00:00
gahr c24a2bec01 Regenerate configure 2019-12-30 13:49:39 +00:00
gahr 54e9b9d2b3 Fix equality check, reported by Emiliano 2019-12-30 13:48:44 +00:00
gahr 61ddd431ca Include LDFLAGS in TCL_LIB, since that's where MATH_LIBS come in 2019-12-27 12:53:48 +00:00
gahr a5fd8b5d9c Regenerate configure 2019-12-27 12:13:15 +00:00
gahr 70b0310ff7 Make sure LDFLAGS are propagated to MAKE_LIB 2019-12-27 12:12:15 +00:00
gahr 54aabbf053 Use AC_CHECK_LIB and put ltommath in MATH_LIBS to avoid polluting LIBS 2019-12-27 12:11:38 +00:00
Kevin B Kenny ccc57bc577 Merge Tcl 8.6 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] 2019-12-27 00:23:49 +00:00
Kevin B Kenny 8140d238ea Merge Tcl 8.5 changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] 2019-12-27 00:12:58 +00:00
Kevin B Kenny f7d1daa7fd Merge changes to deal with integer overflow in the exponent, and floating point overflow in the significand, of floating point input conversion (Bug [1de6b0629e] 2019-12-27 00:03:41 +00:00
Kevin B Kenny ba0a3a3dd2 Add test cases that used to cause floating point overflow in computing the correction term in floating point input conversion. Fix exponent overflow in floating point input conversion, and floating-point overflow in the significand in input conversion. 2019-12-26 23:54:03 +00:00
jan.nijtmans 032451725b Add FALLTHRU markers, eliminating gcc warning using -Wextra 2019-12-24 15:04:57 +00:00
jan.nijtmans 3254602d80 Attempt to improve support for external libtommath 2019-12-24 14:23:42 +00:00
jan.nijtmans 51bf99fdf5 More progress in making clang build on Cygwin warning-free 2019-12-24 13:52:05 +00:00
jan.nijtmans 0f7dc05b52 Make definition of struct mp_int EXACTLY the same as the one in the (modified) tommath.h 2019-12-24 13:51:22 +00:00
jan.nijtmans 2d00a8c17e Put our own included (-I) directories before directories coming in though CFLAGS, so building with external libraries (like libtommath) doesn't possibly corrupt our own build. Reported by Pietro Cerutti 2019-12-24 10:05:40 +00:00
jan.nijtmans cf8d2f27eb Merge 8.6 2019-12-23 13:42:55 +00:00
jan.nijtmans 86e6d287a0 Fix for building Cygwin using Clang. 2019-12-23 13:38:20 +00:00
jan.nijtmans ce2dc4a07d Merge 8.6 2019-12-23 11:27:22 +00:00
jan.nijtmans 1e7fb75229 Workaround for [ce3b9f2b04]: compilation errors with clang (windows msys2) 2019-12-23 11:26:31 +00:00
dgp 63253bc07d Fix parsing bug when (numSigDigs == 0). 2019-12-23 00:54:44 +00:00
dgp 38d9207627 Assign a double literal to a double variable. No point in requiring conversion. 2019-12-22 23:48:00 +00:00
dgp e52a22ff57 Tests for another parsing bug. 2019-12-22 18:44:45 +00:00
jan.nijtmans 7b099b30d8 Merge 8.6 2019-12-22 14:55:25 +00:00
jan.nijtmans 834ee2dd0d Minor optimization in TclFormatInt: No need to check for "0" as special value. No need to include final NULL-byte in character-reversion operation, as we already known the NULL-byte will come last. 2019-12-22 14:52:33 +00:00
dgp 1f81e5eb51 Tests demonstrating the number parsing overflow bugs. 2019-12-21 14:19:08 +00:00
jan.nijtmans f3e5dd7a04 Prevent double definition of MODULE_SCOPE on Darwin 2019-12-20 16:13:36 +00:00
jan.nijtmans bb09dba8c0 Fix 2 unused arguments with USE_DTRACE 2019-12-20 16:11:54 +00:00
jan.nijtmans 8e18ac6cf7 Update travis build fro xcode11 to xcode11.3 as highest platform 2019-12-20 15:23:26 +00:00
jan.nijtmans 4f37c25271 Two more unused arguments.
Merge 8.7
2019-12-20 14:23:11 +00:00
jan.nijtmans 14a974e2d0 Merge 8.7. Exclude 4 test-cases in TCL_NO_DEPRECATED mode, because they are not supposed to work then 2019-12-19 22:26:37 +00:00
jan.nijtmans 2a08be49c2 Merge 8.6 2019-12-19 22:12:19 +00:00
jan.nijtmans 588a92ec6b Merge 8.5 2019-12-19 22:11:01 +00:00
jan.nijtmans 6fa04d74e0 Add type-cast, making sure that the unary minus is handled correctly on any compiler 2019-12-19 22:09:46 +00:00
jan.nijtmans 2c3a603e13 Merge 8.6 2019-12-19 22:04:09 +00:00
jan.nijtmans a0f11eae42 Merge 8.5 2019-12-19 21:31:05 +00:00
jan.nijtmans 88e4842dfe Put back 4 test-cases as they were in core-8-branch, but only for TCL_UTF_MAX=3 2019-12-17 23:14:53 +00:00
jan.nijtmans 3a7b07be0d Better fix for [3390638]: making the intVal variable unsigned prevents the need for using sprintf() altogether. 2019-12-16 10:09:40 +00:00
jan.nijtmans dbd3d4eff0 Only use OPTS=msvcrt in combination with "static", otherwise it's a NOOP. Disable pragma warning:C4146 (backported from 8.6), since it only gives misleading warnings. 2019-12-16 10:08:07 +00:00
jan.nijtmans 899310175d Merge 8.7 2019-12-14 17:46:34 +00:00
jan.nijtmans 4e6d44d0e6 Merge 8.6 2019-12-14 17:43:22 +00:00
jan.nijtmans ea5ed28162 Make win/configure work with CC=g++ (doesn't actually work with Tcl and Tk yet) 2019-12-14 17:36:09 +00:00
jan.nijtmans 72b3895d8b Merge 8.7 2019-12-14 14:08:54 +00:00
jan.nijtmans 112bcf743a merge-mark 2019-12-13 22:20:32 +00:00
jan.nijtmans 59f4600ec3 One #undef too much 2019-12-13 22:18:40 +00:00
jan.nijtmans 89e6e17872 Merge 8.7 and (hopefully) fix Travis build with C++ 2019-12-13 22:12:32 +00:00
jan.nijtmans de326e5c5e Don't export mp_sqr() directly from libtcl 2019-12-13 21:48:15 +00:00
jan.nijtmans 230886d1fe Merge 8.7 2019-12-13 21:27:52 +00:00
jan.nijtmans 9eeefad066 Optimize mp_mul for the case a==b 2019-12-13 21:16:44 +00:00
jan.nijtmans 8ddd0ca822 Merge 8.7 2019-12-13 15:41:16 +00:00
jan.nijtmans e438829082 Merge 8.7 2019-12-13 15:39:23 +00:00
jan.nijtmans 4cef9fbbe2 merge-mark 2019-12-13 15:13:15 +00:00
jan.nijtmans 3fb9396959 Fix Travis build for MSVC Debug mode 2019-12-13 15:12:29 +00:00
jan.nijtmans 6fdc83ae14 Implement TIP's #538: Externalize libtommath 2019-12-13 11:05:43 +00:00
jan.nijtmans db35fe50e9 Little code tweaks, regarding the use of TCL_UTF_MAX or wchar_t. 2019-12-12 21:38:46 +00:00
jan.nijtmans 9ef936369e merge-mark 2019-12-12 21:05:16 +00:00
jan.nijtmans 3701dc242d Add 3 (libtommath) functions to the stub table. Will be added to 8.7 too, through TIP #538 2019-12-12 21:02:48 +00:00
jan.nijtmans 94e8f63367 Merge 8.7. Add C++ entries for Windows to Travis build. 2019-12-12 16:14:05 +00:00
jan.nijtmans f70589ae3e Add many missing constraints 2019-12-12 13:12:29 +00:00
jan.nijtmans 368faf4c43 Update win/tcl.m4, for use with C++ 2019-12-12 13:11:09 +00:00
jan.nijtmans e3f42b0c1a Little doc tweak 2019-12-12 08:23:58 +00:00
jan.nijtmans 74f50a92f3 Merge 8.7 2019-12-11 15:53:07 +00:00
jan.nijtmans f8474f319c Implement "panic" as described in the TIP 2019-12-11 12:41:00 +00:00
jan.nijtmans 81d54e6432 Merge 8.7 2019-12-11 08:55:48 +00:00
jan.nijtmans 1d6a94f9f8 Fix bug in tclEncoding.c, only manifesting in testcase encoding-15.4 for TCL_UTF_MAX=6. (knownBug, fixed now) 2019-12-11 08:52:58 +00:00
jan.nijtmans 86c130f239 Merge 8.6 2019-12-10 13:42:52 +00:00
jan.nijtmans db4a693d72 Fix [5f236bc67a]: valgrind report for Tcl_UniCharToUtf. Also add test-cases for more corner-cases. 2019-12-10 13:16:48 +00:00
sebres 4a214309b2 merge 8.6 2019-12-10 13:15:48 +00:00
sebres 5caaa0f557 amend to [2cf1202807]: find the hooks in tcltest namespace only 2019-12-10 12:45:09 +00:00
jan.nijtmans a7212b0557 Undo accidental change in [343273c9de4fd4f1] 2019-12-09 22:48:56 +00:00
jan.nijtmans 216a1d1937 Attempt to fix [5f236bc67a]: valgrind report for Tcl_UniCharToUtf 2019-12-09 19:36:21 +00:00
sebres 19e564ab89 remove unneeded import (for >= 8.7) 2019-12-09 11:42:57 +00:00
jan.nijtmans 54b0e77083 Merge 8.6 2019-12-09 11:31:25 +00:00
sebres c66173309f merge 8.5 (timing issue avoidance, skip test in runtime feature) 2019-12-09 10:40:04 +00:00
sebres f9490c56c6 small amend (whitespace, no functional) 2019-12-09 10:30:19 +00:00
sebres c8634b0b9e tcltest: hook enhancements rewritten backwards compatible now, reverts [0067db1bbf], [0f3d6f90f0], [b8be012969], [375a566d22] 2019-12-09 10:26:23 +00:00
jan.nijtmans 37f6a196c5 Fix [abd4abedd2]: Failed to build tk 8.6.10 with cross compile 2019-12-09 10:02:20 +00:00
jan.nijtmans fea9c41d92 Add special handling of lower surrogate to UtfToUtfProc(), so valgrind should't complain in that situation. With new test-cases covering that. 2019-12-09 09:59:02 +00:00
jan.nijtmans 1121106257 Merge 8.7 2019-12-08 16:58:26 +00:00
jan.nijtmans 743e03cf5e Merge 8.7 2019-12-08 16:55:03 +00:00
jan.nijtmans 39bf69006a Merge 8.6Merge 8.6 2019-12-08 16:49:34 +00:00
jan.nijtmans d67affb100 Fix Valgrind problem reported as follow-up in [fc4393e9b0]. Since it happens only for TCL_UTF_MAX>3 it's not actully a 'bug' in 8.6, but it might be a corner-case not handled well in 8.7 2019-12-08 16:33:18 +00:00
jan.nijtmans 6d5473da30 merge-mark 2019-12-07 18:25:58 +00:00
jan.nijtmans bf4f51ce78 Fix 2 test-cases, which were failing when TCL_UTF_MAX=6. Add UTF_MAX=6 UNIX build to Travis as proof that now all test-cases pass for UTF_MAX=6 (still not officially supported) 2019-12-07 18:23:41 +00:00
sebres 74b0c7c91a rewrite of [dff608952b]: skip tests if there is really a timing issue (and implements new feature ::tcltest::Skip which allows conditionally skipping of tests at runtime) 2019-12-06 16:42:19 +00:00
jan.nijtmans 364ba5e8b9 Exclude some test-cases with possible timing problems on Windows. Double ;; in generic/tclTimer.c 2019-12-06 14:51:39 +00:00
jan.nijtmans 5aef84d1f4 Merge 8.6 2019-12-06 14:38:28 +00:00
jan.nijtmans f67bef714e Unnecessary double ;; in tclTimer.c. Update compat/zlib to exactly the same content as in the core-8-branch branch. 2019-12-06 14:35:10 +00:00
jan.nijtmans e2ecc3c090 merge-mark 2019-12-06 13:47:34 +00:00
jan.nijtmans a84aa656ee Fix some test-cases when Tcl is compiled with -DTCL_UTF_MAX=6. Not officially supported but used by Androwish. The test-cases prove that "unicode" should be UTF-16 actually for all TCL_UTF_MAX values. 2019-12-06 13:43:25 +00:00
jan.nijtmans 7d17ab9a13 Merge 8.6 2019-12-04 13:26:53 +00:00
jan.nijtmans 0acc700234 Add builds using TCL_UTF_MAX=4 on Windows. Not officially supported, but used by Androwish. Also alphabetise some options in win/makefile.vc and win/rules.vc 2019-12-04 12:54:39 +00:00
jan.nijtmans d02ab64fa2 Use the right encoding when converting (Unicode) messages regarding socket errors on Windows. Some code cleanup in win/tclWinfile.c. 2019-12-04 12:53:25 +00:00
jan.nijtmans 29b775c36a Remove Travis's Clang builds using TCL_UTF_MAX!=4. Too little difference with the corresponding GCC builds to be useful. 2019-12-03 19:30:19 +00:00
jan.nijtmans 40938f72a2 Add build using gcc and TCL_UTF_MAX=4 to Travis build. Not officially supported but used by Androwish. Remove "threads" designator on Windows, since it's already default. 2019-12-03 19:24:05 +00:00
jan.nijtmans 4a5f73e338 Merge 8.7 2019-12-03 16:13:29 +00:00
jan.nijtmans d8fd9552b5 Merge 8.7 2019-12-03 16:12:14 +00:00
jan.nijtmans 28d5df364e Merge 8.6 2019-12-03 13:21:32 +00:00
jan.nijtmans 678d2103f9 Fix encoding-15.6 testacase for TCL_UTF_MAX=6, due to changes escape sequences for upper/lower surrogate combination. 2019-12-03 13:20:47 +00:00
jan.nijtmans c4990c8bf6 Merge 8.6 2019-12-03 12:58:25 +00:00
jan.nijtmans 9e0083e9f0 Fix [3cd9bea1e6]: check-in [43032d7ba3] potential problems. Also don't allow surrogates in \U?????? syntax. 2019-12-03 12:27:42 +00:00
pooryorick 3c7bb58fb9 merge 8.6 2019-12-02 22:07:33 +00:00
pooryorick 36f4518f89 Add tcltest::CleanupTest to make it easier to customize behaviour. 2019-12-02 22:04:41 +00:00
jan.nijtmans cfb43a5a2c Merge 8.6 2019-12-02 20:48:35 +00:00
jan.nijtmans 4f6ea8aef9 If TCL_UTF_MAX>=4, make Tcl_ParseBackslash combine two surrogates so they appear as one 4-byte UTF-8 byte sequence from the start. Add test-case for this. 2019-12-02 20:26:58 +00:00
dgp a42ecfa12e Bump to 8.7a4 to distinguish development from 8.7a3 release. 2019-12-02 18:15:07 +00:00
jan.nijtmans eadbf37f4e Fix [a46a49b90f]: tests http-cookiejar-1.[12] fail 2019-12-02 13:28:46 +00:00
jan.nijtmans 8e1f9bb6d1 Eliminate excess eol-spacing 2019-12-02 10:58:19 +00:00
jan.nijtmans a86677ebd5 Merge 8.6 2019-12-02 10:52:45 +00:00
jan.nijtmans 90493b4012 Renumber tcltest from 2.5.1 -> 2.5.2, already for next release. 2019-12-02 10:49:11 +00:00
jan.nijtmans d6a3244d18 More eol-spacing 2019-12-02 10:48:01 +00:00
jan.nijtmans f7e46677b5 Eliminate unneccessary eol-spacing from documentation. 2019-12-02 10:47:00 +00:00
jan.nijtmans db669f381b Fix make install on Ubuntu (and - most likely - other platforms) 2019-12-01 21:25:32 +00:00
jan.nijtmans 6cc489aa4f Merge 8.7 2019-12-01 20:04:10 +00:00
pooryorick 506589f483 Add tcltest::EvalTest to make it easier to customize behaviour. 2019-12-01 19:45:54 +00:00
jan.nijtmans bd7870ec5f Fix executable flag 2019-12-01 17:52:17 +00:00
pooryorick 7363d850a9 merge 8.6 2019-12-01 13:52:06 +00:00
pooryorick d138d28133 Fix tcltest::SetupTest added in previous commit. 2019-12-01 13:48:48 +00:00
pooryorick af1ecf410e merge 8.6 2019-12-01 12:16:04 +00:00
pooryorick 3435c9713f add tcltest::SetupTest to make it easier to customize the -setup step of a test 2019-12-01 11:59:41 +00:00
jan.nijtmans 09abed41d6 merge-mark 2019-11-29 12:29:18 +00:00
jan.nijtmans 332401e645 Add some new test-cases involving e.g. Unicode 11. Backported from Tcl 8.7a3 2019-11-29 12:27:00 +00:00
jan.nijtmans 17a9125415 Merge 8.7 2019-11-29 09:52:54 +00:00
jan.nijtmans 800a3f62b3 Fix one failing testcase (thanks, Travis!) 2019-11-29 09:52:09 +00:00
jan.nijtmans e4704dda2f Merge 8.7 2019-11-28 14:14:29 +00:00
jan.nijtmans a5162e47d5 Merge 8.6 2019-11-28 13:15:44 +00:00
jan.nijtmans 122bb72a66 Enhance rules.vc like already done in other configure scripts: Determine HAVE_STDINT_H/HAVE_INTTYPES_H/HAVE_STDBOOL_H/MP_NO_STDINT the simple way, just by compiler version. 2019-11-28 12:53:38 +00:00
jan.nijtmans bc00595941 Give cookiejar en tcl::idna a 3-part version number. Use 0.2.0 for cookiejar and 1.0.1 for tcl::idna.
"make install" and "make install-libraries" should now (finally) work fine for all platforms, both with configure/make and nmake.
2019-11-28 12:36:22 +00:00
jan.nijtmans 7c405f2e81 Merge 8.5 (Update opt package from 0.4.6 to 0.4.7).
Also fix installation of opt0.4 as done by makefile.vc, which never worked in Tcl 8.6.
2019-11-28 11:35:51 +00:00
jan.nijtmans d473f1507c Update "opt" from version 0.4.5 to 0.4.7, backported from Tcl 8.7a3. 2019-11-28 10:54:21 +00:00
jan.nijtmans 0e57f61ede (hopefully) fix installation on Windows 2019-11-27 22:20:48 +00:00
jan.nijtmans 4ab699dc03 Merge 8.7. Tweak makefile.vc for detection of stdint.h/inttypes.h/stdbool.h 2019-11-27 21:09:36 +00:00
jan.nijtmans 0c50d57d08 Another minor tweak: No need to include manifest.txt in the vfs zip-file, since it's renamed to pkgIndex.tcl 2019-11-27 20:15:50 +00:00
jan.nijtmans 38e41ac6ef Merge 8.7, and take over some fixes for VC++ 6.0 from Sebres. 2019-11-27 14:41:11 +00:00
jan.nijtmans 9a80393d63 Minor tweak: Don't include the "dde" and "reg" directory in the zip-file on UNIX 2019-11-27 14:25:47 +00:00
sergey.brester 87934d6db3 merge digit-bit-60 2019-11-27 13:43:36 +00:00
sergey.brester dd334ec3d0 fixes compile errors for old VC versions, as well as tommath include path, there are two files with this name and wrapper "generic/tommath.h" gets included, but "libtommath/tommath.h" is never included, because did not addressed directly with this name (first from path wins). 2019-11-27 13:38:37 +00:00
jan.nijtmans f5464908a6 Move check for stdbool.h from SC_MISSING_POSIX_HEADERS to SC_CONFIG_CFLAGS, since it's not POSIX. 2019-11-27 12:14:57 +00:00
jan.nijtmans 37a548351b Merge 8.6 2019-11-27 11:09:33 +00:00
dkf d9f8a23002 Proposed Windows installation code for cookiejar package 2019-11-27 11:01:38 +00:00
jan.nijtmans 1b760ca1a5 Merge 8.5 2019-11-27 10:25:49 +00:00
jan.nijtmans 627fe239a5 Don't bother paths of 64-bit SDK any more: This was Visual Studio 2008-specific and doesn't work with other Visual Studio versions. 2019-11-27 09:44:17 +00:00
jan.nijtmans 9eaa827e59 Merge 8.7 2019-11-26 22:49:05 +00:00
jan.nijtmans 94206b30ff Merge 8.7 2019-11-26 22:42:59 +00:00
jan.nijtmans d8a1ef0827 Fix installation of cookiejar on UNIX, and add same pieces to windows as well. Also modify manifext.txt accordingly, for the zipfile vfs. 2019-11-26 21:35:52 +00:00
dgp e5e3156e56 merge release 2019-11-26 17:35:08 +00:00
dgp 5d1722aaf1 Accept repackaging and distribution of http::cookiejar for Tcl 8.7a3. 2019-11-26 16:29:12 +00:00
dkf 582196abb8 Move the cookiejar package to its own directory so http works as a TM. Fix the unix installation code to include the bootstrap registrar names. 2019-11-26 11:16:12 +00:00
jan.nijtmans e92bcc6be3 Merge 8.7a3 2019-11-26 08:11:37 +00:00
dgp cf9edc4a1d merge 8.7 2019-11-25 18:08:50 +00:00
dgp 76414db5a3 merge mark 2019-11-25 17:00:52 +00:00
dgp b5b74f1c5b merge mark 2019-11-25 16:59:54 +00:00
dgp b427bd59d0 Makefiles got out of sync with tcltest version. 2019-11-25 16:41:51 +00:00
jan.nijtmans 91a9b97aa6 Fix 2 version numbers in Makefile echo's (just misleading). Thanks to Pietro Cerutti for noticing this. 2019-11-25 16:40:32 +00:00
jan.nijtmans a5549e4cd2 Tweak visibility of some libtommath symbols and add --with-system-libtommath configure option (as requested by Pietro Cerutti) 2019-11-25 16:34:20 +00:00
jan.nijtmans b7e4a9f65b Merge 8.7 rc branch 2019-11-23 20:49:55 +00:00
dgp 20ce24d285 merge 8.7 2019-11-22 15:18:54 +00:00
dgp 7172d12a3f merge 8.6 2019-11-22 15:15:54 +00:00
dgp 98fe12ee6d merge release 2019-11-22 15:01:22 +00:00
jan.nijtmans 76f04364e3 Undo minor tweak, no longer necessary 2019-11-22 13:33:53 +00:00
jan.nijtmans 3a1186689a Merge 8.7, and update to latest libtommath (support/1.x branch) 2019-11-22 13:26:30 +00:00
apnadkarni 44bc67ccd6 Merged rc file VERSIONINFO fixes 2019-11-22 04:10:47 +00:00
apnadkarni 931120cefe Fix generation of VERSIONINFO in RC files when package versions have 4 or more
components or use "a" or "b" as version separators. Previously they would result 
in the resource compiler generating an error.
2019-11-22 04:04:48 +00:00
sebres 58a383b2f0 merge 8.6 2019-11-21 19:16:58 +00:00
dgp f19d3d1f63 merge 8.6 2019-11-21 19:08:01 +00:00
sebres c26994f746 merge 8.5 (cmdMZ timing issues + verbose output in error case) 2019-11-21 18:58:44 +00:00
sebres e722bb7121 amend to [c93862b3bc] - fixes next timing test-issue in cmdMZ.test - measure without overhead now (otherwise net-time can be calculated too few);
makes test results more verbose in the error case
2019-11-21 18:30:09 +00:00
dgp 8afc392129 Merge 8.6; update changes. 2019-11-20 15:58:51 +00:00
jan.nijtmans 9c4252f295 Fix typo in tclTestObj.c 2019-11-20 13:32:00 +00:00
jan.nijtmans b39f1c56d5 Merge 8.7. ignore MP_WUR for mp_neg() calls with equal arguments (even though MP_WUR is not enabled yet) 2019-11-18 21:41:18 +00:00
jan.nijtmans 25d746ccdb Merge 8.6 2019-11-18 20:38:28 +00:00
jan.nijtmans c53c54cec4 Fix [13657a2dc3]: application/json is not a binary payload for http. http 2.9.0 -> 2.9.1 2019-11-18 20:33:53 +00:00
jan.nijtmans cf11c42355 http package from 2.7.14 to 2.7.15 2019-11-18 20:27:57 +00:00
jan.nijtmans 5997f60c9a Fix [13657a2dc3]: application/json is not a binary payload for http 2019-11-18 20:22:32 +00:00
jan.nijtmans 377a4e24ed Formatting 2019-11-18 15:56:11 +00:00
jan.nijtmans 29db2a6761 Some code cleanup. Build with zlib dll on Win32 when using makefile.vc (shared-build only) 2019-11-18 14:40:54 +00:00
jan.nijtmans 37e202ac7d Update makefile.vc and rules.vc for using libtommath.dll/zlib1.dll in stead of statically linking libtommath, whenever possible. 2019-11-18 12:58:55 +00:00
jan.nijtmans f02189588a Merge 8.7. Unbreak travis build with TCL_UTF_MAX=3 2019-11-17 13:39:46 +00:00
dgp 16135b4d33 update changes 2019-11-16 19:57:03 +00:00
dgp 85f552fa8a merge 8.7 2019-11-15 20:20:33 +00:00
dgp fc5da6d413 merge 8.6 2019-11-15 20:11:10 +00:00
dgp 20685407f3 merge 8.7; update changes 2019-11-15 20:01:16 +00:00
dgp bab811ce01 merge 8.6; update changes 2019-11-15 19:58:05 +00:00
jan.nijtmans 12a2241641 Fix test-case event-11.8, failing as a result of the TclOOObjectDestroyed() function restructuring. 2019-11-15 15:49:33 +00:00
jan.nijtmans 88e67d27d8 fix compliation warning, resulting from previous commit 2019-11-15 15:42:19 +00:00
jan.nijtmans 84987939c7 Merge 8.7 2019-11-15 15:19:56 +00:00
jan.nijtmans 3ce435c137 Merge 8.7 2019-11-15 14:53:21 +00:00
jan.nijtmans 521b33f6ec Backout [b5c1404365f53fe0], removing TclFreeObj() is a step too far for 8.7 2019-11-15 14:35:12 +00:00
jan.nijtmans ce1e21eb7c Merge 8.7 2019-11-15 14:20:45 +00:00
pooryorick e404d07959 Add TclOOObjectDestroyed to make logic more explicit. Renamed Deleted() to
Destructing().  No functiontional changes.
2019-11-15 13:50:39 +00:00
jan.nijtmans e2e22061b0 Merge 8.6 2019-11-15 13:05:02 +00:00
jan.nijtmans b99314020d Remove mp_get_bit() from the libtommath stub table: It wasn't present in Tcl 8.6.9, isn't used anywhere in Tcl, and is going to be deprecated in libtommath. 2019-11-15 12:54:12 +00:00
jan.nijtmans e5b1e20b49 Merge 8.6.
Also fix the use of WUR (warn unused result) in libtommath function signatures: this cannot be used in combination with "deprecated" or "nostub"
2019-11-15 10:09:11 +00:00
jan.nijtmans e00ef49560 Protect additional Tcl_UtfToUniChar() call, for the case when not enough bytes are available in the buffer any more.
Add additional test-cases for those situations (upper surrogate followed by somthing other than lower surrogate)
2019-11-15 09:41:03 +00:00
sebres c28a047f8a merge 8.6 2019-11-14 20:07:37 +00:00
sebres 4a0d55e4c9 merge 8.5 2019-11-14 19:58:11 +00:00
sebres bb1eeada78 remove unneeded constraint 2019-11-14 19:57:12 +00:00
sebres b350e6ad91 fixes bug [135804138e] 2019-11-14 19:30:23 +00:00
sebres 434361c3c6 restore verification for deleted interp 2019-11-14 19:22:46 +00:00
sebres 05b4cb2080 make oo-7.10 test more readable 2019-11-14 17:41:51 +00:00
sebres b098fb3279 fixed SF [135804138e] -- no call of next possible after object namespace is deleted 2019-11-14 17:06:06 +00:00
sebres f00d9f9d02 bug [135804138e]: test case illustrating the segfault 2019-11-14 17:04:39 +00:00
jan.nijtmans 0cb2dc120b Merge 8.6 2019-11-14 14:48:44 +00:00
jan.nijtmans 3707688157 Better - more complete - fix for [d433c0e0ad]: TCL_UTF_MAX == 4 problems. It allows emoji to be produced by the system encoding, even for other values of TCL_UTF_MAX.
Also added test-cases for this.
2019-11-14 14:01:13 +00:00
dgp c2e61fa00e merge 8.7 2019-11-13 18:24:06 +00:00
dgp 2ab36cc28a merge 8.6 2019-11-13 18:11:56 +00:00
dgp 21c4caf8e1 More work on changes. 2019-11-13 17:32:26 +00:00
jan.nijtmans e9559b5cc0 Merge 8.7 2019-11-13 16:11:37 +00:00
jan.nijtmans 9e9a51f3cb Merge 8.7 2019-11-13 16:10:12 +00:00
jan.nijtmans 8126172c86 Merge 8.6 2019-11-13 16:02:34 +00:00
jan.nijtmans ed907ec2d1 Make tclWinFile compile warningless using -DTCL_UTF_MAX=6 (not officially supported, but used by Androwish) 2019-11-13 16:01:35 +00:00
jan.nijtmans db160493de Don't install tommath_class.h and tommath_superclass.h on Windows any more by makefile.vc. Those are purely internal, not needed by extensions. 2019-11-13 15:59:11 +00:00
jan.nijtmans 3b32ee24fb Merge 8.6 2019-11-13 12:38:08 +00:00
jan.nijtmans d3315530e8 Part 2 of bugfix [d433c0e0ad]: TCL_UTF_MAX == 4 problems 2019-11-13 12:37:24 +00:00
jan.nijtmans f502b57f5d Merge 8.6 2019-11-13 09:08:47 +00:00
jan.nijtmans 3181ee9123 Fix TIP #389 implementation, bug [d433c0e0ad]: TCL_UTF_MAX == 4 problems. Thanks to Christian Werner for the report. 2019-11-13 09:07:08 +00:00
jan.nijtmans de04d595fa Fix compiler warning when compiling with -DTCL_UTF_MAX=4 or 6 2019-11-13 08:16:51 +00:00
jan.nijtmans 863dfac9d9 try to install libtommath 1.2.0 through homebrew on MacOS 2019-11-12 22:06:09 +00:00
jan.nijtmans 41e4211a15 Merge 8.7. Finish implementation. 2019-11-12 12:11:05 +00:00
jan.nijtmans 34714bcefa Merge 8.6 2019-11-11 20:51:07 +00:00
jan.nijtmans 589c6b9de8 Use <inttypes.h> header-file on windows when available, just as on UNIX 2019-11-11 20:50:02 +00:00
jan.nijtmans e85c33074d On win32, include <inttypes.h> if available, just as on UNIX.
Disable compiler warning C4244 on all Microsoft compiler versions, not just the latest ones.
2019-11-11 16:32:42 +00:00
jan.nijtmans 6ce8973116 Merge 8.7 2019-11-11 16:19:46 +00:00
jan.nijtmans e512564f36 Merge 8.7 2019-11-11 14:26:50 +00:00
jan.nijtmans d33f396b99 Merge 8.7 2019-11-09 20:39:06 +00:00
jan.nijtmans ac7ef03d8e Now that libtommath has mp_init_l/mp_init_ll/mp_init_ull, use those instead of the legacy TclBNInitBignumFromLong/TclBNInitBignumFromWideInt/TclBNInitBignumFromWideUInt 2019-11-09 19:39:23 +00:00
jan.nijtmans 3160edd841 Now that libtommath has mp_init_l/mp_init_ll/mp_init_ull, use those instead of the legacy TclBNInitBignumFromLong/TclBNInitBignumFromWideInt/TclBNInitBignumFromWideUInt 2019-11-08 21:56:52 +00:00
jan.nijtmans 99cce0ea11 Fix travis build win32, 32-bit mingw 2019-11-08 20:09:46 +00:00
jan.nijtmans 89dd0dcb93 Merge 8.6 2019-11-08 15:57:24 +00:00
jan.nijtmans c1f8c02900 Add support for mp_init_i32/mp_init_i64/mp_init_l/mp_init_ll/mp_init_u32/mp_init_u64/mp_init_ul/mp_init_ull/mp_set_ull, the main functions in libtommath 1.2.0 for setting values directly in mp_int's.
One new stub entry (mp_set_ull), the others make use of already existing stub entries. This is 100% fully upwards compatible.
2019-11-08 15:32:33 +00:00
dgp 3b028ddc03 Start updates to changes 2019-11-08 15:11:42 +00:00
jan.nijtmans 5de9b738d3 Merge 8.6.
Add support for libtommath's mp_set_ll() function, since that's the replacement for the deprecated TclBNInitBignumFromWideInt() function.
2019-11-08 09:01:43 +00:00
jan.nijtmans 65946d3f86 For long/wide "scans"'s of negative numbers, but scanned as unsigned, generate binary representation in stead of string representation just as for all other numbers. 2019-11-08 07:58:54 +00:00
sebres 2325ddede0 added removal of timeout-event in cleanup of io-44.6 (can bother followed tests), removed unneeded constraint 2019-11-07 18:36:57 +00:00
pooryorick 52e0f14369 Rewrite comments in tclIOUtil.c 2019-11-07 16:40:09 +00:00
jan.nijtmans d6d77a73be Merge 8.7 2019-11-07 15:39:37 +00:00
dgp b82082f321 merge 8.7 2019-11-07 15:09:23 +00:00
jan.nijtmans 22c56e716c merge-mark 2019-11-07 14:57:40 +00:00
jan.nijtmans dd8793f10d Deprecate mp_div_3(): Will be private function in future libtommath, not used in Tcl.
Deprecate mp_sqr() stub entry: Will be converted to macro calling mp_mul().
2019-11-07 13:56:25 +00:00
sebres 1a379fa961 merge 8.6 2019-11-06 23:10:57 +00:00
pooryorick a93db0866a Rewrite documentation of IO subsystem. 2019-11-06 20:41:58 +00:00
dgp 245f333d52 Merge 8.7. Add files missing from distribution. 2019-11-06 14:35:24 +00:00
dgp 1e151782fc Add tcl/library/manifest.txt to the distribution produced by make dist 2019-11-06 14:07:15 +00:00
jan.nijtmans 0bddea7ffe Move tclOOScript.tcl from the generic to the tools directory, so "make dist" can pick it up. Reported by Pietro Cerutti. 2019-11-06 13:34:52 +00:00
jan.nijtmans 9348f23012 Fix tclScan.c, not generating a string representation any more with unsigned wideints 2019-11-06 12:34:27 +00:00
dgp 7f6aa30c40 Bump release date 2019-11-05 17:52:33 +00:00
dgp 2ac91d1f8e merge 8.7 2019-11-05 17:51:55 +00:00
jan.nijtmans d010f7c348 More WIP: All makefile builds appear to work fine, makefile.vc build still to be done. 2019-11-05 16:37:52 +00:00
dgp f8d95ed6e3 Bump release date to Nov 21 2019-11-05 14:15:09 +00:00
jan.nijtmans 2b84291424 Merge 8.7 2019-11-04 12:10:54 +00:00
jan.nijtmans 55e2ef9b31 Merge 8.7 2019-11-04 12:10:19 +00:00
jan.nijtmans 25091201d6 Fix travis build on Windows (tweak to configure script was made on purpose, to workaround a bug in autoconf-2.59) 2019-11-04 12:03:56 +00:00
dgp bbbc406887 Updates from make dist 2019-11-03 02:25:43 +00:00
dgp 0db44b0516 Fix test failures with -singleproc 1 testing 2019-11-03 02:17:02 +00:00
dgp 8bc7833ed3 bump release date 2019-11-02 17:40:08 +00:00
dgp 0125995766 merge 8,6 2019-11-02 17:38:16 +00:00
jan.nijtmans c848a8872a Add compat/stdint.h, upgrade to libtommath 1.2.0, adapt as much as possible accordingly (still WIP) 2019-11-01 16:15:49 +00:00
jan.nijtmans 01c6f7705f Re-base to core-8-branch 2019-11-01 11:25:03 +00:00
jan.nijtmans 493585e802 Merge 8.6 2019-11-01 10:11:18 +00:00
jan.nijtmans ac8455a022 Change references to mp_digit into unsigned int, everywhere in tclTomMath.decls. It's the same, but it makes it possible to compile libtommath with MP_64BIT in stead of MP-32BIT for greater efficiency for compilers that support it. 2019-11-01 08:55:20 +00:00
jan.nijtmans e415aee138 Fix generic\tclStubInit.c(139): warning C4098: 'TclBN_mp_set': 'void' function returning a value 2019-10-31 14:28:40 +00:00
jan.nijtmans 22b17a9836 Merge 8.7 2019-10-31 12:58:08 +00:00
jan.nijtmans 9094a7483e Merge 8.6 2019-10-31 11:16:08 +00:00
jan.nijtmans c4da7631c0 Merge 8.6 2019-10-31 10:15:57 +00:00
jan.nijtmans 5ae87ec20d Merge 8.6 2019-10-30 21:34:02 +00:00
dgp 7732a55113 merge 8.7 2019-10-30 14:27:57 +00:00
jan.nijtmans d06eced64d More tweaks, hopefully fixing the Travis build 2019-10-30 09:20:33 +00:00
jan.nijtmans 92428a1045 More tweaks 2019-10-29 23:22:25 +00:00
jan.nijtmans 95d0649165 WIP: Use unsigned int in stead of mp_digit in libtommath stub entries.
This make libtommath's API independant whether compiled with MP_64BIT or not
2019-10-29 23:07:32 +00:00
jan.nijtmans 24a5107484 On Windows, use <stdint.h> header-file if available. 2019-10-29 12:47:45 +00:00
jan.nijtmans 75fd364ccf Combine TCL_DD_SHORTEN_FLAG and TCL_DD_SHORTEST to be the same flag (which it is .... actually) 2019-10-29 12:42:46 +00:00
dgp f594ed900c update changes 2019-10-28 17:18:01 +00:00
dgp 00a23c159d merge 8.6 2019-10-28 16:56:12 +00:00
jan.nijtmans c8444b192d Merge 8.7 2019-10-28 16:49:32 +00:00
jan.nijtmans e0afc4ae97 Merge 8.6 2019-10-28 16:41:16 +00:00
jan.nijtmans ba1f0d37e1 Don't typedef mp_digit in tcl.h anymore, it is supposed to be brought in from tclTomMath.h.
Add test in configure scripts for <stdint.h> and <stdbool.h>. Not used by Tcl yet, probably handy for TEA extensions wanting to use that ;-)
2019-10-28 16:09:38 +00:00
dgp 7b7cb95a11 merge 8.6 2019-10-28 15:42:48 +00:00
dgp d48eb0305d merge 8.7 2019-10-28 15:37:47 +00:00
dgp 4bcbf9fc65 Close fork, dropping commits apparently in error. 2019-10-28 15:32:28 +00:00
jan.nijtmans 6e88a50771 Remove (temporaryly) tests/fileSystemEncoding.test, since the bug is not fixed yet on Windows 2019-10-28 09:09:59 +00:00
jan.nijtmans 1370648058 Merge 8.6 2019-10-28 08:40:21 +00:00
Kevin Walzer 507395df2c Tweak README 2019-10-27 22:24:39 +00:00
pooryorick a2796ccf0a Test for [bcd100410465] and add ::tcltests::tempdir. 2019-10-26 17:52:25 +00:00
pooryorick 4b994916bd More simple fix for [bcd100410465], stale cached file FsPath object. 2019-10-26 17:47:12 +00:00
jan.nijtmans efe1dce70b Merge 8.7 2019-10-25 20:32:26 +00:00
jan.nijtmans 0c8bc1d8c2 More code cleanup related to libtommath 1.2.0: Adapt naming of (internal) symbols to new conventions. Remove deprecated declarations which were never implemented/included by Tcl. 2019-10-25 19:51:18 +00:00
jan.nijtmans 44f5f557ef Merge 8.6.
Also remove unused variable in unix/tclUnixFile.c
2019-10-25 16:24:11 +00:00
dgp 6ca9f62bb5 merge 8.6 2019-10-25 15:18:11 +00:00
Kevin Walzer 0d122fd177 Remove /System from auto_path on macOS because Apple has deprecated its own ancient installation of Tcl/Tk 2019-10-25 01:25:48 +00:00
jan.nijtmans e22b6eb9ab Merge 8.6 2019-10-24 19:26:44 +00:00
jan.nijtmans d0345abbf6 Reference registry 1.3.3 -> 1.3.4 2019-10-24 15:38:09 +00:00
jan.nijtmans 25eedf811a Merge 8.7 2019-10-24 15:34:30 +00:00
jan.nijtmans 846e8f4c80 Add support for libtommath's MP_WUR annotation to genStubs.tcl. Not enforced yet by the Tcl core, but extensions will encounter the libtommath warnings. Can be switched off. 2019-10-24 15:07:10 +00:00
jan.nijtmans c3353d5a64 Backout [0f2870649c804dd8], since testcase encoding-2.2 fails 2019-10-24 07:57:54 +00:00
jan.nijtmans 710734302b merge-mark 2019-10-23 20:36:03 +00:00
dgp d6513e05a7 merge 8.6 2019-10-23 17:10:06 +00:00
jan.nijtmans b986f31385 Deprecate mp_unsigned_bin_size, mp_init_set_int, mp_set_int, which are deprecated in libtommath 1.2.0.
In stead, add new function mp_set_ul to the build (mp_ubin_size was already included in the build earlier)
2019-10-23 14:11:37 +00:00
jan.nijtmans 6b002a2d06 Fix gcc warning, also introduced by [0f2870649c804dd8] 2019-10-23 11:51:32 +00:00
jan.nijtmans 9f1a598fc1 Fix possible gcc warnings. Also indicate dummy parameters as "dummy" 2019-10-23 11:49:34 +00:00
jan.nijtmans 01498c5ecd Merge 8.6.
Also unbreak windows build, broken since [0f2870649c804dd8].
2019-10-23 10:01:11 +00:00
jan.nijtmans 76da15f7bc Fix breakage from previous commit (still one test-case, encoding-2.2, is failing) 2019-10-22 21:54:14 +00:00
pooryorick 566db2779b Fix for [bcd1004104] 2019-10-22 19:21:48 +00:00
jan.nijtmans 1ce018ea85 Deprecate mp_get_bit, mp_expt_d_ex, mp_toradix_n, mp_to_unsigned_bin, mp_to_unsigned_bin_n, because they are deprecated in libtommath 1.2.0 too.
Add replacement functions mp_to_ubin, mp_ubin_size and mp_to_radix to libtommath stub table.
2019-10-22 15:47:53 +00:00
jan.nijtmans ab6fc07f69 Merge 8.6 2019-10-22 12:25:18 +00:00
dgp 18c563f161 Complete draft changes. 2019-10-21 19:03:51 +00:00
dgp 2922b99f62 merge 8.6 2019-10-21 18:54:11 +00:00
dgp fe24e890ab More progress on changes. 2019-10-21 17:33:46 +00:00
dgp 9b08b0169a merge 8.7 2019-10-21 13:13:52 +00:00
dgp 414826083b merge 8.6 2019-10-21 13:04:46 +00:00
jan.nijtmans 39a95d7e52 Merge-mark 2019-10-15 15:08:49 +00:00
jan.nijtmans 76e2b0d613 Merge 8.6 2019-10-14 21:17:01 +00:00
jan.nijtmans 37b044ce72 Merge 8.6 2019-10-11 12:46:10 +00:00
jan.nijtmans 9b9ef79f51 Merge 8.6 2019-10-10 19:15:37 +00:00
dgp 2e674796fc changes WIP 2019-10-07 18:49:56 +00:00
dgp 180d5e31c9 merge 8.6 2019-10-07 15:51:47 +00:00
jan.nijtmans f73034b8e3 Merge 8.7 2019-10-06 20:39:03 +00:00
jan.nijtmans e53ea0c452 Merge 8.6 2019-10-05 20:44:28 +00:00
jan.nijtmans 3d55f5f6f0 Merge 8.7 2019-10-02 21:40:45 +00:00
dgp b73c0aa0aa merge 8.7 2019-10-02 15:45:36 +00:00
dgp 1b0be70377 merge 8.6 2019-10-02 15:38:07 +00:00
jan.nijtmans 67e037520d Merge 8.6 2019-10-02 11:38:10 +00:00
jan.nijtmans c4606765eb Merge 8.7 2019-10-01 19:32:32 +00:00
jan.nijtmans 53c93039f6 Fix correct export on win32 for TclZipfs_AppHook, when not building with -DUNICODE 2019-09-29 15:45:39 +00:00
jan.nijtmans 0e525ab237 Use Tcl_WCharToUtfDString in stead of (deprecated) Tcl_WinTCharToUtf 2019-09-29 12:16:25 +00:00
jan.nijtmans 07493eeb9d Merge 8.6 2019-09-29 12:08:56 +00:00
dgp 2b53ba06dc merge 8.6 2019-09-27 12:21:09 +00:00
jan.nijtmans 97294cb6f5 Merge 8.7 2019-09-25 15:06:25 +00:00
dgp 22d8a012ca merge 8.7 2019-09-25 15:03:42 +00:00
dgp c3d5218595 merge 8.6 2019-09-25 15:03:10 +00:00
jan.nijtmans 2c327304a1 Merge 8.7 2019-09-25 13:42:11 +00:00
jan.nijtmans 13f90df659 Merge 8.6 2019-09-25 13:14:59 +00:00
jan.nijtmans e1febe2aac merge-mark 2019-09-20 21:28:03 +00:00
jan.nijtmans b776295fc0 Merge 8.6 2019-09-20 21:20:28 +00:00
jan.nijtmans 6178928e34 Merge 8.6 2019-09-20 15:03:24 +00:00
jan.nijtmans 865ea5e678 More Win32 API impovals. 2019-09-20 13:53:39 +00:00
dgp 75bd963079 merge 8.7 2019-09-20 13:28:34 +00:00
dgp 379c5166ff merge 8.6 2019-09-20 13:28:02 +00:00
jan.nijtmans 775e9aac00 Merge 8.7 2019-09-19 18:27:06 +00:00
jan.nijtmans 39795a1da4 Merge 8.6 2019-09-19 15:24:11 +00:00
jan.nijtmans 52f7f8443d Merge 8.6. Missing cast in Tcl_WinTCharToUtf() macro (when compiling without -DUNICODE) 2019-09-19 07:44:09 +00:00
dgp 11fdd10d9e merge 8.7 2019-09-18 16:31:13 +00:00
dgp 9fd52465aa merge 8.6 2019-09-18 16:31:00 +00:00
jan.nijtmans bb14939c64 Add 3 more builds with Clang (UTF_MAX=6, UTF_MAX=3, NO_DEPRECATED).
Change build order a little: Do all static builds after the corresponding shared builds.
2019-09-18 09:36:56 +00:00
jan.nijtmans 0ff016021c Make less dependent on UNICODE definition 2019-09-18 09:33:43 +00:00
jan.nijtmans fa67ca104b Merge 8.6 2019-09-17 13:02:38 +00:00
jan.nijtmans d8577f3bd9 Merge 8.7 2019-09-17 11:39:21 +00:00
jan.nijtmans 1ff9f7ba97 Fix .travis.yml 2019-09-17 10:45:04 +00:00
jan.nijtmans 898b17c6b4 Move testgetencpath/testsetencpath test commands from UNIX-specific to general. Rewrite a few other commands (like "memory") to use the Tcl_Obj interface. 2019-09-17 07:02:17 +00:00
jan.nijtmans 6d451c02f2 Merge 8.6 2019-09-16 21:35:16 +00:00
jan.nijtmans fab75817f4 Merge 8.6 2019-09-16 19:09:04 +00:00
dgp 2ff1a19af2 merge 8.7 2019-09-16 14:50:38 +00:00
jan.nijtmans 19eb51a4cb Fix Utf16ToUtfProc() (from TIP #548): If last code-point is higher surrogate, make sure that actual conversion is delayed until the next round, assuring proper merging of two surrogates into a single UTF-8 character. 2019-09-16 12:47:19 +00:00
jan.nijtmans c9396a84a8 Merge 8.7 2019-09-14 21:52:20 +00:00
jan.nijtmans 93022718af TIP #548 implementation: Support wchar_t conversion functions and deprecate Tcl_WinUtfToTChar() and Tcl_WinTCharToUtf() 2019-09-14 12:41:37 +00:00
jan.nijtmans 5406b20772 TIP #414 implementation: Add (back) Tcl_InitSubsystems as Public API 2019-09-14 12:36:36 +00:00
dgp 71342a5742 merge 8.6 2019-09-13 12:27:22 +00:00
dgp 663240b26f merge 8.7 2019-09-13 12:27:17 +00:00
jan.nijtmans 0ef77b5263 Merge 8.7 2019-09-13 09:14:34 +00:00
jan.nijtmans e0d5d4dfe5 Merge 8.6 2019-09-13 09:11:27 +00:00
jan.nijtmans d6390873ff Merge 8.6 2019-09-13 07:56:17 +00:00
sebres 4a16d65cc6 merge 8.6 2019-09-12 19:46:25 +00:00
jan.nijtmans ba0c94d03e Merge 8.7 2019-09-12 14:19:04 +00:00
jan.nijtmans 57805e2383 merge-mark 2019-09-12 14:12:55 +00:00
jan.nijtmans c73f421606 Merge 8.6 2019-09-12 11:26:49 +00:00
José Ignacio Marín 5783fb3197 Update TZ info to tzdata2019c. 2019-09-12 08:01:37 +00:00
jan.nijtmans 8fbd03b7ab merge-mark 2019-09-12 07:51:56 +00:00
dgp 658bd3b3fc merge 8.6 2019-09-11 19:24:51 +00:00
dgp 2975cfd589 merge 8.7 2019-09-11 16:10:10 +00:00
dgp c2f8b74ee5 merge 8.6 2019-09-11 16:02:44 +00:00
dgp 791a16b48e merge 8.6 2019-09-11 15:55:42 +00:00
jan.nijtmans e43d36be90 Merge 8.6 2019-09-11 11:35:59 +00:00
jan.nijtmans ccbf81ed51 Merge 8.7 2019-09-10 14:18:40 +00:00
jan.nijtmans 7680153063 Merge 8.6 2019-09-10 13:30:21 +00:00
jan.nijtmans 6a8c97bdf8 Don't use -64 in travis titles any more: x64 is implicit if 32-bit is not explicitely mentioned. 2019-09-09 09:23:47 +00:00
jan.nijtmans 31c4acd8e6 Merge 8.6 2019-09-09 09:04:27 +00:00
jan.nijtmans 0371dd2510 Merge 8.6 2019-09-08 13:35:56 +00:00
jan.nijtmans 0e12a5af7c merge-mark 2019-09-07 14:44:20 +00:00
jan.nijtmans 58f3fe5abc Merge 8.6. Remove 3 duplicate build-entries in .travis.yml 2019-09-07 14:03:35 +00:00
fvogel 1f9311a1b7 Fix bug 9d10c37aa8 (in the Tk repository): Improperly converted link in HTML man page for ttk::style 2019-09-07 08:55:08 +00:00
sebres 73dfa2cc44 simple and binary compatible fix for [775ee88560]: use correct relative level (1) in case of top-1, "bad level" message points "below global level" (no regressions anymore, all tests pass) 2019-09-06 20:37:21 +00:00
sebres bbde800d2a merge 8.6 (TclGetFrame is the same as TclObjGetFrame, so no functional changes only test-case which show same "regression" now as "uplevel-4.0.*" tests) 2019-09-06 20:31:47 +00:00
sebres bacdfc5ef0 cherry-pick [af744d56e0ffcc65] fixed segfault of [775ee88560] in 8.7 2019-09-06 17:36:06 +00:00
sebres fda6aed43a merge 8.6 2019-09-06 17:33:25 +00:00
jan.nijtmans 10147df9b8 Fix build with "cl" using configure/make build system. It turns out that using -DIOAPI_NO_64 is harmful on Windows (although it works with mingw-w64) 2019-09-06 14:51:21 +00:00
jan.nijtmans fa39cca32f Merge 8.6 2019-09-06 12:33:14 +00:00
jan.nijtmans e5f0aa5009 Merge 8.7 2019-09-05 21:30:23 +00:00
jan.nijtmans 0a562b0983 Merge 8.6 2019-09-05 21:25:07 +00:00
jan.nijtmans 96c82a32e1 Mark more function paramaters as unused. Now Tcl compiles fully (on UNIX and Windows) without -Wunused-parameters warnings 2019-09-05 15:14:29 +00:00
jan.nijtmans 26c1cd495a Merge 8.7 2019-09-05 07:55:38 +00:00
jan.nijtmans d3ac5d78eb Merge 8.6 2019-09-05 06:57:59 +00:00
jan.nijtmans 2d7fb3bc20 interp is not dummy any-more 2019-09-04 22:11:48 +00:00
jan.nijtmans 2cd19c4e6b Bring back Tcl_UntraceVar 2019-09-04 22:08:23 +00:00
jan.nijtmans ed985943f3 Handle "Unload" as well 2019-09-04 21:19:59 +00:00
jan.nijtmans 6506055954 (experiment) Allow C++ symbols to be found in loaded extensions 2019-09-04 20:51:06 +00:00
jan.nijtmans 74315d3d10 merge-mark 2019-09-04 15:57:53 +00:00
jan.nijtmans e949bfae93 Merge 8.6 2019-09-04 11:02:33 +00:00
jan.nijtmans 8c60b1157a Mark more unused parameters 2019-09-03 20:32:33 +00:00
jan.nijtmans 97cf6a1aff Merge tip-548 2019-09-03 14:55:19 +00:00
jan.nijtmans 2e71e654f8 Merge 8.7 2019-09-03 14:19:05 +00:00
jan.nijtmans 2d3d61a110 Merge 8.6 2019-09-03 10:53:42 +00:00
jan.nijtmans b5f118d875 Merge tip-548. A few more fixes, trying to make the Travis build work (finally) 2019-09-02 12:27:10 +00:00
jan.nijtmans 2552ed664c Merge 8.7 2019-09-02 11:35:55 +00:00
jan.nijtmans 4376455cb3 Tcl_UntraceVar() -> Tcl_UntraceVar2() and similar changes.
Add @runstatedir@ to Makefile.in's (not used yet)
2019-09-02 11:33:06 +00:00
jan.nijtmans 876a5d6782 Let's try a real C++ build with Travis on Linux 2019-08-30 15:21:28 +00:00
jan.nijtmans 289e2891a6 Merge 8.7 2019-08-29 13:36:08 +00:00
jan.nijtmans 4187ab8e37 Merge tip-548 2019-08-29 13:28:32 +00:00
apnadkarni e8ff3d4faa Merge core-8-6-branch. nmake bug fix [889065786b] for extension stubs. 2019-08-29 10:34:01 +00:00
jan.nijtmans ecf5d1b0b8 Fix one version-check in rules.vc (Thanks to Ashok P. Nadkarni for noticing this!) 2019-08-29 07:45:19 +00:00
jan.nijtmans a812c80661 Merge 8.7 2019-08-28 14:38:46 +00:00
dgp 6f8793bff8 merge 8.7 2019-08-28 12:57:14 +00:00
dgp df6c6b5747 merge 8.6 2019-08-28 12:57:04 +00:00
jan.nijtmans da423a1424 Merge 8.6 2019-08-28 11:15:19 +00:00
sebres 478e248339 merge 8.6 2019-08-27 18:33:44 +00:00
jan.nijtmans dfcc35136a Merge 8.6 2019-08-27 11:58:14 +00:00
dgp 278477fcd7 merge 8.7 2019-08-26 16:10:24 +00:00
dgp 9b14adeeea merge 8.6 2019-08-26 15:55:03 +00:00
jan.nijtmans bf62089e12 Merge 8.6 2019-08-26 14:07:03 +00:00
jan.nijtmans 3bdae3d946 Merge 8.7 2019-08-26 09:07:15 +00:00
jan.nijtmans 85a07c9ee7 Merge 8.7 2019-08-26 09:06:31 +00:00
jan.nijtmans bf10d7f187 Merge 8.6 2019-08-26 09:01:00 +00:00
jan.nijtmans 587f8fa3d9 Merge 8.6
Update effective_tld_names.txt.gz to the latest version.
Adapt .gitattributes and .fossil-settings/binary-glob to handle *.gz file transparently in fossil/git
2019-08-23 09:03:27 +00:00
jan.nijtmans b4243394a8 Merge 8.7 2019-08-15 15:33:46 +00:00
jan.nijtmans 4796062aab Merge tip-548 2019-08-15 15:20:29 +00:00
jan.nijtmans 2d85a1f9de Merge 8.7 2019-08-15 08:59:09 +00:00
jan.nijtmans c299d96628 Merge 8.7 2019-08-14 15:13:41 +00:00
jan.nijtmans 261bde3156 Eliminate dependency in test-suite on Unicode functions. Merge tip-548. Fix build with -DTCL_NO_DEPRECATED 2019-08-13 21:00:28 +00:00
jan.nijtmans bce65c12f6 Merge 8.7 2019-08-13 20:10:50 +00:00
jan.nijtmans 4b48c76e1c default TCL_UTF_MAX should still be 3 2019-08-12 20:49:50 +00:00
jan.nijtmans 92c04315ff Forgot some changes from tip-548 2019-08-12 20:47:01 +00:00
jan.nijtmans 8ddf96d852 Merge branch tip-548. No longer define addtional stub-entries for functions that will be removed (because of deprecation) anyway 2019-08-12 20:38:09 +00:00
jan.nijtmans 9c94b7bd76 "utfmax" build should be with TCL_UTF_MAX=6 2019-08-12 19:56:18 +00:00
jan.nijtmans 7934f521d7 Merge tip-548 2019-08-11 21:33:32 +00:00
jan.nijtmans f8484f801a Merge 8.7 2019-08-11 21:24:34 +00:00
jan.nijtmans 995305b8d7 Merge 8.7 2019-08-04 18:26:12 +00:00
jan.nijtmans 67b632666e Use *WChar* in stead of *Char16* functions on Windows, always. It's actually the same, but more consistent. 2019-08-03 21:51:48 +00:00
jan.nijtmans ee3826893d Merge tip-548 (since using the *WChar* functions leads to less type-casts in c++)
Als finish implementaton for MacOSX
2019-08-03 20:25:14 +00:00
jan.nijtmans e74974e6cd Spread out definitions of Tcl_*WChar* functions over multiple lines, making it more readable. 2019-08-02 15:13:54 +00:00
jan.nijtmans 2b096ec26d Merge tip-548 2019-08-02 15:03:45 +00:00
jan.nijtmans a41149258a Oops, wrong check 2019-08-02 14:57:35 +00:00
jan.nijtmans cd61c32b31 Merge 8.7 2019-08-02 14:36:51 +00:00
jan.nijtmans ff1762b095 Merge core-8-branch. Use tclWinDde.c and tclWinReg.c to show how the *WChar* functions could be used in Win32 extensions. 2019-08-02 14:24:59 +00:00
jan.nijtmans 59a630e12e Merge 8.7 2019-08-02 13:00:11 +00:00
jan.nijtmans 474d95712e Merge 8.7. Continue implementation for win32 2019-08-02 12:15:23 +00:00
jan.nijtmans d5de5123cc Merge 8.7. Some formatting. 2019-08-02 09:00:03 +00:00
jan.nijtmans 972ac8cc9d Protect Tcl_AToB() functions against NULL input 2019-08-01 21:55:52 +00:00
jan.nijtmans 203f7657fe wrong length in tclMain.c, and wrong #endif 2019-08-01 21:47:01 +00:00
jan.nijtmans 5c8bbdd6d9 Merge tip-548 2019-08-01 21:35:37 +00:00
jan.nijtmans f0d60d9cdf Merge 8.7. Documentation improvements and code cleanup. Approaching finish. 2019-08-01 16:03:11 +00:00
jan.nijtmans 74f9c831ac Merge tip-548 2019-08-01 11:55:40 +00:00
jan.nijtmans b89c01475a Merge 8.7 2019-08-01 09:31:37 +00:00
jan.nijtmans 8f2b15e6db Merge 8.7 2019-07-17 12:49:37 +00:00
dgp c5da22ebff merge 8.6 2019-07-15 15:00:21 +00:00
jan.nijtmans c81f2463d8 Merge 8.7 2019-07-13 17:20:28 +00:00
jan.nijtmans c5ced4ccd6 Rename UTF-related functions to "WChar" and "Char16" variants, more intuitive because they represent wchar_t and char16_t (since C++11) types in modern compilers. 2019-07-11 07:18:07 +00:00
jan.nijtmans 2a3d586a79 Merge 8.7, and continue implementation. Almost done 2019-07-10 05:51:56 +00:00
jan.nijtmans a0676d22d0 Undo changes in configure script: Since wchar_t is not used in Tcl yet (except in Windows), the -fshort-wchar option is not necessary 2019-07-07 20:51:24 +00:00
jan.nijtmans d6fda47fa8 Merge 8.7, and a few tweaks: Only provide Tcl_WinUtfToTChar on Tcl 8.x, not on 9.0 any more 2019-07-07 20:38:54 +00:00
jan.nijtmans 3e181ede9d Fix UNIX/Mac build 2019-07-06 23:09:08 +00:00
dgp 42dff1d622 merge 8.6 2019-07-05 14:40:11 +00:00
jan.nijtmans 30b0dabb9b Improvement: always export both 16-bit and 32-bit UTF function 2019-07-05 09:03:12 +00:00
jan.nijtmans 26a830241e Merge 8.7 2019-07-04 07:07:10 +00:00
jan.nijtmans d409a29e57 Experiment: compile Tcl with C++ compiler. WIP 2019-07-04 06:54:24 +00:00
dgp 459aa94020 merge 8.6 2019-07-03 15:48:09 +00:00
dgp 93c913d132 merge 8.6 2019-07-01 13:28:20 +00:00
jan.nijtmans a2d61902c5 Merge tip-548 2019-06-29 14:35:51 +00:00
jan.nijtmans a293b747f1 Merge 8.7 2019-06-29 13:59:55 +00:00
jan.nijtmans 3d185e117d Merge tip-548 2019-06-29 07:19:50 +00:00
jan.nijtmans 300d11729e Merge 8.7 2019-06-29 07:18:39 +00:00
jan.nijtmans 65e3c9b74d Fix execute flag for win/tclWinFile.c here too 2019-06-27 13:29:40 +00:00
dgp eb64fc3dac merge 8.7 2019-06-27 13:08:45 +00:00
dgp 8884cc7dae merge 8.6 2019-06-27 13:06:42 +00:00
jan.nijtmans 379b57abd7 Merge tip-548 2019-06-27 10:49:29 +00:00
jan.nijtmans 44bc247a5a Code cleanup for Tcl_WinUtfToTChar/Tcl_WinTCharToUtf. Tested with Tk now. 2019-06-27 08:22:35 +00:00
jan.nijtmans 218593d964 Merge tip-548 2019-06-26 21:25:54 +00:00
jan.nijtmans 63502e3b41 Add compatibility macro's for Tcl_WinUtfToTChar/Tcl_WinTCharToUtf 2019-06-26 21:03:21 +00:00
jan.nijtmans a0ce8846be Merge tip-547 2019-06-26 20:08:18 +00:00
dgp c3c72d902f Bump version numbers for 8.6.10 release. 2019-06-17 18:56:40 +00:00
dgp fe44a8d5e9 merge 8.7 2019-06-17 18:28:39 +00:00
dgp 1fea6044ed merge 8.7 2019-06-12 18:58:35 +00:00
jan.nijtmans d64f20cebe Merge tip-548 2019-06-09 21:18:35 +00:00
jan.nijtmans ce24c767fc Merge tip-547 2019-06-09 21:17:41 +00:00
jan.nijtmans e2abfe30a7 Merge tip-548 branch. 2019-06-03 21:20:07 +00:00
jan.nijtmans 9a414590a6 TIP #548: Deprecate Tcl_WinUtfToTChar() and Tcl_WinTCharToUtf() and provide more flexible replacement functions 2019-06-03 19:48:14 +00:00
jan.nijtmans 83661bdca4 Merge tip-547 2019-05-31 23:35:20 +00:00
dgp 9b8f76b445 merge 8.7 2019-05-30 12:14:57 +00:00
jan.nijtmans 58260d444e More simplifications, taking deprecations into account 2019-05-22 21:50:14 +00:00
jan.nijtmans ea5190faaa Merge 8.7 2019-05-22 07:33:13 +00:00
jan.nijtmans d063a23455 More WIP: eliminate all usage of (platform-specific) Tcl_WinTCharToUtf()/Tcl_WinUtfToTChar() to its proposed portable replacements: Tcl_Utf16ToUtfDString()/Tcl_UtfToUtf16DString()
This allows for Tcl_WinTCharToUtf()/Tcl_WinUtfToTChar() to be declared deprecated.
2019-05-22 07:32:37 +00:00
dgp 28cc8c889e merge 8.7 2019-05-17 14:42:44 +00:00
jan.nijtmans f51c5464dc Merge 8.7 2019-05-17 14:22:50 +00:00
jan.nijtmans 3a37a573a2 Merge 8.7 2019-05-13 21:55:28 +00:00
dgp 7278c6fb2c Complete doc changes for TIP 543 in Tcl 8.7 2019-05-11 14:43:06 +00:00
dgp 0c863ddec8 Start of TIP 543 implementation. 2019-05-10 20:30:41 +00:00
jan.nijtmans 8ffde10c06 Merge 8.7 2019-05-10 16:35:53 +00:00
jan.nijtmans 7b90ffbb48 merge 8.7 2019-05-10 07:46:32 +00:00
jan.nijtmans d5c3b7ac25 Complete implementation for MSVC (even building minigzip) 2019-04-10 19:53:39 +00:00
jan.nijtmans fbf45e053a Merge 8.7. Complete implementation for MSVC and for UNIX. 2019-04-09 19:21:38 +00:00
jan.nijtmans bb3ef94985 Merge 8.7. Intended operation completed for mingw-w64 (but not yet for other compilers/platforms) 2019-04-08 19:06:57 +00:00
jan.nijtmans 4865914200 Merge 8.7. Add checks for libtommath library to configure script (experimental) 2019-04-06 20:41:21 +00:00
jan.nijtmans 889e874282 Merge 8.7
Undo Tcl-specific changes in bn_mp_sqrt.c, and re-enable the two disabled test-cases: This proves the observed crash with DIBIT_BIT=60 is caused by those Tcl-specific changes!
2019-04-04 21:31:01 +00:00
jan.nijtmans f9eb1833d2 Merge 8.7 2019-04-03 19:52:38 +00:00
jan.nijtmans 7d8a7adc9f (temporary workaround): Mark expr-47.12 and expr-47.13 as nonPortable: Those are the test-cases failing with DIGIT_BIT=60 on MacOSX but not on other platforms. To be investigated further! 2019-03-31 20:45:46 +00:00
jan.nijtmans d1a1ae5194 Merge 8.7 2019-03-28 22:49:59 +00:00
jan.nijtmans 3664f127cd More complete typedef for mp_word, for MP_8BIT and MP_16BIT as well. 2019-03-28 22:42:56 +00:00
jan.nijtmans b3664a2eaa Experiment: On platforms which support it (gcc), compiled libtommath with DIGIT_BIT=60 2019-03-28 21:44:39 +00:00
jan.nijtmans 388ed8fba7 Merge 8.7 2019-03-24 13:05:07 +00:00
jan.nijtmans ebd469c2a8 Merge 8.7. Also fix invalid reference to TclUtfToWChar, causing build failure 2019-03-21 20:28:49 +00:00
jan.nijtmans d8c1fbed81 Merge 8.7 2019-03-20 22:54:13 +00:00
jan.nijtmans 301062d3fb Add 4 new encodings, and add documentation. 2019-03-18 20:07:15 +00:00
jan.nijtmans 6d0e92b89e More WIP. Seems to be *almost* working. 2019-03-17 22:01:42 +00:00
jan.nijtmans bc2c8431fc Merge 8.7
Move up some stub entries related to Tcl_UniChar
Use TCL_UTF_MAX=4 for full Unicode in stead of TCL_UTF_MAX=6 (TCL_UTF_MAX: 3 is default)
2019-03-16 21:10:20 +00:00
jan.nijtmans 842878d2d0 Merge 8.7.
Fix 2 test-cases which were failing for TCL_UTF_MAX=6
2019-03-14 20:59:28 +00:00
jan.nijtmans da96c53041 Even better support for -DTCL_UTF_MAX=6. Ongoing improvements (TIP being planned) 2019-03-12 20:39:42 +00:00
dgp 03405163b7 merge 8.7 2019-02-25 17:46:36 +00:00
jan.nijtmans d50da922b1 merge 8.7 2019-02-04 22:46:56 +00:00
dgp 995a8579cf merge 8.7 2018-12-14 21:33:25 +00:00
jan.nijtmans 795fcf4f08 Merge 8.7
Bring back Tcl_InitSubsystems to what Tcl_InitSubsystems was: without additional parameters or additional functionality
2018-12-08 17:16:36 +00:00
dgp e32b5b3f8a merge 8.7 2018-11-19 16:13:52 +00:00
dgp b0122226ed merge 8.7 2018-11-15 18:07:47 +00:00
dgp e326690201 Bump to version 8.7a3 for release. 2018-11-14 17:52:35 +00:00
jan.nijtmans b5fe898956 Merge tip-512 branch 2018-10-23 19:40:21 +00:00
jan.nijtmans 0b6248c50a Rebase TIP-414 to TIP-512: If Tcl_SetPanicProc doesn't have a stub entry, it can take over the function of Tcl_InitSubsystems, just by changing its return value. TIP-512 description still to be adapted accordingly. 2018-10-18 22:25:04 +00:00
dgp 441aa364da merge 8.7 2018-10-18 13:24:10 +00:00
jan.nijtmans f6fb514688 Merge 8.7 2018-05-31 07:21:14 +00:00
jan.nijtmans 1489bcfe34 merge 8.7 2018-05-19 05:18:47 +00:00
jan.nijtmans 9e929c12d5 merge core-8-branch 2018-01-20 14:38:38 +00:00
jan.nijtmans fe4ff7a3fb merge core-8-branch 2017-12-06 12:27:50 +00:00
jan.nijtmans d2ef001c49 merge trunk 2017-04-12 12:00:11 +00:00
jan.nijtmans b4b8dd8fff merge trunk 2015-09-24 13:48:37 +00:00
jan.nijtmans 6a438c4be4 rebase TIP [http://tip.tcl.tk/414|#414] implementation 2013-11-08 15:06:22 +00:00
jan.nijtmans 507739c16e rebase TIP [http://tip.tcl.tk/414|#414] implementation 2013-10-18 07:16:08 +00:00
jan.nijtmans 26472fc645 Rebase TIP #414 implementation. 2013-09-07 08:06:14 +00:00
jan.nijtmans 5e0f0ee61a rebase TIP [http://tip.tcl.tk/414|414] implementation 2013-08-19 09:05:33 +00:00
jan.nijtmans 332f11d646 rebase 2013-08-11 15:21:22 +00:00
jan.nijtmans 0aa1749495 Rebase.
Remove usability of -DUSE_TCL_STUBS
2013-07-08 12:37:00 +00:00
jan.nijtmans 8c8d7776cd rebase 2013-06-27 10:30:26 +00:00
jan.nijtmans 5ef0b5263e rebase 2013-06-26 08:15:12 +00:00
jan.nijtmans f6ed765b4a merge trunk 2013-06-25 12:32:14 +00:00
jan.nijtmans 948876257f rebase 2013-06-21 12:28:42 +00:00
jan.nijtmans 0db50478bc Simplify TIP #414 implementation by using the function TclInitStubTable() in stead of re-use Tcl_InitStubs(). 2013-06-18 08:13:22 +00:00
jan.nijtmans 3ff5e13b09 rebase TIP #414 implementation 2013-06-12 07:19:19 +00:00
641 changed files with 71483 additions and 48567 deletions
+21 -1
View File
@@ -4,6 +4,26 @@ compat/zlib/win64/zdll.lib
compat/zlib/win64/zlib1.dll
compat/zlib/win64/libz.dll.a
compat/zlib/zlib.3.pdf
compat/zlib/win32/zdll.lib
compat/zlib/win32/zlib1.dll
compat/zlib/win64/zdll.lib
compat/zlib/win64/zlib1.dll
compat/zlib/win64/libz.dll.a
compat/zlib/zlib.3.pdf
libtommath/win32/tommath.lib
libtommath/win32/libtommath.dll
libtommath/win64/tommath.lib
libtommath/win64/libtommath.dll
libtommath/win64/libtommath.dll.a
*.a
*.bmp
*.dll
*.exe
*.gif
*.png
*.gz
*.jpg
*.lib
*.pdf
*.png
*.xlsx
*.zip
-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
+3
View File
@@ -0,0 +1,3 @@
Important Note
==========
Please do not file issues with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there.
+3
View File
@@ -0,0 +1,3 @@
Important Note
==========
Please do not file pull requests with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues (including patches) are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there.
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tcl8.6</name>
<name>tcl8</name>
<comment></comment>
<projects>
</projects>
+162 -40
View File
@@ -6,28 +6,50 @@ matrix:
# Testing on Linux with various compilers
- name: "Linux/GCC/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- name: "Linux/GCC/Shared: UTF_MAX=4"
os: linux
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
- name: "Linux/GCC/Shared: NO_DEPRECATED"
os: linux
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
- name: "Linux/GCC/Static"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- CFGOPT="--disable-shared"
- BUILD_DIR=unix
- name: "Linux/GCC/Debug"
os: linux
dist: xenial
dist: bionic
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
# C++ build.
- name: "Linux/G++/Shared"
os: linux
dist: bionic
compiler: g++
env:
- BUILD_DIR=unix
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
# Older versions of GCC...
- name: "Linux/GCC 7/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc-7
addons:
apt:
@@ -39,7 +61,7 @@ matrix:
- BUILD_DIR=unix
- name: "Linux/GCC 6/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc-6
addons:
apt:
@@ -51,7 +73,7 @@ matrix:
- BUILD_DIR=unix
- name: "Linux/GCC 5/Shared"
os: linux
dist: xenial
dist: bionic
compiler: gcc-5
addons:
apt:
@@ -61,48 +83,43 @@ matrix:
- g++-5
env:
- BUILD_DIR=unix
- name: "Linux/GCC 4.9/Shared"
os: linux
dist: xenial
compiler: gcc-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
env:
- BUILD_DIR=unix
# Clang
- name: "Linux/Clang/Shared"
os: linux
dist: bionic
compiler: clang
env:
- BUILD_DIR=unix
- name: "Linux/Clang/Shared:NO_DEPRECATED"
os: linux
dist: xenial
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
- name: "Linux/Clang/Static"
os: linux
dist: xenial
dist: bionic
compiler: clang
env:
- CFGOPT="--disable-shared"
- BUILD_DIR=unix
- name: "Linux/Clang/Debug"
os: linux
dist: xenial
dist: bionic
compiler: clang
env:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols"
# Testing on Mac, various styles
- name: "macOS/Xcode 11/Shared/Unix-like"
- name: "macOS/Xcode 11.3/Shared/Unix-like"
os: osx
osx_image: xcode11
osx_image: xcode11.3
env:
- BUILD_DIR=unix
- name: "macOS/Xcode 11/Shared"
- name: "macOS/Xcode 11.3/Shared"
os: osx
osx_image: xcode11
osx_image: xcode11.3
env:
- BUILD_DIR=macosx
install: []
@@ -110,6 +127,17 @@ matrix:
- make all
# The styles=develop avoids some weird problems on OSX
- make test styles=develop
addons:
homebrew:
packages:
- libtommath
- name: "macOS/Xcode 11/Shared"
os: osx
osx_image: xcode11
env:
- BUILD_DIR=macosx
install: []
script: *mactest
- name: "macOS/Xcode 10/Shared"
os: osx
osx_image: xcode10.3
@@ -117,6 +145,10 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
addons:
homebrew:
packages:
- libtommath
- name: "macOS/Xcode 9/Shared"
os: osx
osx_image: xcode9
@@ -124,6 +156,10 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
addons:
homebrew:
packages:
- libtommath
- name: "macOS/Xcode 8/Shared"
os: osx
osx_image: xcode8
@@ -131,11 +167,15 @@ matrix:
- BUILD_DIR=macosx
install: []
script: *mactest
addons:
homebrew:
packages:
- libtommath
# Test with mingw-w64 cross-compile
# Doesn't run tests because wine is only an imperfect Windows emulation
- name: "Linux-cross-Windows/GCC/Shared/no test"
os: linux
dist: xenial
dist: bionic
compiler: x86_64-w64-mingw32-gcc
addons:
apt:
@@ -156,7 +196,7 @@ matrix:
# Doesn't run tests because wine is only an imperfect Windows emulation
- name: "Linux-cross-Windows-32/GCC/Shared/no test"
os: linux
dist: xenial
dist: bionic
compiler: i686-w64-mingw32-gcc
addons:
apt:
@@ -168,7 +208,7 @@ matrix:
- gcc-multilib
env:
- BUILD_DIR=win
- CFGOPT="--host=i686-w64-mingw32"
- CFGOPT=--host=i686-w64-mingw32
script: *crosstest
# Test on Windows with MSVC native
- name: "Windows/MSVC/Shared"
@@ -182,8 +222,26 @@ matrix:
- cd ${BUILD_DIR}
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=threads -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=threads -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc test
- name: "Windows/MSVC/Shared: UTF_MAX=4"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
- name: "Windows/MSVC/Shared: NO_DEPRECATED"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
- name: "Windows/MSVC/Static"
os: windows
compiler: cl
@@ -191,8 +249,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static,msvcrt,threads -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=static,msvcrt,threads -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC/Debug"
os: windows
compiler: cl
@@ -200,8 +258,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols,msvcrt,threads -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x64 && nmake OPTS=symbols,msvcrt,threads -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
# Test on Windows with MSVC native (32-bit)
- name: "Windows/MSVC-x86/Shared"
os: windows
@@ -210,8 +268,26 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=threads -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=threads -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc test
- name: "Windows/MSVC-x86/Shared: UTF_MAX=4"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Shared: NO_DEPRECATED"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Static"
os: windows
compiler: cl
@@ -219,8 +295,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static,msvcrt,threads -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=static,msvcrt,threads -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Debug"
os: windows
compiler: cl
@@ -228,8 +304,8 @@ matrix:
before_install: *vcpreinst
install: []
script:
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=symbols,msvcrt,threads -f makefile.vc all tcltest'
- cmd.exe /C 'vcvarsall.bat x86 && nmake OPTS=symbols,msvcrt,threads -f makefile.vc test'
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=symbols' '-f' makefile.vc test
# Test on Windows with GCC native
- name: "Windows/GCC/Shared"
os: windows
@@ -238,8 +314,31 @@ matrix:
- BUILD_DIR=win
- CFGOPT="--enable-64bit"
before_install: &makepreinst
- choco install make
- choco install -y make zip
- cd ${BUILD_DIR}
- name: "Windows/GCC/Shared: UTF_MAX=4"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
before_install: *makepreinst
- name: "Windows/GCC/Shared: NO_DEPRECATED"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
before_install: *makepreinst
- name: "Windows/G++/Shared"
os: windows
compiler: g++
env:
- BUILD_DIR=win
- CFGOPT="CC=g++ --enable-64bit"
before_install: *makepreinst
script:
- make all tcltest
- name: "Windows/GCC/Static"
os: windows
compiler: gcc
@@ -261,6 +360,29 @@ matrix:
env:
- BUILD_DIR=win
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: UTF_MAX=4"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=4"
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: NO_DEPRECATED"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
before_install: *makepreinst
- name: "Windows/G++-x86/Shared"
os: windows
compiler: g++
env:
- BUILD_DIR=win
- CFGOPT="CC=g++"
before_install: *makepreinst
script:
- make all tcltest
- name: "Windows/GCC-x86/Static"
os: windows
compiler: gcc
+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>
+5 -5
View File
@@ -1,11 +1,11 @@
# README: Tcl
This is the **Tcl 8.6.9** source distribution.
This is the **Tcl 8.7a4** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
[![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-6-branch)](https://travis-ci.org/tcltk/tcl)
[![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-branch)](https://travis-ci.org/tcltk/tcl)
## Contents
1. [Introduction](#intro)
@@ -43,7 +43,7 @@ and selling it either in whole or in part. See the file
## <a id="doc">2.</a> Documentation
Extensive documentation is available at our website.
The home page for this release, including new features, is
[here](https://www.tcl.tk/software/tcltk/8.6.html).
[here](https://www.tcl.tk/software/tcltk/8.7.html).
Detailed release notes can be found at the
[file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/)
by clicking on the relevant version.
@@ -53,8 +53,8 @@ Xchange](https://www.tcl-lang.org/about/).
There have been many Tcl books on the market. Many are mentioned in
[the Wiki](https://wiki.tcl-lang.org/_/ref?N=25206).
The complete set of reference manual entries for Tcl 8.6 is [online,
here](https://www.tcl-lang.org/man/tcl8.6/).
The complete set of reference manual entries for Tcl 8.7 is [online,
here](https://www.tcl-lang.org/man/tcl8.7/).
### <a id="doc.unix">2a.</a> Unix Documentation
The `doc` subdirectory in this release contains a complete set of
+226
View File
@@ -8796,6 +8796,55 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
--- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tcl/ for details
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:
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
2016-11-25 [array names -regexp] supports backrefs (goth)
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
2017-05-31 Purge build support for SunOS-4.* (stu)
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
=> TclOO 1.2.0
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
2017-08-10 [array names -regexp] supports backrefs (goth)
2017-08-10 Fix gcc build failures due to #pragma placement (cassoff,fellows)
@@ -8894,3 +8943,180 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
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/ -
2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres)
2018-12-30 (bug)[3cf3a9] variable 'timezone' deprecated in vc2017 (nijtmans)
2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres)
2019-02-01 (bug)[e3f481] tests var-1.2[01] (sebres)
2019-03-01 (new) Update to Unicode 12.0 (nijtmans)
2019-03-05 (new)[TIP 527] New command [timerate] (sebres)
2019-03-08 (bug)[39fed4] [package require] memory validity (hume,porter)
2019-04-23 (new) New command tcl::unsupported::corotype (fellows)
2019-05-04 (bug) memlink when namespace deletion kills linked var (porter)
2019-05-28 (new) README file converted to README.md in Markdown (nijtmans)
2019-06-17 (bug)[8b9854] [info level 0] regression with ensembles (porter)
2019-06-20 (bug)[6bdadf] crash multi-arg write-traced [lappend] (fellows,porter)
2019-06-21 (bug)[f8a33c] crash Tcl_Exit before init (brooks,sebres)
2019-08-27 (bug)[fa6bf3] Bytecode fails epoch recovery at numLevel=0 (sebres)
2019-08-29 (bug)[fec0c1] C stack overflow compiling bytecode (ade,sebres)
2019-09-12 tzdata updated to Olson's tzdata2019c (jima)
2019-09-20 (new) registry/dde no longer need -DUNICODE (nijtmans)
=> registry 1.3.4
=> dde 1.4.2
2019-10-02 (bug)[16768d] Fix [info hostname] on NetBSD (rytaro)
2019-10-23 (new) libtommath updated to release 1.2.0 (nijtmans)
2019-10-25 OSX: system Tcl deprecated. End default use of its packages. (walzer)
2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter)
2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres)
- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ -
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter)
2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter)
2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows)
2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans)
2017-11-20 (support) Ended use of the obsolete values.h header (culler)
2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans)
2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans)
2017-12-08 [TIP 477] Reform of nmake build (nadkarni)
2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter)
2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans)
2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter)
2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter)
2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans)
2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans)
2018-03-05 [TIP 351] [lsearch] striding
2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter)
2018-03-12 [TIP 462] [::tcl::process]
2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann)
2018-03-12 [TIP 499] custom locale preference list (oehlmann)
=> msgcat 1.7.0
2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter)
2018-03-30 Refactored [lrange] (spjuth)
2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans)
2018-04-20 [TIP 421] [array for]
2018-05-11 [TIP 425] Windows panic callback use of UTF-8
2018-05-17 [TIP 491] Phase out --disable-threads support
2018-06-03 [TIP 500] TclOO Private Methods and Variables
2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter)
2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows)
2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans)
2018-09-12 [TIP 430] zipfs and embedded script library (woods)
2018-09-26 [TIP 508] [array default] (bonnet,fellows)
2018-09-27 [TIP 515] level value reform (nijtmans)
2018-09-27 [TIP 516] More OO slot operations (fellows)
2018-09-27 [TIP 426] [info cmdtype] (fellows)
2018-09-28 [TIP 509] Cross platform reentrant mutex
2018-10-08 [TIP 514] native integers are 64-bit
2018-10-12 [TIP 502] index value reform (porter)
2018-11-06 [TIP 406] http cookies (fellows)
2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter)
2018-11-06 [TIP 501] [string is dict]
2018-11-06 [TIP 519] inline export/unexport option for [oo::define]
2018-11-06 [TIP 523] [lpop]
2018-11-06 [TIP 524] TclOO custom dialects
2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter)
2018-11-15 [TIP 512] No stub for Tcl_SetExitProc()
2019-04-08 (bug)[45b9fa] crash in [try] (coulter)
2019-04-14 [TIP 160] terminal and serial channel controls
2019-04-14 [TIP 312] more types for Tcl_LinkVar
2019-04-14 [TIP 367] [lremove]
2019-04-14 [TIP 504] [string insert]
2019-04-16 [TIP 342] [dict getwithdefault]
2019-05-25 [TIP 431] [file tempdir]
2019-05-25 [TIP 383] [coroinject], [coroprobe]
2019-05-31 [TIP 544] Tcl_GetIntForIndex()
2019-06-12 Replace TclOffset() with offsetof()
2019-06-15 [TIP 461] string compare operators for [expr]
2019-06-16 [TIP 521] floating point classification functions for [expr]
2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows)
2019-06-28 [TIP 547] New encodings utf-16, ucs-2
2019-09-14 [TIP 414] Tcl_InitSubsystems()
2019-09-14 [TIP 548] wchar_t conversion functions
- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details -
+2 -1
View File
@@ -73,6 +73,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
struct hostent *hp;
char tmpserv[16];
(void)salen;
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
return (EAI_FAMILY);
@@ -153,7 +154,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
{
struct addrinfo *ai;
ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
ai = (struct addrinfo *)malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
if (ai == NULL)
return (NULL);
-14
View File
@@ -1,14 +0,0 @@
/*
* float.h --
*
* This is a dummy header file to #include in Tcl when there
* is no float.h in /usr/include. Right now this file is empty:
* Tcl contains #ifdefs to deal with the lack of definitions;
* all it needs is for the #include statement to work.
*
* Copyright (c) 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.
*/
+2 -1
View File
@@ -21,10 +21,11 @@ gettimeofday(
struct timezone *tz)
{
struct timeb t;
(void)tz;
ftime(&t);
tp->tv_sec = t.time;
tp->tv_usec = t. millitm * 1000;
tp->tv_usec = t.millitm * 1000;
return 0;
}
+7 -6
View File
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/*
*----------------------------------------------------------------------
@@ -32,19 +33,19 @@
int
mkstemp(
char *template) /* Template for filename. */
char *tmpl) /* Template for filename. */
{
static const char alphanumerics[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
register char *a, *b;
char *a, *b;
int fd, count, alphanumericsLen = strlen(alphanumerics); /* == 62 */
a = template + strlen(template);
while (a > template && *(a-1) == 'X') {
a = tmpl + strlen(tmpl);
while (a > tmpl && *(a-1) == 'X') {
a--;
}
if (a == template) {
if (a == tmpl) {
errno = ENOENT;
return -1;
}
@@ -71,7 +72,7 @@ mkstemp(
* Template is now realized; try to open (with correct options).
*/
fd = open(template, O_RDWR|O_CREAT|O_EXCL, 0600);
fd = open(tmpl, O_RDWR|O_CREAT|O_EXCL, 0600);
} while (fd == -1 && errno == EEXIST && --count > 0);
return fd;
+7 -7
View File
@@ -20,9 +20,9 @@ DIR *
opendir(
char *name)
{
register DIR *dirp;
register int fd;
char *myname;
DIR *dirp;
int fd;
const char *myname;
myname = ((*name == '\0') ? "." : name);
if ((fd = open(myname, 0, 0)) == -1) {
@@ -65,9 +65,9 @@ struct olddirect {
struct dirent *
readdir(
register DIR *dirp)
DIR *dirp)
{
register struct olddirect *dp;
struct olddirect *dp;
static struct dirent dir;
for (;;) {
@@ -101,10 +101,10 @@ readdir(
void
closedir(
register DIR *dirp)
DIR *dirp)
{
close(dirp->dd_fd);
dirp->dd_fd = -1;
dirp->dd_loc = 0;
ckfree((char *) dirp);
ckfree(dirp);
}
+919
View File
@@ -0,0 +1,919 @@
/* A portable stdint.h
****************************************************************************
* BSD License:
****************************************************************************
*
* Copyright (c) 2005-2016 Paul Hsieh
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************
*
* Version 0.1.16.0
*
* The ANSI C standard committee, for the C99 standard, specified the
* inclusion of a new standard include file called stdint.h. This is
* a very useful and long desired include file which contains several
* very precise definitions for integer scalar types that is critically
* important for making several classes of applications portable
* including cryptography, hashing, variable length integer libraries
* and so on. But for most developers its likely useful just for
* programming sanity.
*
* The problem is that some compiler vendors chose to ignore the C99
* standard and some older compilers have no opportunity to be updated.
* Because of this situation, simply including stdint.h in your code
* makes it unportable.
*
* So that's what this file is all about. It's an attempt to build a
* single universal include file that works on as many platforms as
* possible to deliver what stdint.h is supposed to. Even compilers
* that already come with stdint.h can use this file instead without
* any loss of functionality. A few things that should be noted about
* this file:
*
* 1) It is not guaranteed to be portable and/or present an identical
* interface on all platforms. The extreme variability of the
* ANSI C standard makes this an impossibility right from the
* very get go. Its really only meant to be useful for the vast
* majority of platforms that possess the capability of
* implementing usefully and precisely defined, standard sized
* integer scalars. Systems which are not intrinsically 2s
* complement may produce invalid constants.
*
* 2) There is an unavoidable use of non-reserved symbols.
*
* 3) Other standard include files are invoked.
*
* 4) This file may come in conflict with future platforms that do
* include stdint.h. The hope is that one or the other can be
* used with no real difference.
*
* 5) In the current version, if your platform can't represent
* int32_t, int16_t and int8_t, it just dumps out with a compiler
* error.
*
* 6) 64 bit integers may or may not be defined. Test for their
* presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
* Note that this is different from the C99 specification which
* requires the existence of 64 bit support in the compiler. If
* this is not defined for your platform, yet it is capable of
* dealing with 64 bits then it is because this file has not yet
* been extended to cover all of your system's capabilities.
*
* 7) (u)intptr_t may or may not be defined. Test for its presence
* with the test: #ifdef PTRDIFF_MAX. If this is not defined
* for your platform, then it is because this file has not yet
* been extended to cover all of your system's capabilities, not
* because its optional.
*
* 8) The following might not been defined even if your platform is
* capable of defining it:
*
* WCHAR_MIN
* WCHAR_MAX
* (u)int64_t
* PTRDIFF_MIN
* PTRDIFF_MAX
* (u)intptr_t
*
* 9) The following have not been defined:
*
* WINT_MIN
* WINT_MAX
*
* 10) The criteria for defining (u)int_least(*)_t isn't clear,
* except for systems which don't have a type that precisely
* defined 8, 16, or 32 bit types (which this include file does
* not support anyways). Default definitions have been given.
*
* 11) The criteria for defining (u)int_fast(*)_t isn't something I
* would trust to any particular compiler vendor or the ANSI C
* committee. It is well known that "compatible systems" are
* commonly created that have very different performance
* characteristics from the systems they are compatible with,
* especially those whose vendors make both the compiler and the
* system. Default definitions have been given, but its strongly
* recommended that users never use these definitions for any
* reason (they do *NOT* deliver any serious guarantee of
* improved performance -- not in this file, nor any vendor's
* stdint.h).
*
* 12) The following macros:
*
* PRINTF_INTMAX_MODIFIER
* PRINTF_INT64_MODIFIER
* PRINTF_INT32_MODIFIER
* PRINTF_INT16_MODIFIER
* PRINTF_LEAST64_MODIFIER
* PRINTF_LEAST32_MODIFIER
* PRINTF_LEAST16_MODIFIER
* PRINTF_INTPTR_MODIFIER
*
* are strings which have been defined as the modifiers required
* for the "d", "u" and "x" printf formats to correctly output
* (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
* (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
* PRINTF_INTPTR_MODIFIER is not defined for some systems which
* provide their own stdint.h. PRINTF_INT64_MODIFIER is not
* defined if INT64_MAX is not defined. These are an extension
* beyond what C99 specifies must be in stdint.h.
*
* In addition, the following macros are defined:
*
* PRINTF_INTMAX_HEX_WIDTH
* PRINTF_INT64_HEX_WIDTH
* PRINTF_INT32_HEX_WIDTH
* PRINTF_INT16_HEX_WIDTH
* PRINTF_INT8_HEX_WIDTH
* PRINTF_INTMAX_DEC_WIDTH
* PRINTF_INT64_DEC_WIDTH
* PRINTF_INT32_DEC_WIDTH
* PRINTF_INT16_DEC_WIDTH
* PRINTF_UINT8_DEC_WIDTH
* PRINTF_UINTMAX_DEC_WIDTH
* PRINTF_UINT64_DEC_WIDTH
* PRINTF_UINT32_DEC_WIDTH
* PRINTF_UINT16_DEC_WIDTH
* PRINTF_UINT8_DEC_WIDTH
*
* Which specifies the maximum number of characters required to
* print the number of that type in either hexadecimal or decimal.
* These are an extension beyond what C99 specifies must be in
* stdint.h.
*
* Compilers tested (all with 0 warnings at their highest respective
* settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
* bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
* .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
*
* This file should be considered a work in progress. Suggestions for
* improvements, especially those which increase coverage are strongly
* encouraged.
*
* Acknowledgements
*
* The following people have made significant contributions to the
* development and testing of this file:
*
* Chris Howie
* John Steele Scott
* Dave Thorup
* John Dill
* Florian Wobbe
* Christopher Sean Morrison
* Mikkel Fahnoe Jorgensen
*
*/
#include <stddef.h>
#include <limits.h>
#include <signal.h>
/*
* For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
*/
#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
#include <stdint.h>
#define _PSTDINT_H_INCLUDED
# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__))
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "l"
# endif
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
# else
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# ifndef PRINTF_INT32_MODIFIER
# if (UINT_MAX == UINT32_MAX)
# define PRINTF_INT32_MODIFIER ""
# else
# define PRINTF_INT32_MODIFIER "l"
# endif
# endif
# endif
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
# endif
# ifndef PRINTF_INT64_HEX_WIDTH
# define PRINTF_INT64_HEX_WIDTH "16"
# endif
# ifndef PRINTF_UINT64_HEX_WIDTH
# define PRINTF_UINT64_HEX_WIDTH "16"
# endif
# ifndef PRINTF_INT32_HEX_WIDTH
# define PRINTF_INT32_HEX_WIDTH "8"
# endif
# ifndef PRINTF_UINT32_HEX_WIDTH
# define PRINTF_UINT32_HEX_WIDTH "8"
# endif
# ifndef PRINTF_INT16_HEX_WIDTH
# define PRINTF_INT16_HEX_WIDTH "4"
# endif
# ifndef PRINTF_UINT16_HEX_WIDTH
# define PRINTF_UINT16_HEX_WIDTH "4"
# endif
# ifndef PRINTF_INT8_HEX_WIDTH
# define PRINTF_INT8_HEX_WIDTH "2"
# endif
# ifndef PRINTF_UINT8_HEX_WIDTH
# define PRINTF_UINT8_HEX_WIDTH "2"
# endif
# ifndef PRINTF_INT64_DEC_WIDTH
# define PRINTF_INT64_DEC_WIDTH "19"
# endif
# ifndef PRINTF_UINT64_DEC_WIDTH
# define PRINTF_UINT64_DEC_WIDTH "20"
# endif
# ifndef PRINTF_INT32_DEC_WIDTH
# define PRINTF_INT32_DEC_WIDTH "10"
# endif
# ifndef PRINTF_UINT32_DEC_WIDTH
# define PRINTF_UINT32_DEC_WIDTH "10"
# endif
# ifndef PRINTF_INT16_DEC_WIDTH
# define PRINTF_INT16_DEC_WIDTH "5"
# endif
# ifndef PRINTF_UINT16_DEC_WIDTH
# define PRINTF_UINT16_DEC_WIDTH "5"
# endif
# ifndef PRINTF_INT8_DEC_WIDTH
# define PRINTF_INT8_DEC_WIDTH "3"
# endif
# ifndef PRINTF_UINT8_DEC_WIDTH
# define PRINTF_UINT8_DEC_WIDTH "3"
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
# endif
# ifndef PRINTF_UINTMAX_HEX_WIDTH
# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
# endif
# ifndef PRINTF_UINTMAX_DEC_WIDTH
# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
# endif
/*
* Something really weird is going on with Open Watcom. Just pull some of
* these duplicated definitions from Open Watcom's stdint.h file for now.
*/
# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
# if !defined (INT64_C)
# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
# endif
# if !defined (UINT64_C)
# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
# endif
# if !defined (INT32_C)
# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
# endif
# if !defined (UINT32_C)
# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
# endif
# if !defined (INT16_C)
# define INT16_C(x) (x)
# endif
# if !defined (UINT16_C)
# define UINT16_C(x) (x)
# endif
# if !defined (INT8_C)
# define INT8_C(x) (x)
# endif
# if !defined (UINT8_C)
# define UINT8_C(x) (x)
# endif
# if !defined (UINT64_MAX)
# define UINT64_MAX 18446744073709551615ULL
# endif
# if !defined (INT64_MAX)
# define INT64_MAX 9223372036854775807LL
# endif
# if !defined (UINT32_MAX)
# define UINT32_MAX 4294967295UL
# endif
# if !defined (INT32_MAX)
# define INT32_MAX 2147483647L
# endif
# if !defined (INTMAX_MAX)
# define INTMAX_MAX INT64_MAX
# endif
# if !defined (INTMAX_MIN)
# define INTMAX_MIN INT64_MIN
# endif
# endif
#endif
/*
* I have no idea what is the truly correct thing to do on older Solaris.
* From some online discussions, this seems to be what is being
* recommended. For people who actually are developing on older Solaris,
* what I would like to know is, does this define all of the relevant
* macros of a complete stdint.h? Remember, in pstdint.h 64 bit is
* considered optional.
*/
#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED)
#include <sys/inttypes.h>
#define _PSTDINT_H_INCLUDED
#endif
#ifndef _PSTDINT_H_INCLUDED
#define _PSTDINT_H_INCLUDED
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t)-1)
#endif
/*
* Deduce the type assignments from limits.h under the assumption that
* integer sizes in bits are powers of 2, and follow the ANSI
* definitions.
*/
#ifndef UINT8_MAX
# define UINT8_MAX 0xff
#endif
#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks)
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
typedef unsigned char uint8_t;
# define UINT8_C(v) ((uint8_t) v)
# else
# error "Platform not supported"
# endif
#endif
#ifndef INT8_MAX
# define INT8_MAX 0x7f
#endif
#ifndef INT8_MIN
# define INT8_MIN INT8_C(0x80)
#endif
#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks)
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
typedef signed char int8_t;
# define INT8_C(v) ((int8_t) v)
# else
# error "Platform not supported"
# endif
#endif
#ifndef UINT16_MAX
# define UINT16_MAX 0xffff
#endif
#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks)
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
typedef unsigned int uint16_t;
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER ""
# endif
# define UINT16_C(v) ((uint16_t) (v))
#elif (USHRT_MAX == UINT16_MAX)
typedef unsigned short uint16_t;
# define UINT16_C(v) ((uint16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef INT16_MAX
# define INT16_MAX 0x7fff
#endif
#ifndef INT16_MIN
# define INT16_MIN INT16_C(0x8000)
#endif
#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks)
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
typedef signed int int16_t;
# define INT16_C(v) ((int16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER ""
# endif
#elif (SHRT_MAX == INT16_MAX)
typedef signed short int16_t;
# define INT16_C(v) ((int16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef UINT32_MAX
# define UINT32_MAX (0xffffffffUL)
#endif
#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks)
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
typedef unsigned long uint32_t;
# define UINT32_C(v) v ## UL
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
#elif (UINT_MAX == UINT32_MAX)
typedef unsigned int uint32_t;
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
# define UINT32_C(v) v ## U
#elif (USHRT_MAX == UINT32_MAX)
typedef unsigned short uint32_t;
# define UINT32_C(v) ((unsigned short) (v))
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef INT32_MAX
# define INT32_MAX (0x7fffffffL)
#endif
#ifndef INT32_MIN
# define INT32_MIN INT32_C(0x80000000)
#endif
#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks)
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
typedef signed long int32_t;
# define INT32_C(v) v ## L
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
#elif (INT_MAX == INT32_MAX)
typedef signed int int32_t;
# define INT32_C(v) v
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#elif (SHRT_MAX == INT32_MAX)
typedef signed short int32_t;
# define INT32_C(v) ((short) (v))
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#else
#error "Platform not supported"
#endif
#endif
/*
* The macro stdint_int64_defined is temporarily used to record
* whether or not 64 integer support is available. It must be
* defined for any 64 integer extensions for new platforms that are
* added.
*/
#undef stdint_int64_defined
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
# define stdint_int64_defined
typedef long long int64_t;
typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# endif
#endif
#if !defined (stdint_int64_defined)
# if defined(__GNUC__) && !defined(vxWorks)
# define stdint_int64_defined
__extension__ typedef long long int64_t;
__extension__ typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
# define stdint_int64_defined
typedef long long int64_t;
typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
# define stdint_int64_defined
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
# define UINT64_C(v) v ## UI64
# define INT64_C(v) v ## I64
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "I64"
# endif
# endif
#endif
#if !defined (LONG_LONG_MAX) && defined (INT64_C)
# define LONG_LONG_MAX INT64_C (9223372036854775807)
#endif
#ifndef ULONG_LONG_MAX
# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
#endif
#if !defined (INT64_MAX) && defined (INT64_C)
# define INT64_MAX INT64_C (9223372036854775807)
#endif
#if !defined (INT64_MIN) && defined (INT64_C)
# define INT64_MIN INT64_C (-9223372036854775808)
#endif
#if !defined (UINT64_MAX) && defined (INT64_C)
# define UINT64_MAX UINT64_C (18446744073709551615)
#endif
/*
* Width of hexadecimal for number field.
*/
#ifndef PRINTF_INT64_HEX_WIDTH
# define PRINTF_INT64_HEX_WIDTH "16"
#endif
#ifndef PRINTF_INT32_HEX_WIDTH
# define PRINTF_INT32_HEX_WIDTH "8"
#endif
#ifndef PRINTF_INT16_HEX_WIDTH
# define PRINTF_INT16_HEX_WIDTH "4"
#endif
#ifndef PRINTF_INT8_HEX_WIDTH
# define PRINTF_INT8_HEX_WIDTH "2"
#endif
#ifndef PRINTF_INT64_DEC_WIDTH
# define PRINTF_INT64_DEC_WIDTH "19"
#endif
#ifndef PRINTF_INT32_DEC_WIDTH
# define PRINTF_INT32_DEC_WIDTH "10"
#endif
#ifndef PRINTF_INT16_DEC_WIDTH
# define PRINTF_INT16_DEC_WIDTH "5"
#endif
#ifndef PRINTF_INT8_DEC_WIDTH
# define PRINTF_INT8_DEC_WIDTH "3"
#endif
#ifndef PRINTF_UINT64_DEC_WIDTH
# define PRINTF_UINT64_DEC_WIDTH "20"
#endif
#ifndef PRINTF_UINT32_DEC_WIDTH
# define PRINTF_UINT32_DEC_WIDTH "10"
#endif
#ifndef PRINTF_UINT16_DEC_WIDTH
# define PRINTF_UINT16_DEC_WIDTH "5"
#endif
#ifndef PRINTF_UINT8_DEC_WIDTH
# define PRINTF_UINT8_DEC_WIDTH "3"
#endif
/*
* Ok, lets not worry about 128 bit integers for now. Moore's law says
* we don't need to worry about that until about 2040 at which point
* we'll have bigger things to worry about.
*/
#ifdef stdint_int64_defined
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
# define INTMAX_MAX INT64_MAX
# define INTMAX_MIN INT64_MIN
# define UINTMAX_MAX UINT64_MAX
# define UINTMAX_C(v) UINT64_C(v)
# define INTMAX_C(v) INT64_C(v)
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
# endif
#else
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
# define INTMAX_MAX INT32_MAX
# define UINTMAX_MAX UINT32_MAX
# define UINTMAX_C(v) UINT32_C(v)
# define INTMAX_C(v) INT32_C(v)
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
# endif
#endif
/*
* Because this file currently only supports platforms which have
* precise powers of 2 as bit sizes for the default integers, the
* least definitions are all trivial. Its possible that a future
* version of this file could have different definitions.
*/
#ifndef stdint_least_defined
typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
# define UINT_LEAST8_MAX UINT8_MAX
# define INT_LEAST8_MAX INT8_MAX
# define UINT_LEAST16_MAX UINT16_MAX
# define INT_LEAST16_MAX INT16_MAX
# define UINT_LEAST32_MAX UINT32_MAX
# define INT_LEAST32_MAX INT32_MAX
# define INT_LEAST8_MIN INT8_MIN
# define INT_LEAST16_MIN INT16_MIN
# define INT_LEAST32_MIN INT32_MIN
# ifdef stdint_int64_defined
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
# define UINT_LEAST64_MAX UINT64_MAX
# define INT_LEAST64_MAX INT64_MAX
# define INT_LEAST64_MIN INT64_MIN
# endif
#endif
#undef stdint_least_defined
/*
* The ANSI C committee has defined *int*_fast*_t types as well. This,
* of course, defies rationality -- you can't know what will be fast
* just from the type itself. Even for a given architecture, compatible
* implementations might have different performance characteristics.
* Developers are warned to stay away from these types when using this
* or any other stdint.h.
*/
typedef int_least8_t int_fast8_t;
typedef uint_least8_t uint_fast8_t;
typedef int_least16_t int_fast16_t;
typedef uint_least16_t uint_fast16_t;
typedef int_least32_t int_fast32_t;
typedef uint_least32_t uint_fast32_t;
#define UINT_FAST8_MAX UINT_LEAST8_MAX
#define INT_FAST8_MAX INT_LEAST8_MAX
#define UINT_FAST16_MAX UINT_LEAST16_MAX
#define INT_FAST16_MAX INT_LEAST16_MAX
#define UINT_FAST32_MAX UINT_LEAST32_MAX
#define INT_FAST32_MAX INT_LEAST32_MAX
#define INT_FAST8_MIN INT_LEAST8_MIN
#define INT_FAST16_MIN INT_LEAST16_MIN
#define INT_FAST32_MIN INT_LEAST32_MIN
#ifdef stdint_int64_defined
typedef int_least64_t int_fast64_t;
typedef uint_least64_t uint_fast64_t;
# define UINT_FAST64_MAX UINT_LEAST64_MAX
# define INT_FAST64_MAX INT_LEAST64_MAX
# define INT_FAST64_MIN INT_LEAST64_MIN
#endif
#undef stdint_int64_defined
/*
* Whatever piecemeal, per compiler thing we can do about the wchar_t
* type limits.
*/
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks)
# include <wchar.h>
# ifndef WCHAR_MIN
# define WCHAR_MIN 0
# endif
# ifndef WCHAR_MAX
# define WCHAR_MAX ((wchar_t)-1)
# endif
#endif
/*
* Whatever piecemeal, per compiler/platform thing we can do about the
* (u)intptr_t types and limits.
*/
#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T)
# define STDINT_H_UINTPTR_T_DEFINED
#endif
#ifndef STDINT_H_UINTPTR_T_DEFINED
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__)
# define stdint_intptr_bits 64
# elif defined (__WATCOMC__) || defined (__TURBOC__)
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
# define stdint_intptr_bits 16
# else
# define stdint_intptr_bits 32
# endif
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__)
# define stdint_intptr_bits 32
# elif defined (__INTEL_COMPILER)
/* TODO -- what did Intel do about x86-64? */
# else
/* #error "This platform might not be supported yet" */
# endif
# ifdef stdint_intptr_bits
# define stdint_intptr_glue3_i(a,b,c) a##b##c
# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
# ifndef PRINTF_INTPTR_MODIFIER
# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
# endif
# ifndef PTRDIFF_MAX
# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
# endif
# ifndef PTRDIFF_MIN
# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
# endif
# ifndef UINTPTR_MAX
# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
# endif
# ifndef INTPTR_MAX
# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
# endif
# ifndef INTPTR_MIN
# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
# endif
# ifndef INTPTR_C
# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
# endif
# ifndef UINTPTR_C
# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
# endif
typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
# else
/* TODO -- This following is likely wrong for some platforms, and does
nothing for the definition of uintptr_t. */
typedef ptrdiff_t intptr_t;
# endif
# define STDINT_H_UINTPTR_T_DEFINED
#endif
/*
* Assumes sig_atomic_t is signed and we have a 2s complement machine.
*/
#ifndef SIG_ATOMIC_MAX
# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
#endif
#endif
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
/*
* Please compile with the maximum warning settings to make sure macros are
* not defined more than once.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define glue3_aux(x,y,z) x ## y ## z
#define glue3(x,y,z) glue3_aux(x,y,z)
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0);
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0);
#define DECL(us,bits) glue3(DECL,us,) (bits)
#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits)
#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; }
#define X_SIZE_MAX ((size_t)-1)
int main () {
int err_n = 0;
int err_first = 0;
DECL(I,8)
DECL(U,8)
DECL(I,16)
DECL(U,16)
DECL(I,32)
DECL(U,32)
#ifdef INT64_MAX
DECL(I,64)
DECL(U,64)
#endif
intmax_t imax = INTMAX_C(0);
uintmax_t umax = UINTMAX_C(0);
char str0[256], str1[256];
sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647));
if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH));
sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295));
if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH));
#ifdef INT64_MAX
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807));
if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1)));
sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591));
if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1)));
#endif
sprintf (str0, "%d %x\n", 0, ~0);
sprintf (str1, "%d %x\n", i8, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1));
sprintf (str1, "%u %x\n", u8, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1));
sprintf (str1, "%d %x\n", i16, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1));
sprintf (str1, "%u %x\n", u16, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1));
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1));
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1));
#ifdef INT64_MAX
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1));
#endif
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1));
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1));
TESTUMAX(8);
TESTUMAX(16);
TESTUMAX(32);
#ifdef INT64_MAX
TESTUMAX(64);
#endif
#define STR(v) #v
#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v));
if (err_n) {
printf ("pstdint.h is not correct. Please use sizes below to correct it:\n");
}
Q(int)
Q(unsigned)
Q(long int)
Q(short int)
Q(int8_t)
Q(int16_t)
Q(int32_t)
#ifdef INT64_MAX
Q(int64_t)
#endif
#if UINT_MAX < X_SIZE_MAX
printf ("UINT_MAX < X_SIZE_MAX\n");
#else
printf ("UINT_MAX >= X_SIZE_MAX\n");
#endif
printf ("%" PRINTF_INT64_MODIFIER "u vs %" PRINTF_INT64_MODIFIER "u\n", UINT_MAX, X_SIZE_MAX);
return EXIT_SUCCESS;
}
#endif
+1 -1
View File
@@ -5,7 +5,7 @@
* This file isn't complete in the ANSI-C sense; it only declares things
* that are needed by Tcl. This file is needed even on many systems with
* their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
* all the procedures needed here (such as strtod).
* all the procedures needed here (such as strtol/strtoul).
*
* Copyright (c) 1991 The Regents of the University of California.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
+2 -2
View File
@@ -36,10 +36,10 @@
char *
strstr(
register char *string, /* String to search. */
char *string, /* String to search. */
char *substring) /* Substring to try to find in string. */
{
register char *a, *b;
char *a, *b;
/*
* First scan quickly through the two strings looking for a
+2 -2
View File
@@ -45,7 +45,7 @@ strtol(
* hex, "0" means octal, anything else means
* decimal. */
{
register const char *p;
const char *p;
long result;
/*
@@ -53,7 +53,7 @@ strtol(
*/
p = string;
while (TclIsSpaceProc(*p)) {
while (isspace(UCHAR(*p))) {
p += 1;
}
+4 -4
View File
@@ -62,9 +62,9 @@ strtoul(
* hex, "0" means octal, anything else means
* decimal. */
{
register const char *p;
register unsigned long int result = 0;
register unsigned digit;
const char *p;
unsigned long int result = 0;
unsigned digit;
int anyDigits = 0;
int negative=0;
int overflow=0;
@@ -74,7 +74,7 @@ strtoul(
*/
p = string;
while (TclIsSpaceProc(*p)) {
while (isspace(UCHAR(*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
@@ -70,7 +70,7 @@ waitpid(
int options) /* OR'ed combination of WNOHANG and
* WUNTRACED. */
{
register WaitInfo *waitPtr, *prevPtr;
WaitInfo *waitPtr, *prevPtr;
pid_t result;
WAIT_STATUS_TYPE status;
@@ -100,7 +100,7 @@ waitpid(
} else {
prevPtr->nextPtr = waitPtr->nextPtr;
}
ckfree((char *) waitPtr);
ckfree(waitPtr);
return result;
}
+7
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
*/
@@ -37,6 +43,7 @@ static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */
(void)pcrc_32_tab;
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+816
View File
@@ -0,0 +1,816 @@
/*
Copyright (c) 2013-2017, tinydir authors:
- Cong Xu
- Lautis Sun
- Baudouin Feildel
- Andargor <andargor@yahoo.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TINYDIR_H
#define TINYDIR_H
#ifdef __cplusplus
extern "C" {
#endif
#if ((defined _UNICODE) && !(defined UNICODE))
#define UNICODE
#endif
#if ((defined UNICODE) && !(defined _UNICODE))
#define _UNICODE
#endif
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <tchar.h>
# pragma warning(push)
# pragma warning (disable : 4996)
#else
# include <dirent.h>
# include <libgen.h>
# include <sys/stat.h>
# include <stddef.h>
#endif
#ifdef __MINGW32__
# include <tchar.h>
#endif
/* types */
/* Windows UNICODE wide character support */
#if defined _MSC_VER || defined __MINGW32__
# define _tinydir_char_t TCHAR
# define TINYDIR_STRING(s) _TEXT(s)
# define _tinydir_strlen _tcslen
# define _tinydir_strcpy _tcscpy
# define _tinydir_strcat _tcscat
# define _tinydir_strcmp _tcscmp
# define _tinydir_strrchr _tcsrchr
# define _tinydir_strncmp _tcsncmp
#else
# define _tinydir_char_t char
# define TINYDIR_STRING(s) s
# define _tinydir_strlen strlen
# define _tinydir_strcpy strcpy
# define _tinydir_strcat strcat
# define _tinydir_strcmp strcmp
# define _tinydir_strrchr strrchr
# define _tinydir_strncmp strncmp
#endif
#if (defined _MSC_VER || defined __MINGW32__)
# include <windows.h>
# define _TINYDIR_PATH_MAX MAX_PATH
#elif defined __linux__
# include <limits.h>
# define _TINYDIR_PATH_MAX PATH_MAX
#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
# include <sys/param.h>
# if defined(BSD)
# include <limits.h>
# define _TINYDIR_PATH_MAX PATH_MAX
# endif
#endif
#ifndef _TINYDIR_PATH_MAX
#define _TINYDIR_PATH_MAX 4096
#endif
#ifdef _MSC_VER
/* extra chars for the "\\*" mask */
# define _TINYDIR_PATH_EXTRA 2
#else
# define _TINYDIR_PATH_EXTRA 0
#endif
#define _TINYDIR_FILENAME_MAX 256
#if (defined _MSC_VER || defined __MINGW32__)
#define _TINYDIR_DRIVE_MAX 3
#endif
#ifdef _MSC_VER
# define _TINYDIR_FUNC static __inline
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
# define _TINYDIR_FUNC static __inline__
#else
# define _TINYDIR_FUNC static inline
#endif
/* readdir_r usage; define TINYDIR_USE_READDIR_R to use it (if supported) */
#ifdef TINYDIR_USE_READDIR_R
/* readdir_r is a POSIX-only function, and may not be available under various
* environments/settings, e.g. MinGW. Use readdir fallback */
#if _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE ||\
_POSIX_SOURCE
# define _TINYDIR_HAS_READDIR_R
#endif
#if _POSIX_C_SOURCE >= 200112L
# define _TINYDIR_HAS_FPATHCONF
# include <unistd.h>
#endif
#if _BSD_SOURCE || _SVID_SOURCE || \
(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
# define _TINYDIR_HAS_DIRFD
# include <sys/types.h>
#endif
#if defined _TINYDIR_HAS_FPATHCONF && defined _TINYDIR_HAS_DIRFD &&\
defined _PC_NAME_MAX
# define _TINYDIR_USE_FPATHCONF
#endif
#if defined __MINGW32__ || !defined _TINYDIR_HAS_READDIR_R ||\
!(defined _TINYDIR_USE_FPATHCONF || defined NAME_MAX)
# define _TINYDIR_USE_READDIR
#endif
/* Use readdir by default */
#else
# define _TINYDIR_USE_READDIR
#endif
/* MINGW32 has two versions of dirent, ASCII and UNICODE*/
#ifndef _MSC_VER
#if (defined __MINGW32__) && (defined _UNICODE)
#define _TINYDIR_DIR _WDIR
#define _tinydir_dirent _wdirent
#define _tinydir_opendir _wopendir
#define _tinydir_readdir _wreaddir
#define _tinydir_closedir _wclosedir
#else
#define _TINYDIR_DIR DIR
#define _tinydir_dirent dirent
#define _tinydir_opendir opendir
#define _tinydir_readdir readdir
#define _tinydir_closedir closedir
#endif
#endif
/* Allow user to use a custom allocator by defining _TINYDIR_MALLOC and _TINYDIR_FREE. */
#if defined(_TINYDIR_MALLOC) && defined(_TINYDIR_FREE)
#elif !defined(_TINYDIR_MALLOC) && !defined(_TINYDIR_FREE)
#else
#error "Either define both alloc and free or none of them!"
#endif
#if !defined(_TINYDIR_MALLOC)
#define _TINYDIR_MALLOC(_size) malloc(_size)
#define _TINYDIR_FREE(_ptr) free(_ptr)
#endif /* !defined(_TINYDIR_MALLOC) */
typedef struct tinydir_file
{
_tinydir_char_t path[_TINYDIR_PATH_MAX];
_tinydir_char_t name[_TINYDIR_FILENAME_MAX];
_tinydir_char_t *extension;
int is_dir;
int is_reg;
#ifndef _MSC_VER
#ifdef __MINGW32__
struct _stat _s;
#else
struct stat _s;
#endif
#endif
} tinydir_file;
typedef struct tinydir_dir
{
_tinydir_char_t path[_TINYDIR_PATH_MAX];
int has_next;
size_t n_files;
tinydir_file *_files;
#ifdef _MSC_VER
HANDLE _h;
WIN32_FIND_DATA _f;
#else
_TINYDIR_DIR *_d;
struct _tinydir_dirent *_e;
#ifndef _TINYDIR_USE_READDIR
struct _tinydir_dirent *_ep;
#endif
#endif
} tinydir_dir;
/* declarations */
_TINYDIR_FUNC
int tinydir_open(tinydir_dir *dir, const _tinydir_char_t *path);
_TINYDIR_FUNC
int tinydir_open_sorted(tinydir_dir *dir, const _tinydir_char_t *path);
_TINYDIR_FUNC
void tinydir_close(tinydir_dir *dir);
_TINYDIR_FUNC
int tinydir_next(tinydir_dir *dir);
_TINYDIR_FUNC
int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file);
_TINYDIR_FUNC
int tinydir_readfile_n(const tinydir_dir *dir, tinydir_file *file, size_t i);
_TINYDIR_FUNC
int tinydir_open_subdir_n(tinydir_dir *dir, size_t i);
_TINYDIR_FUNC
int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path);
_TINYDIR_FUNC
void _tinydir_get_ext(tinydir_file *file);
_TINYDIR_FUNC
int _tinydir_file_cmp(const void *a, const void *b);
#ifndef _MSC_VER
#ifndef _TINYDIR_USE_READDIR
_TINYDIR_FUNC
size_t _tinydir_dirent_buf_size(_TINYDIR_DIR *dirp);
#endif
#endif
/* definitions*/
_TINYDIR_FUNC
int tinydir_open(tinydir_dir *dir, const _tinydir_char_t *path)
{
#ifndef _MSC_VER
#ifndef _TINYDIR_USE_READDIR
int error;
int size; /* using int size */
#endif
#else
_tinydir_char_t path_buf[_TINYDIR_PATH_MAX];
#endif
_tinydir_char_t *pathp;
if (dir == NULL || path == NULL || _tinydir_strlen(path) == 0)
{
errno = EINVAL;
return -1;
}
if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX)
{
errno = ENAMETOOLONG;
return -1;
}
/* initialise dir */
dir->_files = NULL;
#ifdef _MSC_VER
dir->_h = INVALID_HANDLE_VALUE;
#else
dir->_d = NULL;
#ifndef _TINYDIR_USE_READDIR
dir->_ep = NULL;
#endif
#endif
tinydir_close(dir);
_tinydir_strcpy(dir->path, path);
/* Remove trailing slashes */
pathp = &dir->path[_tinydir_strlen(dir->path) - 1];
while (pathp != dir->path && (*pathp == TINYDIR_STRING('\\') || *pathp == TINYDIR_STRING('/')))
{
*pathp = TINYDIR_STRING('\0');
pathp++;
}
#ifdef _MSC_VER
_tinydir_strcpy(path_buf, dir->path);
_tinydir_strcat(path_buf, TINYDIR_STRING("\\*"));
#if (defined WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
dir->_h = FindFirstFileEx(path_buf, FindExInfoStandard, &dir->_f, FindExSearchNameMatch, NULL, 0);
#else
dir->_h = FindFirstFile(path_buf, &dir->_f);
#endif
if (dir->_h == INVALID_HANDLE_VALUE)
{
errno = ENOENT;
#else
dir->_d = _tinydir_opendir(path);
if (dir->_d == NULL)
{
#endif
goto bail;
}
/* read first file */
dir->has_next = 1;
#ifndef _MSC_VER
#ifdef _TINYDIR_USE_READDIR
dir->_e = _tinydir_readdir(dir->_d);
#else
/* allocate dirent buffer for readdir_r */
size = _tinydir_dirent_buf_size(dir->_d); /* conversion to int */
if (size == -1) return -1;
dir->_ep = (struct _tinydir_dirent*)_TINYDIR_MALLOC(size);
if (dir->_ep == NULL) return -1;
error = readdir_r(dir->_d, dir->_ep, &dir->_e);
if (error != 0) return -1;
#endif
if (dir->_e == NULL)
{
dir->has_next = 0;
}
#endif
return 0;
bail:
tinydir_close(dir);
return -1;
}
_TINYDIR_FUNC
int tinydir_open_sorted(tinydir_dir *dir, const _tinydir_char_t *path)
{
/* Count the number of files first, to pre-allocate the files array */
size_t n_files = 0;
if (tinydir_open(dir, path) == -1)
{
return -1;
}
while (dir->has_next)
{
n_files++;
if (tinydir_next(dir) == -1)
{
goto bail;
}
}
tinydir_close(dir);
if (tinydir_open(dir, path) == -1)
{
return -1;
}
dir->n_files = 0;
dir->_files = (tinydir_file *)_TINYDIR_MALLOC(sizeof *dir->_files * n_files);
if (dir->_files == NULL)
{
goto bail;
}
while (dir->has_next)
{
tinydir_file *p_file;
dir->n_files++;
p_file = &dir->_files[dir->n_files - 1];
if (tinydir_readfile(dir, p_file) == -1)
{
goto bail;
}
if (tinydir_next(dir) == -1)
{
goto bail;
}
/* Just in case the number of files has changed between the first and
second reads, terminate without writing into unallocated memory */
if (dir->n_files == n_files)
{
break;
}
}
qsort(dir->_files, dir->n_files, sizeof(tinydir_file), _tinydir_file_cmp);
return 0;
bail:
tinydir_close(dir);
return -1;
}
_TINYDIR_FUNC
void tinydir_close(tinydir_dir *dir)
{
if (dir == NULL)
{
return;
}
memset(dir->path, 0, sizeof(dir->path));
dir->has_next = 0;
dir->n_files = 0;
_TINYDIR_FREE(dir->_files);
dir->_files = NULL;
#ifdef _MSC_VER
if (dir->_h != INVALID_HANDLE_VALUE)
{
FindClose(dir->_h);
}
dir->_h = INVALID_HANDLE_VALUE;
#else
if (dir->_d)
{
_tinydir_closedir(dir->_d);
}
dir->_d = NULL;
dir->_e = NULL;
#ifndef _TINYDIR_USE_READDIR
_TINYDIR_FREE(dir->_ep);
dir->_ep = NULL;
#endif
#endif
}
_TINYDIR_FUNC
int tinydir_next(tinydir_dir *dir)
{
if (dir == NULL)
{
errno = EINVAL;
return -1;
}
if (!dir->has_next)
{
errno = ENOENT;
return -1;
}
#ifdef _MSC_VER
if (FindNextFile(dir->_h, &dir->_f) == 0)
#else
#ifdef _TINYDIR_USE_READDIR
dir->_e = _tinydir_readdir(dir->_d);
#else
if (dir->_ep == NULL)
{
return -1;
}
if (readdir_r(dir->_d, dir->_ep, &dir->_e) != 0)
{
return -1;
}
#endif
if (dir->_e == NULL)
#endif
{
dir->has_next = 0;
#ifdef _MSC_VER
if (GetLastError() != ERROR_SUCCESS &&
GetLastError() != ERROR_NO_MORE_FILES)
{
tinydir_close(dir);
errno = EIO;
return -1;
}
#endif
}
return 0;
}
_TINYDIR_FUNC
int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file)
{
if (dir == NULL || file == NULL)
{
errno = EINVAL;
return -1;
}
#ifdef _MSC_VER
if (dir->_h == INVALID_HANDLE_VALUE)
#else
if (dir->_e == NULL)
#endif
{
errno = ENOENT;
return -1;
}
if (_tinydir_strlen(dir->path) +
_tinydir_strlen(
#ifdef _MSC_VER
dir->_f.cFileName
#else
dir->_e->d_name
#endif
) + 1 + _TINYDIR_PATH_EXTRA >=
_TINYDIR_PATH_MAX)
{
/* the path for the file will be too long */
errno = ENAMETOOLONG;
return -1;
}
if (_tinydir_strlen(
#ifdef _MSC_VER
dir->_f.cFileName
#else
dir->_e->d_name
#endif
) >= _TINYDIR_FILENAME_MAX)
{
errno = ENAMETOOLONG;
return -1;
}
_tinydir_strcpy(file->path, dir->path);
_tinydir_strcat(file->path, TINYDIR_STRING("/"));
_tinydir_strcpy(file->name,
#ifdef _MSC_VER
dir->_f.cFileName
#else
dir->_e->d_name
#endif
);
_tinydir_strcat(file->path, file->name);
#ifndef _MSC_VER
#ifdef __MINGW32__
if (_tstat(
#else
if (stat(
#endif
file->path, &file->_s) == -1)
{
return -1;
}
#endif
_tinydir_get_ext(file);
file->is_dir =
#ifdef _MSC_VER
!!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
#else
S_ISDIR(file->_s.st_mode);
#endif
file->is_reg =
#ifdef _MSC_VER
!!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) ||
(
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) &&
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) &&
#ifdef FILE_ATTRIBUTE_INTEGRITY_STREAM
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) &&
#endif
#ifdef FILE_ATTRIBUTE_NO_SCRUB_DATA
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) &&
#endif
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) &&
!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY));
#else
S_ISREG(file->_s.st_mode);
#endif
return 0;
}
_TINYDIR_FUNC
int tinydir_readfile_n(const tinydir_dir *dir, tinydir_file *file, size_t i)
{
if (dir == NULL || file == NULL)
{
errno = EINVAL;
return -1;
}
if (i >= dir->n_files)
{
errno = ENOENT;
return -1;
}
memcpy(file, &dir->_files[i], sizeof(tinydir_file));
_tinydir_get_ext(file);
return 0;
}
_TINYDIR_FUNC
int tinydir_open_subdir_n(tinydir_dir *dir, size_t i)
{
_tinydir_char_t path[_TINYDIR_PATH_MAX];
if (dir == NULL)
{
errno = EINVAL;
return -1;
}
if (i >= dir->n_files || !dir->_files[i].is_dir)
{
errno = ENOENT;
return -1;
}
_tinydir_strcpy(path, dir->_files[i].path);
tinydir_close(dir);
if (tinydir_open_sorted(dir, path) == -1)
{
return -1;
}
return 0;
}
/* Open a single file given its path */
_TINYDIR_FUNC
int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path)
{
tinydir_dir dir;
int result = 0;
int found = 0;
_tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX];
_tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX];
_tinydir_char_t *dir_name;
_tinydir_char_t *base_name;
#if (defined _MSC_VER || defined __MINGW32__)
_tinydir_char_t drive_buf[_TINYDIR_PATH_MAX];
_tinydir_char_t ext_buf[_TINYDIR_FILENAME_MAX];
#endif
if (file == NULL || path == NULL || _tinydir_strlen(path) == 0)
{
errno = EINVAL;
return -1;
}
if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX)
{
errno = ENAMETOOLONG;
return -1;
}
/* Get the parent path */
#if (defined _MSC_VER || defined __MINGW32__)
#if ((defined _MSC_VER) && (_MSC_VER >= 1400))
_tsplitpath_s(
path,
drive_buf, _TINYDIR_DRIVE_MAX,
dir_name_buf, _TINYDIR_FILENAME_MAX,
file_name_buf, _TINYDIR_FILENAME_MAX,
ext_buf, _TINYDIR_FILENAME_MAX);
#else
_tsplitpath(
path,
drive_buf,
dir_name_buf,
file_name_buf,
ext_buf);
#endif
/* _splitpath_s not work fine with only filename and widechar support */
#ifdef _UNICODE
if (drive_buf[0] == L'\xFEFE')
drive_buf[0] = '\0';
if (dir_name_buf[0] == L'\xFEFE')
dir_name_buf[0] = '\0';
#endif
if (errno)
{
errno = EINVAL;
return -1;
}
/* Emulate the behavior of dirname by returning "." for dir name if it's
empty */
if (drive_buf[0] == '\0' && dir_name_buf[0] == '\0')
{
_tinydir_strcpy(dir_name_buf, TINYDIR_STRING("."));
}
/* Concatenate the drive letter and dir name to form full dir name */
_tinydir_strcat(drive_buf, dir_name_buf);
dir_name = drive_buf;
/* Concatenate the file name and extension to form base name */
_tinydir_strcat(file_name_buf, ext_buf);
base_name = file_name_buf;
#else
_tinydir_strcpy(dir_name_buf, path);
dir_name = dirname(dir_name_buf);
_tinydir_strcpy(file_name_buf, path);
base_name =basename(file_name_buf);
#endif
/* Open the parent directory */
if (tinydir_open(&dir, dir_name) == -1)
{
return -1;
}
/* Read through the parent directory and look for the file */
while (dir.has_next)
{
if (tinydir_readfile(&dir, file) == -1)
{
result = -1;
goto bail;
}
if (_tinydir_strcmp(file->name, base_name) == 0)
{
/* File found */
found = 1;
break;
}
tinydir_next(&dir);
}
if (!found)
{
result = -1;
errno = ENOENT;
}
bail:
tinydir_close(&dir);
return result;
}
_TINYDIR_FUNC
void _tinydir_get_ext(tinydir_file *file)
{
_tinydir_char_t *period = _tinydir_strrchr(file->name, TINYDIR_STRING('.'));
if (period == NULL)
{
file->extension = &(file->name[_tinydir_strlen(file->name)]);
}
else
{
file->extension = period + 1;
}
}
_TINYDIR_FUNC
int _tinydir_file_cmp(const void *a, const void *b)
{
const tinydir_file *fa = (const tinydir_file *)a;
const tinydir_file *fb = (const tinydir_file *)b;
if (fa->is_dir != fb->is_dir)
{
return -(fa->is_dir - fb->is_dir);
}
return _tinydir_strncmp(fa->name, fb->name, _TINYDIR_FILENAME_MAX);
}
#ifndef _MSC_VER
#ifndef _TINYDIR_USE_READDIR
/*
The following authored by Ben Hutchings <ben@decadent.org.uk>
from https://womble.decadent.org.uk/readdir_r-advisory.html
*/
/* Calculate the required buffer size (in bytes) for directory *
* entries read from the given directory handle. Return -1 if this *
* this cannot be done. *
* *
* This code does not trust values of NAME_MAX that are less than *
* 255, since some systems (including at least HP-UX) incorrectly *
* define it to be a smaller value. */
_TINYDIR_FUNC
size_t _tinydir_dirent_buf_size(_TINYDIR_DIR *dirp)
{
long name_max;
size_t name_end;
/* parameter may be unused */
(void)dirp;
#if defined _TINYDIR_USE_FPATHCONF
name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX);
if (name_max == -1)
#if defined(NAME_MAX)
name_max = (NAME_MAX > 255) ? NAME_MAX : 255;
#else
return (size_t)(-1);
#endif
#elif defined(NAME_MAX)
name_max = (NAME_MAX > 255) ? NAME_MAX : 255;
#else
#error "buffer size for readdir_r cannot be determined"
#endif
name_end = (size_t)offsetof(struct _tinydir_dirent, d_name) + name_max + 1;
return (name_end > sizeof(struct _tinydir_dirent) ?
name_end : sizeof(struct _tinydir_dirent));
}
#endif
#endif
#ifdef __cplusplus
}
#endif
# if defined (_MSC_VER)
# pragma warning(pop)
# endif
#endif
Executable → Regular
View File
+4 -1
View File
@@ -119,7 +119,7 @@ retrieve the stack trace when script evaluation returns
\fBTCL_ERROR\fR, like so:
.PP
.CS
int code = Tcl_Eval(interp, script);
int code = Tcl_EvalEx(interp, script, -1, 0);
if (code == TCL_ERROR) {
Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code);
Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1);
@@ -247,6 +247,9 @@ record instead of a value. Otherwise, it is similar to
.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.
Interfaces using argument lists have been found to be nonportable in practice.
This function is deprecated and will be removed in Tcl 9.0.
.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
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+2 -2
View File
@@ -648,8 +648,8 @@ It should call \fBTcl_BadChannelOption\fR which itself returns
unrecognized.
If \fInewValue\fR specifies a value for the option that
is not supported or if a system call error occurs,
the function should leave an error message in the
\fIresult\fR field of \fIinterp\fR if \fIinterp\fR is not NULL. The
the function should leave an error message in the result
of \fIinterp\fR if \fIinterp\fR is not NULL. The
function should also call \fBTcl_SetErrno\fR to store an appropriate POSIX
error code.
.PP
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -7
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -22,10 +22,8 @@ Tcl_Interp *
int
\fBTcl_InterpDeleted\fR(\fIinterp\fR)
.sp
.VS 8.6
int
\fBTcl_InterpActive\fR(\fIinterp\fR)
.VE 8.6
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
@@ -70,14 +68,12 @@ deleted and when the whole interpreter is being deleted. In the former case
the callback may recreate the data being deleted, but this would lead to an
infinite loop if the interpreter were being deleted.
.PP
.VS 8.6
\fBTcl_InterpActive\fR is useful for determining whether there is any
execution of scripts ongoing in an interpreter, which is a useful piece of
information when Tcl is embedded in a garbage-collected environment and it
becomes necessary to determine whether the interpreter is a candidate for
deletion. The function returns a true value if the interpreter has at least
one active execution running inside it, and a false value otherwise.
.VE 8.6
.SH "INTERPRETERS AND MEMORY MANAGEMENT"
.PP
\fBTcl_DeleteInterp\fR can be called at any time on an interpreter that may
@@ -138,12 +134,10 @@ All uses of interpreters in Tcl and Tk have already been protected.
Extension writers should ensure that their code also properly protects any
additional interpreters used, as described above.
.PP
.VS 8.6
Note that the protection mechanisms do not work well with conventional garbage
collection systems. When in such a managed environment, \fBTcl_InterpActive\fR
should be used to determine when an interpreter is a candidate for deletion
due to inactivity.
.VE 8.6
.SH "SEE ALSO"
Tcl_Preserve(3), Tcl_Release(3)
.SH KEYWORDS
+28 -1
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_GetCommandInfoFromToken, Tcl_SetCommandInfo, Tcl_SetCommandInfoFromToken, Tcl_GetCommandName, Tcl_GetCommandFullName, Tcl_GetCommandFromObj \- 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
@@ -42,6 +42,14 @@ void
.sp
Tcl_Command
\fBTcl_GetCommandFromObj\fR(\fIinterp, objPtr\fR)
.sp
.VS "info cmdtype feature"
void
\fBTcl_RegisterCommandTypeName\fR(\fIproc, typeName\fR)
.sp
const char *
\fBTcl_GetCommandTypeName\fR(\fItoken\fR)
.VE "info cmdtype feature"
.SH ARGUMENTS
.AS Tcl_CmdDeleteProc *deleteProc in/out
.AP Tcl_Interp *interp in
@@ -65,6 +73,9 @@ Pointer to structure containing various information about a
Tcl command.
.AP Tcl_Obj *objPtr in
Value containing the name of a Tcl command.
.AP "const char" *typeName in
Indicates the name of the type of command implementation associated
with a particular \fIproc\fR, or NULL to break the association.
.BE
.SH DESCRIPTION
.PP
@@ -296,6 +307,22 @@ is appended to the value specified by \fIobjPtr\fR.
specified by the name in a \fBTcl_Obj\fR.
The command name is resolved relative to the current namespace.
Returns NULL if the command is not found.
.PP
.VS "info cmdtype feature"
\fBTcl_RegisterCommandTypeName\fR is used to associate a name (the
\fItypeName\fR argument) with a particular implementation function so that it
can then be looked up with \fBTcl_GetCommandTypeName\fR, which in turn is
called with a command token that information is wanted for and which returns
the name of the type that was registered for the implementation function used
for that command. (The lookup functionality is surfaced virtually directly in Tcl via
\fBinfo cmdtype\fR.) If there is no function registered for a particular
function, the result will be the string literal
.QW \fBnative\fR .
The registration of a name can be undone by registering a mapping to NULL
instead. The result from \fBTcl_GetCommandTypeName\fR will be exactly that
string which was registered, and not a copy; use of a compile-time constant
string is \fIstrongly recommended\fR.
.VE "info cmdtype feature"
.SH "SEE ALSO"
Tcl_CreateCommand(3), Tcl_ResetResult(3), Tcl_SetObjResult(3)
.SH KEYWORDS
+17 -17
View File
@@ -119,7 +119,7 @@ in a hierarchical relationship, and the management of aliases, commands
that when invoked in one interpreter execute a command in another
interpreter. The return value for those procedures that return an \fBint\fR
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
then the \fBresult\fR field of the interpreter contains an error message.
then the interpreter's result contains an error message.
.PP
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
@@ -158,12 +158,12 @@ If no such slave interpreter exists, \fBNULL\fR is returned.
\fIinterp\fR. If \fIinterp\fR has no master (it is a
top-level interpreter) then \fBNULL\fR is returned.
.PP
\fBTcl_GetInterpPath\fR sets the \fIresult\fR field in \fIaskingInterp\fR
to the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
\fBTcl_GetInterpPath\fR stores in the result of \fIaskingInterp\fR
the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computation
of the relative path succeeds, \fBTCL_OK\fR is returned, else
\fBTCL_ERROR\fR is returned and the \fIresult\fR field in
\fIaskingInterp\fR contains the error message.
\fBTCL_ERROR\fR is returned and an error message is stored as the
result of \fIaskingInterp\fR.
.PP
\fBTcl_CreateAlias\fR creates a command named \fIslaveCmd\fR in
\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR
@@ -198,33 +198,33 @@ the set of hidden commands to the set of exposed commands, putting
it under the name
\fIcmdName\fR.
\fIHiddenCmdName\fR must be the name of an existing hidden
command, or the operation will return \fBTCL_ERROR\fR and leave an error
message in the \fIresult\fR field in \fIinterp\fR.
command, or the operation will return \fBTCL_ERROR\fR and
leave an error message as the result of \fIinterp\fR.
If an exposed command named \fIcmdName\fR already exists,
the operation returns \fBTCL_ERROR\fR and leaves an error message in the
value result of \fIinterp\fR.
the operation returns \fBTCL_ERROR\fR and leaves an error message as
the result of \fIinterp\fR.
If the operation succeeds, it returns \fBTCL_OK\fR.
After executing this command, attempts to use \fIcmdName\fR in a call to
\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will again succeed.
After executing this command, attempts to use \fIcmdName\fR in any
script evaluation mechanism will again succeed.
.PP
\fBTcl_HideCommand\fR moves the command named \fIcmdName\fR from the set of
exposed commands to the set of hidden commands, under the name
\fIhiddenCmdName\fR.
\fICmdName\fR must be the name of an existing exposed
command, or the operation will return \fBTCL_ERROR\fR and leave an error
message in the value result of \fIinterp\fR.
message as the result of \fIinterp\fR.
Currently both \fIcmdName\fR and \fIhiddenCmdName\fR must not contain
namespace qualifiers, or the operation will return \fBTCL_ERROR\fR and
leave an error message in the value result of \fIinterp\fR.
leave an error message as the result of \fIinterp\fR.
The \fICmdName\fR will be looked up in the global namespace, and not
relative to the current namespace, even if the current namespace is not the
global one.
If a hidden command whose name is \fIhiddenCmdName\fR already
exists, the operation also returns \fBTCL_ERROR\fR and the \fIresult\fR
field in \fIinterp\fR contains an error message.
exists, the operation also returns \fBTCL_ERROR\fR and an error
message is left as the result of \fIinterp\fR.
If the operation succeeds, it returns \fBTCL_OK\fR.
After executing this command, attempts to use \fIcmdName\fR in a call to
\fBTcl_Eval\fR or with the Tcl \fBeval\fR command will fail.
After executing this command, attempts to use \fIcmdName\fR in
any script evaluation mechanism will fail.
.PP
For a description of the Tcl interface to multiple interpreters, see
\fIinterp(n)\fR.
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DictObj 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+12 -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, Tcl_GetDefaultEncodingDir, Tcl_SetDefaultEncodingDir \- procedures for creating and using encodings
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, 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
@@ -255,11 +255,17 @@ is filled with the corresponding number of bytes that were stored in
\fIdst\fR. The return values are the same as the return values for
\fBTcl_ExternalToUtf\fR.
.PP
\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR are
Windows-only convenience
functions for converting between UTF-8 and Windows strings
based on the TCHAR type which is by convention
a Unicode character on Windows NT.
\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR are Windows-only
convenience functions for converting between UTF-8 and Windows strings
based on the TCHAR type which is by convention a Unicode character on
Windows NT. Those functions are deprecated. You can use
\fBTcl_UtfToWCharDString\fR resp. \fBTcl_WCharToUtfDString\fR as replacement.
If you want compatibility with earlier Tcl releases than 8.7, use
\fBTcl_UtfToUniCharDString\fR resp. \fBTcl_UniCharToUtfDString\fR as
replacement, and make sure you compile your extension with -DTCL_UTF_MAX=3.
Beware: Those replacement functions don't initialize their Tcl_DString (you'll
have to do that yourself), and \fBTcl_UniCharToUtfDString\fR from Tcl 8.6
doesn't accept -1 as length parameter.
.PP
\fBTcl_GetEncodingName\fR is roughly the inverse of \fBTcl_GetEncoding\fR.
Given an \fIencoding\fR, the return value is the \fIname\fR argument that
-4
View File
@@ -36,13 +36,11 @@ int
int
\fBTcl_SetEnsembleMappingDict\fR(\fIinterp, token, dictObj\fR)
.sp
.VS 8.6
int
\fBTcl_GetEnsembleParameterList\fR(\fIinterp, token, listObjPtr\fR)
.sp
int
\fBTcl_SetEnsembleParameterList\fR(\fIinterp, token, listObj\fR)
.VE 8.6
.sp
int
\fBTcl_GetEnsembleSubcommandList\fR(\fIinterp, token, listObjPtr\fR)
@@ -163,7 +161,6 @@ All command names in prefixes set via \fBTcl_SetEnsembleMappingDict\fR
must be fully qualified.
.TP
\fBformal pre-subcommand parameter list\fR (read-write)
.VS 8.6
A list of formal parameter names (the names only being used when generating
error messages) that come at invocation of the ensemble between the name of
the ensemble and the subcommand argument. NULL (the default) is equivalent to
@@ -174,7 +171,6 @@ respectively. The result of both of those functions is a Tcl result code
ensemble) and the
dictionary obtained from \fBTcl_GetEnsembleParameterList\fR should always be
treated as immutable even if it is unshared.
.VE 8.6
.TP
\fBsubcommand list\fR (read-write)
.
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_PutEnv 3 "7.5" Tcl "Tcl Library Procedures"
.so man.macros
.BS
+3 -2
View File
@@ -150,13 +150,14 @@ equivalent to using the \fBTCL_EVAL_GLOBAL\fR flag (see below).
of any length, concatenates them into a single string,
then calls \fBTcl_Eval\fR to execute that string as a Tcl command.
It returns the result of the command and also modifies
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
the interpreter result 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.
list. Interfaces using argument lists have been found to be nonportable
in practice. This function is deprecated and will be removed in Tcl 9.0.
.SH "FLAG BITS"
.PP
+3
View File
@@ -134,6 +134,9 @@ 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 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
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
-10
View File
@@ -63,10 +63,8 @@ int
\fBTcl_FSLoadFile\fR(\fIinterp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
loadHandlePtr, unloadProcPtr\fR)
.sp
.VS 8.6
int
\fBTcl_FSUnloadFile\fR(\fIinterp, loadHandle\fR)
.VE 8.6
.sp
int
\fBTcl_FSMatchInDirectory\fR(\fIinterp, resultPtr, pathPtr, pattern, types\fR)
@@ -146,7 +144,6 @@ Tcl_Obj *
Tcl_StatBuf *
\fBTcl_AllocStatBuf\fR()
.sp
.VS 8.6
Tcl_WideInt
\fBTcl_GetAccessTimeFromStat\fR(\fIstatPtr\fR)
.sp
@@ -185,7 +182,6 @@ Tcl_WideUInt
.sp
int
\fBTcl_GetUserIdFromStat\fR(\fIstatPtr\fR)
.VE 8.6
.SH ARGUMENTS
.AS Tcl_GlobTypeData **srcPathPtr out
.AP "const Tcl_Filesystem" *fsPtr in
@@ -444,20 +440,16 @@ belongs will be called. If that filesystem does not implement this
function (most virtual filesystems will not, because of OS limitations
in dynamically loading binary code), Tcl will attempt to copy the file
to a temporary directory and load that temporary file.
.VS 8.6
\fBTcl_FSUnloadFile\fR reverses the operation, asking for the library
indicated by the \fIloadHandle\fR to be removed from the process. Note that,
unlike with the \fBunload\fR command, this does not give the library any
opportunity to clean up.
.VE 8.6
.PP
Both the above functions return a standard Tcl completion code. If an error
occurs, an error message is left in the \fIinterp\fR's result.
.PP
.VS 8.6
The token provided via the variable indicated by \fIloadHandlePtr\fR may be
used with \fBTcl_FindSymbol\fR.
.VE 8.6
.PP
\fBTcl_FSMatchInDirectory\fR is used by the globbing code to search a
directory for all files which match a given pattern. The appropriate
@@ -795,7 +787,6 @@ 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
.VS 8.6
The portable fields of a \fITcl_StatBuf\fR may be read using the following
functions, each of which returns the value of the corresponding field listed
in the table below. Note that on some platforms there may be other fields in
@@ -819,7 +810,6 @@ for a full description of these fields.
\fBTcl_GetBlocksFromStat\fR st_blocks
\fBTcl_GetBlockSizeFromStat\fR st_blksize
.DE
.VE 8.6
.SH "THE VIRTUAL FILESYSTEM API"
.PP
A filesystem provides a \fBTcl_Filesystem\fR structure that contains
+4 -2
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -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
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+5 -2
View File
@@ -57,6 +57,9 @@ after the optional white space and sign are
.QW \fB0x\fR
then \fIsrc\fR is expected to be in hexadecimal form; otherwise,
if the first such characters are
.QW \fB0d\fR
then \fIsrc\fR is expected to be in decimal form; otherwise,
if the first such characters are
.QW \fB0o\fR
then \fIsrc\fR is expected to be in octal form; otherwise,
if the first such characters are
@@ -65,8 +68,8 @@ 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 octal 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
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_GetTime 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -281,7 +281,7 @@ The \fIhashKeyProc\fR member contains the address of a function called to
calculate a hash value for the key.
.PP
.CS
typedef unsigned int \fBTcl_HashKeyProc\fR(
typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR(
Tcl_HashTable *\fItablePtr\fR,
void *\fIkeyPtr\fR);
.CE
+1 -1
View File
@@ -1,7 +1,7 @@
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+4 -4
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_InitStubs 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -23,11 +23,11 @@ Tcl interpreter handle.
A version string consisting of one or more decimal numbers
separated by dots.
.AP int exact in
Non-zero means that only the particular version specified by
1 means that only the particular version specified by
\fIversion\fR is acceptable.
Zero means that versions newer than \fIversion\fR are also
0 means that versions newer than \fIversion\fR are also
acceptable as long as they have the same major version number
as \fIversion\fR.
as \fIversion\fR. Other bits have no effect.
.BE
.SH INTRODUCTION
.PP
+31
View File
@@ -0,0 +1,31 @@
'\"
'\" Copyright (c) 2018 Tcl Core Team
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_InitSubsystems \- initialize the Tcl library.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
void
\fBTcl_InitSubsystems\fR(\fIvoid\fR)
.SH DESCRIPTION
.PP
The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
library. This procedure is typically invoked as the very
first thing in the application's main program.
.PP
\fBTcl_InitSubsystems\fR is very similar in use to
\fBTcl_FindExecutable\fR. It can be used when Tcl is
used as utility library, no other encodings than utf8,
iso8859-1 or unicode are used, and no interest exists in the
value of \fBinfo nameofexecutable\fR. The system encoding will not
be extracted from the environment, but falls back to iso8859-1.
.SH KEYWORDS
binary, executable file
+17 -2
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \- manipulate Tcl values as integers
Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetIntForIndex, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \- manipulate Tcl values as integers
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -32,6 +32,9 @@ int
\fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR)
.sp
int
\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, intPtr\fR)
.sp
int
\fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR)
.sp
int
@@ -55,6 +58,8 @@ int
\fBTcl_InitBignumFromDouble\fR(\fIinterp, doubleValue, bigValue\fR)
.SH ARGUMENTS
.AS Tcl_WideInt doubleValue in/out
.AP int endValue in
\fBTcl_GetIntForIndex\fR will return this when the input value is "end".
.AP int intValue in
Integer value used to initialize or set a Tcl value.
.AP long longValue in
@@ -97,7 +102,7 @@ are provided by the C language standard. The \fBTcl_WideInt\fR type is a
typedef defined to be whatever signed integral type covers at least the
64-bit integer range (-9223372036854775808 to 9223372036854775807). Depending
on the platform and the C compiler, the actual type might be
\fBlong int\fR, \fBlong long int\fR, \fB__int64\fR, or something else.
\fBlong long int\fR, \fB__int64\fR, or something else.
The \fBmp_int\fR type is a multiple-precision integer type defined
by the LibTomMath multiple-precision integer library.
.PP
@@ -115,6 +120,16 @@ violates Tcl's copy-on-write policy. Any existing string representation
or internal representation in the unshared Tcl value will be freed
as a consequence of setting the new value.
.PP
The \fBTcl_GetIntForIndex\fR routine attempts to retrieve an index
value from the Tcl value \fIobjPtr\fR. If the attempt succeeds,
then \fBTCL_OK\fR is returned, and the value is written to the
storage provided by the caller. The attempt might fail if
\fIobjPtr\fR does not hold an index value. If the attempt fails,
then \fBTCL_ERROR\fR is returned, and if \fIinterp\fR is non-NULL,
an error message is left in \fIinterp\fR. The \fBTcl_ObjType\fR
of \fIobjPtr\fR may be changed to make subsequent calls to the
same routine more efficient.
.PP
The \fBTcl_GetIntFromObj\fR, \fBTcl_GetLongFromObj\fR,
\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetBignumFromObj\fR, and
\fBTcl_TakeBignumFromObj\fR routines attempt to retrieve an integral
+13 -106
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures"
.TH Tcl_Interp 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -15,9 +15,9 @@ Tcl_Interp \- client-visible fields of interpreter structures
\fB#include <tcl.h>\fR
.sp
typedef struct {
char *\fIresult\fR;
Tcl_FreeProc *\fIfreeProc\fR;
int \fIerrorLine\fR;
char *\fIresult\fR; /* NO LONGER AVAILABLE */
Tcl_FreeProc *\fIfreeProc\fR; /* NO LONGER AVAILABLE */
int \fIerrorLine\fR; /* NO LONGER AVAILABLE */
} \fBTcl_Interp\fR;
typedef void \fBTcl_FreeProc\fR(
@@ -25,110 +25,17 @@ typedef void \fBTcl_FreeProc\fR(
.BE
.SH DESCRIPTION
.PP
The \fBTcl_CreateInterp\fR procedure returns a pointer to a Tcl_Interp
The \fBTcl_CreateInterp\fR procedure returns a pointer to a \fBTcl_Interp\fR
structure. Callers of \fBTcl_CreateInterp\fR should use this pointer
as an opaque token, suitable for nothing other than passing back to
other routines in the Tcl interface. Accessing fields directly through
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.
other routines in the Tcl interface from the same thread that called
\fBTcl_CreateInterp\fR. The \fBTcl_Interp\fR struct no longer has any
supported client-visible fields. Supported public routines such as
\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,
and by \fBTcl_Eval\fR back to its callers.
The \fIresult\fR field points to the string that represents the
result or error message, and the \fIfreeProc\fR field tells how
to dispose of the storage for the string when it is not needed anymore.
The easiest way for command procedures to manipulate these
fields is to call procedures like \fBTcl_SetResult\fR
or \fBTcl_AppendResult\fR; they
will hide all the details of managing the fields.
The description below is for those procedures that manipulate the
fields directly.
.PP
Whenever a command procedure returns, it must ensure
that the \fIresult\fR field of its interpreter points to the string
being returned by the command.
The \fIresult\fR field must always point to a valid string.
If a command wishes to return no result then \fIinterp->result\fR
should point to an empty string.
Normally, results are assumed to be statically allocated,
which means that the contents will not change before the next time
\fBTcl_Eval\fR is called or some other command procedure is invoked.
In this case, the \fIfreeProc\fR field must be zero.
Alternatively, a command procedure may dynamically
allocate its return value (e.g. using \fBTcl_Alloc\fR)
and store a pointer to it in \fIinterp->result\fR.
In this case, the command procedure must also set \fIinterp->freeProc\fR
to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR
if the storage was allocated directly by Tcl or by a call to
\fBTcl_Alloc\fR.
If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR
to free the space pointed to by \fIinterp->result\fR before it
invokes the next command.
If a client procedure overwrites \fIinterp->result\fR when
\fIinterp->freeProc\fR is non-zero, then it is responsible for calling
\fIfreeProc\fR to free the old \fIinterp->result\fR (the \fBTcl_FreeResult\fR
macro should be used for this purpose).
.PP
\fIFreeProc\fR should have arguments and result that match the
\fBTcl_FreeProc\fR declaration above: it receives a single
argument which is a pointer to the result value to free.
In most applications \fBTCL_DYNAMIC\fR is the only non-zero value ever
used for \fIfreeProc\fR.
However, an application may store a different procedure address
in \fIfreeProc\fR in order to use an alternate memory allocator
or in order to do other cleanup when the result memory is freed.
.PP
As part of processing each command, \fBTcl_Eval\fR initializes
\fIinterp->result\fR
and \fIinterp->freeProc\fR just before calling the command procedure for
the command. The \fIfreeProc\fR field will be initialized to zero,
and \fIinterp->result\fR will point to an empty string. Commands that
do not return any value can simply leave the fields alone.
Furthermore, the empty string pointed to by \fIresult\fR is actually
part of an array of \fBTCL_RESULT_SIZE\fR characters (approximately 200).
If a command wishes to return a short string, it can simply copy
it to the area pointed to by \fIinterp->result\fR. Or, it can use
the sprintf procedure to generate a short result string at the location
pointed to by \fIinterp->result\fR.
.PP
It is a general convention in Tcl-based applications that the result
of an interpreter is normally in the initialized state described
in the previous paragraph.
Procedures that manipulate an interpreter's result (e.g. by
returning an error) will generally assume that the result
has been initialized when the procedure is called.
If such a procedure is to be called after the result has been
changed, then \fBTcl_ResetResult\fR should be called first to
reset the result to its initialized state. The direct use of
\fIinterp->result\fR is strongly deprecated (see \fBTcl_SetResult\fR).
.PP
The \fIerrorLine\fR
field is valid only after \fBTcl_Eval\fR returns
a \fBTCL_ERROR\fR return code. In this situation the \fIerrorLine\fR
field identifies the line number of the command being executed when
the error occurred. The line numbers are relative to the command
being executed: 1 means the first line of the command passed to
\fBTcl_Eval\fR, 2 means the second line, and so on.
The \fIerrorLine\fR field is typically used in conjunction with
\fBTcl_AddErrorInfo\fR to report information about where an error
occurred.
\fIErrorLine\fR should not normally be modified except by \fBTcl_Eval\fR.
Any legacy programs and extensions trying to access the fields above
in their source code will need conversion to compile for Tcl 8.7 and later.
.SH KEYWORDS
free, initialized, interpreter, malloc, result
interpreter, result
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_LimitCheck 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+111 -35
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variable
Tcl_LinkArray, Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variable
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -17,27 +17,52 @@ Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variab
int
\fBTcl_LinkVar\fR(\fIinterp, varName, addr, type\fR)
.sp
.VS "TIP 312"
int
\fBTcl_LinkArray\fR(\fIinterp, varName, addr, type, size\fR)
.VE "TIP 312"
.sp
\fBTcl_UnlinkVar\fR(\fIinterp, varName\fR)
.sp
\fBTcl_UpdateLinkedVar\fR(\fIinterp, varName\fR)
.SH ARGUMENTS
.AS Tcl_Interp writable
.AS Tcl_Interp varName in
.AP Tcl_Interp *interp in
Interpreter that contains \fIvarName\fR.
Also used by \fBTcl_LinkVar\fR to return error messages.
.AP "const char" *varName in
Name of global variable.
.AP char *addr in
.AP void *addr in
Address of C variable that is to be linked to \fIvarName\fR.
.sp
.VS "TIP 312"
In \fBTcl_LinkArray\fR, may be NULL to tell Tcl to create the storage
for the array in the variable.
.VE "TIP 312"
.AP int type in
Type of C variable. Must be one of \fBTCL_LINK_INT\fR,
Type of C variable for \fBTcl_LinkVar\fR or type of array element for
\fBTcl_LinkArray\fR. Must be one of \fBTCL_LINK_INT\fR,
\fBTCL_LINK_UINT\fR, \fBTCL_LINK_CHAR\fR, \fBTCL_LINK_UCHAR\fR,
\fBTCL_LINK_SHORT\fR, \fBTCL_LINK_USHORT\fR, \fBTCL_LINK_LONG\fR,
\fBTCL_LINK_ULONG\fR, \fBTCL_LINK_WIDE_INT\fR,
\fBTCL_LINK_WIDE_UINT\fR, \fBTCL_LINK_FLOAT\fR,
\fBTCL_LINK_DOUBLE\fR, \fBTCL_LINK_BOOLEAN\fR, or
\fBTCL_LINK_STRING\fR, optionally OR'ed with \fBTCL_LINK_READ_ONLY\fR
to make Tcl variable read-only.
\fBTCL_LINK_WIDE_UINT\fR, \fBTCL_LINK_FLOAT\fR, \fBTCL_LINK_DOUBLE\fR,
\fBTCL_LINK_BOOLEAN\fR, or one of the extra ones listed below.
.sp
In \fBTcl_LinkVar\fR, the additional linked type \fBTCL_LINK_STRING\fR may be
used.
.sp
.VS "TIP 312"
In \fBTcl_LinkArray\fR, the additional linked types \fBTCL_LINK_CHARS\fR and
\fBTCL_LINK_BYTES\fR may be used.
.VE "TIP 312"
.sp
All the above for both functions may be
optionally OR'ed with \fBTCL_LINK_READ_ONLY\fR to make the Tcl
variable read-only.
.AP int size in
.VS "TIP 312"
The number of elements in the C array. Must be greater than zero.
.VE "TIP 312"
.BE
.SH DESCRIPTION
.PP
@@ -52,130 +77,179 @@ while setting up the link (e.g. because \fIvarName\fR is the
name of array) then \fBTCL_ERROR\fR is returned and the interpreter's result
contains an error message.
.PP
.VS "TIP 312"
\fBTcl_LinkArray\fR is similar, but for arrays of fixed size (given by
the \fIsize\fR argument). When asked to allocate the backing C array
storage (via the \fIaddr\fR argument being NULL), it writes the
address that it allocated to the Tcl interpreter result.
.VE "TIP 312"
.PP
The \fItype\fR argument specifies the type of the C variable,
or the type of the elements of the C array,
and must have one of the following values, optionally OR'ed with
\fBTCL_LINK_READ_ONLY\fR:
.TP
\fBTCL_LINK_INT\fR
The C variable is of type \fBint\fR.
.
The C variable, or each element of the C array, is of type \fBint\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write
non-integer values into \fIvarName\fR will be rejected with
Tcl errors. Incomplete integer representations (like the empty
string, '+', '-' or the hex/octal/binary prefix) are accepted
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_UINT\fR
The C variable is of type \fBunsigned int\fR.
.
The C variable, or each element of the C array, is of type \fBunsigned int\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
platform's defined range for the \fBunsigned int\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_CHAR\fR
The C variable is of type \fBchar\fR.
.
The C variable, or each element of the C array, is of type \fBchar\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
\fBchar\fR datatype; attempts to write non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.RS
.PP
.VS "TIP 312"
If using an array of these, consider using \fBTCL_LINK_CHARS\fR instead.
.VE "TIP 312"
.RE
.TP
\fBTCL_LINK_CHARS\fR
.VS "TIP 312"
The C array is of type \fBchar *\fR and is mapped into Tcl as a string.
Any value written into the Tcl variable must have the same length as
the underlying storage. Only supported with \fBTcl_LinkArray\fR.
.VE "TIP 312"
.TP
\fBTCL_LINK_UCHAR\fR
The C variable is of type \fBunsigned char\fR.
.
The C variable, or each element of the C array, is of type \fBunsigned char\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
platform's defined range for the \fBunsigned char\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.RS
.PP
.VS "TIP 312"
If using an array of these, consider using \fBTCL_LINK_BYTES\fR instead.
.VE "TIP 312"
.RE
.TP
\fBTCL_LINK_BYTES\fR
.VS "TIP 312"
The C array is of type \fBunsigned char *\fR and is mapped into Tcl
as a bytearray.
Any value written into the Tcl variable must have the same length as
the underlying storage. Only supported with \fBTcl_LinkArray\fR.
.VE "TIP 312"
.TP
\fBTCL_LINK_SHORT\fR
The C variable is of type \fBshort\fR.
.
The C variable, or each element of the C array, is of type \fBshort\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
\fBshort\fR datatype; attempts to write non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_USHORT\fR
The C variable is of type \fBunsigned short\fR.
.
The C variable, or each element of the C array, is of type \fBunsigned short\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
platform's defined range for the \fBunsigned short\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_LONG\fR
The C variable is of type \fBlong\fR.
.
The C variable, or each element of the C array, is of type \fBlong\fR.
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetLongFromObj\fR; attempts to write
non-integer or out-of-range
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
integer representations (like the empty string, '+', '-' or the
hex/octal/binary prefix) are accepted as if they are valid too.
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_ULONG\fR
The C variable is of type \fBunsigned long\fR.
.
The C variable, or each element of the C array, is of type \fBunsigned long\fR.
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
platform's defined range for the \fBunsigned long\fR type; attempts to
write non-integer values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
representations (like the empty string, '+', '-' or the hex/octal/binary
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_DOUBLE\fR
The C variable is of type \fBdouble\fR.
.
The C variable, or each element of the C array, is of type \fBdouble\fR.
Any value written into the Tcl variable must have a proper real
form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write
non-real values into \fIvarName\fR will be rejected with
Tcl errors. Incomplete integer or real representations (like the
empty string, '.', '+', '-' or the hex/octal/binary prefix) are
empty string, '.', '+', '-' or the hex/octal/decimal/binary prefix) are
accepted as if they are valid too.
.TP
\fBTCL_LINK_FLOAT\fR
The C variable is of type \fBfloat\fR.
.
The C variable, or each element of the C array, is of type \fBfloat\fR.
Any value written into the Tcl variable must have a proper real
form acceptable to \fBTcl_GetDoubleFromObj\fR and must be within the
range acceptable for a \fBfloat\fR; attempts to
write non-real values (or values outside the range) into
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
or real representations (like the empty string, '.', '+', '-' or
the hex/octal/binary prefix) are accepted as if they are valid too.
the hex/octal/decimal/binary prefix) are accepted as if they are valid too.
.TP
\fBTCL_LINK_WIDE_INT\fR
The C variable is of type \fBTcl_WideInt\fR (which is an integer type
.
The C variable, or each element of the C array, is of type \fBTcl_WideInt\fR
(which is an integer type
at least 64-bits wide on all platforms that can support it.)
Any value written into the Tcl variable must have a proper integer
form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write
non-integer values into \fIvarName\fR will be rejected with
Tcl errors. Incomplete integer representations (like the empty
string, '+', '-' or the hex/octal/binary prefix) are accepted
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_WIDE_UINT\fR
The C variable is of type \fBTcl_WideUInt\fR (which is an unsigned
integer type at least 64-bits wide on all platforms that can support
it.)
.
The C variable, or each element of the C array, is of type \fBTcl_WideUInt\fR
(which is an unsigned integer type at least 64-bits wide on all platforms that
can support it.)
Any value written into the Tcl variable must have a proper unsigned
integer form acceptable to \fBTcl_GetWideIntFromObj\fR (it will be
cast to unsigned);
.\" FIXME! Use bignums instead.
attempts to write non-integer values into \fIvarName\fR will be
rejected with Tcl errors. Incomplete integer representations (like
the empty string, '+', '-' or the hex/octal/binary prefix) are accepted
the empty string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
as if they are valid too.
.TP
\fBTCL_LINK_BOOLEAN\fR
The C variable is of type \fBint\fR.
.
The C variable, or each element of the C array, is of type \fBint\fR.
If its value is zero then it will read from Tcl as
.QW 0 ;
otherwise it will read from Tcl as
@@ -188,6 +262,7 @@ non-boolean values into \fIvarName\fR will be rejected with
Tcl errors.
.TP
\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 or \fBckalloc\fR.
@@ -197,6 +272,7 @@ new value.
If the C variable contains a NULL pointer then the Tcl variable
will read as
.QW NULL .
This is only supported by \fBTcl_LinkVar\fR.
.PP
If the \fBTCL_LINK_READ_ONLY\fR flag is present in \fItype\fR then the
variable will be read-only from Tcl, so that its value can only be
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Load 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+31 -13
View File
@@ -9,18 +9,18 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_ClassSetConstructor, Tcl_ClassSetDestructor, Tcl_MethodDeclarerClass, Tcl_MethodDeclarerObject, Tcl_MethodIsPublic, Tcl_MethodIsType, Tcl_MethodName, Tcl_NewInstanceMethod, Tcl_NewMethod, Tcl_ObjectContextInvokeNext, Tcl_ObjectContextIsFiltering, Tcl_ObjectContextMethod, Tcl_ObjectContextObject, Tcl_ObjectContextSkippedArgs \- manipulate methods and method-call contexts
Tcl_ClassSetConstructor, Tcl_ClassSetDestructor, Tcl_MethodDeclarerClass, Tcl_MethodDeclarerObject, Tcl_MethodIsPublic, Tcl_MethodIsPrivate, Tcl_MethodIsType, Tcl_MethodName, Tcl_NewInstanceMethod, Tcl_NewMethod, Tcl_ObjectContextInvokeNext, Tcl_ObjectContextIsFiltering, Tcl_ObjectContextMethod, Tcl_ObjectContextObject, Tcl_ObjectContextSkippedArgs \- manipulate methods and method-call contexts
.SH SYNOPSIS
.nf
\fB#include <tclOO.h>\fR
.sp
Tcl_Method
\fBTcl_NewMethod\fR(\fIinterp, class, nameObj, isPublic,
methodTypePtr, clientData\fR)
\fBTcl_NewMethod\fR(\fIinterp, class, nameObj, flags, methodTypePtr,
clientData\fR)
.sp
Tcl_Method
\fBTcl_NewInstanceMethod\fR(\fIinterp, object, nameObj, isPublic,
methodTypePtr, clientData\fR)
\fBTcl_NewInstanceMethod\fR(\fIinterp, object, nameObj, flags, methodTypePtr,
clientData\fR)
.sp
\fBTcl_ClassSetConstructor\fR(\fIinterp, class, method\fR)
.sp
@@ -35,8 +35,13 @@ Tcl_Object
Tcl_Obj *
\fBTcl_MethodName\fR(\fImethod\fR)
.sp
.VS TIP500
int
\fBTcl_MethodIsPublic\fR(\fImethod\fR)
.VE TIP500
.sp
int
\fBTcl_MethodIsPrivate\fR(\fImethod\fR)
.sp
int
\fBTcl_MethodIsType\fR(\fImethod, methodTypePtr, clientDataPtr\fR)
@@ -66,10 +71,15 @@ The class to create the method in.
.AP Tcl_Obj *nameObj in
The name of the method to create. Should not be NULL unless creating
constructors or destructors.
.AP int isPublic in
A flag saying what the visibility of the method is. The only supported public
values of this flag are 0 for a non-exported method, and 1 for an exported
method.
.AP int flags in
A flag saying (currently) what the visibility of the method is. The supported
public values of this flag are \fBTCL_OO_METHOD_PUBLIC\fR (which is fixed at 1
for backward compatibility) for an exported method,
\fBTCL_OO_METHOD_UNEXPORTED\fR (which is fixed at 0 for backward
compatibility) for a non-exported method,
.VS TIP500
and \fBTCL_OO_METHOD_PRIVATE\fR for a private method.
.VE TIP500
.AP Tcl_MethodType *methodTypePtr in
A description of the type of the method to create, or the type of method to
compare against.
@@ -105,8 +115,12 @@ Given a method, the entity that declared it can be found using
attached to (or NULL if the method is not attached to any class) and
\fBTcl_MethodDeclarerObject\fR which returns the object that the method is
attached to (or NULL if the method is not attached to an object). The name of
the method can be retrieved with \fBTcl_MethodName\fR and whether the method
is exported is retrieved with \fBTcl_MethodIsPublic\fR. The type of the method
the method can be retrieved with \fBTcl_MethodName\fR, whether the method
is exported is retrieved with \fBTcl_MethodIsPublic\fR,
.VS TIP500
and whether the method is private is retrieved with \fBTcl_MethodIsPrivate\fR.
.VE TIP500
The type of the method
can also be introspected upon to a limited degree; the function
\fBTcl_MethodIsType\fR returns whether a method is of a particular type,
assigning the per-method \fIclientData\fR to the variable pointed to by
@@ -117,8 +131,12 @@ Methods are created by \fBTcl_NewMethod\fR and \fBTcl_NewInstanceMethod\fR,
which
create a method attached to a class or an object respectively. In both cases,
the \fInameObj\fR argument gives the name of the method to create, the
\fIisPublic\fR argument states whether the method should be exported
initially, the \fImethodTypePtr\fR argument describes the implementation of
\fIflags\fR argument states whether the method should be exported
initially
.VS TIP500
or be marked as a private method,
.VE TIP500
the \fImethodTypePtr\fR argument describes the implementation of
the method (see the \fBMETHOD TYPES\fR section below) and the \fIclientData\fR
argument gives some implementation-specific data that is passed on to the
implementation of the method when it is called.
+1 -1
View File
@@ -1,6 +1,6 @@
.\"
.\" Copyright (c) 2008 by Kevin B. Kenny.
.\" Copyright (c) 2018 by Nathan Coulter.
.\" Copyright (c) 2018 by Nathan Coulter.
.\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+2 -2
View File
@@ -3,10 +3,10 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" Note that some of these functions do not seem to belong, but they
'\" were all introduced with the same TIP (#139)
'\"
'\"
.TH Tcl_Namespace 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+11 -21
View File
@@ -132,22 +132,17 @@ higher-level software that they have occurred. The procedures
and \fBTcl_SetMaxBlockTime\fR, \fBTcl_QueueEvent\fR, and
\fBTcl_DeleteEvents\fR are used primarily by event sources.
.IP [2]
The event queue: for non-threaded applications,
there is a single queue for the whole application,
containing events that have been detected but not yet serviced. Event
sources place events onto the queue so that they may be processed in
order at appropriate times during the event loop. The event queue
guarantees a fair discipline of event handling, so that no event
source can starve the others. It also allows events to be saved for
servicing at a future time. Threaded applications work in a
similar manner, except that there is a separate event queue for
each thread containing a Tcl interpreter.
The event queue: there is a single queue for each thread containing
a Tcl interpreter, containing events that have been detected but not
yet serviced. Event sources place events onto the queue so that they
may be processed in order at appropriate times during the event loop.
The event queue guarantees a fair discipline of event handling, so that
no event source can starve the others. It also allows events to be
saved for servicing at a future time.
\fBTcl_QueueEvent\fR is used (primarily
by event sources) to add events to the event queue and
by event sources) to add events to the current thread's event queue and
\fBTcl_DeleteEvents\fR is used to remove events from the queue without
processing them. In a threaded application, \fBTcl_QueueEvent\fR adds
an event to the current thread's queue, and \fBTcl_ThreadQueueEvent\fR
adds an event to a queue in a specific thread.
processing them.
.IP [3]
The event loop: in order to detect and process events, the application
enters a loop that waits for events to occur, places them on the event
@@ -403,11 +398,7 @@ 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
Threaded applications work in a
similar manner, except that there is a separate event queue for
each thread containing a Tcl interpreter.
Calling \fBTcl_QueueEvent\fR in a multithreaded application adds
an event to the current thread's queue.
Calling \fBTcl_QueueEvent\fR adds an event to the current thread's queue.
To add an event to another thread's queue, use \fBTcl_ThreadQueueEvent\fR.
\fBTcl_ThreadQueueEvent\fR accepts as an argument a Tcl_ThreadId argument,
which uniquely identifies a thread in a Tcl application. To obtain the
@@ -498,8 +489,7 @@ under Unix it happens when \fBTcl_WaitForEvent\fR would have waited
forever because there were no active event sources and the timeout was
infinite.
.PP
\fBTcl_AlertNotifier\fR is used in multithreaded applications to allow
any thread to
\fBTcl_AlertNotifier\fR is used to allow any thread to
.QW "wake up"
the notifier to alert it to new events on its
queue. \fBTcl_AlertNotifier\fR requires as an argument the notifier
-2
View File
@@ -85,14 +85,12 @@ unless \fIinterp\fR is NULL.
Otherwise, it returns \fBTCL_OK\fR.
Passing a NULL \fIinterp\fR allows this procedure to be used
as a test whether the conversion can be done (and in fact was done).
.VS 8.5
.PP
In many cases, the \fItypePtr->setFromAnyProc\fR routine will
set \fIobjPtr->typePtr\fR to the argument value \fItypePtr\fR,
but that is no longer guaranteed. The \fIsetFromAnyProc\fR is
free to set the internal representation for \fIobjPtr\fR to make
use of another related Tcl_ObjType, if it sees fit.
.VE 8.5
.SH "THE TCL_OBJTYPE STRUCTURE"
.PP
Extension writers can define new value types by defining four
+17 -3
View File
@@ -4,12 +4,12 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures"
.TH Tcl_OpenTcpClient 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer \- procedures to open channels using TCP sockets
Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer, Tcl_OpenTcpServerEx \- procedures to open channels using TCP sockets
.SH SYNOPSIS
.nf
\fB#include <tcl.h> \fR
@@ -23,6 +23,9 @@ Tcl_Channel
Tcl_Channel
\fBTcl_OpenTcpServer\fR(\fIinterp, port, myaddr, proc, clientData\fR)
.sp
Tcl_Channel
\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, proc, clientData\fR)
.sp
.SH ARGUMENTS
.AS Tcl_TcpAcceptProc clientData
.AP Tcl_Interp *interp in
@@ -30,6 +33,9 @@ Tcl interpreter to use for error reporting. If non-NULL and an
error occurs, an error message is left in the interpreter's result.
.AP int port in
A port number to connect to as a client or to listen on as a server.
.AP "const char" *service in
A string specifying the port number to connect to as a client or to listen on as
a server.
.AP "const char" *host in
A string specifying a host name or address for the remote end of the connection.
.AP int myport in
@@ -41,6 +47,9 @@ for the local end of the connection. If NULL, a default interface is
chosen.
.AP int async in
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 ClientData sock in
Platform-specific handle for client TCP socket.
.AP Tcl_TcpAcceptProc *proc in
@@ -130,7 +139,7 @@ for the new channel, \fIhostName\fR points to a string containing
the name of the client host making the connection, and \fIport\fR
will contain the client's port number.
The new channel
is opened for both input and output.
is opened for both input and output.
If \fIproc\fR raises an error, the connection is closed automatically.
\fIProc\fR has no return value, but if it wishes to reject the
connection it can close \fIchannel\fR.
@@ -158,6 +167,11 @@ register it, use \fBTcl_RegisterChannel\fR.
If one of the standard channels, \fBstdin\fR, \fBstdout\fR or \fBstderr\fR was
previously closed, the act of creating the new channel also assigns it as a
replacement for the standard channel.
.SS TCL_OPENTCPSERVEREX
.PP
\fBTcl_OpenTcpServerEx\fR behaviour is identical to \fBTcl_OpenTcpServer\fR but
gives more flexibility to the user by providing a mean to further customize some
aspects of the socket via the \fIflags\fR parameter.
.SH "PLATFORM ISSUES"
.PP
On Unix platforms, the socket handle is a Unix file descriptor as
+19 -3
View File
@@ -7,7 +7,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc \- 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
@@ -21,6 +21,9 @@ void
void
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
void
\fBTcl_ConsolePanic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
.sp
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP "const char*" format in
@@ -50,10 +53,18 @@ In a freshly loaded Tcl library, \fBTcl_Panic\fR prints the formatted
error message to the standard error file of the process, and then
calls \fBabort\fR to terminate the process. \fBTcl_Panic\fR does not
return. On Windows, when a debugger is running, the formatted error
message is sent to the debugger in stead. If the windows executable
message is sent to the debugger instead. If the windows executable
does not have a stderr channel (e.g. \fBwish.exe\fR), then a
system dialog box is used to display the panic message.
.PP
If your application doesn't use \fBTcl_Main\fR or \fBTk_Main\fR
and you want to implicitly use the stderr channel of your
application's C runtime (instead of the stderr channel of the
C runtime used by Tcl), you can call \fBTcl_SetPanicProc\fR
with \fBTcl_ConsolePanic\fR as its argument. On platforms which
only have one C runtime (almost all platforms except Windows)
\fBTcl_ConsolePanic\fR is equivalent to NULL.
.PP
\fBTcl_SetPanicProc\fR may be used to modify the behavior of
\fBTcl_Panic\fR. The \fIpanicProc\fR argument should match the
type \fBTcl_PanicProc\fR:
@@ -75,6 +86,9 @@ The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
to be displayed or reported in a manner more suitable for the
application or the platform.
.PP
\fBTcl_SetPanicProc\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.
.PP
Although the primary callers of \fBTcl_Panic\fR are the procedures of
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
@@ -82,7 +96,9 @@ 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.
taking a variable number of arguments it takes an argument list. Interfaces
using argument lists have been found to be nonportable in practice. This
function is deprecated and will be removed in Tcl 9.0.
.SH "SEE ALSO"
abort(3), printf(3), exec(n), format(n)
.SH KEYWORDS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -3
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -32,8 +32,6 @@ the command at global level instead of the current stack level.
.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
(or \fBTcl_GlobalEvalObj\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set
in \fIflags\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
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+36 -71
View File
@@ -1,6 +1,7 @@
'\"
'\" Copyright (c) 1997 by Sun Microsystems, Inc.
'\" Contributions from Don Porter, NIST, 2004. (not subject to US copyright)
'\" Copyright (c) 2018 Nathan Coulter.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -9,7 +10,9 @@
.so man.macros
.BS
.SH NAME
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState, Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- save and restore an interpreter's state
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState,
Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- Save and restore the
state of an an interpreter.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -30,91 +33,53 @@ int
.SH ARGUMENTS
.AS Tcl_InterpState savedPtr
.AP Tcl_Interp *interp in
Interpreter for which state should be saved.
The interpreter for the operation.
.AP int status in
Return code value to save as part of interpreter state.
The return code for the state.
.AP Tcl_InterpState state in
Saved state token to be restored or discarded.
A token for saved state.
.AP Tcl_SavedResult *savedPtr in
Pointer to location where interpreter result should be saved or restored.
A pointer to storage for saved state.
.BE
.SH DESCRIPTION
.PP
These routines allows a C procedure to take a snapshot of the current
state of an interpreter so that it can be restored after a call
to \fBTcl_Eval\fR or some other routine that modifies the interpreter
state. There are two triplets of routines meant to work together.
These routines save the state of an interpreter before a call to a routine such
as \fBTcl_Eval\fR, and restore the state afterwards.
.PP
The first triplet stores the snapshot of interpreter state in
an opaque token returned by \fBTcl_SaveInterpState\fR. That token
value may then be passed back to one of \fBTcl_RestoreInterpState\fR
or \fBTcl_DiscardInterpState\fR, depending on whether the interp
state is to be restored. So long as one of the latter two routines
is called, Tcl will take care of memory management.
\fBTcl_SaveInterpState\fR saves the parts of \fIinterp\fR that comprise the
result of a script, including the resulting value, the return code passed as
\fIstatus\fR, and any options such as \fB\-errorinfo\fR and \fB\-errorcode\fR.
It returns a token for the saved state. The interpreter result is not reset
and no interpreter state is changed.
.PP
The second triplet stores the snapshot of only the interpreter
result (not its complete state) in memory allocated by the caller.
These routines are passed a pointer to \fBTcl_SavedResult\fR
that is used to store enough information to restore the interpreter result.
\fBTcl_SavedResult\fR can be allocated on the stack of the calling
procedure. These routines do not save the state of any error
information in the interpreter (e.g. the \fB\-errorcode\fR or
\fB\-errorinfo\fR return options, when an error is in progress).
\fBTcl_RestoreInterpState\fR restores the state indicated by \fIstate\fR and
returns the \fIstatus\fR originally passed in the corresponding call to
\fBTcl_SaveInterpState\fR.
.PP
Because the routines \fBTcl_SaveInterpState\fR,
\fBTcl_RestoreInterpState\fR, and \fBTcl_DiscardInterpState\fR perform
a superset of the functions provided by the other routines,
any new code should only make use of the more powerful routines.
The older, weaker routines \fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR,
and \fBTcl_DiscardResult\fR continue to exist only for the sake
of existing programs that may already be using them.
If a saved state is not restored, \fBTcl_DiscardInterpState\fR must be called
to release it. A token used to discard or restore state must not be used
again.
.PP
\fBTcl_SaveInterpState\fR takes a snapshot of those portions of
interpreter state that make up the full result of script evaluation.
This include the interpreter result, the return code (passed in
as the \fIstatus\fR argument, and any return options, including
\fB\-errorinfo\fR and \fB\-errorcode\fR when an error is in progress.
This snapshot is returned as an opaque token of type \fBTcl_InterpState\fR.
The call to \fBTcl_SaveInterpState\fR does not itself change the
state of the interpreter. Unlike \fBTcl_SaveResult\fR, it does
not reset the interpreter.
\fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR, and \fBTcl_DiscardResult\fR are
deprecated. Instead use \fBTcl_SaveInterpState\fR,
\fBTcl_RestoreInterpState\fR, and \fBTcl_DiscardInterpState\fR, which are more
capable.
.PP
\fBTcl_RestoreInterpState\fR accepts a \fBTcl_InterpState\fR token
previously returned by \fBTcl_SaveInterpState\fR and restores the
state of the interp to the state held in that snapshot. The return
value of \fBTcl_RestoreInterpState\fR is the status value originally
passed to \fBTcl_SaveInterpState\fR when the snapshot token was
created.
\fBTcl_SaveResult\fR moves the result of \fIinterp\fR to the location
\fIstatePtr\fR points to and returns the interpreter result to its initial
state. It does not save options such as \fB\-errorcode\fR or
\fB\-errorinfo\fR.
.PP
\fBTcl_DiscardInterpState\fR is called to release a \fBTcl_InterpState\fR
token previously returned by \fBTcl_SaveInterpState\fR when that
snapshot is not to be restored to an interp.
.PP
The \fBTcl_InterpState\fR token returned by \fBTcl_SaveInterpState\fR
must eventually be passed to either \fBTcl_RestoreInterpState\fR
or \fBTcl_DiscardInterpState\fR to avoid a memory leak. Once
the \fBTcl_InterpState\fR token is passed to one of them, the
token is no longer valid and should not be used anymore.
.PP
\fBTcl_SaveResult\fR moves the string and value results
of \fIinterp\fR into the location specified by \fIstatePtr\fR.
\fBTcl_SaveResult\fR clears the result for \fIinterp\fR and
leaves the result in its normal empty initialized state.
.PP
\fBTcl_RestoreResult\fR moves the string and value results from
\fIstatePtr\fR back into \fIinterp\fR. Any result or error that was
already in the interpreter will be cleared. The \fIstatePtr\fR is left
in an uninitialized state and cannot be used until another call to
\fBTcl_RestoreResult\fR clears any existing result or error in \fIinterp\fR and
moves the result from \fIstatePtr\fR back to \fIinterp\fR. \fIstatePtr\fR is
then in an undefined state and must not be used until passed again to
\fBTcl_SaveResult\fR.
.PP
\fBTcl_DiscardResult\fR releases the saved interpreter state
stored at \fBstatePtr\fR. The state structure is left in an
uninitialized state and cannot be used until another call to
\fBTcl_DiscardResult\fR releases the state stored at \fBstatePtr\fR, which is
then in an undefined state and must not be used until passed again to
\fBTcl_SaveResult\fR.
.PP
Once \fBTcl_SaveResult\fR is called to save the interpreter
result, either \fBTcl_RestoreResult\fR or
\fBTcl_DiscardResult\fR must be called to properly clean up the
memory associated with the saved state.
If a saved result is not restored, \fBTcl_DiscardResult\fR must be called to
release it.
.SH KEYWORDS
result, state, interp
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+19 -28
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures"
.TH Tcl_SetResult 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -30,9 +30,7 @@ const char *
.sp
\fBTcl_ResetResult\fR(\fIinterp\fR)
.sp
.VS 8.6
\fBTcl_TransferResult\fR(\fIsourceInterp, result, targetInterp\fR)
.VE 8.6
\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
.sp
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
.sp
@@ -57,18 +55,11 @@ Address of procedure to call to release storage at
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.AP Tcl_Interp *sourceInterp in
.VS 8.6
Interpreter that the result and error information should be copied from.
.VE 8.6
Interpreter that the result and return options should be transferred from.
.AP Tcl_Interp *targetInterp in
.VS 8.6
Interpreter that the result and error information should be copied to.
.VE 8.6
.AP int result in
.VS 8.6
If \fBTCL_OK\fR, only copy the result. If \fBTCL_ERROR\fR, copy the error
information as well.
.VE 8.6
Interpreter that the result and return options should be transferred to.
.AP int code in
Return code value that controls transfer of return options.
.BE
.SH DESCRIPTION
.PP
@@ -154,13 +145,17 @@ 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.
Interfaces using argument lists have been found to be nonportable in practice.
This function is deprecated and will be removed in Tcl 9.0.
.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
information dictionary as well. The interpreters must be in the same thread.
The source interpreter will have its result reset by this operation.
.VE 8.6
\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR
to \fItargetInterp\fR. The two interpreters must have been created in the
same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same,
nothing is done. Otherwise, \fBTcl_TransferResult\fR moves the result
from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result
in \fIsourceInterp\fR. It also moves the return options dictionary as
controlled by the return code value \fIcode\fR in the same manner
as \fBTcl_GetReturnOptions\fR.
.SH "DEPRECATED INTERFACES"
.SS "OLD STRING PROCEDURES"
.PP
@@ -202,14 +197,9 @@ is about to replace one result value with another.
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
permit this access. 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
@@ -250,6 +240,7 @@ typedef void \fBTcl_FreeProc\fR(
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
.SH "SEE ALSO"
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
Tcl_GetReturnOptions
.SH KEYWORDS
append, command, element, list, value, result, return value, interpreter
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SplitList 3 8.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+4 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -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
\fBTcl_StaticPackage\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
initialization procedure, package, static linking
.SH "SEE ALSO"
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH "Standard Channels" 3 7.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_StringMatch 3 8.5 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+6 -3
View File
@@ -37,7 +37,7 @@ Tcl_UniChar *
Tcl_UniChar *
\fBTcl_GetUnicode\fR(\fIobjPtr\fR)
.sp
Tcl_UniChar
int
\fBTcl_GetUniChar\fR(\fIobjPtr, index\fR)
.sp
int
@@ -204,7 +204,8 @@ where the caller does not need the length of the unicode string
representation.
.PP
\fBTcl_GetUniChar\fR returns the \fIindex\fR'th character in the
value's Unicode representation.
value's Unicode representation. If the index is out of range or
it references a low surrogate preceded by a high surrogate, it returns -1;
.PP
\fBTcl_GetRange\fR returns a newly created value comprised of the
characters between \fIfirst\fR and \fIlast\fR (inclusive) in the
@@ -248,7 +249,9 @@ 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.
argument list. Interfaces using argument lists have been found to be
nonportable in practice. This function is deprecated and will be removed
in Tcl 9.0.
.PP
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
except that it imposes a limit on how many bytes are appended.
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH Tcl_SubstObj 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+2 -2
View File
@@ -1,8 +1,8 @@
'\"
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\"
'\"
.TH TCL_MEM_DEBUG 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+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.
+1 -1
View File
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH TclZlib 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
+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
\fBTcl_Main\fR 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)
+9 -3
View File
@@ -45,7 +45,9 @@ int
.AP Tcl_Condition *condPtr in
A condition variable, which must be associated with a mutex lock.
.AP Tcl_Mutex *mutexPtr in
A mutex lock.
.VS TIP509
A recursive mutex lock.
.VE TIP509
.AP "const Tcl_Time" *timePtr in
A time limit on the condition wait. NULL to wait forever.
Note that a polling value of 0 seconds does not make much sense.
@@ -140,8 +142,12 @@ of code by calling \fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR.
If one thread holds a mutex, any other thread calling \fBTcl_MutexLock\fR will
block until \fBTcl_MutexUnlock\fR is called.
A mutex can be destroyed after its use by calling \fBTcl_MutexFinalize\fR.
The result of locking a mutex twice from the same thread is undefined.
On some platforms it will result in a deadlock.
.VS TIP509
Mutexes are reentrant: they can be locked several times from the same
thread. However there must be exactly one call to
\fBTcl_MutexUnlock\fR for each call to \fBTcl_MutexLock\fR in order
for a thread to release a mutex completely.
.VE TIP509
The \fBTcl_MutexLock\fR, \fBTcl_MutexUnlock\fR and \fBTcl_MutexFinalize\fR
procedures are defined as empty macros if not compiling with threads enabled.
For declaration of mutexes the \fBTCL_DECLARE_MUTEX\fR macro should be used.
+3 -10
View File
@@ -13,13 +13,13 @@ Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_
.nf
\fB#include <tcl.h>\fR
.sp
Tcl_UniChar
int
\fBTcl_UniCharToUpper\fR(\fIch\fR)
.sp
Tcl_UniChar
int
\fBTcl_UniCharToLower\fR(\fIch\fR)
.sp
Tcl_UniChar
int
\fBTcl_UniCharToTitle\fR(\fIch\fR)
.sp
int
@@ -78,12 +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 Unicode
plane 0 characters. The result for Unicode characters above 0xffff
is undefined, but - actually - only the lower 16 bits of the
character value is handled.
.SH KEYWORDS
utf, unicode, toupper, tolower, totitle, case
+11 -22
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
.TH Tcl_TraceVar 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -95,7 +95,7 @@ Invoke \fIproc\fR whenever an attempt is made to modify the variable.
Invoke \fIproc\fR whenever the variable is unset.
A variable may be unset either explicitly by an \fBunset\fR command,
or implicitly when a procedure returns (its local variables are
automatically unset) or when the interpreter is deleted (all
automatically unset) or when the interpreter or namespace is deleted (all
variables are automatically unset).
.TP
\fBTCL_TRACE_ARRAY\fR
@@ -160,10 +160,6 @@ The bit \fBTCL_TRACE_DESTROYED\fR will be set in \fIflags\fR if the trace is
about to be destroyed; this information may be useful to \fIproc\fR
so that it can clean up its own internal data structures (see
the section \fBTCL_TRACE_DESTROYED\fR below for more details).
Lastly, the bit \fBTCL_INTERP_DESTROYED\fR will be set if the entire
interpreter is being destroyed.
When this bit is set, \fIproc\fR must be especially careful in
the things it does (see the section \fBTCL_INTERP_DESTROYED\fR below).
The trace procedure's return value should normally be NULL; see
\fBERROR RETURNS\fR below for information on other possibilities.
.PP
@@ -330,6 +326,15 @@ During unset traces, the return value is ignored and all relevant
trace procedures will always be invoked.
.SH "RESTRICTIONS"
.PP
Because operations on variables may take place as part of the deletion
of the interp that contains them, \fIproc\fR must be careful about checking
what the \fIinterp\fR parameter can be used to do.
The routine \fBTcl_InterpDeleted\fR is an important tool for this.
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
to invoke any scripts in \fIinterp\fR. You may encounter old code using
a deprecated flag value \fBTCL_INTERP_DESTROYED\fR to signal this
condition, but any supported code should be converted to stop using it.
.PP
A trace procedure can be called at any time, even when there
are partially formed results stored in the interpreter. If
the trace procedure does anything that could damage this result (such
@@ -354,24 +359,8 @@ Traces on a variable are always removed whenever the variable
is deleted; the only time \fBTCL_TRACE_DESTROYED\fR is not set is for
a whole-array trace invoked when only a single element of an
array is unset.
.SH "TCL_INTERP_DESTROYED"
.PP
When an interpreter is destroyed, unset traces are called for
all of its variables.
The \fBTCL_INTERP_DESTROYED\fR bit will be set in the \fIflags\fR
argument passed to the trace procedures.
Trace procedures must be extremely careful in what they do if
the \fBTCL_INTERP_DESTROYED\fR bit is set.
It is not safe for the procedures to invoke any Tcl procedures
on the interpreter, since its state is partially deleted.
All that trace procedures should do under these circumstances is
to clean up and free their own internal data structures.
.SH BUGS
.PP
Tcl does not do any error checking to prevent trace procedures
from misusing the interpreter during traces with \fBTCL_INTERP_DESTROYED\fR
set.
.PP
Array traces are not yet integrated with the Tcl \fBinfo exists\fR command,
nor is there Tcl-level access to array traces.
.SH "SEE ALSO"
+1 -1
View File
@@ -48,7 +48,7 @@ int
.SH ARGUMENTS
.AS int ch
.AP int ch in
The Tcl_UniChar to be examined.
The Unicode character to be examined.
.BE
.SH DESCRIPTION
+58 -22
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToWCharDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -21,12 +21,30 @@ int
int
\fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR)
.sp
int
\fBTcl_UtfToChar16\fR(\fIsrc, uPtr\fR)
.sp
int
\fBTcl_UtfToWChar\fR(\fIsrc, wPtr\fR)
.sp
char *
\fBTcl_UniCharToUtfDString\fR(\fIuniStr, uniLength, dsPtr\fR)
.sp
char *
\fBTcl_Char16ToUtfDString\fR(\fIuStr, uniLength, dsPtr\fR)
.sp
char *
\fBTcl_WCharToUtfDString\fR(\fIwStr, uniLength, dsPtr\fR)
.sp
Tcl_UniChar *
\fBTcl_UtfToUniCharDString\fR(\fIsrc, length, dsPtr\fR)
.sp
unsigned short *
\fBTcl_UtfToChar16DString\fR(\fIsrc, length, dsPtr\fR)
.sp
wchar_t *
\fBTcl_UtfToWCharDString\fR(\fIsrc, length, dsPtr\fR)
.sp
int
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
.sp
@@ -63,7 +81,7 @@ const char *
const char *
\fBTcl_UtfPrev\fR(\fIsrc, start\fR)
.sp
Tcl_UniChar
int
\fBTcl_UniCharAtIndex\fR(\fIsrc, index\fR)
.sp
const char *
@@ -75,11 +93,15 @@ int
.AS "const Tcl_UniChar" *uniPattern in/out
.AP char *buf out
Buffer in which the UTF-8 representation of the Tcl_UniChar is stored. At most
\fBTCL_UTF_MAX\fR bytes are stored in the buffer.
4 bytes are stored in the buffer.
.AP int ch in
The Unicode character to be converted or examined.
.AP Tcl_UniChar *chPtr out
Filled with the Tcl_UniChar represented by the head of the UTF-8 string.
.AP unsigned short *uPtr out
Filled with the utf-16 represented by the head of the UTF-8 string.
.AP wchar_t *wPtr out
Filled with the wchar_t represented by the head of the UTF-8 string.
.AP "const char" *src in
Pointer to a UTF-8 string.
.AP "const char" *cs in
@@ -94,12 +116,21 @@ A null-terminated Unicode string.
A null-terminated Unicode string.
.AP "const Tcl_UniChar" *uniPattern in
A null-terminated Unicode string.
.AP "const unsigned short" *uStr in
A null-terminated UTF-16 string.
.AP "const wchar_t" *wStr in
A null-terminated wchar_t string.
.AP "const unsigned short" *utf16s in
A null-terminated utf-16 string.
.AP "const unsigned short" *utf16t in
A null-terminated utf-16 string.
.AP "const unsigned short" *utf16Pattern in
A null-terminated utf-16 string.
.AP int length in
The length of the UTF-8 string in bytes (not UTF-8 characters). If
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.
The length of the Unicode string in characters.
.AP "Tcl_DString" *dsPtr in/out
A pointer to a previously initialized \fBTcl_DString\fR.
.AP "unsigned long" numChars in
@@ -113,7 +144,7 @@ If non-NULL, filled with the number of bytes in the backslash sequence,
including the backslash character.
.AP char *dst out
Buffer in which the bytes represented by the backslash sequence are stored.
At most \fBTCL_UTF_MAX\fR bytes are stored in the buffer.
At most 4 bytes are stored in the buffer.
.AP int nocase in
Specifies whether the match should be done case-sensitive (0) or
case-insensitive (1).
@@ -121,18 +152,21 @@ case-insensitive (1).
.SH DESCRIPTION
.PP
These routines convert between UTF-8 strings and Tcl_UniChars. A
Tcl_UniChar is a Unicode character represented as an unsigned, fixed-size
quantity. A UTF-8 character is a Unicode character represented as
a varying-length sequence of up to \fBTCL_UTF_MAX\fR bytes. A multibyte UTF-8
sequence consists of a lead byte followed by some number of trail bytes.
These routines convert between UTF-8 strings and Unicode/Utf-16 characters.
A UTF-8 character is a Unicode character represented as a varying-length
sequence of up to \fB4\fR bytes. A multibyte UTF-8 sequence
consists of a lead byte followed by some number of trail bytes.
.PP
\fBTCL_UTF_MAX\fR is the maximum number of bytes that it takes to
represent one Unicode character in the UTF-8 representation.
\fBTCL_UTF_MAX\fR is the maximum number of bytes that \fBTcl_UtfToUniChar\fR
can consume in a single call.
.PP
\fBTcl_UniCharToUtf\fR stores the Tcl_UniChar \fIch\fR as a UTF-8 string
\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.
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
@@ -140,13 +174,15 @@ number of bytes read from \fIsrc\fR. The caller must ensure that the
source buffer is long enough such that this routine does not run off the
end and dereference non-existent or random memory; if the source buffer
is known to be null-terminated, this will not happen. If the input is
a byte in the range 0x80 - 0x9F, \fBTcl_UtfToUniChar\fR assumes the
cp1252 encoding, stores the corresponding Tcl_UniChar in \fI*chPtr\fR
and returns 1. If the input is otherwise
not in proper UTF-8 format, \fBTcl_UtfToUniChar\fR will store the first
byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x0000 and
0x00ff and return 1.
byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x00A0 and
0x00FF and return 1.
.PP
\fBTcl_UniCharToUtfDString\fR converts the given Unicode string
to UTF-8, storing the result in a previously initialized \fBTcl_DString\fR.
You must specify \fIuniLength\fR, the length of the given Unicode string.
The return value is a pointer to the UTF-8 representation of the
Unicode string. Storage for the return value is appended to the
end of the \fBTcl_DString\fR.
@@ -200,7 +236,7 @@ of \fIlength\fR bytes is long enough to be decoded by
\fBTcl_UtfToUniChar\fR, or 0 otherwise. This function does not guarantee
that the UTF-8 string is properly formed. This routine is used by
procedures that are operating on a byte at a time and need to know if a
full Tcl_UniChar has been seen.
full Unicode character has been seen.
.PP
\fBTcl_NumUtfChars\fR corresponds to \fBstrlen\fR for UTF-8 strings. It
returns the number of Tcl_UniChars that are represented by the UTF-8 string
@@ -208,12 +244,12 @@ returns the number of Tcl_UniChars that are represented by the UTF-8 string
length is negative, all bytes up to the first null byte are used.
.PP
\fBTcl_UtfFindFirst\fR corresponds to \fBstrchr\fR for UTF-8 strings. It
returns a pointer to the first occurrence of the Tcl_UniChar \fIch\fR
returns a pointer to the first occurrence of the Unicode character \fIch\fR
in the null-terminated UTF-8 string \fIsrc\fR. The null terminator is
considered part of the UTF-8 string.
.PP
\fBTcl_UtfFindLast\fR corresponds to \fBstrrchr\fR for UTF-8 strings. It
returns a pointer to the last occurrence of the Tcl_UniChar \fIch\fR
returns a pointer to the last occurrence of the Unicode character \fIch\fR
in the null-terminated UTF-8 string \fIsrc\fR. The null terminator is
considered part of the UTF-8 string.
.PP
@@ -246,7 +282,7 @@ the return pointer points to the first character in the source string.
\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl
commands. It parses a backslash sequence and stores the properly formed
UTF-8 character represented by the backslash sequence in the output
buffer \fIdst\fR. At most \fBTCL_UTF_MAX\fR bytes are stored in the buffer.
buffer \fIdst\fR. At most 4 bytes are stored in the buffer.
\fBTcl_UtfBackslash\fR modifies \fI*readPtr\fR to contain the number
of bytes in the backslash sequence, including the backslash character.
The return value is the number of bytes stored in the output buffer.
+77
View File
@@ -0,0 +1,77 @@
'\"
'\" Copyright (c) 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 abstract n 0.3 TclOO "TclOO Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
oo::abstract \- a class that does not allow direct instances of itself
.SH SYNOPSIS
.nf
package require TclOO
\fBoo::abstract\fI method \fR?\fIarg ...\fR?
.fi
.SH "CLASS HIERARCHY"
.nf
\fBoo::object\fR
\(-> \fBoo::class\fR
\(-> \fBoo::abstract\fR
.fi
.BE
.SH DESCRIPTION
Abstract classes are classes that can contain definitions, but which cannot be
directly manufactured; they are intended to only ever be inherited from and
instantiated indirectly. The characteristic methods of \fBoo::class\fR
(\fBcreate\fR and \fBnew\fR) are not exported by an instance of
\fBoo::abstract\fR.
.PP
Note that \fBoo::abstract\fR is not itself an instance of \fBoo::abstract\fR.
.SS CONSTRUCTOR
The \fBoo::abstract\fR class does not define an explicit constructor; this
means that it is effectively the same as the constructor of the
\fBoo::class\fR class.
.SS DESTRUCTOR
The \fBoo::abstract\fR class does not define an explicit destructor;
destroying an instance of it is just like destroying an ordinary class (and
will destroy all its subclasses).
.SS "EXPORTED METHODS"
The \fBoo::abstract\fR class defines no new exported methods.
.SS "NON-EXPORTED METHODS"
The \fBoo::abstract\fR class explicitly states that \fBcreate\fR,
\fBcreateWithNamespace\fR, and \fBnew\fR are unexported.
.SH EXAMPLES
.PP
This example defines a simple class hierarchy and creates a new instance of
it. It then invokes a method of the object before destroying the hierarchy and
showing that the destruction is transitive.
.PP
.CS
\fBoo::abstract\fR create fruit {
method eat {} {
puts "yummy!"
}
}
oo::class create banana {
superclass fruit
method peel {} {
puts "skin now off"
}
}
set b [banana \fBnew\fR]
$b peel \fI\(-> prints 'skin now off'\fR
$b eat \fI\(-> prints 'yummy!'\fR
set f [fruit new] \fI\(-> error 'unknown method "new"...'\fR
.CE
.SH "SEE ALSO"
oo::define(n), oo::object(n)
.SH KEYWORDS
abstract class, class, metaclass, object
.\" Local variables:
.\" mode: nroff
.\" fill-column: 78
.\" End:
+9 -3
View File
@@ -20,6 +20,11 @@ Append all of the \fIvalue\fR arguments to the current value
of variable \fIvarName\fR. If \fIvarName\fR does not exist,
it is given a value equal to the concatenation of all the
\fIvalue\fR arguments.
.VS TIP508
If \fIvarName\fR indicate an element that does not exist of an array that has
a default value set, the concatenation of the default value and all the
\fIvalue\fR arguments will be stored in the array element.
.VE TIP508
The result of this command is the new value stored in variable
\fIvarName\fR.
This command provides an efficient way to build up long
@@ -44,6 +49,7 @@ puts $var
concat(n), lappend(n)
.SH KEYWORDS
append, variable
'\" Local Variables:
'\" mode: nroff
'\" End:
.\" Local variables:
.\" mode: nroff
.\" fill-column: 78
.\" End:
+61 -1
View File
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH array n 8.3 Tcl "Tcl Built-In Commands"
.TH array n 8.7 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
@@ -36,6 +36,53 @@ with an empty name, since the return value from
\fBarray nextelement\fR will not indicate whether the search
has been completed.
.TP
\fBarray default \fIsubcommand arrayName args...\fR
.VS 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 \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.
.RS
.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
.TP
\fBarray default exists \fIarrayName\fR
.VS 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
.TP
\fBarray default get \fIarrayName\fR
.VS 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
.TP
\fBarray default set \fIarrayName value\fR
.VS 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
.TP
\fBarray default unset \fIarrayName\fR
.VS 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
.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
@@ -47,6 +94,15 @@ been the return value from a previous invocation of
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
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
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.
.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
@@ -185,3 +241,7 @@ foreach color [lsort [\fBarray names\fR colorcount]] {
list(n), string(n), variable(n), trace(n), foreach(n)
.SH KEYWORDS
array, element names, search
.\" Local variables:
.\" mode: nroff
.\" fill-column: 78
.\" End:
+272 -90
View File
@@ -12,12 +12,10 @@
.SH NAME
binary \- Insert and extract fields from binary strings
.SH SYNOPSIS
.VS 8.6
\fBbinary decode \fIformat\fR ?\fI\-option value ...\fR? \fIdata\fR
.br
\fBbinary encode \fIformat\fR ?\fI\-option value ...\fR? \fIdata\fR
.br
.VE 8.6
\fBbinary format \fIformatString \fR?\fIarg arg ...\fR?
.br
\fBbinary scan \fIstring formatString \fR?\fIvarName varName ...\fR?
@@ -31,11 +29,9 @@ architecture, it might produce an 8-byte binary string consisting of
two 4-byte integers, one for each of the numbers. The subcommand
\fBbinary scan\fR, does the opposite: it extracts data
from a binary string and returns it as ordinary Tcl string values.
.VS 8.6
The \fBbinary encode\fR and \fBbinary decode\fR subcommands convert
binary data to or from string encodings such as base64 (used in MIME
messages for example).
.VE 8.6
.PP
Note that other operations on binary data, such as taking a subsequence of it,
getting its length, or reinterpreting it as a string in some encoding, are
@@ -44,7 +40,6 @@ done by other Tcl commands (respectively \fBstring range\fR,
binary string in Tcl is merely one where all the characters it contains are in
the range \eu0000\-\eu00FF.
.SH "BINARY ENCODE AND DECODE"
.VS 8.6
.PP
When encoding binary data as a readable string, the starting binary data is
passed to the \fBbinary encode\fR command, together with the name of the
@@ -128,7 +123,6 @@ characters. Otherwise it ignores them.
Note that neither the encoder nor the decoder handle the header and footer of
the uuencode format.
.RE
.VE 8.6
.SH "BINARY FORMAT"
.PP
The \fBbinary format\fR command generates a binary string whose layout
@@ -143,7 +137,9 @@ Most field specifiers consume one argument to obtain the value to be
formatted. The type character specifies how the value is to be
formatted. The \fIcount\fR typically indicates how many items of the
specified type are taken from the value. If present, the \fIcount\fR
is a non-negative decimal integer or \fB*\fR, which normally indicates
is a non-negative decimal integer or
.QW \fB*\fR ,
which normally indicates
that all of the items in the value are to be used. If the number of
arguments does not match the number of fields in the format string
that consume arguments, then an error is generated. The flag character
@@ -151,6 +147,7 @@ is ignored for \fBbinary format\fR.
.PP
Here is a small example to clarify the relation between the field
specifiers and the arguments:
.PP
.CS
\fBbinary format\fR d3d {1.0 2.0 3.0 4.0} 0.1
.CE
@@ -178,29 +175,63 @@ not part of the ISO 8859\-1 character set.)
If \fIarg\fR has fewer than \fIcount\fR bytes, then additional zero
bytes are used to pad out the field. If \fIarg\fR is longer than the
specified length, the extra characters will be ignored. If
\fIcount\fR is \fB*\fR, then all of the bytes in \fIarg\fR will be
\fIcount\fR is
.QW \fB*\fR ,
then all of the bytes in \fIarg\fR will be
formatted. If \fIcount\fR is omitted, then one character will be
formatted. For example,
formatted. For example, the command:
.RS
.PP
.CS
\fBbinary format\fR a7a*a alpha bravo charlie
.CE
will return a string equivalent to \fBalpha\e000\e000bravoc\fR,
.PP
will return a binary string equivalent to:
.PP
.CS
\fBalpha\e000\e000bravoc\fR
.CE
.PP
the command:
.PP
.CS
\fBbinary format\fR a* [encoding convertto utf-8 \eu20ac]
.CE
will return a string equivalent to \fB\e342\e202\e254\fR (which is the
UTF-8 byte sequence for a Euro-currency character) and
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\e342\e202\e254\fR
.CE
.PP
(which is the
UTF-8 byte sequence for a Euro-currency character), and the command:
.PP
.CS
\fBbinary format\fR a* [encoding convertto iso8859-15 \eu20ac]
.CE
will return a string equivalent to \fB\e244\fR (which is the ISO
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\e244\fR
.CE
.PP
(which is the ISO
8859\-15 byte sequence for a Euro-currency character). Contrast these
last two with:
.PP
.CS
\fBbinary format\fR a* \eu20ac
.CE
which returns a string equivalent to \fB\e254\fR (i.e. \fB\exac\fR) by
.PP
which returns a binary string equivalent to:
.PP
.CS
\fB\e254\fR
.CE
.PP
(i.e. \fB\exac\fR) by
truncating the high-bits of the character, and which is probably not
what is desired.
.RE
@@ -208,42 +239,62 @@ what is desired.
This form is the same as \fBa\fR except that spaces are used for
padding instead of nulls. For example,
.RS
.PP
.CS
\fBbinary format\fR A6A*A alpha bravo charlie
.CE
will return \fBalpha bravoc\fR.
.PP
will return
.PP
.CS
\fBalpha bravoc\fR
.CE
.RE
.IP \fBb\fR 5
Stores a string of \fIcount\fR binary digits in low-to-high order
within each byte in the output string. \fIArg\fR must contain a
within each byte in the output binary string. \fIArg\fR must contain a
sequence of \fB1\fR and \fB0\fR characters. The resulting bytes are
emitted in first to last order with the bits being formatted in
low-to-high order within each byte. If \fIarg\fR has fewer than
\fIcount\fR digits, then zeros will be used for the remaining bits.
If \fIarg\fR has more than the specified number of digits, the extra
digits will be ignored. If \fIcount\fR is \fB*\fR, then all of the
digits will be ignored. If \fIcount\fR is
.QW \fB*\fR ,
then all of the
digits in \fIarg\fR will be formatted. If \fIcount\fR is omitted,
then one digit will be formatted. If the number of bits formatted
does not end at a byte boundary, the remaining bits of the last byte
will be zeros. For example,
.RS
.PP
.CS
\fBbinary format\fR b5b* 11100 111000011010
.CE
will return a string equivalent to \fB\ex07\ex87\ex05\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex07\ex87\ex05\fR
.CE
.RE
.IP \fBB\fR 5
This form is the same as \fBb\fR except that the bits are stored in
high-to-low order within each byte. For example,
.RS
.PP
.CS
\fBbinary format\fR B5B* 11100 111000011010
.CE
will return a string equivalent to \fB\exe0\exe1\exa0\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\exe0\exe1\exa0\fR
.CE
.RE
.IP \fBH\fR 5
Stores a string of \fIcount\fR hexadecimal digits in high-to-low
within each byte in the output string. \fIArg\fR must contain a
within each byte in the output binary string. \fIArg\fR must contain a
sequence of characters in the set
.QW 0123456789abcdefABCDEF .
The resulting bytes are emitted in first to last order with the hex digits
@@ -251,43 +302,66 @@ being formatted in high-to-low order within each byte. If \fIarg\fR
has fewer than \fIcount\fR digits, then zeros will be used for the
remaining digits. If \fIarg\fR has more than the specified number of
digits, the extra digits will be ignored. If \fIcount\fR is
\fB*\fR, then all of the digits in \fIarg\fR will be formatted. If
.QW \fB*\fR ,
then all of the digits in \fIarg\fR will be formatted. If
\fIcount\fR is omitted, then one digit will be formatted. If the
number of digits formatted does not end at a byte boundary, the
remaining bits of the last byte will be zeros. For example,
.RS
.PP
.CS
\fBbinary format\fR H3H*H2 ab DEF 987
.CE
will return a string equivalent to \fB\exab\ex00\exde\exf0\ex98\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\exab\ex00\exde\exf0\ex98\fR
.CE
.RE
.IP \fBh\fR 5
This form is the same as \fBH\fR except that the digits are stored in
low-to-high order within each byte. This is seldom required. For example,
.RS
.PP
.CS
\fBbinary format\fR h3h*h2 AB def 987
.CE
will return a string equivalent to \fB\exba\ex00\exed\ex0f\ex89\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\exba\ex00\exed\ex0f\ex89\fR
.CE
.RE
.IP \fBc\fR 5
Stores one or more 8-bit integer values in the output string. If no
\fIcount\fR is specified, then \fIarg\fR must consist of an integer
value. If \fIcount\fR is specified, \fIarg\fR must consist of a list
containing at least that many integers. The low-order 8 bits of each integer
are stored as a one-byte value at the cursor position. If \fIcount\fR
is \fB*\fR, then all of the integers in the list are formatted. If the
are stored as a one-byte value at the cursor position. If \fIcount\fR is
.QW \fB*\fR ,
then all of the integers in the list are formatted. If the
number of elements in the list is greater
than \fIcount\fR, then the extra elements are ignored. For example,
.RS
.PP
.CS
\fBbinary format\fR c3cc* {3 -3 128 1} 260 {2 5}
.CE
will return a string equivalent to
\fB\ex03\exfd\ex80\ex04\ex02\ex05\fR, whereas
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex03\exfd\ex80\ex04\ex02\ex05\fR
.CE
.PP
whereas:
.PP
.CS
\fBbinary format\fR c {2 5}
.CE
.PP
will generate an error.
.RE
.IP \fBs\fR 5
@@ -297,22 +371,32 @@ low-order 16-bits of each integer are stored as a two-byte value at
the cursor position with the least significant byte stored first. For
example,
.RS
.PP
.CS
\fBbinary format\fR s3 {3 -3 258 1}
.CE
will return a string equivalent to
\fB\ex03\ex00\exfd\exff\ex02\ex01\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex03\ex00\exfd\exff\ex02\ex01\fR
.CE
.RE
.IP \fBS\fR 5
This form is the same as \fBs\fR except that it stores one or more
16-bit integers in big-endian byte order in the output string. For
example,
.RS
.PP
.CS
\fBbinary format\fR S3 {3 -3 258 1}
.CE
will return a string equivalent to
\fB\ex00\ex03\exff\exfd\ex01\ex02\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex00\ex03\exff\exfd\ex01\ex02\fR
.CE
.RE
.IP \fBt\fR 5
This form (mnemonically \fItiny\fR) is the same as \fBs\fR and \fBS\fR
@@ -327,22 +411,32 @@ low-order 32-bits of each integer are stored as a four-byte value at
the cursor position with the least significant byte stored first. For
example,
.RS
.PP
.CS
\fBbinary format\fR i3 {3 -3 65536 1}
.CE
will return a string equivalent to
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex03\ex00\ex00\ex00\exfd\exff\exff\exff\ex00\ex00\ex01\ex00\fR
.CE
.RE
.IP \fBI\fR 5
This form is the same as \fBi\fR except that it stores one or more one
or more 32-bit integers in big-endian byte order in the output string.
For example,
.RS
.PP
.CS
\fBbinary format\fR I3 {3 -3 65536 1}
.CE
will return a string equivalent to
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex00\ex00\ex00\ex03\exff\exff\exff\exfd\ex00\ex01\ex00\ex00\fR
.CE
.RE
.IP \fBn\fR 5
This form (mnemonically \fInumber\fR or \fInormal\fR) is the same as
@@ -358,20 +452,24 @@ low-order 64-bits of each integer are stored as an eight-byte value at
the cursor position with the least significant byte stored first. For
example,
.RS
.PP
.CS
\fBbinary format\fR w 7810179016327718216
.CE
will return the string \fBHelloTcl\fR
.PP
will return the binary string \fBHelloTcl\fR.
.RE
.IP \fBW\fR 5
This form is the same as \fBw\fR except that it stores one or more one
or more 64-bit integers in big-endian byte order in the output string.
For example,
.RS
.PP
.CS
\fBbinary format\fR Wc 4785469626960341345 110
.CE
will return the string \fBBigEndian\fR
.PP
will return the binary string \fBBigEndian\fR
.RE
.IP \fBm\fR 5
This form (mnemonically the mirror of \fBw\fR) is the same as \fBw\fR
@@ -394,11 +492,16 @@ double-precision floating point numbers internally, there may be some
loss of precision in the conversion to single-precision. For example,
on a Windows system running on an Intel Pentium processor,
.RS
.PP
.CS
\fBbinary format\fR f2 {1.6 3.4}
.CE
will return a string equivalent to
\fB\excd\excc\excc\ex3f\ex9a\ex99\ex59\ex40\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\excd\excc\excc\ex3f\ex9a\ex99\ex59\ex40\fR
.CE
.RE
.IP \fBr\fR 5
This form (mnemonically \fIreal\fR) is the same as \fBf\fR except that
@@ -415,11 +518,16 @@ or more double-precision floating point numbers in the machine's native
representation in the output string. For example, on a
Windows system running on an Intel Pentium processor,
.RS
.PP
.CS
\fBbinary format\fR d1 {1.6}
.CE
will return a string equivalent to
\fB\ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fB\ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f\fR
.CE
.RE
.IP \fBq\fR 5
This form (mnemonically the mirror of \fBd\fR) is the same as \fBd\fR
@@ -432,26 +540,37 @@ This form is the same as \fBq\fR except that it stores the
double-precision floating point numbers in big-endian order.
.IP \fBx\fR 5
Stores \fIcount\fR null bytes in the output string. If \fIcount\fR is
not specified, stores one null byte. If \fIcount\fR is \fB*\fR,
not specified, stores one null byte. If \fIcount\fR is
.QW \fB*\fR ,
generates an error. This type does not consume an argument. For
example,
.RS
.PP
.CS
\fBbinary format\fR a3xa3x2a3 abc def ghi
.CE
will return a string equivalent to \fBabc\e000def\e000\e000ghi\fR.
.PP
will return a binary string equivalent to:
.PP
.CS
\fBabc\e000def\e000\e000ghi\fR
.CE
.RE
.IP \fBX\fR 5
Moves the cursor back \fIcount\fR bytes in the output string. If
\fIcount\fR is \fB*\fR or is larger than the current cursor position,
\fIcount\fR is
.QW \fB*\fR
or is larger than the current cursor position,
then the cursor is positioned at location 0 so that the next byte
stored will be the first byte in the result string. If \fIcount\fR is
omitted then the cursor is moved back one byte. This type does not
consume an argument. For example,
.RS
.PP
.CS
\fBbinary format\fR a3X*a3X2a3 abc def ghi
.CE
.PP
will return \fBdghi\fR.
.RE
.IP \fB@\fR 5
@@ -460,14 +579,22 @@ specified by \fIcount\fR. Position 0 refers to the first byte in the
output string. If \fIcount\fR refers to a position beyond the last
byte stored so far, then null bytes will be placed in the uninitialized
locations and the cursor will be placed at the specified location. If
\fIcount\fR is \fB*\fR, then the cursor is moved to the current end of
\fIcount\fR is
.QW \fB*\fR ,
then the cursor is moved to the current end of
the output string. If \fIcount\fR is omitted, then an error will be
generated. This type does not consume an argument. For example,
.RS
.PP
.CS
\fBbinary format\fR a5@2a1@*a3@10a1 abcde f ghi j
.CE
will return \fBabfdeghi\e000\e000j\fR.
.PP
will return
.PP
.CS
\fBabfdeghi\e000\e000j\fR
.CE
.RE
.SH "BINARY SCAN"
.PP
@@ -489,8 +616,9 @@ argument to obtain the variable into which the scanned values should
be placed. The type character specifies how the binary data is to be
interpreted. The \fIcount\fR typically indicates how many items of
the specified type are taken from the data. If present, the
\fIcount\fR is a non-negative decimal integer or \fB*\fR, which
normally indicates that all of the remaining items in the data are to
\fIcount\fR is a non-negative decimal integer or
.QW \fB*\fR ,
which normally indicates that all of the remaining items in the data are to
be used. If there are not enough bytes left after the current cursor
position to satisfy the current field specifier, then the
corresponding variable is left untouched and \fBbinary scan\fR returns
@@ -504,6 +632,7 @@ is accepted for all field types but is ignored for non-integer fields.
A similar example as with \fBbinary format\fR should explain the
relation between field specifiers and arguments in case of the binary
scan subcommand:
.PP
.CS
\fBbinary scan\fR $bytes s3s first second
.CE
@@ -515,12 +644,15 @@ If \fIbytes\fR contains fewer than 8 bytes (i.e. four 2-byte
integers), no assignment to \fIsecond\fR will be made, and if
\fIbytes\fR contains fewer than 6 bytes (i.e. three 2-byte integers),
no assignment to \fIfirst\fR will be made. Hence:
.PP
.CS
puts [\fBbinary scan\fR abcdefg s3s first second]
puts $first
puts $second
.CE
.PP
will print (assuming neither variable is set previously):
.PP
.CS
1
25185 25699 26213
@@ -532,14 +664,17 @@ It is \fIimportant\fR to note that the \fBc\fR, \fBs\fR, and \fBS\fR
long data size values. In doing this, values that have their high
bit set (0x80 for chars, 0x8000 for shorts, 0x80000000 for ints),
will be sign extended. Thus the following will occur:
.PP
.CS
set signShort [\fBbinary format\fR s1 0x8000]
\fBbinary scan\fR $signShort s1 val; \fI# val == 0xFFFF8000\fR
.CE
.PP
If you require unsigned values you can include the
.QW u
flag character following
the field type. For example, to read an unsigned short value:
.PP
.CS
set signShort [\fBbinary format\fR s1 0x8000]
\fBbinary scan\fR $signShort su1 val; \fI# val == 0x00008000\fR
@@ -550,8 +685,9 @@ reading bytes from the current position. The cursor is initially
at position 0 at the beginning of the data. The type may be any one of
the following characters:
.IP \fBa\fR 5
The data is a byte string of length \fIcount\fR. If \fIcount\fR
is \fB*\fR, then all of the remaining bytes in \fIstring\fR will be
The data is a byte string of length \fIcount\fR. If \fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bytes in \fIstring\fR will be
scanned into the variable. If \fIcount\fR is omitted, then one
byte will be scanned.
All bytes scanned will be interpreted as being characters in the
@@ -560,24 +696,30 @@ needed if the string is not a binary string or a string encoded in ISO
8859\-1.
For example,
.RS
.PP
.CS
\fBbinary scan\fR abcde\e000fghi a6a10 var1 var2
.CE
.PP
will return \fB1\fR with the string equivalent to \fBabcde\e000\fR
stored in \fIvar1\fR and \fIvar2\fR left unmodified, and
.PP
.CS
\fBbinary scan\fR \e342\e202\e254 a* var1
set var2 [encoding convertfrom utf-8 $var1]
.CE
.PP
will store a Euro-currency character in \fIvar2\fR.
.RE
.IP \fBA\fR 5
This form is the same as \fBa\fR, except trailing blanks and nulls are stripped from
the scanned value before it is stored in the variable. For example,
.RS
.PP
.CS
\fBbinary scan\fR "abc efghi \e000" A* var1
.CE
.PP
will return \fB1\fR with \fBabc efghi\fR stored in \fIvar1\fR.
.RE
.IP \fBb\fR 5
@@ -588,13 +730,16 @@ and
.QW 0
characters. The data bytes are scanned in first to last order with
the bits being taken in low-to-high order within each byte. Any extra
bits in the last byte are ignored. If \fIcount\fR is \fB*\fR, then
all of the remaining bits in \fIstring\fR will be scanned. If
bits in the last byte are ignored. If \fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bits in \fIstring\fR will be scanned. If
\fIcount\fR is omitted, then one bit will be scanned. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex07\ex87\ex05 b5b* var1 var2
.CE
.PP
will return \fB2\fR with \fB11100\fR stored in \fIvar1\fR and
\fB1110000110100000\fR stored in \fIvar2\fR.
.RE
@@ -602,9 +747,11 @@ will return \fB2\fR with \fB11100\fR stored in \fIvar1\fR and
This form is the same as \fBb\fR, except the bits are taken in
high-to-low order within each byte. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex70\ex87\ex05 B5B* var1 var2
.CE
.PP
will return \fB2\fR with \fB01110\fR stored in \fIvar1\fR and
\fB1000011100000101\fR stored in \fIvar2\fR.
.RE
@@ -615,13 +762,16 @@ high-to-low order represented as a sequence of characters in the set
The data bytes are scanned in first to last
order with the hex digits being taken in high-to-low order within each
byte. Any extra bits in the last byte are ignored. If \fIcount\fR is
\fB*\fR, then all of the remaining hex digits in \fIstring\fR will be
.QW \fB*\fR ,
then all of the remaining hex digits in \fIstring\fR will be
scanned. If \fIcount\fR is omitted, then one hex digit will be
scanned. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex07\exC6\ex05\ex1f\ex34 H3H* var1 var2
.CE
.PP
will return \fB2\fR with \fB07c\fR stored in \fIvar1\fR and
\fB051f34\fR stored in \fIvar2\fR.
.RE
@@ -629,9 +779,11 @@ will return \fB2\fR with \fB07c\fR stored in \fIvar1\fR and
This form is the same as \fBH\fR, except the digits are taken in
reverse (low-to-high) order within each byte. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex07\ex86\ex05\ex12\ex34 h3h* var1 var2
.CE
.PP
will return \fB2\fR with \fB706\fR stored in \fIvar1\fR and
\fB502143\fR stored in \fIvar2\fR.
.PP
@@ -640,135 +792,151 @@ multiple bytes in order should use the \fBH\fR format.
.RE
.IP \fBc\fR 5
The data is turned into \fIcount\fR 8-bit signed integers and stored
in the corresponding variable as a list. If \fIcount\fR is \fB*\fR,
in the corresponding variable as a list, or as unsigned if \fBu\fR is placed
immediately after the \fBc\fR. If \fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bytes in \fIstring\fR will be scanned. If
\fIcount\fR is omitted, then one 8-bit integer will be scanned. For
example,
.RS
.PP
.CS
\fBbinary scan\fR \ex07\ex86\ex05 c2c* var1 var2
.CE
.PP
will return \fB2\fR with \fB7 -122\fR stored in \fIvar1\fR and \fB5\fR
stored in \fIvar2\fR. Note that the integers returned are signed, but
they can be converted to unsigned 8-bit quantities using an expression
like:
.CS
set num [expr { $num & 0xff }]
.CE
stored in \fIvar2\fR. Note that the integers returned are signed unless
\fBcu\fR in place of \fBc\fR.
.RE
.IP \fBs\fR 5
The data is interpreted as \fIcount\fR 16-bit signed integers
represented in little-endian byte order. The integers are stored in
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
all of the remaining bytes in \fIstring\fR will be scanned. If
represented in little-endian byte order, or as unsigned if \fBu\fR is placed
immediately after the \fBs\fR. The integers are stored in
the corresponding variable as a list. If \fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bytes in \fIstring\fR will be scanned. If
\fIcount\fR is omitted, then one 16-bit integer will be scanned. For
example,
.RS
.PP
.CS
\fBbinary scan\fR \ex05\ex00\ex07\ex00\exf0\exff s2s* var1 var2
.CE
.PP
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
stored in \fIvar2\fR. Note that the integers returned are signed, but
they can be converted to unsigned 16-bit quantities using an expression
like:
.CS
set num [expr { $num & 0xffff }]
.CE
stored in \fIvar2\fR. Note that the integers returned are signed unless
\fBsu\fR is used in place of \fBs\fR.
.RE
.IP \fBS\fR 5
This form is the same as \fBs\fR except that the data is interpreted
as \fIcount\fR 16-bit signed integers represented in big-endian byte
as \fIcount\fR 16-bit integers represented in big-endian byte
order. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex00\ex05\ex00\ex07\exff\exf0 S2S* var1 var2
.CE
.PP
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
stored in \fIvar2\fR.
.RE
.IP \fBt\fR 5
The data is interpreted as \fIcount\fR 16-bit signed integers
represented in the native byte order of the machine running the Tcl
script. It is otherwise identical to \fBs\fR and \fBS\fR.
script, or as unsigned if \fBu\fR is placed
immediately after the \fBt\fR. It is otherwise identical to \fBs\fR and \fBS\fR.
To determine what the native byte order of the machine is, refer to
the \fBbyteOrder\fR element of the \fBtcl_platform\fR array.
.IP \fBi\fR 5
The data is interpreted as \fIcount\fR 32-bit signed integers
represented in little-endian byte order. The integers are stored in
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
all of the remaining bytes in \fIstring\fR will be scanned. If
represented in little-endian byte order, or as unsigned if \fBu\fR is placed
immediately after the \fBi\fR. The integers are stored in
the corresponding variable as a list. If \fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bytes in \fIstring\fR will be scanned. If
\fIcount\fR is omitted, then one 32-bit integer will be scanned. For
example,
.RS
.PP
.CS
set str \ex05\ex00\ex00\ex00\ex07\ex00\ex00\ex00\exf0\exff\exff\exff
\fBbinary scan\fR $str i2i* var1 var2
.CE
.PP
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
stored in \fIvar2\fR. Note that the integers returned are signed, but
they can be converted to unsigned 32-bit quantities using an expression
like:
.CS
set num [expr { $num & 0xffffffff }]
.CE
stored in \fIvar2\fR. Note that the integers returned are signed unless
\fBiu\fR is used in place of \fBi\fR.
.RE
.IP \fBI\fR 5
This form is the same as \fBI\fR except that the data is interpreted
as \fIcount\fR 32-bit signed integers represented in big-endian byte
order. For example,
order, or as unsigned if \fBu\fR is placed
immediately after the \fBI\fR. For example,
.RS
.PP
.CS
set str \ex00\ex00\ex00\ex05\ex00\ex00\ex00\ex07\exff\exff\exff\exf0
\fBbinary scan\fR $str I2I* var1 var2
.CE
.PP
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
stored in \fIvar2\fR.
.RE
.IP \fBn\fR 5
The data is interpreted as \fIcount\fR 32-bit signed integers
represented in the native byte order of the machine running the Tcl
script. It is otherwise identical to \fBi\fR and \fBI\fR.
script, or as unsigned if \fBu\fR is placed
immediately after the \fBn\fR. It is otherwise identical to \fBi\fR and \fBI\fR.
To determine what the native byte order of the machine is, refer to
the \fBbyteOrder\fR element of the \fBtcl_platform\fR array.
.IP \fBw\fR 5
The data is interpreted as \fIcount\fR 64-bit signed integers
represented in little-endian byte order. The integers are stored in
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
all of the remaining bytes in \fIstring\fR will be scanned. If
represented in little-endian byte order, or as unsigned if \fBu\fR is placed
immediately after the \fBw\fR. The integers are stored in
the corresponding variable as a list. If \fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bytes in \fIstring\fR will be scanned. If
\fIcount\fR is omitted, then one 64-bit integer will be scanned. For
example,
.RS
.PP
.CS
set str \ex05\ex00\ex00\ex00\ex07\ex00\ex00\ex00\exf0\exff\exff\exff
\fBbinary scan\fR $str wi* var1 var2
.CE
.PP
will return \fB2\fR with \fB30064771077\fR stored in \fIvar1\fR and
\fB\-16\fR stored in \fIvar2\fR. Note that the integers returned are
signed and cannot be represented by Tcl as unsigned values.
\fB\-16\fR stored in \fIvar2\fR.
.RE
.IP \fBW\fR 5
This form is the same as \fBw\fR except that the data is interpreted
as \fIcount\fR 64-bit signed integers represented in big-endian byte
order. For example,
order, or as unsigned if \fBu\fR is placed
immediately after the \fBW\fR. For example,
.RS
.PP
.CS
set str \ex00\ex00\ex00\ex05\ex00\ex00\ex00\ex07\exff\exff\exff\exf0
\fBbinary scan\fR $str WI* var1 var2
.CE
.PP
will return \fB2\fR with \fB21474836487\fR stored in \fIvar1\fR and \fB\-16\fR
stored in \fIvar2\fR.
.RE
.IP \fBm\fR 5
The data is interpreted as \fIcount\fR 64-bit signed integers
represented in the native byte order of the machine running the Tcl
script. It is otherwise identical to \fBw\fR and \fBW\fR.
script, or as unsigned if \fBu\fR is placed
immediately after the \fBm\fR. It is otherwise identical to \fBw\fR and \fBW\fR.
To determine what the native byte order of the machine is, refer to
the \fBbyteOrder\fR element of the \fBtcl_platform\fR array.
.IP \fBf\fR 5
The data is interpreted as \fIcount\fR single-precision floating point
numbers in the machine's native representation. The floating point
numbers are stored in the corresponding variable as a list. If
\fIcount\fR is \fB*\fR, then all of the remaining bytes in
\fIcount\fR is
.QW \fB*\fR ,
then all of the remaining bytes in
\fIstring\fR will be scanned. If \fIcount\fR is omitted, then one
single-precision floating point number will be scanned. The size of a
floating point number may vary across architectures, so the number of
@@ -777,9 +945,11 @@ valid floating point number, the resulting value is undefined and
compiler dependent. For example, on a Windows system running on an
Intel Pentium processor,
.RS
.PP
.CS
\fBbinary scan\fR \ex3f\excc\excc\excd f var1
.CE
.PP
will return \fB1\fR with \fB1.6000000238418579\fR stored in
\fIvar1\fR.
.RE
@@ -799,9 +969,11 @@ as \fIcount\fR double-precision floating point numbers in the
machine's native representation. For example, on a Windows system
running on an Intel Pentium processor,
.RS
.PP
.CS
\fBbinary scan\fR \ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f d var1
.CE
.PP
will return \fB1\fR with \fB1.6000000000000001\fR
stored in \fIvar1\fR.
.RE
@@ -817,28 +989,36 @@ order. This conversion is not portable to the minority of systems not
using IEEE floating point representations.
.IP \fBx\fR 5
Moves the cursor forward \fIcount\fR bytes in \fIstring\fR. If
\fIcount\fR is \fB*\fR or is larger than the number of bytes after the
\fIcount\fR is
.QW \fB*\fR
or is larger than the number of bytes after the
current cursor position, then the cursor is positioned after
the last byte in \fIstring\fR. If \fIcount\fR is omitted, then the
cursor is moved forward one byte. Note that this type does not
consume an argument. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex01\ex02\ex03\ex04 x2H* var1
.CE
.PP
will return \fB1\fR with \fB0304\fR stored in \fIvar1\fR.
.RE
.IP \fBX\fR 5
Moves the cursor back \fIcount\fR bytes in \fIstring\fR. If
\fIcount\fR is \fB*\fR or is larger than the current cursor position,
\fIcount\fR is
.QW \fB*\fR
or is larger than the current cursor position,
then the cursor is positioned at location 0 so that the next byte
scanned will be the first byte in \fIstring\fR. If \fIcount\fR
is omitted then the cursor is moved back one byte. Note that this
type does not consume an argument. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex01\ex02\ex03\ex04 c2XH* var1 var2
.CE
.PP
will return \fB2\fR with \fB1 2\fR stored in \fIvar1\fR and \fB020304\fR
stored in \fIvar2\fR.
.RE
@@ -849,9 +1029,11 @@ by \fIcount\fR. Note that position 0 refers to the first byte in
\fIstring\fR, then the cursor is positioned after the last byte. If
\fIcount\fR is omitted, then an error will be generated. For example,
.RS
.PP
.CS
\fBbinary scan\fR \ex01\ex02\ex03\ex04 c2@1H* var1 var2
.CE
.PP
will return \fB2\fR with \fB1 2\fR stored in \fIvar1\fR and \fB020304\fR
stored in \fIvar2\fR.
.RE
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH break n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
+88
View File
@@ -0,0 +1,88 @@
'\"
'\" Copyright (c) 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 callback n 0.3 TclOO "TclOO Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
callback, mymethod \- generate callbacks to methods
.SH SYNOPSIS
.nf
package require TclOO
\fBcallback\fR \fImethodName\fR ?\fIarg ...\fR?
\fBmymethod\fR \fImethodName\fR ?\fIarg ...\fR?
.fi
.BE
.SH DESCRIPTION
The \fBcallback\fR command,
'\" Based on notes in the tcllib docs, we know the provenance of mymethod
also called \fBmymethod\fR for compatibility with the ooutil and snit packages
of Tcllib,
and which should only be used from within the context of a call to a method
(i.e. inside a method, constructor or destructor body) is used to generate a
script fragment that will invoke the method, \fImethodName\fR, on the current
object (as reported by \fBself\fR) when executed. Any additional arguments
provided will be provided as leading arguments to the callback. The resulting
script fragment shall be a proper list.
.PP
Note that it is up to the caller to ensure that the current object is able to
handle the call of \fImethodName\fR; this command does not check that.
\fImethodName\fR may refer to any exported or unexported method, but may not
refer to a private method as those can only be invoked directly from within
methods. If there is no such method present at the point when the callback is
invoked, the standard \fBunknown\fR method handler will be called.
.SH EXAMPLE
This is a simple echo server class. The \fBcallback\fR command is used in two
places, to arrange for the incoming socket connections to be handled by the
\fIAccept\fR method, and to arrange for the incoming bytes on those
connections to be handled by the \fIReceive\fR method.
.PP
.CS
oo::class create EchoServer {
variable server clients
constructor {port} {
set server [socket -server [\fBcallback\fR Accept] $port]
set clients {}
}
destructor {
chan close $server
foreach client [dict keys $clients] {
chan close $client
}
}
method Accept {channel clientAddress clientPort} {
dict set clients $channel [dict create \e
address $clientAddress port $clientPort]
chan event $channel readable [\fBcallback\fR Receive $channel]
}
method Receive {channel} {
if {[chan gets $channel line] >= 0} {
my echo $channel $line
} else {
chan close $channel
dict unset clients $channel
}
}
method echo {channel line} {
dict with clients $channel {
chan puts $channel \e
[format {[%s:%d] %s} $address $port $line]
}
}
}
.CE
.SH "SEE ALSO"
chan(n), fileevent(n), my(n), self(n), socket(n), trace(n)
.SH KEYWORDS
callback, object
.\" Local Variables:
.\" mode: nroff
.\" fill-column: 78
.\" End:
+1 -1
View File
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
.TH case n 7.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
-6
View File
@@ -56,9 +56,7 @@ When the return code from evaluation of \fIscript\fR is
\fBTCL_ERROR\fR, four additional entries are defined in the dictionary
of return options stored in \fIoptionsVarName\fR: \fB\-errorinfo\fR,
\fB\-errorcode\fR, \fB\-errorline\fR, and
.VS 8.6
\fB\-errorstack\fR.
.VE 8.6
The value of the \fB\-errorinfo\fR entry is a formatted stack trace containing
more information about the context in which the error happened. The formatted
stack trace is meant to be read by a person. The value of the
@@ -67,7 +65,6 @@ list. The \fB\-errorcode\fR value is meant to be further processed by
programs, and may not be particularly readable by people. The value of the
\fB\-errorline\fR entry is an integer indicating which line of \fIscript\fR
was being evaluated when the error occurred.
.VS 8.6
The value of the \fB\-errorstack\fR entry is an
even-sized list made of token-parameter pairs accumulated while
unwinding the stack. The token may be
@@ -87,14 +84,11 @@ the static text of the calling sites, and
.IP [3]
it is coarser-grained, with only one element per stack frame (like procs; no
separate elements for \fBforeach\fR constructs for example).
.VE 8.6
.PP
The values of the \fB\-errorinfo\fR and \fB\-errorcode\fR entries of
the most recent error are also available as values of the global
variables \fB::errorInfo\fR and \fB::errorCode\fR respectively.
.VS 8.6
The value of the \fB\-errorstack\fR entry surfaces as \fBinfo errorstack\fR.
.VE 8.6
.PP
Tcl packages may provide commands that set other entries in the
dictionary of return options, and the \fBreturn\fR command may be

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