Compare commits

..
Author SHA1 Message Date
jan.nijtmans a13bb5c7e5 Merge 9.0. Further Makefile tweaks 2023-05-03 16:12:46 +00:00
jan.nijtmans 881b147ab5 Merge 8.7 2023-05-03 15:59:09 +00:00
jan.nijtmans b583ea7360 Backport "Comments only. Fix blatantly obsolete ones". And a few more improvements from the same files. 2023-05-03 15:51:10 +00:00
pointsman d40bb9d13a Removed the bug specific test constraint from the tests related to [0306a5563c] because the bug is fixed. 2023-05-03 15:18:17 +00:00
apnadkarni 06cc962945 Comments only. Fix blatantly obsolete ones 2023-05-03 10:01:50 +00:00
pooryorick 88760a8a81 Use Tcl_Size instead of ptrdiff_t in Tcl_ObjCmdProc2(), Tcl_CmdObjTraceProc2, and Tcl_MethodCallProc2(). 2023-05-03 09:31:08 +00:00
apnadkarni aa4247d47b Merge mark 8.7 2023-05-03 04:06:28 +00:00
apnadkarni 81b4fa2fbd Changed CHANNEL_PROFILE_* to ENCODING_PROFILE_* and moved out of tclIO.h. See below.
For whatever reason, these macros were renamed and moved to tclIO.h post-660. This is
inappropriate as those macros deal with *encoding* flags, not *channel* flags and have
relevance outside of I/O making their renaming inappropriate. Further putting them in tclIO.h
forces inclusion of that header in modules that do not otherwise need that header.
2023-05-03 04:03:36 +00:00
apnadkarni 7b688527d7 Changed CHANNEL_PROFILE_* to ENCODING_PROFILE_* and moved out of tclIO.h. See below.
For whatever reason, these macros were renamed and moved to tclIO.h post-660.
This is inappropriate as those macros deal with *encoding* flags, not *channel*
flags and have relevance outside of I/O making their renaming inappropriate. Further
putting them in tclIO.h forces inclusion of that header in modules that do not
otherwise need that header.
2023-05-03 03:31:49 +00:00
pointsman 41aa17e389 Fix for [0306a5563c]. 2023-05-02 22:11:28 +00:00
pointsman 84d939b69a Fix for [0306a5563c]. 2023-05-02 21:50:48 +00:00
apnadkarni 60ba166da0 Merge 8.7 fix [784befb0ba] - tailcall crash 2023-05-02 17:06:38 +00:00
apnadkarni 2dccd2a567 Merge 8.6 - [ab123cfd3d] and [784befb0ba] 2023-05-02 16:48:57 +00:00
apnadkarni df75b91956 Fix [ab123cfd3d] - scan ubsan. Tx chrstphrchvz for patch 2023-05-02 16:33:39 +00:00
apnadkarni 43b5729ddf Fix [784befb0ba] - tailcall crash 2023-05-02 16:08:30 +00:00
apnadkarni 03d0f99e6c Fix [bb69c8d17e] compiled string last 2023-05-02 08:42:21 +00:00
jan.nijtmans 28e5ec7db6 Add missing "deprecated" constraint 2023-05-01 15:50:02 +00:00
apnadkarni b6bc736eee Tests for [dcac54a685] 2023-05-01 12:39:43 +00:00
apnadkarni fe84f70800 Tests for [ad9361fd20] 2023-05-01 12:16:44 +00:00
apnadkarni c77055a803 Fix [d07f42998d] - argument list truncation 2023-05-01 11:41:48 +00:00
apnadkarni 3b426fffa1 Fix [ab123cfd3d] - ubsan warning in ValidateFormat 2023-05-01 10:38:12 +00:00
apnadkarni 782009ca67 Fix [ab123cfd3d] - ubsan scan warning. 2023-05-01 06:51:51 +00:00
apnadkarni e1f2905dbc Added missing bigdata constraint 2023-05-01 06:41:25 +00:00
jan.nijtmans dd6950d635 Merge 8.7 2023-04-30 19:21:50 +00:00
jan.nijtmans c3cb435cf4 Fix OPTS=utf16 build for Tcl 9.0 2023-04-30 19:03:12 +00:00
jan.nijtmans 6c4b78cfa8 Eliminate ListSizeT_MAX, since it's the same as TCL_SIZE_MAX 2023-04-30 17:32:25 +00:00
jan.nijtmans 75eea66ef7 Add testcase for TclGetBytesFromObj() 2023-04-30 12:32:20 +00:00
jan.nijtmans 251211e714 Don't test compatibility macro's when TCL_NO_DEPRECATED is defined: this is expected to fail 2023-04-30 12:02:38 +00:00
apnadkarni e313582726 Fix [27b3ce2997] - check INT_MAX limit on script length 2023-04-30 10:20:19 +00:00
apnadkarni a06189323f Fix one more error message for max arg limit 2023-04-30 09:54:16 +00:00
apnadkarni 93f06f4469 Working on [d07f42998d] 2023-04-30 08:08:24 +00:00
apnadkarni 6c973cf9a2 Add tests. Panic on bytecode length limit 2023-04-29 16:16:58 +00:00
jan.nijtmans e393e2694c Add experimental testcase for TclGetBytesFromObj() 2023-04-29 16:10:56 +00:00
jan.nijtmans 1645895629 Eliminate ListSizeT_MAX, since it's the same as TCL_SIZE_MAX 2023-04-29 15:20:12 +00:00
jan.nijtmans ef51b5aacd Resolve a TODO 2023-04-29 14:56:13 +00:00
jan.nijtmans 905633199c Merge 8.7 2023-04-29 14:50:50 +00:00
pointsman 4d289b8084 Updated from trunk. Simplified bug specific tests. 2023-04-29 14:11:36 +00:00
apnadkarni 85a2a91729 Fix [7cddd2845c] - crash with >= INT_MAX operands 2023-04-29 03:15:11 +00:00
apnadkarni 947e3f8405 Limit scripts to INT_MAX-1 bytes 2023-04-29 02:11:48 +00:00
jan.nijtmans ad7deae634 Remove some (void *) typecasts, which are no longer necessary 2023-04-28 15:02:09 +00:00
pooryorick a6d654980e Limit memset() to "TCL_UTF_MAX=3' builds. 2023-04-28 06:43:49 +00:00
pooryorick 2fae9f1746 Add bytearray checking to TclCheckEmptyString(), and then use
TclCheckEmptyString() in Tcl_AppendObjToObj and TclStringCat() to reduce string
generation.
2023-04-27 20:54:21 +00:00
pooryorick 5eb2064b63 Fix for [f5eadcbf9a6b1b4c], passing pointer to uninitialized memory leads
Tcl_UniCharToUtf() to corrupt data.
2023-04-27 20:42:04 +00:00
pooryorick 7f433932f6 memset(0xff) instead of memset(0) to accomodate tests that fill buffer with
0xff.
2023-04-27 20:34:22 +00:00
jan.nijtmans 2e9301202d More size_t -> Tcl_Size, missed by earlier updates 2023-04-27 14:01:37 +00:00
jan.nijtmans 8bfaaa8337 Simplify Tcl 9 compatibility macro's. No change in functionality. 2023-04-27 13:52:42 +00:00
apnadkarni 175931c905 Merge trunk 2023-04-27 13:34:55 +00:00
apnadkarni 18f61eeeeb More checks for exceeding max words 2023-04-27 12:47:08 +00:00
jan.nijtmans 54b8f46097 RingSizeT -> Tcl_Size 2023-04-26 20:24:01 +00:00
jan.nijtmans 372bf74334 Reduce number of needed type-casts. No change in functionality 2023-04-26 19:29:44 +00:00
griffin f9f1724b36 Fix index descrepencies (bug-fa00fbbbabe).
Fix inconsistent rounding (bug-e5f06285de).
2023-04-26 16:18:04 +00:00
jan.nijtmans cd51753d86 More size_t -> Tcl_Size changes, which were missed before. Also (experimental) make the wrapper macro's produce compiler warnings is Tcl_Size is not used. 2023-04-26 15:53:40 +00:00
apnadkarni f227a5d1ff Test fix for [0f98bce669] 2023-04-26 15:45:12 +00:00
apnadkarni 5ddcd8fea9 Fix for [7cddd2845c] (in progress) 2023-04-26 14:56:21 +00:00
jan.nijtmans fe4e51b427 Merge 8.7 2023-04-26 06:51:52 +00:00
jan.nijtmans bd259695f1 Merge 8.6 2023-04-26 06:49:22 +00:00
jan.nijtmans e5eeaadf3c Don't refer to CVS any more 2023-04-26 06:40:14 +00:00
griffin 3aaf8c0544 merge trunk, address some 32-bit issues. 2023-04-26 03:41:57 +00:00
pooryorick 76130df460 Fix for issue [f5eadcbf9a], passing pointer to uninitialized memory leads
Tcl_UniCharToUtf() to corrupt data.
2023-04-25 20:34:03 +00:00
griffin da6df4adde Add fix inconsistent rounding (bug-e5f06285de).
Compute and use the "precision" for sequences of doubles: determine the number of significant digits in the fractional part of the given arguments, and round the results to that limit.
Fix copy bug in DupArithSeriesInternalRep.
2023-04-25 00:36:30 +00:00
pointsman 1ddccee9d3 Added a test for the initial problem and another for the known remaining problem. 2023-04-24 20:21:42 +00:00
pointsman 48570b93a6 Merge trunk. 2023-04-24 20:09:40 +00:00
apnadkarni 025b74f7c7 Fix [2e3fed53ba] - binary encode uuencode 2023-04-24 17:46:14 +00:00
apnadkarni 51043c29db Fix [c719fa8716] - binary encode base64 assertion failure 2023-04-24 17:16:58 +00:00
apnadkarni 553caf0d2c Fix [9369f83649] - binary format/scan for big data 2023-04-24 16:49:34 +00:00
apnadkarni 87e417c1a1 Fix [a814ee5bbd] - string compare/equal -length for long strings 2023-04-24 16:28:21 +00:00
dgp e95eb57666 Adapt signature of TclCompileScript() to fit better after TIP 660. 2023-04-24 15:51:00 +00:00
apnadkarni 3a9a817f67 Fix [d4ede611a7] - scan bigdata 2023-04-24 14:51:20 +00:00
dgp 277effbc04 TIP 422 eliminated va_list arguments from the API of Tcl 9.
However, some of the documentation lingered on.  No more.
2023-04-24 14:22:07 +00:00
apnadkarni 9f102b5b85 Minor change to length limit checks 2023-04-24 13:54:33 +00:00
apnadkarni 642792b1c2 Fix [a550f9710b] (format bigdata) 2023-04-24 12:55:35 +00:00
apnadkarni ef5af05366 Fix for bug [d4ede611a7] (scan) 2023-04-24 10:02:23 +00:00
pointsman 439a4360b3 Fixes the examples given in [0306a5563c]. Still more to do for a full fix. 2023-04-24 09:41:04 +00:00
pooryorick 321bff2cd5 Add bytearray checking to TclCheckEmptyString(), and then use
TclCheckEmptyString() in Tcl_AppendObjToObj and TclStringCat() to reduce string
generation.
2023-04-23 23:57:17 +00:00
jan.nijtmans d252076f75 Missing !defined(TCL_NO_DEPRECATED) around TIP #616 macro's. Thanks Rolf for noticing! 2023-04-23 21:59:34 +00:00
pooryorick eb3390224b Add bytearray checking to TclCheckEmptyString(), and then use
TclCheckEmptyString() in Tcl_AppendObjToObj and TclStringCat() to reduce string
generation.

jn: See discussion on mailing list "On the changing the sourcing of scripts to using strict profiles by default" for explanation why this commit is wrong, just as [e6fe76ae6b] and [4a7b807856] (which are similar commits, disguised as different ones).
2023-04-23 11:28:19 +00:00
jan.nijtmans adab48a862 Support combination TCL_UTF_MAX=3 with TCL_NO_DEPRECATED=1 2023-04-23 10:41:40 +00:00
jan.nijtmans 11048e958a Remove TCL_8_COMPAT. No longer necessesary, because of TIP #660 2023-04-23 10:31:18 +00:00
jan.nijtmans f87dbfe42e Backout [3016169b6f], since TIP #657 (Make "-profile strict" the default in Tcl 9.0) is not accepted yet. And when it's accepted, this change won't be necessary any more. 2023-04-23 08:56:48 +00:00
jan.nijtmans dd36d764b7 Backout [e6fe76ae6b]. See build failure with -DTCL_UTF_MAX=3 [https://github.com/tcltk/tcl/actions/runs/4777092335/jobs/8492557766] 2023-04-23 08:53:23 +00:00
apnadkarni 2b41b2d12b Fix gcc type mismatch warnings exposed by disabling casts using disabletcl8api 2023-04-23 08:13:11 +00:00
apnadkarni 6f566fc406 Merge trunk 2023-04-23 07:24:49 +00:00
apnadkarni 9cd23041f3 Merge 8.7 - [d90fee06d0] (lassign) and [203792a48c] (Utf32ToUtf) 2023-04-23 05:23:01 +00:00
apnadkarni 00afea1c26 Bug [d90fee06d0] - lassign performance 2023-04-23 04:18:20 +00:00
apnadkarni f5125db22b Bug [d4ede611a7] (scan) - in progress 2023-04-23 03:25:33 +00:00
pooryorick 08d2d4c09b Make Tcl_AppendObjToObj avoid string generation in a couple more circumstances,
and edit some documentation and comments.
2023-04-22 22:49:50 +00:00
jan.nijtmans f14ee8d1bb Fix [203792a48c]: Avoid signed integer overflow in Utf32ToUtfProc() 2023-04-22 17:55:36 +00:00
jan.nijtmans d425f04462 Merge 8.7 2023-04-22 17:34:11 +00:00
jan.nijtmans c90b84b116 Fill in URL in previous commit 2023-04-22 17:32:52 +00:00
jan.nijtmans 8da10bea0f Register "utf32string" for Python 2023-04-22 17:31:50 +00:00
jan.nijtmans 9ec33349d5 Fix tclTomMath.h (from prev commit) 2023-04-22 17:29:49 +00:00
jan.nijtmans 556c3fc35b Fix [2a5cb49733ff]: Make TCL_NO_TOMMATH_H sufficient for tclTomMathDecls.h 2023-04-22 16:34:56 +00:00
jan.nijtmans 39180cad0e Backout [4a7b807856], It breaks the build. See: [https://github.com/tcltk/tcl/actions/runs/4771586851/jobs/8483606969] 2023-04-22 16:29:07 +00:00
apnadkarni 4402cae446 Use TclListObjRange in lassign for performance reasons 2023-04-22 10:04:53 +00:00
jan.nijtmans 79af33ce68 Merge 8.7 2023-04-21 20:39:19 +00:00
pooryorick a3380d8151 Make Tcl_AppendObjToObj more efficient and avoid unnecessarily generating a
string representation when the object to append to is the empty string.
2023-04-21 20:32:38 +00:00
jan.nijtmans b58023ffa1 Since Tcl_GetSizeIntFromObj is the same as Tcl_GetIntFromObj (in 8.7), it's not worth to spend a stub entry for it 2023-04-21 20:32:26 +00:00
jan.nijtmans e3e6c33969 Add testcases 2023-04-21 20:26:08 +00:00
jan.nijtmans 1fe7d754ed Reduce diff between 8.7 and 9.0. Add some testcases 2023-04-21 20:18:54 +00:00
apnadkarni d39298874a Fix gcc warning about format specifier in error message 2023-04-21 10:07:08 +00:00
pooryorick b794cb03e1 Set the encoding profile to strict in Tcl_FSEvalFileEx(). 2023-04-21 09:19:51 +00:00
apnadkarni c7f27e3c87 Fix warnings generated on disable8api builds 2023-04-21 06:16:53 +00:00
apnadkarni e86259d193 Create new branch named "apn-disabletcl8api-warnings" 2023-04-21 04:56:16 +00:00
griffin 6ca1315df1 merge trunk 2023-04-21 00:35:20 +00:00
griffin b807564e68 sync with trunk. Fix lseq size bugs. 2023-04-20 18:13:36 +00:00
apnadkarni c091b78af6 Bugs [4ce858a049] (lrepeat), [f4d15772f1] (foreach), [6926a21840] (lmap). 2023-04-20 16:44:49 +00:00
dgp e359627a36 TIP 660 changes to stop warnings in --enable-symbols=mem build. 2023-04-19 19:36:40 +00:00
apnadkarni f22a5b57f7 Fix [a4617c8e90] - lsearch index truncation 2023-04-19 15:49:13 +00:00
apnadkarni 883924f1e8 Minor doc corrections 2023-04-19 14:33:40 +00:00
apnadkarni 11b8f6eb00 Fix [3c04fcdd1a] - join truncates large lists 2023-04-19 13:21:56 +00:00
apnadkarni f6830a72ec Merge apn-bigdata-tests 2023-04-19 09:49:01 +00:00
apnadkarni ae3ae231d0 Merge trunk 2023-04-19 09:18:32 +00:00
apnadkarni d4dd40b364 Merge mark with 8.7 TIP 660 manpages 2023-04-19 05:50:25 +00:00
apnadkarni 4c6600039e Fix a few function signatures in manpages for TIP 660. 2023-04-19 05:49:37 +00:00
apnadkarni f3d3725e39 Merge mark with 8.7 TIP 660 changes 2023-04-19 05:21:45 +00:00
apnadkarni 21d90d4f4a TIP 660 accepted 2023-04-19 05:18:04 +00:00
apnadkarni 2f2003c490 Merge 8.7 2023-04-19 04:45:14 +00:00
apnadkarni b98b8f9181 Fix dltest on Unix 2023-04-19 04:20:19 +00:00
apnadkarni aab1aa08f0 Fix missing stddef.h include 2023-04-19 04:00:00 +00:00
apnadkarni e90011ea91 TIP 660 accepted. 2023-04-19 03:36:43 +00:00
apnadkarni f42b2cef2a Pick up lreplace.test and lseq.test from tip-660-with-trunk-testcases 2023-04-19 02:32:33 +00:00
apnadkarni ddefa6b172 Merge trunk 2023-04-19 02:00:26 +00:00
pooryorick 9a3cd17eb7 In DoReadChars() reset CHANNEL_ENCODING_ERROR instead of CHANNEL_BLOCKED. 2023-04-18 22:35:58 +00:00
pooryorick df0ddd7b9b Fix for [25cdcb7e8fb381fb]: Incomplete utf-8 sequence followed by eofchar
results in failed assertion.
2023-04-18 22:00:10 +00:00
pooryorick fdaffbc402 Eliminate unnecessary clearance of CHANNEL_STICKY_EOF flag. 2023-04-18 21:16:24 +00:00
jan.nijtmans 5cb63f12bd Almost a merge-mark, just remove one (size_t) cast. 2023-04-18 19:43:37 +00:00
jan.nijtmans 49cfc0317e Adapt TIP's #494/#481/#537/#544/#568/#616/#623/#627/#630 to TIP #660 changes 2023-04-18 19:42:02 +00:00
apnadkarni d87bc3c2f0 Merge trunk 2023-04-18 16:47:40 +00:00
jan.nijtmans b30e837f58 Merge 8.7 2023-04-18 15:46:15 +00:00
jan.nijtmans db8e59ed80 Add TCL_T_MODIFIER (from TIP #660). Some header-file clean-up. 2023-04-18 15:23:33 +00:00
pooryorick 870ad938f7 Correct CHANNEL_BLOCKED to CHANNEL_ENCODING_ERROR in Tcl_GetsObj(). 2023-04-18 10:47:46 +00:00
apnadkarni c37a94290c Fix io-75.1{4,5} on Windows. Ticket [a7a89d422a] 2023-04-18 05:18:52 +00:00
apnadkarni 60c1da90cc Merge trunk 2023-04-18 02:55:05 +00:00
pooryorick 6f003899fe Make encoding profile explicit in some tests. 2023-04-17 22:01:17 +00:00
jan.nijtmans 75f7e5328a Plug memory leak caused by [46e7091a77b71ed7|this] commit 2023-04-17 20:03:38 +00:00
pooryorick e08e6f2733 Correct some test descriptions in encoding.test. 2023-04-17 12:12:42 +00:00
pooryorick 87df69042c Fix for [eabcbd08274f2d22], [read] error persists on channel with strict
encoding after encoding is changed to binary.
2023-04-16 23:10:16 +00:00
griffin 2aed8b1bdf Fix bug-fa00fbbbabe - seq / lindex discrepancies
Replace macros with static inline functions.
Limit ArithSeries list size to LIST_MAX. This way, shimmering less likely to fail if it happens.
Speed up UpdateStringOfArithSeries.
Fixed issues around indexing into vary large lseq lists.
2023-04-16 18:36:18 +00:00
jan.nijtmans 0ceb73f34c Merge 8.7 2023-04-16 18:08:08 +00:00
jan.nijtmans 61722ce13d Remove unneeded ENCODING_UTF flags 2023-04-16 18:07:22 +00:00
jan.nijtmans 249b57ef37 some spelling corrections 2023-04-16 17:58:44 +00:00
apnadkarni a9974c36d0 size_t -> ptrdiff_t to match Tcl 9 unsigned->signed change 2023-04-16 17:31:58 +00:00
apnadkarni e645e12652 Update manpages for TIP 660. Also one size_t -> Tcl_Size change in public API 2023-04-16 17:05:07 +00:00
pooryorick 898f354492 Remove unneeded ENCODING_UTF flags. 2023-04-16 14:16:51 +00:00
pooryorick 4655526dd7 Fix mistake in test io-75.14 and make some spelling corrections. 2023-04-16 12:58:24 +00:00
apnadkarni cceb3ebdde Merge core-8-branch 2023-04-16 10:55:42 +00:00
apnadkarni c899e77701 Merge trunk 2023-04-16 08:01:49 +00:00
apnadkarni ad32d6ed76 Merge trunk 2023-04-16 07:55:08 +00:00
apnadkarni 713ccc8bb6 Fix VC++ unused variable warning, lappend and join. 2023-04-16 05:44:19 +00:00
jan.nijtmans b37682866b Fix indenting 2023-04-15 22:11:48 +00:00
jan.nijtmans 9224a1a6c2 Fix SetResult doc 2023-04-15 19:50:28 +00:00
jan.nijtmans 8248b84e17 Merge 8.7 2023-04-15 19:13:01 +00:00
jan.nijtmans f64db5dae2 Merge 8.6 2023-04-15 19:11:35 +00:00
jan.nijtmans 52425dcf5d Add one more unused stub entry 2023-04-15 19:09:41 +00:00
jan.nijtmans 7882365428 Backout fix for [718de2132f487cf2]: It breaks on MacOS and other systems which don't support the --strip-unneeded option 2023-04-15 19:02:44 +00:00
pooryorick 7962f209ac Extend test io-75.15 to read invalid bytes in binary mode and then use [gets]
to retrieve last two lines.
2023-04-15 13:25:28 +00:00
pooryorick afacee3f07 Fix for [a7a89d422a4f5dd3], Under strict encoding, [gets] returns an error instead of returning the second line.
Also, ensure that position in file does not change if [gets] return an error.
2023-04-15 11:54:27 +00:00
apnadkarni e8326222de Add missing constraint to string-equal/compare test 2023-04-15 02:10:23 +00:00
jan.nijtmans b52ee10fc7 Merge 8.7 2023-04-14 21:42:54 +00:00
jan.nijtmans f82e6059dc int -> Tcl_Size where appropriate in tcl.decls (reducing the diff against Tcl 9.0) 2023-04-14 21:40:50 +00:00
apnadkarni aff6cc9141 Fixed bug-a498006438 2023-04-14 15:07:27 +00:00
apnadkarni 0db2f11f15 Merge trunk 2023-04-14 15:01:18 +00:00
pooryorick 810eabe0ef Fix for issue [718de2132f487cf2], "review use of strip on the stubs library". 2023-04-14 11:49:36 +00:00
pooryorick 3ecc8df3dc Fix for issue [718de2132f487cf2], "review use of strip on the stubs library". 2023-04-14 11:46:27 +00:00
pooryorick 0000e98387 Fix for issue [718de2132f487cf2], "review use of strip on the stubs library". 2023-04-14 11:40:11 +00:00
pooryorick c8259f4fec New test for [gets] with strict encoding. Also add "\" in io-76.9, missing in
last commit.
2023-04-14 09:19:32 +00:00
pooryorick d3bb4906d1 Fix for [0cd1ae596e709259], under strict encoding, [gets] returns an error even
though a complete line is available.
2023-04-14 07:21:48 +00:00
apnadkarni ec63738e5c Merge trunk 2023-04-14 03:24:42 +00:00
apnadkarni dcd5ea5b91 Finish up list tests. Add testbigdata dict command for generating dicts 2023-04-14 03:06:44 +00:00
apnadkarni d8c2bafa2c Few more bigdata tests 2023-04-13 18:05:00 +00:00
jan.nijtmans f7c3a98827 Re-generate unix/configure 2023-04-13 16:58:03 +00:00
jan.nijtmans ee84d52e39 Re-generate unix/configure 2023-04-13 16:56:57 +00:00
jan.nijtmans 50f141d888 re-generate unix/configure 2023-04-13 16:55:51 +00:00
pooryorick d5619e30fe Rewrite documentation file SetResult.3 2023-04-13 14:31:49 +00:00
jan.nijtmans 4307d0a739 Follow-up to previous commit: Let's not break TIP #627 either. Also adapt documentation (will be needed to be done anyway) 2023-04-13 14:02:23 +00:00
jan.nijtmans 12b3b1ee00 Allow Tcl build without the Tcl 8 compat API. Derived from "disabletcl8api" branch (thanks, Rolf), but using the already existing -DTCL_NO_DEPRECATED (in Makefile) or CHECKS=nodep (makefile.vc)
Since there are Github Action builds with -DTCL_NO_DEPRECATED/CHECKS=nodep, we cannot use the Tcl 8 compat API in the core code itself any more.
2023-04-13 13:13:13 +00:00
pooryorick e40a0e13a8 Clean up Tcl_SetObjResult(). 2023-04-13 10:20:21 +00:00
pooryorick a1021c091c Remove unnecessary reference count bump in Tcl_ReadObjCmd(). 2023-04-13 09:18:53 +00:00
pooryorick a6754db559 Remove last reference to -nocomplainencoding and fix some spelling errors. 2023-04-13 07:16:20 +00:00
jan.nijtmans c3cfa1176e Merge 8.7 2023-04-13 06:18:24 +00:00
jan.nijtmans 023ceb178d cherry-pick from trunk: Remove one unnecesary call to Tcl_SetErrno() in DoReadChars(). 2023-04-13 06:16:05 +00:00
apnadkarni bce26daa76 Fix compilation on macos, test loading on mingw 2023-04-13 02:40:00 +00:00
pooryorick ca227dbb84 Remove one unnecesary call to Tcl_SetErrno() in DoReadChars(). 2023-04-13 00:12:08 +00:00
pooryorick 54ad113891 Correct the documentation of Tcl_SetObjLength. 2023-04-12 20:39:38 +00:00
pooryorick 7d767c4cb9 Remove unnecessary generation of string representation in DoReadChars. 2023-04-12 20:39:00 +00:00
jan.nijtmans f3ea1d46e1 merge-mark 2023-04-12 20:06:23 +00:00
jan.nijtmans 4518ee9a6d Cherry-pick: Rearrange code blocks in DoReadChars to do less work when returning early 2023-04-12 19:52:38 +00:00
pooryorick 786549398b Rearrange code blocks in DoReadChars to do less work when returning early. 2023-04-12 18:37:24 +00:00
jan.nijtmans ae5de56339 merge-mark 2023-04-12 18:19:37 +00:00
jan.nijtmans e4749b5f32 Some more int -> Tcl_Size (which is actually the same in 8.7). Backported from 9.0 2023-04-12 18:17:43 +00:00
apnadkarni b4542dd058 Test cases for more failures 2023-04-12 17:08:02 +00:00
pooryorick b77f43bb11 Correct spelling errors in comments and documentation, but also a non-comment corrections in history.tcl and tcltest.test. 2023-04-12 14:25:41 +00:00
jan.nijtmans 83677a47e7 merge-mark 2023-04-12 13:54:15 +00:00
jan.nijtmans 3d91df2489 More int -> Tcl_Size, so (theoretically) longer lists could be handled. Thanks, Rolf! 2023-04-12 13:51:33 +00:00
pooryorick 2456020044 Undo spelling corrections in compat/zlib. 2023-04-12 13:36:17 +00:00
pooryorick cf6c56c88d Correct spelling errors in comments and documentation, but also a non-comment
corrections in history.tcl and tcltest.test.
2023-04-12 13:30:39 +00:00
jan.nijtmans 55375d0dfe 2 more spelling fixes, but undo fixes in compat/zlib: Please report them upstream, otherwise they will re-appear here every time zlib is updated to a newer version. 2023-04-12 12:48:12 +00:00
pooryorick 3b742b785e Correct spelling errors in comments and documentation, but also non-comment
corrections in history.tcl and tcltest.test.
2023-04-12 09:35:08 +00:00
jan.nijtmans a0d8d381c1 Merge 8.7 2023-04-12 09:11:21 +00:00
jan.nijtmans b571892e4f int -> Tcl_Size for tclWinDde.c/tclWinReg.c, so it could (theoretically) handle larger lists in Tcl 9. 2023-04-12 09:10:26 +00:00
jan.nijtmans 9c0541d0e4 Fix [0b9200888e]: TIP #660 breaks TIP #628/#630 2023-04-12 08:58:03 +00:00
jan.nijtmans bee240eab0 Proposed fix for [0b9200888e]: TIP #660 breaks TIP #628/#630 2023-04-11 22:50:40 +00:00
pointsman 4d067d1cdf Merged disabletcl8api-win in. Which adds optional Tcl 9 API only to the windows build with native tools. And fixed the error with Tcl_GetIndexFromObjStruct(). Simplified the mess in tclDecl a bit. All problems with API calls of the core itself up to now hidden by the Tcl 8 compatibility macros are fixed. Thanks, apnadkarni. 2023-04-11 22:03:23 +00:00
apnadkarni 4acb728d29 Add tests for binary command. Add testlutil command for speeding up list tests. 2023-04-11 16:52:49 +00:00
apnadkarni 7b249ac174 scan, reg*, subst tests 2023-04-10 14:52:44 +00:00
apnadkarni 06e049afdf Fix compiler warnings and crashes. Builds and passes test suite on Windows and Ubuntu for 64-bit 2023-04-10 13:21:02 +00:00
apnadkarni b223689153 Add notcl8api to OPTS to mirror --disable-tcl8api in configure 2023-04-10 13:19:22 +00:00
apnadkarni d90b82d5ce Sloooow progress on testing bigdata 2023-04-09 16:28:02 +00:00
pointsman 7bfc449085 Experimental branch which adds configure option --disable-tcl8api which builds without the Tcl 8 compatibility API. Atm unix only. 2023-04-09 00:09:50 +00:00
apnadkarni f350cdd7cc A few more bigdata tests for strings 2023-04-08 17:19:10 +00:00
apnadkarni 3643909840 Merge 9.0 2023-04-08 08:22:20 +00:00
pointsman 9365f75b61 Editorial fix in Tcl_Panic() message. 2023-04-07 23:14:20 +00:00
pooryorick 4d73d1039b Merge bug-[fa3d9fd818fa0072]. 2023-04-06 12:24:28 +00:00
pooryorick edb446d267 Update the documentation for [chan] with regard to binary data. 2023-04-06 12:10:56 +00:00
pooryorick 20d27150a6 Remove obsolete comments. 2023-04-06 10:28:19 +00:00
pooryorick 1c1cbe4444 Further fix for [fa3d9fd818fa0072]. In ChannelState.encoding, NULL no longer
represents the binary encoding.
2023-04-06 10:03:49 +00:00
pooryorick 3749d89fa6 Merge trunk. 2023-04-06 09:41:35 +00:00
apnadkarni 9deff281ee TIP 602 - update manpages 2023-04-05 17:04:05 +00:00
jan.nijtmans 3d9106c78b Merge 8.7 2023-04-05 16:06:52 +00:00
jan.nijtmans fc9cd641eb Make sure that infoPtr->validMask only contains TCL_READABLE|TCL_WRITABLE|TCL_EXCEPTION, no other flags 2023-04-05 16:05:36 +00:00
apnadkarni e49e2ac11d Merge trunk 2023-04-05 15:49:19 +00:00
jan.nijtmans 1c6c9f56e9 Merge 8.7 2023-04-05 15:12:52 +00:00
jan.nijtmans 4df4a598eb Use Tcl_GetIntForIndex() in testcases (tclTestObj.c) in stead of Tcl_GetWideIntFromObj().
Meant for Ashok, to show that we already have Tcl_GetSizeIntFromObj(). (I already planned this conversion for a long time, thanks, Ashok for reminding me)
Also some other cleanups
2023-04-05 14:19:45 +00:00
apnadkarni 0fb466009e Fix tclStubInit gcc warnings with TCL_UTF_MAX=3 2023-04-05 11:44:02 +00:00
apnadkarni 3c2a7e1741 Add TCL_SIZE_MAX and TCL_SIZE_MODIFIER 2023-04-05 11:03:35 +00:00
apnadkarni a066019d75 Export Tcl_GetSizeFromObj in stubs 2023-04-05 10:45:44 +00:00
apnadkarni 1ab82013f2 Tcl_GetSizeIntFromObj 2023-04-05 06:40:43 +00:00
apnadkarni 543bde3f26 Merge 9.0 2023-04-05 04:47:52 +00:00
jan.nijtmans 096c6ef84f Fix [6390566ecd]: Testcase cmdAH-4.3.13.00DC0000.tail.utf-32.tcl8.a fails sometimes 2023-04-04 22:47:27 +00:00
jan.nijtmans 2948220674 Accidental rename from TCL_8_COMPAT to TCL_SIGNED_SIZE in previous commit, so undo that 2023-04-04 21:58:38 +00:00
jan.nijtmans e5aed17b9d Merge 8.7 2023-04-04 21:55:41 +00:00
jan.nijtmans d206ee3c75 Starting with [51d813943bcaf835], chan-io-52.10 and io-52.10 are failing on the Windows (with Visual Studio) environment. For now, disable the testcases. 2023-04-04 21:54:35 +00:00
jan.nijtmans ef765324c9 TIP #628 addendum (various fixes to improve handling of 8.7 <-> 9.0 header differences) 2023-04-04 21:49:30 +00:00
apnadkarni eea17e30ab Some very initial tests for large data 2023-04-04 17:16:51 +00:00
apnadkarni 556b19bf28 Start on tests for large data 2023-04-04 17:14:44 +00:00
pooryorick 8528cc5323 Fix for [9ca87e6286262a62], sync fcopy buffers input in ReadChars(). 2023-04-04 16:26:18 +00:00
pooryorick e1420101e1 Fix for [fa3d9fd818fa0072], [fcopy $chan1 $chan2 -size $size] is not [puts
-nonewline $chan2 [read $chan1 -size $size].
2023-04-03 21:20:28 +00:00
pooryorick 5d3ba90d87 Fix for [fa3d9fd818fa0072], [fcopy $chan1 $chan2 -size $size] is not [puts
-nonewline $chan2 [read $chan1 -size $size].
2023-04-03 20:58:46 +00:00
pooryorick 530c3b8f01 Fix typo in test io-53.12.1. 2023-04-03 19:58:42 +00:00
pooryorick 1203f8d384 Fix typo in previous commit. 2023-04-03 19:56:56 +00:00
pooryorick 1215212601 Fix for [9ca87e6286262a62], sync fcopy buffers input in ReadChars(). 2023-04-03 17:13:19 +00:00
pooryorick 3e6eaa5776 Fix for [9ca87e6286262a62], sync fcopy buffers input in ReadChars(). 2023-04-03 17:12:11 +00:00
pooryorick 465fa239eb Failing test for [9ca87e6286262a62f], Sync fcopy buffers input in ReadChars(). 2023-04-03 16:37:27 +00:00
mchn1350 77a0b2b716 Windows Threads are joinable 2023-04-03 07:41:10 +00:00
Konrad Schwarz 83d4470ed9 Clarified that it is suboptimal to hold the associated mutex when signaling a condition variable.
If the mutex is held, there is a danger of the signaled, hence newly awakened threads
of immediately blocking again when trying to acquire the mutex.  This is avoided
by signaling after releasing the mutex. Naturally, this somewhat increases the
danger that an unrelated thread will enter the mutex and invalidate the
underlying condition.  However, this case cannot be ruled out even when
the condition variable is signaled while the mutex is being held.
The "spurious wakeup" clause forces applications to re-check the condition
after reacquiring the mutex in any case.
2023-04-02 15:41:39 +00:00
apnadkarni 5e5a852fe0 Bug [7e3f26c748] - TCL_MEM_DEBUG false positive 2023-04-02 13:23:33 +00:00
Konrad Schwarz fe5d5b9dec Replaced non-thread-safe re-initialization checks with the Win32 INIT_ONCE one-time initialization API 2023-04-02 08:45:41 +00:00
mchn1350 31855faf56 Use native Win32 ConditionVariables
Replaces the home-grown condition variable implementation
with Win32 ConditionVariables, as introduced in Windows Vista.
2023-04-01 23:01:34 +00:00
jan.nijtmans 17d857c579 Merge 8.7 2023-04-01 14:55:36 +00:00
jan.nijtmans 81999e0554 Add -Wall -Wextra -Wc++-compat -Wconversion -Werror to CFLAGS in unix/dltest/Makefile.in, and minimal changes to make it work warning-free. Fix indenting 2023-04-01 14:52:08 +00:00
apnadkarni d9bef75f08 Fix gcc warnings from prior 9.0 merge 2023-04-01 11:35:49 +00:00
jan.nijtmans baa549af6a Merge 9.0 2023-04-01 10:27:54 +00:00
jan.nijtmans ce04b407d9 Merge 8.7. Code cleanup in dltest packages 2023-04-01 08:16:03 +00:00
jan.nijtmans 0726ae90db New "pkgt" for testing TIP #627 2023-04-01 07:45:22 +00:00
jan.nijtmans 7d1613ac75 Improve tcltest package: Don't use 'scan' for printable characters, and don't print lf as \x0A any more (as in Tcl 8.6) 2023-04-01 07:27:28 +00:00
jan.nijtmans b6a444f634 merge-mark 2023-03-31 21:41:58 +00:00
jan.nijtmans 21c787abd0 Restore iogt-2.3 expectation expectation to what it was in Tcl 8.6 (due to previous bug-fix) 2023-03-31 21:41:03 +00:00
jan.nijtmans efc68f3008 adapt iogt-2.3 expectation 2023-03-31 21:25:26 +00:00
jan.nijtmans 9a89f0e222 merge-mark 2023-03-31 19:25:52 +00:00
jan.nijtmans fc78297f13 Backport CHANNEL_PROFILE_GET() usage fix from 9.0 2023-03-31 19:24:35 +00:00
jan.nijtmans c5d4ce7c51 Correct other CHANNEL_PROFILE_GET() usage as well, which had the same error. Further on: 1) profile in inputEncodingFlags is always equal to profile in outputEncodingFlags, so we only have to test one of them
2) We copy from inputchannel to outputchannel, so we - really - only have to test inStatePtr->inputEncodingFlags and outStatePtr->outputEncodingFlags. 3) In Tcl 9 we only want to set sameencoding when both channels are in tcl8 mode
2023-03-31 19:14:05 +00:00
pooryorick 90f77cbdf1 Fix TclCopyChannel() incorrect use of CHANNEL_PROFILE_GET(). 2023-03-31 18:56:33 +00:00
jan.nijtmans 3eb5ddf1da Merge 8.7 2023-03-31 11:16:20 +00:00
apnadkarni a30f4dce67 Fix macos Tcl_MacOSXOpenVersionedBundleResources to use Tcl_Size 2023-03-31 11:09:05 +00:00
jan.nijtmans cc936d0713 Merge 8.6 2023-03-31 11:06:35 +00:00
jan.nijtmans 6bdd668a7c Update to tzdata 2023c (which is identical to 2023a, due to the summertime situation in Libanon) 2023-03-31 07:57:12 +00:00
jan.nijtmans 726c679083 Rename TclWinOpenFileChannel to OpenFileChannel, because it's static now. 2023-03-31 07:49:39 +00:00
jan.nijtmans feac96c8b3 Merge 8.7 2023-03-30 22:22:32 +00:00
jan.nijtmans ed24f448c7 One more snprintf 2023-03-30 22:06:00 +00:00
jan.nijtmans dc5930bc81 Merge 8.6 2023-03-30 22:02:55 +00:00
jan.nijtmans 1861455786 Fix [0cb3554903]: macOS 13 SDK deprecates sprintf() 2023-03-30 21:20:30 +00:00
apnadkarni 5a1359a5e8 TIP 660. No compiler warnings. Tests suite pass on Win and Ubuntu 2023-03-30 18:01:48 +00:00
apnadkarni edb3e7b8d2 Create new branch named "tip-660" 2023-03-30 17:55:39 +00:00
jan.nijtmans 191fecdc87 Fix [0cb3554903]: macOS 13 SDK deprecates sprintf(). But better not use it on other platforms either. 2023-03-30 15:19:44 +00:00
max 67ced52076 Merge 8.7: Allow empty mode list in [chan create]. 2023-03-30 09:23:44 +00:00
max f8b9e919c9 Merge 8.6: Allow empty mode list in [chan create]. 2023-03-30 09:13:22 +00:00
max 784535a35c Allow empty mode list in [chan create], so that refchans are able to mimic the behavior of channels created by [socket -server]. 2023-03-30 08:46:27 +00:00
dgp 5b6755494d test hygiene. Match [removeFile] arguments to [makeFile] to fix debug alerts. 2023-03-29 15:06:48 +00:00
Konrad Schwarz 45b907287d added copyright note 2023-03-29 09:02:07 +00:00
jan.nijtmans 7d527f91fd Merge 8.7. Some size_t -> Tcl_Size in internal header files 2023-03-29 08:54:52 +00:00
jan.nijtmans ef16c107bf typo 2023-03-29 08:32:52 +00:00
pooryorick 24d6b91453 Replace bit twiddling with clear expression. 2023-03-29 06:16:03 +00:00
pooryorick ef52a3851a Remove the last occurrences of TCL_ENCODING_NOCOMPLAIN. 2023-03-28 19:30:58 +00:00
pooryorick 9576a35d02 Combine two branches in write(). 2023-03-28 19:29:21 +00:00
mchn1350 71d42c7655 On Windows, join threads using Win32 HANDLEs.
This works by extending the existing WinThread structure
with the thread's HANDLE. The lifetime of the WinThread structure
is until the thread terminates, for non-joinable threads,
or until the thread is joined. For joinable
threadsd, the thread's HANDLE remains open;
Windows signals the HANDLE when the thread terminates.
The thread's return value is transported using
the standard Windows mechanism.

A new thread-specific variable is introduced so a thread can
find its WinThread structure. Initial threads (those
not created via Tcl_CreateThread) receive a
WinThread lazily, when Tcl_GetCurrentThread is called
for the first time.

Instead of using the Windows ThreadId as the Tcl threadId,
the address of the WinThread is used. The least significant
bit of the pointer value is used to distinguish
joinable threads from non-joinable threads.
(For future use or debugging, the Windows ThreadId is stored
in the WinThread structure as well.)

generic/tclThreadJoin.c is made redudant by this patch.
2023-03-28 18:58:30 +00:00
jan.nijtmans 4d14a84353 Minor fix in winConsole.test 2023-03-28 16:03:42 +00:00
jan.nijtmans 7854b03fa2 Fix iocmd-12.11 testcase 2023-03-28 15:50:31 +00:00
jan.nijtmans 2445b5d59b Merge 8.7 2023-03-28 07:15:41 +00:00
jan.nijtmans dca79c0aca Fix [fa128568a5]: EOVERFLOW does not necessarily mean "file too big". Synchronize many error-messages with what Linux gives nowadays. 2023-03-28 07:14:35 +00:00
apnadkarni 9d87e5b616 Merge 8.7. POSIX errors update and minizip fix 2023-03-28 05:13:26 +00:00
apnadkarni 02ed0444e9 Merge 8.6. POSIX errors update and minizip fix 2023-03-28 05:02:08 +00:00
apnadkarni 2616ef0ef1 Fix irritating gcc warning for minizip 2023-03-28 04:47:00 +00:00
jan.nijtmans 82098d2dca Fix some typo's in POSIX error-messages, and add missing ones (ESTRPIPE, ERESTART, ENOSHARE, ENOMEDIUM, ENMFILE, EMEDIUMTYPE, EFTYPE, ECASECLASH) 2023-03-27 20:56:28 +00:00
jan.nijtmans 91fa419271 More text fixes 2023-03-27 20:24:09 +00:00
pooryorick 0899e9d020 Remove unneeded parts from test in fileName.test. 2023-03-27 20:08:21 +00:00
pooryorick bc060f980c Remove unneeded parts from test in fileName.test. 2023-03-27 19:56:36 +00:00
dgp 7f39dac888 test hygiene cleaning up created files. 2023-03-27 17:23:48 +00:00
jan.nijtmans f3e40e67d4 Merge 8.7 2023-03-27 14:44:28 +00:00
jan.nijtmans ac324e9b0b spacing 2023-03-27 14:42:18 +00:00
pooryorick 5ffb8a5035 Make the documentation of [encoding] more concise and readable. 2023-03-27 12:16:36 +00:00
pooryorick 3faf228237 Make the documentation of [encoding] more concise and readable. 2023-03-27 12:14:03 +00:00
jan.nijtmans e0df4408c7 Merge 8.7 2023-03-27 11:49:53 +00:00
jan.nijtmans d531e7af51 Merge 8.7 2023-03-27 11:43:02 +00:00
jan.nijtmans 2524a62bb6 More (internal) usage of TclGetString() and TclGetStringFromObj() macro's 2023-03-27 11:35:58 +00:00
pooryorick 587c1ebdba Avoid msvc "illegal indirection" error. 2023-03-27 11:14:50 +00:00
pooryorick b026d900d3 Avoid msvc "illegal indirection" error. 2023-03-27 11:13:17 +00:00
jan.nijtmans e1fdad425a Merge 8.7. Go back to lowercase for POSIX err-messages 2023-03-27 09:59:14 +00:00
pooryorick 49b6ecfb4e Fix some formatting errors. 2023-03-26 22:29:05 +00:00
pooryorick 38a87927cf Update reference-counting advice for Tcl_ObjSetVar2 and friends. 2023-03-26 22:18:05 +00:00
jan.nijtmans 1df3dc0ae2 Merge 8.7 2023-03-26 21:46:40 +00:00
pooryorick cc28ac83dd Mark: Valgrind reports no leaks. 2023-03-26 20:04:26 +00:00
pooryorick 7a84646588 Fix memory leak in Tcl_JoinObjCmd(). 2023-03-26 19:14:36 +00:00
jan.nijtmans d2fc2aa765 Sync all error-messages with modern Linux 2023-03-26 18:41:13 +00:00
jan.nijtmans 83740bf7d7 Merge 8.7 2023-03-26 17:22:02 +00:00
jan.nijtmans ad4011e1c8 Merge 8.6 2023-03-26 17:18:32 +00:00
jan.nijtmans e18f327808 Update to tzdata 2023b 2023-03-26 17:13:55 +00:00
pooryorick 30428a50c8 Merge-mark: Valgrind reports no memory leaks. 2023-03-26 16:42:41 +00:00
pooryorick 1df48c6782 Fix for [6d4e9d1af5bf5b7d]: Memory leak: SetFsPathFromAny, assisted by the
global literal table, causes a Tcl_Obj to reference itself.
2023-03-26 15:35:10 +00:00
pooryorick 0fd20aeeaa Fix for [6d4e9d1af5bf5b7d]: Memory leak: SetFsPathFromAny, assisted by the global
literal table, causes a Tcl_Obj to reference itself.
2023-03-26 15:07:56 +00:00
pooryorick 2002e0f0f0 Fix for [6d4e9d1af5bf5b7d]: Memory leak: SetFsPathFromAny, assisted by the
global literal table, causes a Tcl_Obj to reference itself.
2023-03-26 15:02:55 +00:00
pooryorick 2122f0eb09 Failing test for [6d4e9d1af5bf5b7d]. 2023-03-26 14:55:23 +00:00
jan.nijtmans 5c40bd9a6c Experimental fix for [fa128568a5]: EOVERFLOW does not necessarily mean "file too big"
Let's synchronize the POSIX error-messages with what Linux gives nowadays.
2023-03-25 20:00:58 +00:00
jan.nijtmans fc30e5e704 Merge 8.7 2023-03-24 21:09:33 +00:00
jan.nijtmans 414896d31f Fix [68417a8bb3]: No result/LF printed for 64-bit integer type check 2023-03-24 21:08:11 +00:00
jan.nijtmans f49e4099fe Merge 8.7 2023-03-24 20:58:04 +00:00
jan.nijtmans 220282500b Merge 8.6 2023-03-24 20:47:40 +00:00
jan.nijtmans e27c66d81a Fix [15e74a2fe6]: Fix various typos 2023-03-24 20:19:49 +00:00
dgp de08e1a143 duplicate test name 2023-03-24 16:49:17 +00:00
jan.nijtmans b0a23df7d6 Merge "unchained" branch, since all it does is add a little valgrind stuff to Makefile.in.
Hopefully this will stop Nathan's useless single-commit merges (his way there would be 32 more merges left to go)
2023-03-23 16:02:33 +00:00
jan.nijtmans ae9ebe2176 Merge 8.7 2023-03-23 15:55:22 +00:00
jan.nijtmans b726273bbe Merge 8.6 2023-03-23 15:54:27 +00:00
jan.nijtmans 5e0c34678e Resolve C warnings on 32-bit platforms. More code cleanup. 2023-03-23 15:48:54 +00:00
Konrad Schwarz 3985945f96 Merge-mark 2023-03-23 07:28:41 +00:00
jan.nijtmans ed66664f84 fix for [f3cb2a32d6] Add initialization to allocation of string rep buffer to resolve valgrind reports on use of uninitialized memory 2023-03-23 07:27:28 +00:00
pooryorick a51afb0e46 Merge trunk 4dca8eb033: Make "tcltest" package use "-profile tcl8" internally,
irrespective of what the default profile is.
2023-03-22 21:39:54 +00:00
pooryorick da0251a1f4 Merge trunk b10e2b66a9: Manpage fixes. 2023-03-22 21:38:41 +00:00
pooryorick 4576880f96 Merge trunk 9aa2b65a57: TIP 656 manpages. 2023-03-22 21:37:45 +00:00
pooryorick 10423ea0ca Merge trunk 49a4c8f8fb: TIP 656 implementation. 2023-03-22 21:36:46 +00:00
pooryorick 25a166a77a Merge trunk 31788d9a4b: arm64e -> arm64, since arm64e is not available yet on
MacOS (Thanks to Stefan Sobernig).
2023-03-22 21:24:16 +00:00
pooryorick 99a897fb41 Merge trunk 5ecd70c8ce: Unbreak build, and minor cleanup. 2023-03-22 21:21:46 +00:00
pooryorick 40a90d5fce Merge trunk 43584b2ac9: If TCL_UTF_MAX=4, don't set 'exact' to 1. 2023-03-22 21:19:31 +00:00
jan.nijtmans e66310792a Merge 9.0 2023-03-22 21:15:16 +00:00
pooryorick 9837f0e993 Merge trunk 9e266d00f2: Empty 2023-03-22 21:14:38 +00:00
pooryorick 3f624f6af0 Merge core-8-branch 7f5879e9cb: Fix (minor) warning on 32-bit platforms. 2023-03-22 21:13:13 +00:00
jan.nijtmans 4dcd70c967 Remove knownProfileBug constraint: this is already fixed 2023-03-22 21:11:12 +00:00
pooryorick 9d432523a6 Merge core-8-branch 3082cb9e80: Make valgrind_foreach target in Makefile.in
properly handle interrupted tests.
2023-03-22 20:26:05 +00:00
pooryorick 7f3849495a Merge core-8-branch 7fde86610c: New script used in the "valgrind_each" target
in Makefile.in.
2023-03-22 20:15:47 +00:00
jan.nijtmans d984134999 Merge 9.0 2023-03-22 20:13:09 +00:00
jan.nijtmans 17937238e2 One missing int -> Tcl_Size change 2023-03-22 20:09:09 +00:00
jan.nijtmans f4a64c89a2 Forgot one line in previous commit, and indenting 2023-03-22 19:30:02 +00:00
jan.nijtmans 6fec8f2b6c Let's get in the 'readability' changes from the 'unchained' branch, without the need for all those partial merges. 2023-03-22 18:13:29 +00:00
jan.nijtmans 1451fc7537 Merge 8.7 2023-03-22 18:00:15 +00:00
jan.nijtmans c103cb5d10 Merge 8.6 2023-03-22 17:57:39 +00:00
pooryorick 178c9d17be Merge trunk 6ef2153f20: Minor cleanup (Thanks, Gustaf!). 2023-03-22 17:54:26 +00:00
pooryorick a4b2c694ce Merge trunk c1e45151b3: Remove _LARGEFILE_SOURCE64 usage. See [d690400d07]. 2023-03-22 17:53:28 +00:00
pooryorick ff8b3d5c27 Merge trunk d04c1efe83: Merge in constraint spelling fix. Keep it in case the knownBug constraint is ever removed. 2023-03-22 17:51:31 +00:00
jan.nijtmans dedbaf0009 Fix [0265750233]: invalid read in cmdAH-4.3.13.C1.solo.utf-8.tcl8 2023-03-22 17:50:05 +00:00
pooryorick 511ae7efcb Merge trunk a76dee9eb4: Further fix for issue [ea69b0258a9833cb], crash when
using a channel transformation on TCP client socket.
2023-03-22 17:24:22 +00:00
pooryorick 5aedb72b9c Merge trunk a19e2f0c0b: ckfree -> Tcl_Free 2023-03-22 17:17:47 +00:00
pooryorick 364b4e65bf Merge trunk 30ba320f81: Since "unicode" is deprecated, use "utf-16" in
testcases. Otherwise -DTCL_NO_DEPRECATED build fails.
2023-03-22 17:16:42 +00:00
pooryorick e038969b66 Merge trunk 62058cafe0: Fix for issue [ea69b0258a9833cb], crash when using a
channel transformation on TCP client socket.
2023-03-22 17:15:26 +00:00
pooryorick 46d59bb7db Merge trunk 5c6fa768fe: Merge 8.6: Bug [183a1adcc0]. Buffer overflow in
Tcl_UtfToExternal.
2023-03-22 17:13:41 +00:00
pooryorick 30cce986ca Merge trunk 9db02d187b: 2 more testcases, proving utf-32 handling of surrogates
(actually: not handling!) is OK.
2023-03-22 17:11:37 +00:00
pooryorick 4fdc61a1f6 Merge trunk 6fb14ee3e: Minor bug-fix for utf-32: Only throw exception for
codepoints > +U10FFFF if "-strict" is specified. Otherwise replace with 0xFFF.
2023-03-22 17:10:54 +00:00
pooryorick 120806ee03 Merge trunk 286d6e9ab0: Fix [db7a085bd9]: encoding convertfrom -strict utf-16
accepts partial surrogates.
2023-03-22 17:09:51 +00:00
pooryorick bc309ba006 Merge trunk 8e467866ef: Forgot that \x00 is not printable anyway. 2023-03-22 17:08:35 +00:00
pooryorick 629aea4b6a Merge trunk 1bf875b575: Always output 2 hex characters in "unexpected byte sequence" exception message.
make testcases io-38.3/chan-io-38.3 independant from system encoding.
Bump version of tcltest to 2.5.6
2023-03-22 17:07:18 +00:00
pooryorick 5df2af1808 Merge trunk a0abb8bdc5: Make test less fragile to changing set of options. 2023-03-22 17:02:17 +00:00
pooryorick f8a7412ae3 Merge trunk bb76745df2: Fix cmdAH-4.3.13.00D80000.solo.utf-32le.tcl8.a testcase
from tip-656-tcl9 branch, when TCL_UTF_MAX=3.
2023-03-22 17:01:25 +00:00
pooryorick eaad662c18 Merge trunk 64c58db9fc: Adapt 2 testcases (io-39.16/io-39.16a), showing that
"-encoding" can be shortened to "-en", but not to "-e" (because there is
-eofchar too).
2023-03-22 16:58:45 +00:00
pooryorick ccf567f6a8 Merge trunk a52ac1d5fa: winFCmd-1.24 differs in error code on Win 11. 2023-03-22 16:57:08 +00:00
pooryorick 796370fa55 Merge trunk 13b04d4d60: Add "notWsl" test constraints. Clean up many testcases. 2023-03-22 16:56:08 +00:00
pooryorick 96b80a42ae Merge trunk 837dbec7cc: More -Wconversion warning fixes. 2023-03-22 16:55:24 +00:00
pooryorick 479247a5f0 Merge trunk 82bf22dad8: Add "teststringobj newunicode". Not used in testcases yet. 2023-03-22 16:53:56 +00:00
pooryorick e882c87033 Merge trunk 1997f71246: Fix [b4af93cd9f]: uninitialized bytes in http11-1.13.0. 2023-03-22 16:51:17 +00:00
pooryorick 2239eb3a90 Merge trunk fe9c231f48: Fix a few -Wconversion warnings. 2023-03-22 16:50:06 +00:00
pooryorick ce1b091802 Merge trunk 24072d92fc: testchmod fix. 2023-03-22 16:48:11 +00:00
jan.nijtmans 636a6d0ea9 Proposed fix for [0265750233]: invalid read in cmdAH-4.3.13.C1.solo.utf-8.tcl8. 2023-03-22 16:36:22 +00:00
pooryorick ce9c1b59e5 Merge trunk 04077c7b2e: Fix [95e287b956]: uninit value use in stringObj-4.2. 2023-03-22 14:11:19 +00:00
pooryorick d462ed2dd9 Merge trunk 2c4994d39e: ckfree() -> Tcl_Free(). 2023-03-22 14:09:11 +00:00
pooryorick 2a7d240b80 Merge trunk 37fc768d3: Tcl_WinTCharToUtf() is deprecated, so use Tcl_WCharToUtfDString() instead. 2023-03-22 14:08:41 +00:00
pooryorick ec7356be4c Merge trunk 9e195dccd7: Add new valgrind suppression items. 2023-03-22 14:07:38 +00:00
pooryorick 631b9cae2e Merge trunk 6b8ecafc24: A better fix for Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-22 14:07:00 +00:00
pooryorick 88caedc3ce Merge trunk 1ad5d08ee8: Another round of -1 -> TCL_INDEX_NONE. 2023-03-22 13:59:58 +00:00
pooryorick dc7946e162 Merge trunk 7a2fc29ce0: More -1 -> TCL_INDEX_NONE. 2023-03-22 13:57:13 +00:00
pooryorick e21761aab7 Merge trunk adb38c336f: Make dltest/pkg*.c simple example how to use Tcl_Size
with Tcl_GetStringFromObj().
2023-03-22 13:55:33 +00:00
pooryorick a19bc41c3a Merge trunk aceb89781d: Protect zlib errors with check for null interp. 2023-03-22 13:54:50 +00:00
pooryorick a78ce452f2 Merge trunk: Test constraint notInCIenv no longer necessary (due to previous
fix).
2023-03-22 13:53:41 +00:00
pooryorick 438dbba007 Merge trunk: Fix [1b8df10110]: Tcl_GetTime returns wrong usec value on Windows. 2023-03-22 13:52:53 +00:00
pooryorick 6c33026c8c Merge trunk 91247f5ef8: Adapt type-casts to Tcl 9.0 signature of
Tcl_Free/Tcl_Realloc/Tcl_AttemptRealloc.
2023-03-22 13:51:45 +00:00
pooryorick 0fc4d3ef81 Merge trunk c1e87a7fe5: ckfree() shouldn't be used in Tcl 9 core code any more. 2023-03-22 13:50:49 +00:00
pooryorick bb933cb954 Merge trunk: Fix Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-22 13:50:02 +00:00
pooryorick b523637e3b Merge trunk: Fix bug [9a978f8323], large reads > 2GB. 2023-03-22 13:48:45 +00:00
pooryorick ae0f696f21 Merge trunk: Disable more file permissions tests for WSL (not supported in
WSL/NTFS).
2023-03-22 13:46:42 +00:00
pooryorick e1e66d9209 Disable file permission tests under WSL as WSL does not support Unix file attrs
without special config.
2023-03-22 13:45:16 +00:00
pooryorick 84ad8e1eae Fix msvc build (with OPTS=symbols) 2023-03-22 13:44:15 +00:00
pooryorick 8602bafbb8 Merge trunk: Fix [f8ef6b3670] crash. TclpSysAlloc macro was truncating size
request to 32 bits on Windows.
2023-03-22 13:33:18 +00:00
pooryorick b12a433518 Merge trunk: Put back testcase io-52.20, and re-fix [4a7397e0b3]. 2023-03-22 13:31:32 +00:00
pooryorick 8f8776b56b Merge trunk: Add missing ')'. 2023-03-22 13:30:32 +00:00
pooryorick 12fbbf9df9 Merge trunk: Restore previous behavior for non-blocking mode, as for this mode
the semantics of [read]/[gets] were not broken. This was the 'some agreement'.
The change in line 8286 is necessary for both blocking and non-blocking mode:
Whenver the encoding change we need to reset the CHANNEL_ENCODING_ERROR flag.
2023-03-22 13:22:17 +00:00
pooryorick 7a69ce0ac4 Reverted [d156af9fb76dd2f4] and removed tests io-52.20 io-75.6 io-75.7, as this
commit, intended to fix issue [b8f575aa2398b0e4], breaks the semantics of
[read] and [gets]. Such a change would require an accepted TIP. See
[b8f575aa2398b0e4] for further discussion.
2023-03-22 13:16:33 +00:00
pooryorick 7b07b1df54 Merge 8.7. And fix Tcl_UtfToExternal()/Tcl_ExternalToUtf() (at least - suffucient for tclZlib.c), such that it now returns an error when src and dst *both* exceed INT_MAX. To be discussed further. 2023-03-22 13:14:39 +00:00
pooryorick a182a5bf20 Merge bug-fb368527ae. Bug [fb368527ae] Large string truncation 2023-03-22 13:13:13 +00:00
pooryorick 097fff3b0d Merge trunk: Make the descriptions in doc/Tcl.n more concise and intuitive. 2023-03-22 13:10:21 +00:00
pooryorick 574c6392d0 Merge trunk: Fix formatting issue in Tcl.n 2023-03-22 13:09:34 +00:00
pooryorick b14bccc65d Merge trunk: In case of combining TIP #494 (TCL_8_COMPAT) and #628 (building for Tcl 8.7
with 9.0 headers), ignore TCL_8_COMPAT macro. More Tcl_Size usage.
2023-03-22 13:07:50 +00:00
pooryorick ac8cf85039 Merge trunk: Fix [3d01d51bc4]: Tcl 9: Cannot write large strings to file. Also
some size_t -> Tcl_Size changes.
2023-03-22 13:06:58 +00:00
pooryorick 85461b74b3 Merge trunk: Fix [46dda6fc29] - trace crash caused by TclScanElement 2023-03-22 13:05:49 +00:00
pooryorick 30e195d456 Merge trunk: Fix [1d074b177a]. Failure to read .tclshrc 2023-03-22 13:04:46 +00:00
pooryorick a23d9c4dac Merge trunk: int -> Tcl_Size in tclEncoding.c 2023-03-22 13:03:21 +00:00
pooryorick 965d3fae6a Merge trunk: Fix [4bea02e811]: encoding convertfrom -strict ascii \x7f
generates exception Many other encodings had the same problem, and also the
reverse happened: encodings which should throw an exception with -strict but
didn't (within range 0x80-0x9F).
2023-03-22 13:01:17 +00:00
pooryorick 8088657ecc Merge trunk: Fix [d19fe0a5b]: Handling incomplete byte sequences for
utf-16/utf-32.
2023-03-22 12:35:24 +00:00
pooryorick b2f6161a18 Merge trunk: -strict for ucs-2. 2023-03-22 12:28:43 +00:00
pooryorick c258128087 Merge trunk: Fix for [885c86a9a0]: convertfrom utf8 breaks for 4 byte utf encodings. 2023-03-22 12:26:41 +00:00
pooryorick 1a13ddd24b Merge trunk: Final part of [10c2c17c32]: UTF-LE32 encoder mapping of
surrogates. Problem was in testcase, not in actual code.
2023-03-22 12:25:33 +00:00
pooryorick aeafdad0a9 Merge trunk 6ca5a8a9cd: encoding convertfrom -failindex, -strict for cesu-8. 2023-03-22 12:24:39 +00:00
pooryorick ae0658c370 Merge trunk e90924bb13: Test-case only. 2023-03-22 12:20:42 +00:00
pooryorick 3c37f824cc Merge trunk de933019a1: Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode
allows surrogates in input sequence.
2023-03-22 12:19:26 +00:00
pooryorick cb4d5ce631 Merge trunk a155df4adc: (new) testcase encoding-16.15 as "knownBug": still needs a fix. 2023-03-22 12:12:14 +00:00
pooryorick 167878d3af Merge Trunk 2d036d968c: Proposed fix (and testcases) for [4a7397e0b3]: Tcl 9: fcopy with -strictencoding 1 UTF-8 channels 2023-03-22 12:02:44 +00:00
jan.nijtmans 32860a2742 Merge 8.7 2023-03-22 12:02:09 +00:00
jan.nijtmans f1fafe7c16 Move (TCL_ENCODING_PROFILE_MASK|GET|SET) from tcl.h to tclIO.h, since those are not public. Some formatting. 2023-03-22 11:44:33 +00:00
jan.nijtmans c9bc915417 Merge 8.7 2023-03-22 10:02:28 +00:00
pooryorick 79bc1e0416 Merge trunk e851055acb: Fix documentation on "encoding" command. 2023-03-22 09:50:03 +00:00
jan.nijtmans 44357a2534 code cleanup: use more *SURROGATE() macro's 2023-03-22 09:41:00 +00:00
jan.nijtmans 1e95b894cf merge-mark 2023-03-22 08:34:09 +00:00
jan.nijtmans 133af7524b Since TCL_ENCODING_PROFILE_DEFAULT == TCL_ENCODING_PROFILE_TCL8 (on Tcl 8), we can simplify. 2023-03-22 08:32:10 +00:00
pooryorick e0d5199463 Merge trunk c093f8b044: Renumber testscase. 2023-03-22 06:43:19 +00:00
apnadkarni e7c416995e Fix longIs64Bit->has64BitLengths else test will not run on 64-bit Wind 2023-03-22 02:39:10 +00:00
pooryorick ac8ac73e77 Remove unneeded Tcl_IncrRefCount and TclDecrRefCount. TclPtrSetVarIdx takes
ownership of newValuePtr if its refCount is 0, and either stores or frees it.
2023-03-21 23:55:12 +00:00
pooryorick 0fcb3ce5dc Remove unneeded Tcl_IncrRefCount and TclDecrRefCount. TclPtrSetVarIdx takes
ownership of newValuePtr if its refCount is 0, and either stores or frees it.
2023-03-21 23:49:01 +00:00
jan.nijtmans 4f5ae9bf24 Merge 8.7 2023-03-21 16:54:19 +00:00
jan.nijtmans 9152d5eec0 Fix [1bedc53c8c]: synchronous [read] with -strictencoding does not produce an error on invalid input 2023-03-21 16:28:57 +00:00
jan.nijtmans d63d524e1d Fix indenting. More use of TCL_INDEX_NONE 2023-03-21 16:26:30 +00:00
jan.nijtmans 48dcbfcc5b Some test-cases, which test for partial read without throwing EILSEQ immediately, only work with ""-blocking 0". That's expected. 2023-03-21 11:11:02 +00:00
jan.nijtmans afdd59e358 Merge 8.7 2023-03-21 08:45:56 +00:00
jan.nijtmans 8f3fb2f85e Fix [154ed7ce56]: Tcl 9: [gets] on -strictencoding 1 configured channel 2023-03-21 08:44:37 +00:00
jan.nijtmans 6ff9d841db Missing backslashes in macro def 2023-03-21 08:40:08 +00:00
jan.nijtmans f5c47e4402 Proposed fix for [1bedc53c8c]: synchronous [read] with -strictencoding does not produce an error on invalid input 2023-03-20 23:17:11 +00:00
jan.nijtmans 4ea926a40b Proposed fix for [154ed7ce56]: Tcl 9: [gets] on -strictencoding 1 configured channel.
Extracted from TIP #657 branch (better keeping bug-fix separate from enhancements)
2023-03-20 22:53:33 +00:00
jan.nijtmans 28add0c150 More TclNewIndexObj() usages (for values between -1 and SIZE_MAX-1) 2023-03-20 21:06:09 +00:00
dgp 88f1825232 Candidate fix for [f3cb2a32d6]
Add initialization to allocation of string rep buffer to resolve valgrind
reports on use of uninitialized memory
2023-03-20 18:45:28 +00:00
dgp 8133df3b6d Duplicate test name 2023-03-20 16:39:06 +00:00
jan.nijtmans 8b0dc386ba Merge 8.7 2023-03-20 14:19:35 +00:00
jan.nijtmans 5319a7d93f Fix [bdcb5126c0]: Failed assertion in test chan-io-7.3 2023-03-20 14:18:47 +00:00
jan.nijtmans cc2747afa8 Add longIs64bit constraint to lseq-4.4 (because this isn't expected to work on 32-bit platforms). Remove some unused constraints. 2023-03-20 12:08:58 +00:00
jan.nijtmans d103b73dba Fix [5ae5ffc3f4]: Problem with -failindex on 32-bit platform 2023-03-20 11:42:19 +00:00
jan.nijtmans b273a9c1d4 Use TclNewIndexObj() in stead of Tcl_NewWideIntObj(), which - actually - does the same but better for debugging. 2023-03-20 11:40:25 +00:00
jan.nijtmans 2475fa8cb8 Merge 8.7 2023-03-20 11:31:14 +00:00
jan.nijtmans 5d63902332 Fix [d7fd37ebd9]: handling leftover prefix in table encoding 2023-03-20 11:29:49 +00:00
apnadkarni 921b0dfdea Merge 8.7 - Fix http11 test hang 2023-03-20 02:38:36 +00:00
apnadkarni 75664c655d Fix http11 test hang caused by trailing brace in previous commit 2023-03-20 02:36:36 +00:00
jan.nijtmans 2d9a47cff1 Possible fix for [d7fd37ebd9]: handling leftover prefix in table encoding 2023-03-19 21:51:50 +00:00
jan.nijtmans 1876fe215d Another fix: don't access (w) twice 2023-03-19 13:34:04 +00:00
jan.nijtmans 78c295898e Doesn't look like a mem-leak: It appears that Tcl_ObjSetVar2() already handles that. 2023-03-19 13:32:46 +00:00
jan.nijtmans 449998d358 Proposed fix for [5ae5ffc3f4]: Problem with -failindex on 32-bit platform. This also fixes a memory-leak. 2023-03-19 13:23:03 +00:00
jan.nijtmans 203f1d691d Merge 8.7 2023-03-19 11:58:07 +00:00
jan.nijtmans 800d78f04d Don't let httpd11 depend on the system encoding any more: All text files are now stored in utf-8. 2023-03-19 11:56:58 +00:00
jan.nijtmans 8e6d7429e9 Merge 8.7 2023-03-19 11:45:22 +00:00
jan.nijtmans 291ff6db1b Remove unneeded backslash 2023-03-19 11:44:38 +00:00
jan.nijtmans d5ac687adb Merge 8.7 2023-03-18 09:08:35 +00:00
jan.nijtmans 7834acd2e4 one too much "-profile tcl8" 2023-03-18 09:07:20 +00:00
jan.nijtmans 5e2a39d626 Make http package use "-profile tcl8", irrespective of the default profile in Tcl, until decided differently 2023-03-18 09:02:15 +00:00
jan.nijtmans cb121886a4 Merge 8.7 2023-03-18 08:52:25 +00:00
jan.nijtmans 278b807336 Make "tcltest" package use "-profile tcl8" internally, irrespective of what the default profile is 2023-03-18 08:50:34 +00:00
jan.nijtmans 036b676c8b Merge 8.7 2023-03-18 08:45:55 +00:00
jan.nijtmans 5fbaf44ecf Manpage fixes 2023-03-18 08:42:39 +00:00
apnadkarni 43218725b3 Merge 8.7 - TIP 656 manpages 2023-03-18 04:28:49 +00:00
apnadkarni c6b740609a Update manpages for TIP 656 2023-03-18 04:10:47 +00:00
apnadkarni 64c45c10a9 Merge mark post-656 2023-03-18 03:37:24 +00:00
apnadkarni 1a75f270bd TIP 656 accepted 2023-03-18 03:35:02 +00:00
apnadkarni e89caee68c TIP 656 accepted 2023-03-18 03:18:13 +00:00
apnadkarni b90a2e051c Merge trunk 2023-03-18 02:59:14 +00:00
apnadkarni 6134622b61 Merge 8.7 2023-03-18 02:36:42 +00:00
jan.nijtmans 4ce715f36a Merge 8.7 2023-03-17 20:11:26 +00:00
jan.nijtmans bdad96ab69 Few more arm64e -> arm64 2023-03-17 20:10:29 +00:00
jan.nijtmans c0a02fd487 Merge 8.6 2023-03-17 20:09:18 +00:00
jan.nijtmans 453c27a88e arm64e -> arm64, since arm64e is not available yet on MacOS (Thanks to Stefan Sobernig) 2023-03-17 20:04:48 +00:00
jan.nijtmans ac93862047 Merge 8.7 2023-03-17 19:43:07 +00:00
jan.nijtmans 2d75729976 Merge 8.7 2023-03-17 16:15:16 +00:00
jan.nijtmans e9ccf557eb Fix [6390566ecd]: Testcase cmdAH-4.3.13.00DC0000.tail.utf-32.tcl8.a fails sometimes 2023-03-17 16:12:23 +00:00
dgp 5b8c37d24f merge 8.6 2023-03-17 14:38:16 +00:00
dgp 13b1529c7b Clean up after events to avoid errors in later tests that use an event loop. 2023-03-17 14:22:44 +00:00
dgp 1ee3af2d3d merge mark 2023-03-17 12:40:12 +00:00
dgp 87b6456684 unbreak the build 2023-03-17 12:35:51 +00:00
jan.nijtmans 4f2de3dfc9 merge-mark 2023-03-17 08:25:56 +00:00
jan.nijtmans 4aa63fcc25 Don't return from a void function 2023-03-17 08:24:59 +00:00
pooryorick 72deb9db89 Merge-Mark. 2023-03-17 08:13:44 +00:00
jan.nijtmans 3d439d74da Merge-mark 2023-03-17 08:06:13 +00:00
jan.nijtmans 9c8a1292c0 Don't introduce size_t in a header-file which didn't use it before. Make more clear that those are unsupported internal functions. 2023-03-17 07:57:14 +00:00
jan.nijtmans d81f257f99 Merge 8.7 2023-03-16 20:16:08 +00:00
jan.nijtmans 3129864cc2 If TCL_UTF_MAX=4, don't set 'exact' to 1 2023-03-16 20:12:23 +00:00
apnadkarni aa14feed8b Missed two tests. Blast it :-( 2023-03-16 18:15:46 +00:00
apnadkarni e7fc2e1e1d Merge 9.0 2023-03-16 18:11:08 +00:00
apnadkarni 527e79c3a8 Fix passing of encoding state in testencoding Tcl_UtfToExternal 2023-03-16 17:54:12 +00:00
apnadkarni 5655318f50 Merge 8.7 2023-03-16 17:29:12 +00:00
apnadkarni 05262be331 Update manpages in anticipation of TIP 656 2023-03-16 16:24:04 +00:00
jan.nijtmans 88f9f54d4c Merge 8.7 2023-03-16 15:38:40 +00:00
jan.nijtmans ae0471127e Prevent extensions compiled with TCL_UTF_MAX=4 (See [https://core.tcl-lang.org/tips/doc/trunk/tip/542.md|TIP #542]) from running in Tcl 8.6. 2023-03-16 15:36:55 +00:00
jan.nijtmans 1a6f1d5c40 Add some undocumented stub functions. Those can prevent a crash like [http://paste.tclers.tk/5763|this] example, when compiled with 8.7 headers but running it in Tcl 8.6. 2023-03-16 15:12:17 +00:00
jan.nijtmans 1eefaec471 Minor cleanup (Thanks, Gustaf!) 2023-03-16 11:38:20 +00:00
jan.nijtmans e019e5bd1d Fix (minor) warning on 32-bit platforms 2023-03-16 11:29:14 +00:00
jan.nijtmans 93ce80a916 unicode -> utf-16. Remove some unneeded encodingProfileTodo constraints 2023-03-16 10:00:26 +00:00
pooryorick 5846b1666f Make valgrind_foreach target in Makefile.in properly handle interrupted tests. 2023-03-16 08:15:03 +00:00
apnadkarni 4d978a00ed Change -encodingprofile to -profile 2023-03-16 03:48:45 +00:00
apnadkarni a3c59e320d Change -encodingprofile to -profile 2023-03-16 03:08:12 +00:00
pooryorick 70cf69246f New script used in the "valgrind_each" target in Makefile.in 2023-03-15 20:13:22 +00:00
jan.nijtmans 6f4eba042c Merge 8.7 2023-03-15 16:24:16 +00:00
jan.nijtmans 7543a1313f Merge 8.6 2023-03-15 16:23:22 +00:00
jan.nijtmans e0e09638fe Remove _LARGEFILE_SOURCE64 usage. See [d690400d07] 2023-03-15 16:21:53 +00:00
dgp a0be72dbca merge 8.7 2023-03-15 13:41:05 +00:00
dgp 6d3b66ad23 Merge in constraint spelling fix. Keep it in case the knownBug constraint is ever removed. 2023-03-15 13:28:55 +00:00
dgp 6bd8763c2d Misspelled constraint created testing noise. 2023-03-15 12:53:03 +00:00
pooryorick f378b48b06 Further fix for issue [ea69b0258a9833cb], crash when using a channel transformation on TCP client socket. 2023-03-15 11:37:13 +00:00
jan.nijtmans 23a421a9c1 Merge-mark. @nathan, please do forward merges from core-8-6-branch -> core-8-branch -> trunk. Fossil is not so intelligent, figuring out what's happening here. 2023-03-15 09:32:02 +00:00
pooryorick ba737587a8 Further fix for issue [ea69b0258a9833cb], crash when using a channel transformation on TCP client socket. 2023-03-15 09:25:15 +00:00
jan.nijtmans ea9a0277a2 ckfree -> Tcl_Free 2023-03-15 09:11:22 +00:00
pooryorick 6ded4b92be Further fix for issue [ea69b0258a9833cb], crash when using a channel transformation on TCP client socket. 2023-03-15 08:42:11 +00:00
pooryorick 6cf4a0dea3 Merge core-8-branch. 2023-03-14 20:37:45 +00:00
pooryorick fdcb9621bb Further fix for issue [ea69b0258a9833cb], crash when using a channel
transformation on TCP client socket.
2023-03-14 20:30:34 +00:00
pooryorick 3aef0c58f9 Further fix for issue [ea69b0258a9833cb], crash when using a channel transformation on TCP client socket. 2023-03-14 20:27:04 +00:00
apnadkarni c5d0535121 Merge 9.0. Also fix replace profile handling of orphan surrogates 2023-03-14 17:23:47 +00:00
apnadkarni 87b3bcc550 Merge 8.7 2023-03-14 15:34:42 +00:00
jan.nijtmans 76526242c0 Merge 8.7 2023-03-14 10:33:43 +00:00
jan.nijtmans b05b4cf948 Since "unicode" is deprecated, use "utf-16" in testcases. Otherwise -DTCL_NO_DEPRECATED build fails. 2023-03-14 10:30:59 +00:00
jan.nijtmans 18a99f2522 Add "ucs-2" constraint to encoding-bug-183a1adcc0-5 testcase, otherwise it fails with TCL_UTF_MAX>3.
Broken by [47857515422b8519|this] commit
2023-03-14 10:05:24 +00:00
pooryorick 4c26d23f06 Fix for issue [ea69b0258a9833cb], crash when using a channel transformation
on TCP client socket.
2023-03-13 20:57:59 +00:00
pooryorick 953a44bc6e Fix for issue [ea69b0258a9833cb], crash when using a channel transformation on
TCP client socket.
2023-03-13 19:19:32 +00:00
pooryorick 5094fb7825 Fix for issue [ea69b0258a9833cb], crash when using a channel transformation on
TCP client socket.
2023-03-13 19:07:25 +00:00
apnadkarni 95158a2d57 Fix passing of encoding state in testencoding Tcl_UtfToExternal 2023-03-13 16:32:55 +00:00
apnadkarni 5c3377f2e1 Merge 8.7: Bug [183a1adcc0]. Buffer overflow in Tcl_UtfToExternal 2023-03-13 15:59:11 +00:00
apnadkarni d53dfb14c7 Merge 8.6: Bug [183a1adcc0]. Buffer overflow in Tcl_UtfToExternal 2023-03-13 15:34:22 +00:00
apnadkarni 6d74232282 Bug [183a1adcc0]. Buffer overflow in Tcl_UtfToExternal 2023-03-13 13:44:35 +00:00
pooryorick df8a3a6ea4 Fix for issue [ea69b0258a9833cb], crash when using a channel transformation on
TCP client socket.
2023-03-13 13:36:52 +00:00
pooryorick 967e55306e Fix for issue [ea69b0258a9833cb], crash when using a channel transformation on
TCP client socket.
2023-03-13 12:22:06 +00:00
apnadkarni 844792f3bb Cherrypick yip-656. Start on Tcl_ExternalToUtf/Tcl_UtfToExternal tests 2023-03-12 17:10:51 +00:00
apnadkarni 22239fb7d2 Start on Tcl_ExternalToUtf/Tcl_UtfToExternal tests 2023-03-12 16:47:08 +00:00
jan.nijtmans ab2c6de1ed merge-mark 2023-03-12 16:38:13 +00:00
jan.nijtmans 131176ce2f Backport [6fb14ee3e876978c]. Add testcases 2023-03-12 16:37:12 +00:00
jan.nijtmans aee8588fbc 2 more testcases, proving utf-32 handling of surrogates (actually: not handling!) is OK 2023-03-12 16:23:33 +00:00
jan.nijtmans eeee744ee2 Minor bug-fix for utf-32: Only throw exception for codepoints > +U10FFFF if "-strict" is specified. Otherwise replace with 0xFFFD 2023-03-12 16:10:52 +00:00
jan.nijtmans 63b29d841b Merge 8.7 2023-03-12 12:59:28 +00:00
jan.nijtmans 77e951f2b8 Fix [db7a085bd9]: encoding convertfrom -strict utf-16 accepts partial surrogates 2023-03-12 12:37:29 +00:00
jan.nijtmans 9fb3d5754a Merge 9.0. Also ckalloc -> Tcl_Alloc and ckfree -> Tcl_Free 2023-03-12 12:00:49 +00:00
jan.nijtmans a16eb9ac30 Merge 8.7 2023-03-12 11:34:03 +00:00
jan.nijtmans 8bf2e2ace2 Forgot that \x00 is not printable anyway 2023-03-12 11:32:52 +00:00
jan.nijtmans ed8932a4eb Merge 8.7 2023-03-12 11:28:00 +00:00
jan.nijtmans b7f151f126 Make test-output more readable when it contains non-printable characters (stolen from TIP #656 impl, thanks Ashok!)
tcltest -> 2.5.6
2023-03-12 11:24:24 +00:00
jan.nijtmans 8c5fc11b5a Always output 2 hex characters in "unexpected byte sequence" exception message.
make testcases io-38.3/chan-io-38.3 independant from system encoding
2023-03-12 10:49:18 +00:00
jan.nijtmans 1889ded114 Proposed fix for [db7a085bd9]: encoding convertfrom -strict utf-16 accepts partial surrogates. TODO: testcases, and implement for 8.7 too 2023-03-11 22:00:29 +00:00
apnadkarni 5533596329 Add testencoding Tcl_ExternalToUtf/Tcl_UtfToExternal for raw testing of corresponding C functions 2023-03-11 16:47:42 +00:00
apnadkarni 6f85588bab Add testencoding Tcl_ExternalToUtf/Tcl_UtfToExternal for raw testing of corresponding C functions 2023-03-11 16:43:36 +00:00
apnadkarni 93160df498 Merged 9.0. Note knownProfileBug constraint which mark questionable tests to be resolved later. 2023-03-10 15:29:36 +00:00
dgp 21388fa31e merge 8.7 2023-03-10 13:45:01 +00:00
dgp 0951d3f692 merge 8.6 2023-03-10 13:33:19 +00:00
dgp 93bf87ed85 Make test less fragile to changing set of options. 2023-03-10 13:32:47 +00:00
apnadkarni d06a38ae5d Merge 8.7 2023-03-10 09:53:32 +00:00
apnadkarni e9b9864f56 Fix parsing of fconfigure set -encoding* options 2023-03-10 07:37:55 +00:00
jan.nijtmans 494b4c8127 Fix cmdAH-4.3.13.00D80000.solo.utf-32le.tcl8.a testcase from tip-656-tcl9 branch, when TCL_UTF_MAX=3 2023-03-09 20:55:43 +00:00
apnadkarni 56f5c7751c Fix SetChannelOption parsing of -encoding* to match GetChannelOption 2023-03-09 10:47:12 +00:00
jan.nijtmans bd3a6be21b Merge 8.7 2023-03-09 10:22:55 +00:00
jan.nijtmans 962d8aed89 Merge 8.6 2023-03-09 10:21:54 +00:00
jan.nijtmans 5b0be62536 Adapt 2 testcases (io-39.16/io-39.16a), showing that "-encoding" can be shortened to "-en", but not to "-e" (because there is -eofchar too) 2023-03-09 10:08:02 +00:00
jan.nijtmans a1fb554585 Fix tests/tcltest.test testcases (missing "namespace import") 2023-03-09 09:39:59 +00:00
apnadkarni 552d2bb53f Merge 8.7 - winFCmd-1.24 differs in error code on Win 11 2023-03-09 02:52:51 +00:00
apnadkarni 1b7f525ec7 Merge 8.6 - winFCmd-1.24 differs in error code on Win 11 2023-03-09 02:50:32 +00:00
apnadkarni 38555b60a2 winFCmd-1.24 has different error code on Win 11 2023-03-09 02:47:53 +00:00
jan.nijtmans 9f1cf8d5ef Merge 8.7 2023-03-08 20:40:23 +00:00
jan.nijtmans 23becaa71a Merge 9.0 2023-03-08 20:37:56 +00:00
jan.nijtmans c3da6c8fed Merge core-8-branch 2023-03-08 20:16:32 +00:00
jan.nijtmans 468e5148b3 Merge 8.6 2023-03-08 20:15:43 +00:00
jan.nijtmans 7ed7017d94 Add "notWsl" test constraints. Clean up many testcases 2023-03-08 19:58:08 +00:00
jan.nijtmans 10f4d4565d More -Wconversion warning fixes 2023-03-08 15:01:20 +00:00
jan.nijtmans fa28b1f243 Merge 8.7 2023-03-08 11:12:04 +00:00
jan.nijtmans 3203978c65 Add "teststringobj newunicode". Not used in testcases yet. 2023-03-08 11:02:27 +00:00
jan.nijtmans ebfa9b6f2d ckalloc -> Tcl_Alloc and ckfree -> Tcl_Free 2023-03-08 09:36:14 +00:00
jan.nijtmans 8dbd350305 Merge 8.7 2023-03-07 20:14:23 +00:00
jan.nijtmans 73229a7e53 Merge 9.0 2023-03-07 20:13:24 +00:00
jan.nijtmans 9aea48988c Merge 8.7 2023-03-07 20:10:15 +00:00
jan.nijtmans 0e0d74624b Fix [b4af93cd9f]: uninitialized bytes in http11-1.13.0 2023-03-07 20:09:30 +00:00
jan.nijtmans fffb0bdce5 Merge 8.7 2023-03-07 18:23:15 +00:00
jan.nijtmans 82acd6a35a Merge 8.6 2023-03-07 18:14:39 +00:00
jan.nijtmans 5cf1eed910 Fix a few -Wconversion warnings 2023-03-07 17:56:45 +00:00
apnadkarni 8c5476848a Merge 8.7 - testchmod fixes 2023-03-07 12:53:58 +00:00
apnadkarni 4df874dd7f Merge 8.6 - testchmod fixes 2023-03-07 12:28:40 +00:00
apnadkarni 906268caa7 Merge testchmod fix 2023-03-07 10:46:31 +00:00
jan.nijtmans 1ae5fd8198 Merge 8.7 2023-03-07 07:41:26 +00:00
jan.nijtmans 01d6e02666 Merge 8.6 2023-03-07 07:34:21 +00:00
jan.nijtmans e10915b565 Fix [95e287b956]: uninit value use in stringObj-4.2 2023-03-07 07:23:10 +00:00
jan.nijtmans 03618f8c95 merge-mark 2023-03-07 07:06:51 +00:00
jan.nijtmans 071917e1b2 Fix [f3cb2a32d6]: uninitialized value in format-2.18. Also remove repeated call to Tcl_DStringInit() 2023-03-07 07:03:36 +00:00
apnadkarni 1f6cec5ff3 Fix testchmod and associated tests that always failed on Windows 2023-03-07 02:52:26 +00:00
apnadkarni fe7ee54772 Create new branch named "bug-win-testchmod" 2023-03-07 02:27:43 +00:00
jan.nijtmans f5ba8a8478 Proposed fix for [95e287b956]: uninit value use in stringObj-4.2 2023-03-06 21:01:45 +00:00
jan.nijtmans f4450abcf9 Proposed fix for [f3cb2a32d6]: uninitialized value in format-2.18 2023-03-06 19:58:53 +00:00
dgp 5e095a3a4d [b4af93cd9f] Proposed fix from apnadkarni. It works! 2023-03-06 18:17:19 +00:00
jan.nijtmans 3eb68691b8 ckfree() -> Tcl_Free() 2023-03-06 10:30:41 +00:00
jan.nijtmans f0e415c1e1 Merge 8.7 2023-03-06 10:28:47 +00:00
jan.nijtmans cfa443421b Tcl_WinTCharToUtf() is deprecated, so use Tcl_WCharToUtfDString() in stead. 2023-03-06 10:24:15 +00:00
pooryorick 296e4767ea Add new valgrind suppression items. 2023-03-06 07:00:48 +00:00
pooryorick fa795b478a Add new valgrind suppression items. 2023-03-06 06:59:52 +00:00
pooryorick 40e214cd76 Add new valgrind suppression items. 2023-03-06 06:58:13 +00:00
jan.nijtmans 7ec4501d37 Merge 8.7 2023-03-05 21:27:49 +00:00
jan.nijtmans 9e0cc9d630 Merge-mark (but also remove some lost spacing) 2023-03-05 21:16:33 +00:00
jan.nijtmans 9d2cc36a0e Fix [57bfcf43dd]: Remove unreachable code in Tcl_SetWideIntObj() 2023-03-05 21:09:46 +00:00
jan.nijtmans e4e1062338 Another round of -1 -> TCL_INDEX_NONE 2023-03-05 19:57:48 +00:00
apnadkarni 0968aa6de7 Merge 8.7: Bug [9c5a00c69d]. Fix ~user on Windows 2023-03-05 11:42:31 +00:00
pooryorick f736bb9d86 A better fix for Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-05 11:39:36 +00:00
apnadkarni 6e7d72c158 Merge 8.6: Bug [9c5a00c69d]. Fix ~user on Windows 2023-03-05 11:09:10 +00:00
apnadkarni 1f7d2aae34 Bug [9c5a00c69d]. Fix ~user on Windows 2023-03-05 09:57:29 +00:00
pooryorick 76edd58c3e A better fix for Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-05 07:11:15 +00:00
jan.nijtmans 923ff1e3ca More -1 -> TCL_INDEX_NONE 2023-03-05 00:26:54 +00:00
jan.nijtmans 33d81b98be Make dltest/pkg*.c simple example how to use Tcl_Size with Tcl_GetStringFromObj() 2023-03-04 18:12:49 +00:00
apnadkarni 234394e2df Merge 8.7 - Protect zlib errors with check for null interp 2023-03-04 16:33:36 +00:00
apnadkarni 7b3ef36925 Protect zlib errors with check for null interp 2023-03-04 16:26:00 +00:00
apnadkarni c862e57095 Add test for [9c5a00c69d], tilde expansion of ~user 2023-03-04 15:11:01 +00:00
apnadkarni 0229ba1283 Bug [9c5a00c69d]. Tilde expansion on Windows 2023-03-04 12:13:31 +00:00
jan.nijtmans 4e84e02684 Merge 8.7 2023-03-04 10:20:34 +00:00
jan.nijtmans 80b392ba8e Merge 8.6 2023-03-04 10:19:44 +00:00
jan.nijtmans e13edcba86 Test constraint notInCIenv no longer necessary (due to previous fix) 2023-03-04 10:18:41 +00:00
jan.nijtmans e95b015990 Merge 8.7 2023-03-04 10:13:19 +00:00
jan.nijtmans aebb7627f5 Merge 8.6 2023-03-04 10:09:21 +00:00
jan.nijtmans 6285c13367 Fix [1b8df10110]: Tcl_GetTime returns wrong usec value on Windows 2023-03-04 10:08:18 +00:00
jan.nijtmans 8f18e27691 Adapt type-casts to Tcl 9.0 signature of Tcl_Free/Tcl_Realloc/Tcl_AttemptRealloc 2023-03-03 13:04:11 +00:00
jan.nijtmans 7f3d1257ff ckfree() shouldn't be used in Tcl 9 core code any more 2023-03-03 13:03:02 +00:00
pooryorick e7b37f1737 Fix Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-03 12:39:09 +00:00
pooryorick 18385b8363 Fix Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-03 12:17:15 +00:00
pooryorick d3aa6839f4 Fix Valgrind "still reachable" report in TestcmdtokenCmd(). 2023-03-03 12:15:11 +00:00
apnadkarni cb3d36ad5a Bug [9a978f8323]: Fix large reads > 2GB 2023-03-03 10:47:51 +00:00
apnadkarni f4618fc2d9 Merge 9.0 - disable file perms tests on wsl 2023-03-02 08:00:48 +00:00
apnadkarni 1ad16ea481 Merge 8.7 - disable tests on WSL 2023-03-02 07:46:17 +00:00
apnadkarni b464703493 Merge 8.7: Disable more file permissions tests for WSL (not supported in WSL/NTFS) 2023-03-02 07:32:04 +00:00
apnadkarni 4d67456953 Disable more file permissions tests for WSL (not supported in WSL/NTFS) 2023-03-02 07:08:48 +00:00
apnadkarni 44fdf09f7b Bug [e778e3f804]. Fix error message for invalid profile name. 2023-03-02 06:41:39 +00:00
apnadkarni ad8dae7587 Bug [e778e3f804]. Fix error message for invalid profile name. 2023-03-02 06:29:10 +00:00
apnadkarni 806babb932 Add encoding test vector files 2023-03-02 04:48:00 +00:00
apnadkarni f736321295 Cherrypick [13537afd1b] - eliminate TCL_ENCODING_MODIFIED 2023-03-02 04:35:44 +00:00
apnadkarni b2cdedcec2 Eliminate TCL_ENCODING_MODIFIED flag 2023-03-02 04:16:44 +00:00
apnadkarni a0beeb8a76 Fix Tcl_UtfToExternalDStringEx call in macos code 2023-03-01 15:39:06 +00:00
apnadkarni 1d9ebbc740 Merge mark with core-8-branch 2023-03-01 14:57:20 +00:00
apnadkarni 5a3e0c869e Cherrypick [f1dd5f1cc7]: constrain tests not supported on WSL 2023-03-01 14:55:13 +00:00
apnadkarni 64e7f77040 Disable file permission tests under WSL as WSL does not support Unix file attrs without special config 2023-03-01 13:58:52 +00:00
apnadkarni cc5dd09db3 Merge trunk 2023-03-01 13:41:44 +00:00
apnadkarni 30a9b333ba Bug [9a978f8323]: crash reading large files 2023-03-01 13:18:17 +00:00
jan.nijtmans 261c174d97 Fix msvc build (with OPTS=symbols) 2023-03-01 11:06:17 +00:00
apnadkarni 0f06bb38e8 Merge 9.0. TclpSysalloc fix. 2023-03-01 08:01:51 +00:00
apnadkarni a6b4ef3d29 Fix [f8ef6b3670] crash. TclpSysAlloc macro was truncating size request to 32 bits on Windows. 2023-03-01 07:56:03 +00:00
apnadkarni 9522e37880 Merge 9.0 2023-03-01 07:19:07 +00:00
apnadkarni 00e1068c03 Cherrypick [070225e33d]. Move setting of profile flags to lower level functions in case they are called directly 2023-02-28 17:16:25 +00:00
apnadkarni 74b7d6bc14 Merge 8.7 2023-02-28 15:39:09 +00:00
apnadkarni 3d177bd8b5 int -> Tcl_Size to match TIP 2023-02-28 14:08:19 +00:00
jan.nijtmans 62d9150ef5 Merge 8.7 2023-02-28 13:36:00 +00:00
jan.nijtmans 4227ef37bb Put back testcase io-52.20, and re-fix [4a7397e0b3] 2023-02-28 13:33:04 +00:00
apnadkarni 1652c942d8 Merge 8.7 2023-02-28 13:25:34 +00:00
apnadkarni 5d56a5b435 Merge 8.7 2023-02-28 13:24:18 +00:00
jan.nijtmans 7c9fe49b51 Merge 8.7 2023-02-28 12:45:06 +00:00
jan.nijtmans bb80189110 Missing ')' 2023-02-28 12:43:53 +00:00
apnadkarni 1eac8ab060 Move setting of profile in flags parameter to lower level functions in case they are called directly 2023-02-28 12:25:34 +00:00
jan.nijtmans 1923d22832 Merge 8.7 2023-02-28 12:20:34 +00:00
jan.nijtmans 70e40dd53d Restore previous behavior for non-blocking mode, as for this mode the semantics of [read]/[gets] were not broken. This was the 'some agreement'.
The change in line 8286 is necessary for both blocking and non-blocking mode: Whenver the encoding change we need to reset the CHANNEL_ENCODING_ERROR flag.
2023-02-28 12:16:10 +00:00
pooryorick 7661972907 Reverted [d156af9fb76dd2f4] and removed tests io-52.20 io-75.6 io-75.7, as this
commit, intended to fix issue [b8f575aa2398b0e4], breaks the semantics of
[read] and [gets].  Such a change would require an accepted TIP. See [b8f575aa2398b0e4] for further discussion.

jn: @pouryorick See [b8f575aa2398b0e4] for the reason why this commit is not appropriate: It gets core-8-branch back in the buggy state it was, without even providing a real solution everyone agrees on. You shouldn't revert my patch just because I reverted yours.

pooryorick:  As I explained, the reason for this reversion is that it hard-codes an unapproved change in the semantics of [read] and [gets] into the test suite.  Jan, your statement that it's a "revenge" reversion is false.  I spent a month trying to find some alternative to this reversion before actually performing it.  A commit that codifes in its tests changes in semantcs to [read]/[gets] simply shouldn't be on core-8-branch.
2023-02-28 11:57:03 +00:00
pooryorick bb2f06fc73 Reverted [d156af9fb76dd2f4] and removed tests io-52.20 io-75.6 io-75.7, as this
commit, intended to fix issue [b8f575aa2398b0e4], breaks the semantics of
[read] and [gets].  Such a change would require an accepted TIP. See [b8f575aa2398b0e4] for further discussion.

jn: @pouryorick See [b8f575aa2398b0e4] for the reason why this commit is not appropriate: It gets core-8-branch back in the buggy state it was, without even providing a real solution everyone agrees on. You shouldn't revert my patch just because I reverted yours.

pooryorick:  As I explained, the reason for this reversion is that it hard-codes an unapproved change in the semantics of [read] and [gets] into the test suite.  Jan, your statement that it's a "revenge" reversion is false.  I spent a month trying to find some alternative to this reversion before actually performing it.  A commit that codifes in its tests changes in semantcs to [read]/[gets] simply shouldn't be on core-8-branch.
2023-02-28 11:42:15 +00:00
jan.nijtmans fadb24f26a Merge 8.7. And fix Tcl_UtfToExternal()/Tcl_ExternalToUtf() (at least - sufficient for tclZlib.c), such that it now returns an error when src and dst *both* exceed INT_MAX. To be discussed further. 2023-02-28 11:00:44 +00:00
jan.nijtmans 5d8ae9bf17 Merge 8.6 2023-02-28 10:36:25 +00:00
apnadkarni 8e139e5cd7 Merge bug-fb368527ae. Bug [fb368527ae] Large string truncation 2023-02-28 10:28:28 +00:00
jan.nijtmans da55e192ba Fix [f9eafc3886]: Error handling in zlib comment/filename 2023-02-28 10:18:28 +00:00
pooryorick 57d266423a Make the descriptions in doc/Tcl.n more concise and intuitive. 2023-02-28 10:13:25 +00:00
pooryorick d29598480f Make the descriptions in doc/Tcl.n more concise and intuitive. 2023-02-28 10:06:22 +00:00
pooryorick 7d6cf09e02 Make the descriptions in doc/Tcl.n more concise and intuitive. 2023-02-28 10:04:49 +00:00
pooryorick 8b417f0e1e Fix formatting issue in Tcl.n 2023-02-28 09:59:29 +00:00
pooryorick e743d3e487 Fix formatting issue in Tcl.n 2023-02-28 09:57:22 +00:00
jan.nijtmans a947270ff7 In case of combining TIP #494 (TCL_8_COMPAT) and #628 (building for Tcl 8.7 with 9.0 headers), ignore TCL_8_COMPAT macro. More Tcl_Size usage. 2023-02-28 07:45:27 +00:00
jan.nijtmans a1fe72fa4a Fix testcases 2023-02-27 20:50:33 +00:00
apnadkarni 85bf0db1e8 Fix crash. int->size_t needs +1 in comparisons. 2023-02-27 12:31:49 +00:00
jan.nijtmans c6bb33407a Fix [3d01d51bc4]: Tcl 9: Cannot write large strings to file. Also some size_t -> Tcl_Size changes. 2023-02-27 11:59:54 +00:00
apnadkarni e2d89615d5 Tests for encoding strings > 4GB (under perf constraint) 2023-02-27 04:15:07 +00:00
apnadkarni ed360ca42f Add perf constraint to large io tests to prevent memory faults on systems with limited memory 2023-02-27 03:13:38 +00:00
jan.nijtmans 6b172a2131 fill in bug ticket-nr 2023-02-26 21:37:15 +00:00
jan.nijtmans e7b8b9d2dd Proposed fix for [f9eafc3886]: Error handling in zlib comment/filename. With testcases 2023-02-26 20:12:43 +00:00
jan.nijtmans 152d7203ac Handle Tcl_UtfToExternal error in tclZlib.c 2023-02-26 17:19:07 +00:00
jan.nijtmans baf9b5e9bb Handle statePtr != NULL as well 2023-02-26 16:54:02 +00:00
jan.nijtmans cbda5cb9b2 Make Tcl_UtfToExternal()/Tcl_ExternalToUtf() report the error, if srcLen and dstLen are both > INT_MAX and therefore not all characters can be handled by this function. 2023-02-26 16:41:06 +00:00
jan.nijtmans 6ab1efe806 merge-mark 2023-02-26 16:04:57 +00:00
jan.nijtmans 08a6b105e5 Merge 8.6 2023-02-26 16:04:03 +00:00
jan.nijtmans 8fdf20ec2b More dstring testcases, extracted from [46dda6fc29] 2023-02-26 16:01:29 +00:00
apnadkarni 4e6558b44a Fix [46dda6fc29] - trace crash caused by TclScanElement 2023-02-26 15:42:37 +00:00
jan.nijtmans 5ffda39949 Move the "srcLen -= srcChunkRead;" past the "if ((result != TCL_CONVERT_NOSPACE)..." (where it originally was), since this isn't needed if the loop ends anyway. 2023-02-26 12:56:18 +00:00
jan.nijtmans 79cbdf745a (size_t) -1 -> TCL_INDEX_NONE 2023-02-26 12:27:43 +00:00
apnadkarni deec081e74 Also fix [90ff9b7f73] - writes of exactly 4294967295 bytes 2023-02-26 07:15:06 +00:00
apnadkarni 2fb6b99620 Minor refactor, add tests 2023-02-26 06:26:01 +00:00
apnadkarni 7b0b2ebd37 Fix large writes to file. Need to break into INT_MAX size chunks. 2023-02-25 17:23:42 +00:00
apnadkarni 2a5b403768 Experimental fix for [fb368527ae] - length truncation 2023-02-25 16:29:09 +00:00
apnadkarni aa2b48262b Fix and tests for [46dda6fc29] 2023-02-25 09:26:06 +00:00
apnadkarni a826e66f11 Add tests for Bug [46dda6fc29] 2023-02-25 08:58:31 +00:00
apnadkarni 8390c51fca Fix [1d074b177a]. Failure to read .tclshrc 2023-02-25 07:35:21 +00:00
apnadkarni 4207c3d5c3 Tests pass modulo couple of differences in Tcl 8 and 9 default behavior to be discussed (tickets logged) 2023-02-25 06:13:21 +00:00
apnadkarni f0f2ee57f9 Compiles and runs. Tests still to be ported. 2023-02-25 03:03:46 +00:00
apnadkarni 50cafc9f13 Create new branch named "tip-656-tcl9" 2023-02-24 13:37:45 +00:00
apnadkarni 58db3d68eb Add teststringobj newunicode command to test invalid input to Tcl_NewUnicodeObj 2023-02-24 13:34:15 +00:00
apnadkarni 99a24e7883 Raise error on invalid flags 2023-02-24 10:32:37 +00:00
apnadkarni 76adf3151b Merge 8.7 2023-02-24 09:57:07 +00:00
apnadkarni 854369a67c Factor out encoding test vectors into separate file so they can be used for file IO tests 2023-02-24 09:35:09 +00:00
jan.nijtmans d5e9da898f Merge 8.7 2023-02-24 08:33:24 +00:00
jan.nijtmans 1c3c25097b int -> Tcl_Size in tclEncoding.c (making the diff between Tcl 8.7 and 9.0 smaller) 2023-02-24 08:25:27 +00:00
apnadkarni 485bc2fd88 Bug [40c61a5d10]. Fix syntax error message. 2023-02-24 03:35:31 +00:00
apnadkarni fe5707421f Merge [bug-dab7fd5973]. Pick up memory leak fix from 8.7. Thanks, Jan 2023-02-24 03:10:16 +00:00
jan.nijtmans 6caf484379 -strictencoding 1 -> -encodingprofile strict (since the testcases placed back in previous commit didn't have that yet) 2023-02-23 21:31:04 +00:00
jan.nijtmans 10c559acbf Remove left-over traces of [0a74820b6d], which was merged into the apn-encoding-profile and landed into tip-656. This commit was merged premature into core-8-branch, leaving a [dab7fd5973|memory leak] 2023-02-23 21:20:21 +00:00
apnadkarni 186cc71273 Had forgotten to remove disabled code 2023-02-23 13:24:58 +00:00
apnadkarni da915fdadf New signature for Tcl_ExternalToUtfDStringEx and Tcl_UtfToExternalDStringEx as per TIP 656 2023-02-23 13:19:45 +00:00
apnadkarni e469cdf190 Merge 8.7 2023-02-23 11:22:22 +00:00
jan.nijtmans 190f9219d5 Merge 8.7 2023-02-23 11:02:00 +00:00
jan.nijtmans 956059093c Fix [4bea02e811]: encoding convertfrom -strict ascii \x7f generates exception
Many other encodings had the same problem, and also the reverse happened: encodings which should throw an exception with -strict but didn't (within range 0x80-0x9F)
2023-02-23 11:00:48 +00:00
jan.nijtmans ce349b05df merge-mark 2023-02-23 10:45:56 +00:00
jan.nijtmans bf7b1adb89 See [d19fe0a5b] for follow-up to previous commit 2023-02-23 10:44:56 +00:00
apnadkarni d1920b380d Fix gcc warnings and encoding error message (bug [40c61a5d10]) 2023-02-23 10:22:58 +00:00
jan.nijtmans 9ae7f4dc4f merge-mark 2023-02-22 20:46:01 +00:00
jan.nijtmans 1d76ffb03b minor bug-fix in utf-16/utf-32: 2 testcases failed in Tcl 9 compatibility mode (-DTCL_NO_DEPRECATED) 2023-02-22 20:44:13 +00:00
jan.nijtmans 7c6f71019a Merge 8.7 2023-02-22 20:27:34 +00:00
jan.nijtmans 8f37d5c24e Merge 8.6 2023-02-22 17:56:42 +00:00
jan.nijtmans c3e063b0aa Fix [d19fe0a5b]: Handling incomplete byte sequences for utf-16/utf-32 2023-02-22 17:34:22 +00:00
apnadkarni 320eaab501 Merge 8.7 2023-02-22 15:28:00 +00:00
apnadkarni 2935048126 Add ICU tests for unmapped characters. 2023-02-22 13:42:55 +00:00
jan.nijtmans 12345dfed8 re-generate macDingbats.enc, so it can now throw exceptions for the range 0x8E-0x9F 2023-02-22 13:34:04 +00:00
jan.nijtmans 78db448fff Make txt2enc smarter, so we don't have to add DELETE any more in all original tables, better keep them as-is. 2023-02-22 13:31:41 +00:00
jan.nijtmans 58f1209a70 Merge 8.7. Adapt more testcases not to depend on the system encoding any more 2023-02-22 13:03:31 +00:00
jan.nijtmans e106525498 Merge 8.7 2023-02-22 07:48:10 +00:00
jan.nijtmans f0284298ad Fix [5607d6482c]: strict ucs-2 never implemented (TIP #346/#656) 2023-02-22 07:28:27 +00:00
jan.nijtmans 03a9d6928d Merge 8.6 2023-02-22 07:24:42 +00:00
jan.nijtmans 5219c94af5 Fix [534172ff5b]: Crash in DeleteReflectedChannelMap (introduced via tcllib 1.21) 2023-02-22 07:21:15 +00:00
jan.nijtmans a970bffd00 Add 0x7F: DELETE to more mac* encodings (so re-generating doesn't remove it again) 2023-02-21 23:22:45 +00:00
jan.nijtmans f95599f4d4 More encoding fixes, e.g. range 0x80-0x9F for dingbats and symbol. Remove "-m" option from txt2enc.c tool, since the same is already handled in the table encoding code in Tcl itself. This was wat prevent Tcl to handle throwing exceptions correctly 2023-02-21 23:16:14 +00:00
jan.nijtmans c606ae1574 Proposed fix for [d19fe0a5b]: Handling incomplete byte sequences for utf-16/utf-32 2023-02-21 17:50:36 +00:00
apnadkarni 9b8fa27457 Rework ICU tests to check validity of whole charmap in one test, else too many tests. 2023-02-21 17:27:16 +00:00
jan.nijtmans 42956f6f09 Some test-cases start failing in 9.0-compatibility-mode (-DTCL_NO_DEPRECATED), if the system encoding is one with gaps. So, better use iso8859-1 for those testcases 2023-02-21 16:58:13 +00:00
jan.nijtmans 417f868693 Proposed fix for [534172ff5b]: Crash in DeleteReflectedChannelMap (introduced via tcllib 1.21) 2023-02-21 16:09:18 +00:00
apnadkarni 4d644dfb73 Generate test data from ICU UCM data files. SBCS only for now 2023-02-21 16:03:18 +00:00
jan.nijtmans 3315012c95 re-generated 8 more encodings 2023-02-20 21:43:29 +00:00
jan.nijtmans 8660fd1af2 Two more files, re-generated 2023-02-20 20:52:06 +00:00
jan.nijtmans 280034d2ab Proposed fix for [4bea02e811]: encoding convertfrom -strict ascii \x7f generates exception 2023-02-20 20:41:00 +00:00
apnadkarni fa9ac8a850 Fix replace profile handling of truncated surrogates 2023-02-20 15:41:15 +00:00
apnadkarni 41af9f9e84 Add UTF16 and UTF32 tests 2023-02-20 15:08:58 +00:00
jan.nijtmans 23d9ca0ec4 Proposed fix for [5607d6482c]: strict ucs-2 never implemented (TIP #346/#656) 2023-02-19 11:41:44 +00:00
apnadkarni 9f595d2fa3 Remove knownBug test constraints now that fix has been merged from core-8-branch 2023-02-19 07:40:29 +00:00
apnadkarni 41c5d1cd91 Minor refactoring/fixes after merge 2023-02-18 17:41:44 +00:00
apnadkarni 933e1c8e0c Merge 8.7 to pick up UTF-8 encoding fix 2023-02-18 17:34:25 +00:00
apnadkarni 3d2dc70845 Done with invalid utf-8 table 2023-02-18 16:25:57 +00:00
jan.nijtmans 0892c6f37c Merge 8.7 2023-02-17 19:15:28 +00:00
jan.nijtmans c731ca1ffd Fix for [885c86a9a0]: convertfrom utf8 breaks for 4 byte utf encodings 2023-02-17 19:14:42 +00:00
apnadkarni fdbb12eced Part way through utf-8 test equivalence classes 2023-02-17 18:59:28 +00:00
apnadkarni 359092510b Merge 8.7 2023-02-17 11:08:17 +00:00
jan.nijtmans 45796af99d complete fix 2023-02-16 21:50:53 +00:00
jan.nijtmans 6bcdbfbf84 Merge 8.7 2023-02-16 21:41:49 +00:00
jan.nijtmans 6d674a96a1 Final part of [10c2c17c32]: UTF-LE32 encoder mapping of surrogates. Problem was in testcase, not in actual code 2023-02-16 21:29:07 +00:00
jan.nijtmans a3f58db271 Merge 8.7 2023-02-16 21:14:24 +00:00
jan.nijtmans 2c3252bc5c Fix [5e6ae6e05e]: Implement -strict correctly for cesu-8 2023-02-16 21:03:48 +00:00
jan.nijtmans d790e81db2 Fix [33ab6d08eb]: Inconsistent behavior with encoding convertfrom -failindex 2023-02-16 20:57:47 +00:00
apnadkarni 684cbb8f5c Bit more work on encoding test framework. Long way to go. 2023-02-16 17:15:35 +00:00
jan.nijtmans 0563a78902 Fix [5e6ae6e05e]: Implement -strict correctly for cesu-8 2023-02-16 16:59:10 +00:00
jan.nijtmans 5053891183 Try to fix [885c86a9a0]. Doesn't work completely yet. 2023-02-16 07:59:09 +00:00
jan.nijtmans f06c5e7af1 Fix for [33ab6d08eb]: Inconsistent behavior with encoding convertfrom -failindex 2023-02-15 20:26:10 +00:00
apnadkarni 96e60d29b7 Start on expanding encoding tests 2023-02-15 17:27:55 +00:00
jan.nijtmans 7fb1760f42 Merge 8.7. Test-case only 2023-02-15 07:30:03 +00:00
jan.nijtmans 4c2d834fca Ticket [10c2c17c32] follow-up. One output char too much with -failindex. 2023-02-15 07:21:55 +00:00
apnadkarni 6aed3e7d30 Merge 8.7 2023-02-15 05:24:48 +00:00
jan.nijtmans fb260e8382 Merge 8.7 2023-02-14 22:06:32 +00:00
jan.nijtmans 5040a69c28 Fix for [bd1a60eb9c]: convertfrom utf-8 strict mode allows surrogates in input sequence 2023-02-14 21:42:01 +00:00
jan.nijtmans 38df355850 Complete fix for [bd1a60eb9c]. Also fix a bug in the tableencoding. With testcases. 2023-02-14 20:50:26 +00:00
apnadkarni 891d60a9ad Remove obsolete comment 2023-02-14 11:56:49 +00:00
apnadkarni a750ed2c24 Fix uniqueness parsing fconfigure -encoding / -encodingprofile options 2023-02-14 11:39:35 +00:00
apnadkarni 85320f8fd0 Bug [bd1a60eb9c]. Eliminate TCL_ENCODING_UTF. 2023-02-14 11:37:35 +00:00
jan.nijtmans 2974b57279 Make a start fixing [bd1a60eb9c]. WIP 2023-02-14 07:29:36 +00:00
jan.nijtmans 0c306c8f81 Merge 8.7. Mark (new) testcase encoding-16.15 as "knownBug": still needs a fix. 2023-02-13 10:12:45 +00:00
jan.nijtmans 05f4bc701f Fix for [10c2c17c32]: UTF-LE32 encoder mapping of surrogates. With testcases (both for utf-32 and utf-16, which had the same bug) 2023-02-13 08:39:29 +00:00
apnadkarni 86d84d444c Tentative fix for [bd1a60eb9] - surrogates in strict utf-8 2023-02-12 17:34:58 +00:00
apnadkarni 0c764d2b03 Minor fixes and tests 2023-02-12 16:56:17 +00:00
apnadkarni bf448a6421 Added 'encoding profiles' 2023-02-12 11:04:16 +00:00
apnadkarni b5095134df Minor readability changes 2023-02-12 06:15:59 +00:00
jan.nijtmans bfaa709c2e Merge 8.7 2023-02-12 01:00:58 +00:00
jan.nijtmans 3954b7c2a3 Proposed fix (and testcases) for [4a7397e0b3]: Tcl 9: fcopy with -strictencoding 1 UTF-8 channels 2023-02-12 00:49:22 +00:00
apnadkarni 727887b6dc Partial implementation of replace profile 2023-02-11 17:38:07 +00:00
apnadkarni c2f0e2f8da Eliminate TCL_ENCODING_{STRICT,NOCOMPLAIN} 2023-02-11 01:51:32 +00:00
jan.nijtmans bab9170bdc Proposed fix (and testcases) for [4a7397e0b3]: Tcl 9: fcopy with -strictencoding 1 UTF-8 channels 2023-02-10 20:22:07 +00:00
apnadkarni e26214c287 Phase out (almost) STRICT and NOCOMPLAIN flags. 2023-02-10 17:07:12 +00:00
jan.nijtmans fd83fb931e Add 4 more testcases, showing that the same bug is present in utf-16 as well. Also fix the bug (really, now!) 2023-02-09 19:52:00 +00:00
apnadkarni 9d1ba01f11 Modify encoding C API to use profiles (in progress) 2023-02-09 17:04:33 +00:00
apnadkarni d46a244159 Add equivalent tests from ff630bf370 2023-02-09 17:03:31 +00:00
jan.nijtmans b185a55c3b Add 4 testcases, showing that the bug fix introduces another (minor) problem. To be fixed soon 2023-02-09 07:55:29 +00:00
apnadkarni 4294befd8b Do not have -failindex imply -strict 2023-02-09 07:27:43 +00:00
apnadkarni d04dfba748 Merge bug-10c2c17c32 2023-02-09 06:56:39 +00:00
apnadkarni 615082f1fa Merge core-8-branch 2023-02-07 17:10:07 +00:00
apnadkarni b741dab392 Fix tcltest to not exit on encoding errors when printing to stdout 2023-02-07 11:25:22 +00:00
apnadkarni e0ee29b9b6 Refactor encoding tests for broader coverage and easier test case management 2023-02-07 11:23:52 +00:00
apnadkarni 694ae19131 Fix call to EncodingConvertParseOption for decoding 2023-02-07 11:22:08 +00:00
jan.nijtmans f5f5ff4257 Proposed fix for [10c2c17c32]: UTF-LE32 encoder mapping of surrogates. TODO: testcase 2023-02-06 22:43:30 +00:00
pooryorick 597d3b9e7b Fix for [b8f575aa2398b0e4] and [154ed7ce564a7b4c], double-[read]/[gets]
problem. Partial-read functionality commented out.
2023-02-04 14:10:40 +00:00
pooryorick f238eb1dbc Fix test io-75.14. 2023-02-04 00:28:12 +00:00
pooryorick 4b5b655e61 Fix for [b8f575aa2398b0e4] and [154ed7ce564a7b4c], double-[read]/[gets]
problem. Partial-read functionality commented out.

jn: First, see broken build [https://github.com/tcltk/tcl/actions/runs/4082362246/jobs/7036637005|here]. Second: Moving this to core-8-branch is getting TIP #653 into 8.7 without being voted upon. It's simply not ready.

pooryorick:  That second statement is false. The parts of this fix that implement TIP #653 are specifically commented out.
2023-02-03 22:15:25 +00:00
pooryorick 52fc9a970c Fix for [b8f575aa2398b0e4] and [154ed7ce564a7b4c], double-[read]/[gets]
problem.  Partial-read functionality commented out.
2023-02-02 22:51:26 +00:00
apnadkarni 100d8ce724 Update tests to use -encodingprofile 2023-02-02 16:43:12 +00:00
apnadkarni e31133e3b0 Change encoding error options to fconfigure to encoding profiles 2023-02-02 15:37:21 +00:00
apnadkarni 26e89b4b3c Use common option parsing for ConvertfromObjCmd. Fix test error messages. 2023-02-02 12:23:37 +00:00
apnadkarni 637e7224c9 Replace encoding -strict etc. with -profile 2023-02-02 11:52:31 +00:00
jan.nijtmans c529405c65 Merge 8.7 2023-02-02 07:17:06 +00:00
jan.nijtmans de0a637d7c Fix documentation on "encoding" command 2023-02-02 07:12:34 +00:00
jan.nijtmans 536651d954 Merge 8.7 2023-02-01 23:02:16 +00:00
jan.nijtmans b9c893dbc9 Renumber testscase, sync with Tcl 9.0 2023-02-01 21:01:51 +00:00
jan.nijtmans 6b6d121149 merge-mark 2023-02-01 08:13:06 +00:00
jan.nijtmans 3eaad4bbc9 (cherry-pick) Make Tcl_UniCharToUtf more readable and add test to exercise surrogate handling. (test-case was still missing, which cannot be used in Tcl 8.6) 2023-02-01 08:10:12 +00:00
jan.nijtmans 44dd5d86bc merge-mark 2023-02-01 07:33:13 +00:00
jan.nijtmans 537c8e77ba (cherry-pick) Make Tcl_UniCharToUtf more readable and add test to exercise surrogate handling. 2023-02-01 07:32:14 +00:00
jan.nijtmans 5866ef6d2a (Cherry-pick) Make Tcl_UniCharToUtf more readable. 2023-02-01 07:29:48 +00:00
pooryorick f365be7f4d Merge trunk. 2023-02-01 00:34:50 +00:00
pooryorick 0184ebda4f Make Tcl_UniCharToUtf more readable and add test to exercise surrogate
handling.
2023-01-31 23:04:56 +00:00
pooryorick 078a694834 Fix error introduced in [3e5e37f83b058f3d] for Tcl_UniCharToUtf, and add test. 2023-01-31 22:15:02 +00:00
jan.nijtmans e5272c9be6 Remove incorrect comment. See: [https://www.magicsplat.com/tcl9/tcl9unicode.html#surrogates-as-literals]. Thanks, Ashok, for noticing this! 2023-01-31 17:34:05 +00:00
jan.nijtmans 596e33bb9e Remove incorrect comment. See: [https://www.magicsplat.com/tcl9/tcl9unicode.html#surrogates-as-literals]. Thanks, Ashok, for noticing this! 2023-01-31 17:30:59 +00:00
jan.nijtmans 081c085c0f merge-mark 2023-01-31 08:14:00 +00:00
jan.nijtmans 64e3a23bfd SetFlag -> GotFlag (since SetFlag always returns 1, this is nonsence in an if() statement). Also add test-case, showing that it was actually wrong, in behavior too. 2023-01-31 07:49:16 +00:00
pooryorick 0219b700b1 Update code comments for Tcl_UniCharToUtf(). 2023-01-30 19:37:35 +00:00
pooryorick a70ce8697c Make Tcl_UniCharToUtf() more readable. 2023-01-30 19:14:05 +00:00
pooryorick 7a5be2cdbd A branch of Tcl that does not look backwards. 2023-01-30 19:11:18 +00:00
dgp 58446472bb merge 8.7 2023-01-30 15:57:39 +00:00
dgp d3dae9eba4 silence compiler warning 2023-01-30 15:37:41 +00:00
pooryorick 8c0f76a7de A few more readability changes to Tcl_UniCharToUtf()
jn: Please, don't do that here. Tcl_UniCharToUtf() is shared between 8.6, 8.7 and 9.0. So if you want to make it easier to read, it should be done on all 3 branches. I know you only care about "trunk", but it makes maintenance on 8.6/8.7/9.0 harder than it already is. I don't want to spend time on reviewing such kind of changes, and no-one else is doing it. Thanks for understanding (I hope)!
2023-01-30 11:59:41 +00:00
pooryorick 4d235ca93a Make Tcl_UniCharToUtf() a little easier to read. 2023-01-30 11:22:28 +00:00
jan.nijtmans 5b86b255d4 Another situation where TCL_COMBINE handling gives a strange result (utf-32 encoder) 2023-01-28 20:50:36 +00:00
jan.nijtmans 468b1a4346 Fix "format %c 0x10000041", should give the same answer as in Tcl 8.6 (Handling of TCL_COMBINE flag should not be visible at script level) 2023-01-28 18:50:32 +00:00
pooryorick 7f87f0f8ea Add some comments and tidy code. 2023-01-27 19:15:09 +00:00
jan.nijtmans 5d13f6b527 Merge 8.7 2023-01-27 15:10:36 +00:00
jan.nijtmans 0318ff75d9 Fix off-by-one error in tclCmdAH.c, with testcases showing that it works now. 2023-01-27 14:48:37 +00:00
jan.nijtmans 06de3a9ba1 new testcase encoding-18.1. Testcase cleanup 2023-01-27 14:23:08 +00:00
jan.nijtmans d838764849 Update fcopy documentation regarding -size argument 2023-01-27 08:20:57 +00:00
jan.nijtmans 8ea5f2cfce Update fcopy documentation regarding -size argument 2023-01-27 08:17:34 +00:00
pooryorick 23e46e5885 Merge 8.7 2023-01-27 00:46:36 +00:00
pooryorick d271c9f407 Fix for [ee08ed090b0a5408], sporadic segmentation fault in
coroutine.test/coroutine-7.4.
2023-01-26 23:55:30 +00:00
jan.nijtmans 97041036d3 Merge 8.7 2023-01-24 20:05:00 +00:00
pooryorick 805fa175fc For [read] and [gets] encoding errors, use "-result read" in return options
dictionary instead of just "-result".
2023-01-08 10:07:46 +00:00
pooryorick 985ea00b16 Merge py-b8f575aa23: Fix for [154ed7ce56], Tcl 9: [gets] on -strictencoding 1 configured channel. 2023-01-02 23:12:02 +00:00
pooryorick 3919b0a0b4 Add test for [gets] in non-strict mode after an encoding error. 2022-12-30 21:53:47 +00:00
pooryorick 63e04b3c2d New test, io-12.9.strict, for issue report [1bedc53c8cb878f0]. 2022-12-30 21:05:56 +00:00
pooryorick a801c2d474 Fix DoReadChars() to correctly discard encoding errors after eofchar has been seen, and add new test, io-75.8.invalid. 2022-12-30 20:27:47 +00:00
pooryorick 3b45005127 Arrange new code in DoReadChars to ensure that final steps are always taken. 2022-12-29 22:59:10 +00:00
pooryorick 0f0fc59c9f merge py-b8f575aa23 after updating fix so that all tests pass.
jn: let's wait for more review, since test-cases were modified. This is more than only a bug-fix
2022-12-28 22:58:53 +00:00
pooryorick f2cc84c99a Update fix so that the two failing tests, iocmd-23.8 and iortrans-4.7 now pass. 2022-12-28 22:46:37 +00:00
pooryorick 4a8b2cf10f A better fix for [b8f575aa23], as it maintains the expectation that synchronous
[read] results in an error when invalid data is encountered.

someone other than pooryorick:  Pushed this check-in back on to a review branch.  It needs more baking/review.
As is, it makes two tests fail, and it introduces a new element "-result" to
the return options dictionary.
2022-12-28 12:07:18 +00:00
512 changed files with 24322 additions and 26466 deletions
+6
View File
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
+3 -3
View File
@@ -19,7 +19,7 @@ jobs:
- name: Build
run: make all
env:
CFLAGS: -arch x86_64 -arch arm64e
CFLAGS: -arch x86_64 -arch arm64
- name: Run Tests
run: make test styles=develop
env:
@@ -51,13 +51,13 @@ jobs:
# Note that macOS is always a 64 bit platform
run: ./configure --enable-dtrace --enable-framework ${CFGOPT} "--prefix=$HOME/install" || (cat config.log && exit 1)
env:
CFLAGS: -arch x86_64 -arch arm64e
CFLAGS: -arch x86_64 -arch arm64
CFGOPT: ${{ matrix.cfgopt }}
- name: Build
run: |
make all tcltest
env:
CFLAGS: -arch x86_64 -arch arm64e
CFLAGS: -arch x86_64 -arch arm64
- name: Run Tests
run: |
make test
+1 -1
View File
@@ -62,7 +62,7 @@ jobs:
sudo chmod a+x /usr/local/bin/macher
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
echo "CREATE_DMG=$(cd create-dmg;pwd)/create-dmg" >> $GITHUB_ENV
echo "CFLAGS=-arch x86_64 -arch arm64e" >> $GITHUB_ENV
echo "CFLAGS=-arch x86_64 -arch arm64" >> $GITHUB_ENV
- name: Configure
run: ./configure --disable-symbols --disable-shared --enable-zipfs
working-directory: unix
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tcl8</name>
<name>tcl9</name>
<comment></comment>
<projects>
</projects>
+6 -31
View File
@@ -20,13 +20,13 @@ jobs:
compiler: gcc
env:
- BUILD_DIR=unix
- name: "Linux/GCC/Shared: UTF_MAX=4"
- name: "Linux/GCC/Shared: UTF_MAX=3"
os: linux
dist: focal
compiler: gcc
env:
- BUILD_DIR=unix
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=3"
- name: "Linux/GCC/Shared: NO_DEPRECATED"
os: linux
dist: focal
@@ -83,13 +83,6 @@ jobs:
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: focal
@@ -215,15 +208,6 @@ jobs:
script:
- 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=utf16' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utf16' '-f' makefile.vc test
- name: "Windows/MSVC/Shared: NO_DEPRECATED"
os: windows
compiler: cl
@@ -270,15 +254,6 @@ jobs:
script:
- 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=utf16' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utf16' '-f' makefile.vc test
- name: "Windows/MSVC-x86/Shared: NO_DEPRECATED"
os: windows
compiler: cl
@@ -326,12 +301,12 @@ jobs:
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
- choco install -y make zip
- cd ${BUILD_DIR}
- name: "Windows/GCC/Shared: UTF_MAX=4"
- name: "Windows/GCC/Shared: UTF_MAX=3"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=3"
before_install: *makepreinst
- name: "Windows/GCC/Shared: NO_DEPRECATED"
os: windows
@@ -368,12 +343,12 @@ jobs:
env:
- BUILD_DIR=win
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: UTF_MAX=4"
- name: "Windows/GCC-x86/Shared: UTF_MAX=3"
os: windows
compiler: gcc
env:
- BUILD_DIR=win
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=4"
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=3"
before_install: *makepreinst
- name: "Windows/GCC-x86/Shared: NO_DEPRECATED"
os: windows
+6 -6
View File
@@ -1382,7 +1382,7 @@ a better first place to look now.
2012-05-03 Jan Nijtmans <nijtmans@users.sf.net>
* compat/zlib/*: Upgrade to zlib 1.2.7 (pre-built dll is still 1.2.5,
* compat/zlib/*: Upgrade to zlib 1.2.7 (prebuilt dll is still 1.2.5,
will be upgraded as soon as the official build is available)
2012-05-03 Don Porter <dgp@users.sourceforge.net>
@@ -5482,7 +5482,7 @@ a better first place to look now.
* generic/tclIORChan.c (ReflectClose, ReflectInput, ReflectOutput,
(ReflectSeekWide, ReflectWatch, ReflectBlock, ReflectSetOption,
(ReflectGetOption, ForwardProc): [Bug 2978773]: Preserve
ReflectedChannel* structures across handler invokations, to avoid
ReflectedChannel* structures across handler invocations, to avoid
crashes when the handler implementation induces nested callbacks and
destruction of the channel deep inside such a nesting.
@@ -6363,7 +6363,7 @@ a better first place to look now.
2009-12-28 Donal K. Fellows <dkf@users.sf.net>
* unix/Makefile.in (trace-shell, trace-test): [FRQ 1083288]: Added
targets to allow easier tracing of shell and test invokations.
targets to allow easier tracing of shell and test invocations.
* unix/configure.in: [Bug 942170]: Detect the st_blocks field of
* generic/tclCmdAH.c (StoreStatData): 'struct stat' correctly.
@@ -6847,7 +6847,7 @@ a better first place to look now.
* unix/tclUnixChan.c (TtyParseMode): Partial undo of Donal's tidy-up
from a few days ago (2009-11-9, not in ChangeLog). It seems that
strchr is apparently a macro on AIX and reacts badly to pre-processor
strchr is apparently a macro on AIX and reacts badly to preprocessor
directives in its arguments.
2009-11-16 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
@@ -7141,7 +7141,7 @@ a better first place to look now.
package-* that were for building Solaris packages. Appears that the
pieces needed for these targets to function have never been present in
the current era of Tcl development and belong completely to Tcl
pre-history.
prehistory.
2009-10-19 Don Porter <dgp@users.sourceforge.net>
@@ -8709,7 +8709,7 @@ a better first place to look now.
2009-01-19 David Gravereaux <davygrvy@pobox.com>
* win/build.vc.bat: Improved tools detection and error message
* win/makefile.vc: Reorganized the $(TCLOBJ) file list into seperate
* win/makefile.vc: Reorganized the $(TCLOBJ) file list into separate
parts for easier maintenance. Matched all sources built using -GL to
both $(lib) and $(link) to use -LTCG and avoid a warning message.
Addressed the over-building nature of the htmlhelp target by moving
+1 -1
View File
@@ -388,7 +388,7 @@
the beginning of the test run
* tests/basic.test: Use version information defined in tcltest instead
of hardcoded version number
of hard-coded version number
* tests/socket.test: package require tcltest before attempting to use
variable defined in tcltest namespace
+8 -8
View File
@@ -103,7 +103,7 @@
119398]
* library/init.tcl (unknown): Added specific level parameters to
all uplevel invokations to boost performance; didn't dare touch
all uplevel invocation to boost performance; didn't dare touch
the "namespace inscope" stuff though, since it looks sensitive
to me! Should fix [Bug 123217], though testing is tricky...
@@ -348,7 +348,7 @@
makeFile/makeDirectory and removeFile/removeDirectory.
* tests/basic.test: Changed references to tcltest::tclVersion to
hardcoded numbers.
hard-coded numbers.
* generic/tcl.h: Changed reference to tcltest2.tcl and tcltest.tcl in
comments to tests/basic.test.
@@ -1121,7 +1121,7 @@
2000-06-27 Eric Melski <ericm@scriptics.com>
* tests/stringObj.test: Tweaked tests to avoid hardcoded high-ASCII
* tests/stringObj.test: Tweaked tests to avoid hard-coded high-ASCII
characters (which will fail in multibyte locales); instead used \uXXXX
syntax. [Bug: 3842].
@@ -1356,7 +1356,7 @@
* doc/source.n:
* doc/Eval.3:
* tests/source.test:
* generic/tclIOUtil.c (Tcl_EvalFile): added explicit \32 (^Z) eofchar
* generic/tclIOUtil.c (Tcl_EvalFile): added explicit \x1A (^Z) eofchar
(affects Tcl_EvalFile in C, "source" in Tcl). This was implicit on
Windows already, and is now cross-platform to allow for scripted
documents.
@@ -1546,7 +1546,7 @@
* unix/mkLinks: Regen'd with new mkLinks.tcl.
* unix/mkLinks.tcl: Fixed indentation, made link setup more
intelligent (only do one existance test per man page, instead of one
intelligent (only do one existence test per man page, instead of one
per function).
* doc/library.n: Fixed .SH NAME macro to include each function
@@ -1641,7 +1641,7 @@
2000-04-21 Brent Welch <welch@scriptics.com>
* library/http2.1/http.tcl: More thrashing with the "server closes
without reading post data" scenario. Reverted to the previous filevent
without reading post data" scenario. Reverted to the previous fileevent
configuratiuon, which seems to work better with small amounts of post
data.
@@ -2267,7 +2267,7 @@
* library/auto.tcl: Fixed the regular expression that performs $
escaping before sourcing a file to index. It was erroneously adding \
escapes even to $'s that were already escaped, effectively
"un-escaping" those $'s. (bug #2611).
"unescaping" those $'s. (bug #2611).
2000-01-27 Eric Melski <ericm@scriptics.com>
@@ -2378,7 +2378,7 @@
* generic/tclVar.c: Changed behavior of variable command when name
refers to an element in an array (ie, "variable foo(x)") to always
return an error, regardless of existance of that element in the array
return an error, regardless of existence of that element in the array
(now behavior is consistant with docs too) (bug #981).
2000-01-20 Jeff Hobbs <hobbs@scriptics.com>
+7 -7
View File
@@ -15,7 +15,7 @@
* tests/winPipe.test:
* win/tclWinPipe.c (Tcl_WaitPid):
* win/tclWinTest.c: Gave Tcl_WaitPid the ability to return a Win32
exception code translated into a posix style SIG*. This allows [close]
exception code translated into a Posix-style SIG*. This allows [close]
to report "CHILDKILLED" without the meaning getting lost in a
truncated exit code. In TclCleanupChildren(), TclpGetPid() had to get
moved to before Tcl_WaitPid() as the the handle is removed from the
@@ -1941,7 +1941,7 @@
* tests/pkg/samename.tcl: restored. needed by pkgMkIndex.test.
* library/tcltest/tcltest.tcl: restored writeability testing of
* library/tcltest/tcltest.tcl: restored writability testing of
-tmpdir, augmented by a special exception for the deafault value.
2002-07-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
@@ -1959,9 +1959,9 @@
* tests/info.test: [temporaryDirectory] of tcltest.
* tests/interp.test:
* library/tcltest/tcltest.tcl: Stopped checking for writeability of
* library/tcltest/tcltest.tcl: Stopped checking for writability of
-tmpdir value because no default directory can be guaranteed to be
writeable.
writable.
* tests/autoMkindex.tcl: removed.
* tests/pkg/samename.tcl: removed.
@@ -2469,7 +2469,7 @@
thread-safe *_r counterparts are not available.
* unix/tcl.m4: added configure check for readdir_r
* unix/tcl.m4 (Darwin): set TCL_DEFAULT_ENCODING to utf-8 on MacOSX
(where posix file apis expect utf-8, not iso8859-1).
(where Posix file apis expect utf-8, not iso8859-1).
* unix/configure: regen
* unix/Makefile.in: set DYLD_LIBRARY_PATH in parallel to
LD_LIBRARY_PATH for MacOSX dynamic linker.
@@ -3683,7 +3683,7 @@
* win/tclAppInit.c: Changed #include "tcl.h" to be tclPort.h to remove
the raw windows.h include. tclPort.h brings in windows.h already and
lessens the pre-compiled-header mush and the randomly useless #pragma
lessens the precompiled-header mush and the randomly useless #pragma
comment (lib,...) references throughout the big windows.h tree (as
observed at high linker warning levels).
@@ -3793,7 +3793,7 @@
* generic/tclIO.c: Large-file support (with many consequences.)
* compat/strtoll.c, compat/strtoull.c: New support functions.
* unix/tcl.m4, unix/configure: 64-bit support and greatly enhanced
cacheing.
caching.
Most other changes, including all those in doc/* and test/* as well as
the majority in the platform directories, follow on from these.
+3 -3
View File
@@ -268,7 +268,7 @@
recently fixed by 2003-11-15 commit to regcomp.c by Pavel Goran. His
notes on the fix: This bug results from an error in code that splits
states into "progress" and "no-progress" ones. This error causes an
interesting situation with the pre-collected single-linked list of
interesting situation with the precollected single-linked list of
states to be splitted: many items were added to the list, but only
several of them are accessible from the list beginning, since the
"tmp" member of struct state (which is used here to hold a pointer to
@@ -2331,7 +2331,7 @@
argument, the Tcl_Interp struct loses its termOffset field and the
TCL_BRACKET_TERM flag in the evalFlags field, all of which were only
used (indirectly) by Tcl_SubstObj(). Tests subst-8.7,8.8,11.4,11.5
modified to accomodate the only behavior change: reporting of parse
modified to accommodate the only behavior change: reporting of parse
errors now takes precedence over [return] and [continue] exceptions.
All other behavior should remain compatible. [RFE 536831,684982] [Bug
685106]
@@ -2571,7 +2571,7 @@
2003-02-25 Don Porter <dgp@users.sourceforge.net>
* doc/pkgMkIndex.n: Modified [pkg_mkIndex] to use -nocase matching
* library/package.tcl: of -load patterns, to better accomodate common
* library/package.tcl: of -load patterns, to better accommodate common
user errors due to confusion between [package names] names and [info
loaded] names.
+5 -5
View File
@@ -377,7 +377,7 @@
strstr, strtoul and strtod.
* unix/tcl.m4 (SC_TCL_CHECK_BROKEN_FUNC): Split a complex stanza out
of configure.in into its own function. Also force it to do the right
thing with cacheing of results of AC_TRY_RUN to deal with issue raised
thing with caching of results of AC_TRY_RUN to deal with issue raised
in [Patch 1073524]
* doc/foreach.n: Added simple example. [FRQ 1073334]
@@ -1975,7 +1975,7 @@
* doc/FileSystem.3:
* generic/tclIOUtil.c: Clarified documentation regarding ability of a
filesystem to say that it doesn't support a given operation using the
EXDEV posix error code (copyFileProc, renameFileProc, etc), and
EXDEV Posix error code (copyFileProc, renameFileProc, etc), and
updated one piece of code to ensure correct behaviour when an
operation is not supported [Bug 1017072]
@@ -2277,7 +2277,7 @@
with vfs [Bug 991420].
* tests/fileSystem.test: added test for above bug.
* doc/FileSystem.3: clarified documentation of posix error codes in
* doc/FileSystem.3: clarified documentation of Posix error codes in
'remove directory' FS proc - 'EEXIST' is used to signify a non-empty
directory error (bug reported against tclvfs).
@@ -4339,7 +4339,7 @@
provided by the c-runtime. [Bug 672938]
* win/nmakehlp.c: defensive techniques to avoid static buffer
overflows and a couple envars upsetting invokations of cl.exe and
overflows and a couple envars upsetting invocations of cl.exe and
link.exe. [Bug 885537]
* tests/winPipe.test: Added proof that BuildCommandLine() is not doing
@@ -4548,7 +4548,7 @@
dictionary is computed at compile time (when it is fully known). The
dictionary is pushed on the stack along with the result, and the code
and level values are included in the bytecode as operands. Also
supports optimized compilation of un-[catch]ed [return]s from procs
supports optimized compilation of un[catch]ed [return]s from procs
with default options into the INST_DONE instruction.
* generic/tclExecute.c: Rewrote INST_RETURN instruction to retrieve
+1 -1
View File
@@ -229,7 +229,7 @@
***POTENTIAL INCOMPATIBILITY*** for bytecode savers/loaders. See below
* generic/tclCompCmds.c (TclCompileSwitchCmd): Arrange for very simple
[switch] invokations to be compiled into hash lookups into jump tables;
[switch] invocations to be compiled into hash lookups into jump tables;
only a very specific kind of [switch] can be safely compiled this way,
but that happens to be the most common kind. This makes around 5-10%
difference to the speed of execution of clock.test.
+5 -5
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 expression indicates an error.
numeric when precompiling a constant expression indicates an error.
2007-08-22 Miguel Sofer <msofer@users.sf.net>
@@ -2827,8 +2827,8 @@
2007-03-24 Zoran Vasiljevic <vasiljevic@users.sourceforge.net>
* win/tclWinThrd.c: Thread exit handler marks the current thread as
un-initialized. This allows exit handlers that are registered later to
re-initialize this subsystem in case they need to use some sync
uninitialized. This allows exit handlers that are registered later to
reinitialize this subsystem in case they need to use some sync
primitives (cond variables) from this file again.
2007-03-23 Miguel Sofer <msofer@users.sf.net>
@@ -4938,7 +4938,7 @@
Misc patches to make code more efficient. [Bug 1530474] (afredd)
* generic/*.c, macosx/tclMacOSXNotify.c, unix/tclUnixNotfy.c,
* win/tclWinThrd.c: Tidy up invokations of Tcl_Panic() to promote
* win/tclWinThrd.c: Tidy up invocations of Tcl_Panic() to promote
string constant sharing and consistent style.
* generic/tclBasic.c (Tcl_CreateInterp): More efficient handling of
* generic/tclClock.c (TclClockInit): registration of commands not
@@ -5016,7 +5016,7 @@
2006-07-24 Don Porter <dgp@users.sourceforge.net>
* win/tclWinSock.c: Correct un-initialized Tcl_DString. Thanks to
* win/tclWinSock.c: Correct uninitialized Tcl_DString. Thanks to
afredd. [Bug 1518166]
2006-07-21 Miguel Sofer <msofer@users.sf.net>
+2 -2
View File
@@ -1207,7 +1207,7 @@
* generic/tcl.decls, doc/Ensemble.3, doc/namespace.n
* tests/namespace.test: Allow the handling of a (fixed) number of
formal parameters between an ensemble's command and subcommand at
invokation time. [Patch 1901783]
invocation time. [Patch 1901783]
2008-09-28 Miguel Sofer <msofer@users.sf.net>
@@ -3252,7 +3252,7 @@
2008-03-21 Donal K. Fellows <dkf@users.sf.net>
* doc/switch.n: Clarified documentation in respect of two-argument
invokation. [Bug 1899962]
invocation. [Bug 1899962]
* tests/switch.test: Added more tests of regexp-mode compilation of
the [switch] command. [Bug 1854435]
+15 -4
View File
@@ -1,13 +1,24 @@
# README: Tcl
This is the **Tcl 8.7a6** source distribution.
This is the **Tcl 9.0a4** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
8.6 (production release, daily build)
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/macOS/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-6-branch)
<br>
8.7 (in development, daily build))
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/macOS/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-branch)
<br>
9.0 (in development, daily build))
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Amain)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Amain)
[![Build Status](https://github.com/tcltk/tcl/workflows/macOS/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Amain)
## Contents
1. [Introduction](#intro)
@@ -45,7 +56,7 @@ and selling it either in whole or in part. See the file
## <a id="doc">2.</a> Documentation
Extensive documentation is available on our website.
The home page for this release, including new features, is
[here](https://www.tcl-lang.org/software/tcltk/8.7.html).
[here](https://www.tcl-lang.org/software/tcltk/9.0.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.
@@ -55,8 +66,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.7 is [online,
here](https://www.tcl-lang.org/man/tcl8.7/).
The complete set of reference manual entries for Tcl 9.0 is [online,
here](https://www.tcl-lang.org/man/tcl9.0/).
### <a id="doc.unix">2a.</a> Unix Documentation
The `doc` subdirectory in this release contains a complete set of
+44 -6
View File
@@ -2486,7 +2486,7 @@ interpreter. (JL)
installing and requesting security policies, purely in Tcl code. Overloads
the package command to also allow an interpreter to "require" a policy. The
following new library commands are provided:
tcl_safeCreateInterp -- creates a slave an initializes the
tcl_safeCreateInterp -- creates a slave and initializes the
policy mechanism.
tcl_safeInitInterp -- initializes an existing slave with the
policy mechanism.
@@ -3028,7 +3028,7 @@ in case of errors is required for proper cleanup by the user of fcopy. (BW)
x eval rename foo blotz
x alias foo {}
The problem was that the interp code was not using the actual current name
of the command to be deleted as a result of un-aliasing foo. (JL)
of the command to be deleted as a result of unaliasing foo. (JL)
6/19/97 (feature change) Pass interp down to the ChannelOption and
driver specific calls so system errors can be differentiated from syntax
@@ -4167,7 +4167,7 @@ Only.) This fix included:
the location of the encoding files and libraries. This fix included:
- Adding the TclSetPerInitScript routine.
- Modifying the Tcl_Init routines to evaluate the non-NULL
pre-init script.
preinit script.
- Adding the Tcl_SetdefaultEncodingDir and Tcl_GetDefaultEncodingDir
routines.
- Modifying the TclpInitLibrary routines to append the default
@@ -4976,7 +4976,7 @@ msgcat package (duperval, krone, nelson)
trace {add|remove|list} {variable|command} name ops command
(darley, melski)
2000-09-06 (cross-platform feature) Set ^Z (\32) as default EOF char. (hobbs)
2000-09-06 (cross-platform feature) Set ^Z (\x1A) as default EOF char. (hobbs)
2000-09-07 partial fix for bug 2460 to prevent exec mem leak on Windows for the
common case (gravereaux)
@@ -6977,7 +6977,7 @@ of traced command do not fire (sofer)
2007-08-16 (bug fix)[1773040] ::errorInfo trace crash (janssen,porter)
2007-08-16 (performance)[1564517] pre-compile constant expressions (porter)
2007-08-16 (performance)[1564517] precompile constant expressions (porter)
2007-08-21 (bug fix)[1775878] 'puts \' in interactive tclsh failed to move to
prompt for continuation line (porter)
@@ -8685,7 +8685,7 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
2016-07-08 (bug)[a47641] [file normalize] & Windows junctions (nadkarni)
2016-07-09 [ae61a6] [file] handling of Win hardcoded names (CON) (nadkarni)
2016-07-09 [ae61a6] [file] handling of Win hard-coded names (CON) (nadkarni)
*** POTENTIAL INCOMPATIBILITY ***
2016-07-09 [3613671] [file owned] (more) useful on Win (nadkarni)
@@ -9127,6 +9127,26 @@ in this changeset (new minor version) rather than bug fixes:
- Released 8.7a3, Nov 21, 2019 --- https://core.tcl-lang.org/tcl/ for details -
Changes to 9.0a1 include all changes to the 8.7 line through 8.7a3,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2017-11-03 [TIP 114] Leading zero integer no longer means octal
2017-11-03 [TIP 278] Revise variable name resolution, solve "Creative Writing"
2017-11-03 [TIPs 330,336] Encapsulate struct Tcl_Interp
2017-11-17 [TIP 422] Remove all Tcl_*VA() routines
2017-12-15 [TIP 488] Disable magic $::tcl_precision
2018-10-08 [TIP 494] Increased support for size_t value ranges
2019-05-31 [TIP 537] 64-bit indices in regexp matching
- Released 9.0a1, Nov 25, 2019 --- https://core.tcl-lang.org/tcl/ for details -
2019-12-03 (bug)[3cd9be] Corner case in surrogate handling (nijtmans)
2019-12-09 (new) Add tcltest::(Setup|Eval|Cleanup|)Test (coulter,sebres)
@@ -9334,6 +9354,24 @@ in this changeset (new minor version) rather than bug fixes:
- Released 8.7a5, Jun 18, 2021 --- https://core.tcl-lang.org/tcl/ for details -
Changes to 9.0a3 include all changes to the 8.7 line through 8.7a5,
plus the following, which focuses on the high-level feature changes
in this changeset (new major version) rather than bug fixes:
Many of the TIPs in Tcl 8.7 mentioned above are extended further in 9.0
2020-02-28 [TIP 497] Full support for Unicode planes 1-16
2020-08-21 (bug)[43b434] improper calls to stat64()
2021-04-08 [TIP 595] Unicode-aware loadable library handling.
2021-04-30 [TIP 596] Stubs support for embedding Tcl in apps
Many internal changes to broaden support for sizes beyond 32-bits.
- Released 9.0a3, Jun 23, 2021 --- https://core.tcl-lang.org/tcl/ for details -
2021-02-02 (new) support for MacOS Big Sur updates (nijtmans)
=> platform 1.0.17
+2 -2
View File
@@ -28,7 +28,7 @@ opendir(
if ((fd = open(myname, 0, 0)) == -1) {
return NULL;
}
dirp = (DIR *) ckalloc(sizeof(DIR));
dirp = (DIR *) Tcl_Alloc(sizeof(DIR));
if (dirp == NULL) {
/* unreachable? */
close(fd);
@@ -106,5 +106,5 @@ closedir(
close(dirp->dd_fd);
dirp->dd_fd = -1;
dirp->dd_loc = 0;
ckfree(dirp);
Tcl_Free(dirp);
}
+2 -2
View File
@@ -100,7 +100,7 @@ waitpid(
} else {
prevPtr->nextPtr = waitPtr->nextPtr;
}
ckfree(waitPtr);
Tcl_Free(waitPtr);
return result;
}
@@ -156,7 +156,7 @@ waitpid(
goto waitAgain;
}
}
waitPtr = (WaitInfo *) ckalloc(sizeof(WaitInfo));
waitPtr = (WaitInfo *) Tcl_Alloc(sizeof(WaitInfo));
waitPtr->pid = result;
waitPtr->status = status;
waitPtr->nextPtr = deadList;
+5 -2
View File
@@ -66,6 +66,9 @@
#ifdef _WIN32
#define USEWIN32IOAPI
#include "iowin32.h"
# if defined(_MSC_VER)
# define snprintf _snprintf
# endif
#endif
@@ -365,7 +368,7 @@ void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, i
void addPathToZip(zipFile zf, const char *filenameinzip, const char *password, int opt_exclude_path,int opt_compress_level) {
tinydir_dir dir;
int i;
char newname[512];
char newname[MAXFILENAME+1+MAXFILENAME+1];
tinydir_open_sorted(&dir, filenameinzip);
@@ -375,7 +378,7 @@ void addPathToZip(zipFile zf, const char *filenameinzip, const char *password, i
tinydir_readfile_n(&dir, &file, i);
if(strcmp(file.name,".")==0) continue;
if(strcmp(file.name,"..")==0) continue;
sprintf(newname,"%s/%s",dir.path,file.name);
snprintf(newname, sizeof(newname), "%.*s/%.*s", MAXFILENAME, dir.path, MAXFILENAME, file.name);
if (file.is_dir)
{
addPathToZip(zf,newname,password,opt_exclude_path,opt_compress_level);
+4 -15
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -30,8 +30,6 @@ int
.sp
\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR)
.sp
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
.sp
\fBTcl_GetErrorLine\fR(\fIinterp\fR)
.sp
\fBTcl_SetErrorLine\fR(\fIinterp, lineNum\fR)
@@ -60,7 +58,7 @@ unless \fIlength\fR is negative.
.AP Tcl_Obj *objPtr in
A message to be appended to the \fB\-errorinfo\fR return option
in the form of a Tcl_Obj value.
.AP int length in
.AP Tcl_Size length in
The number of bytes to copy from \fImessage\fR when
appending to the \fB\-errorinfo\fR return option.
If negative, all bytes up to the first null byte are used.
@@ -69,17 +67,14 @@ The \fB\-errorcode\fR return option will be set to this value.
.AP "const char" *element in
String to record as one element of the \fB\-errorcode\fR return option.
Last \fIelement\fR argument must be NULL.
.AP va_list argList in
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.AP int lineNum
The line number of a script where an error occurred.
.AP "const char" *script in
Pointer to first character in script containing command (must be <= command)
.AP "const char" *command in
Pointer to first character in command that generated the error
.AP int commandLength in
Number of bytes in command; -1 means use all bytes up to first null byte
.AP Tcl_Size commandLength in
Number of bytes in command; a negative value means use all bytes up to first null byte
.BE
.SH DESCRIPTION
.PP
@@ -244,12 +239,6 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
\fB\-errorcode\fR return option. However, it takes one or more strings to
record instead of a value. Otherwise, it is similar to
\fBTcl_SetObjErrorCode\fR in behavior.
.PP
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
instead of taking a variable number of arguments it takes an argument list.
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
+13 -29
View File
@@ -4,11 +4,11 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures"
.TH Tcl_Alloc 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetMemoryInfo, ckalloc, ckfree, ckrealloc, attemptckalloc, attemptckrealloc \- allocate or free heap memory
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetMemoryInfo \- allocate or free heap memory
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -19,32 +19,17 @@ char *
void
\fBTcl_Free\fR(\fIptr\fR)
.sp
char *
void *
\fBTcl_Realloc\fR(\fIptr, size\fR)
.sp
char *
void *
\fBTcl_AttemptAlloc\fR(\fIsize\fR)
.sp
char *
void *
\fBTcl_AttemptRealloc\fR(\fIptr, size\fR)
.sp
void
\fBTcl_GetMemoryInfo\fR(\fIdsPtr\fR)
.sp
char *
\fBckalloc\fR(\fIsize\fR)
.sp
void
\fBckfree\fR(\fIptr\fR)
.sp
char *
\fBckrealloc\fR(\fIptr, size\fR)
.sp
char *
\fBattemptckalloc\fR(\fIsize\fR)
.sp
char *
\fBattemptckrealloc\fR(\fIptr, size\fR)
.SH ARGUMENTS
.AS char *size
.AP "unsigned int" size in
@@ -84,18 +69,17 @@ allocation fails, these functions will return NULL. Note that on some
platforms, but not all, attempting to allocate a zero-sized block of
memory will also cause these functions to return NULL.
.PP
The procedures \fBckalloc\fR, \fBckfree\fR, \fBckrealloc\fR,
\fBattemptckalloc\fR, and \fBattemptckrealloc\fR are implemented
as macros. Normally, they are synonyms for the corresponding
procedures documented on this page. When Tcl and all modules
calling Tcl are compiled with \fBTCL_MEM_DEBUG\fR defined, however,
these macros are redefined to be special debugging versions
of these procedures. To support Tcl's memory debugging within a
module, use the macros rather than direct calls to \fBTcl_Alloc\fR, etc.
When a module or Tcl itself is compiled with \fBTCL_MEM_DEBUG\fR defined,
the procedures \fBTcl_Alloc\fR, \fBTcl_Free\fR, \fBTcl_Realloc\fR,
\fBTcl_AttemptAlloc\fR, and \fBTcl_AttempRealloc\fR are implemented
as macros, redefined to be special debugging versions of these procedures.
\fBTcl_GetMemoryInfo\fR appends a list-of-lists of memory stats to the
provided DString. This function cannot be used in stub-enabled extensions,
and it is only available if Tcl is compiled with the threaded memory allocator.
and it is only available if Tcl is compiled with the threaded memory allocator
When used in stub-enabled embedders, the stubs table must be first initialized
using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR,
\fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
.SH KEYWORDS
alloc, allocation, free, malloc, memory, realloc, TCL_MEM_DEBUG
+1 -2
View File
@@ -30,8 +30,7 @@ or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR
return with an appropriate message. The particular script
evaluation procedures of Tcl that act in the manner are
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR,
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and
\fBTcl_VarEvalVA\fR.
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR and \fBTcl_VarEval\fR.
.PP
However, if \fBTcl_AllowExceptions\fR is invoked immediately before
calling one of those a procedures, then arbitrary completion
+3 -3
View File
@@ -13,7 +13,7 @@ Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData \- manage associations o
.nf
\fB#include <tcl.h>\fR
.sp
ClientData
void *
\fBTcl_GetAssocData\fR(\fIinterp, key, delProcPtr\fR)
.sp
\fBTcl_SetAssocData\fR(\fIinterp, key, delProc, clientData\fR)
@@ -31,7 +31,7 @@ Procedure to call when \fIinterp\fR is deleted.
.AP Tcl_InterpDeleteProc **delProcPtr in
Pointer to location in which to store address of current deletion procedure
for association. Ignored if NULL.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value associated with the given key in this
interpreter. This data is owned by the caller.
.BE
@@ -64,7 +64,7 @@ the type \fBTcl_InterpDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_InterpDeleteProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
+2 -2
View File
@@ -35,7 +35,7 @@ int
.AS Tcl_AsyncHandler clientData
.AP Tcl_AsyncProc *proc in
Procedure to invoke to handle an asynchronous event.
.AP ClientData clientData in
.AP void *clientData in
One-word value to pass to \fIproc\fR.
.AP Tcl_AsyncHandler async in
Token for asynchronous event handler.
@@ -95,7 +95,7 @@ type \fBTcl_AsyncProc\fR:
.PP
.CS
typedef int \fBTcl_AsyncProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIcode\fR);
.CE
-47
View File
@@ -1,47 +0,0 @@
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Backslash \- parse a backslash sequence
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
char
\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
.SH ARGUMENTS
.AS char *countPtr out
.AP "const char" *src in
Pointer to a string starting with a backslash.
.AP int *countPtr out
If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
in with number of characters in the backslash sequence, including
the backslash character.
.BE
.SH DESCRIPTION
.PP
The use of \fBTcl_Backslash\fR is deprecated in favor of
\fBTcl_UtfBackslash\fR.
.PP
This is a utility procedure provided for backwards compatibility with
non-internationalized Tcl extensions. It parses a backslash sequence and
returns the low byte of the Unicode character corresponding to the sequence.
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
characters in the backslash sequence.
.PP
See the Tcl manual entry for information on the valid backslash sequences.
All of the sequences described in the Tcl manual entry are supported by
\fBTcl_Backslash\fR.
.SH "SEE ALSO"
Tcl(n), Tcl_UtfBackslash(3)
.SH KEYWORDS
backslash, parse
+22 -37
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_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures"
.TH Tcl_ByteArrayObj 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -34,8 +34,8 @@ unsigned char *
.AP "const unsigned char" *bytes in
The array of bytes used to initialize or set a byte-array value. May be NULL
even if \fInumBytes\fR is non-zero.
.AP int numBytes in
The number of bytes in the array. It must be >= 0.
.AP Tcl_Size numBytes in
The number of bytes in the array.
.AP Tcl_Obj *objPtr in/out
For \fBTcl_SetByteArrayObj\fR, this points to an unshared value to be
overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
@@ -43,7 +43,7 @@ overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
to the value from which to extract an array of bytes.
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
.AP "size_t | int" *numBytesPtr out
.AP "Tcl_Size \&| int" *numBytesPtr out
Points to space where the number of bytes in the array may be written.
Caller may pass NULL when it does not need this information.
.BE
@@ -92,11 +92,6 @@ returns a pointer to the created value with a reference count of zero.
of the unshared \fIobjPtr\fR as appropriate, and keeps its reference
count (0 or 1) unchanged. The value produced by these routines has no
string representation. Any memory allocation failure may cause a panic.
Note that the type of the \fInumBytes\fR argument is \fBint\fR; consequently
the largest byte-array value that can be produced by these routines is one
holding \fBINT_MAX\fR bytes. Note also that the string representation of
any Tcl value is limited to \fBINT_MAX\fR bytes, so caution should be
taken with any byte-array of more than \fBINT_MAX / 2\fR bytes.
.PP
\fBTcl_GetBytesFromObj\fR performs the opposite function of
\fBTcl_SetByteArrayObj\fR, providing access to read a byte-array from
@@ -121,29 +116,14 @@ failure, nothing will be written to \fInumBytesPtr\fR, and if
the \fIinterp\fR argument is non-NULL, then error messages and
codes are left in it recording the error.
.PP
\fBTcl_GetByteArrayFromObj\fR performs nearly the same function as
\fBTcl_GetBytesFromObj\fR. They differ only in the circumstance when
a byte-array internal value must be created by transformation of
a string representation, and that string representation contains a
character with codepoint greater than U+00FF. Instead of failing
the conversion, \fBTcl_GetByteArrayFromObj\fR will use the 8 least
significant bits of each codepoint to produce a valid byte value
from any character codepoint value. In any other circumstance,
\fBTcl_GetByteArrayFromObj\fR performs just as \fBTcl_GetBytesFromObj\fR
does. Since the conversion cannot fail, \fBTcl_GetByteArrayFromObj\fR
has no need for an \fIinterp\fR argument to record any errors and
the caller can assume \fBTcl_GetByteArrayFromObj\fR does not return NULL.
\fBTcl_GetByteArrayFromObj\fR performs exactly the same function as
\fBTcl_GetBytesFromObj\fR does when called with the \fIinterp\fR
argument passed the value NULL. This is incompatible with the
way \fBTcl_GetByteArrayFromObj\fR functioned in Tcl 8.
\fBTcl_GetBytesFromObj\fR is the more capable interface and should
usually be favored for use over \fBTcl_GetByteArrayFromObj\fR.
.PP
\fBTcl_GetByteArrayFromObj\fR must be used with caution. Because of the
truncation on conversion, the byte-array made available to the caller
cannot reliably complete a round-trip back to the original string
representation. This creates opportunities for bugs due to blindness
to differences in values. This routine exists in this form primarily
for compatibility with codebases written for earlier releases of Tcl.
It is expected this routine will incompatibly change in Tcl 9 so that
it also signals failed conversions with a NULL return.
.PP
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
On success, both \fBTcl_GetByteFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
return a pointer into the internal representation of a \fBTcl_Obj\fR.
That pointer must not be freed by the caller, and should not be retained
for use beyond the known time the internal representation of the value
@@ -154,10 +134,14 @@ and any string representation is invalidated.
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
write the number of bytes in the byte-array value of \fIobjPtr\fR
to the space pointed to by \fInumBytesPtr\fR. This space may be of type
\fBsize_t\fR or of type \fBint\fR. In Tcl 8, the largest number of
bytes possible is \fBINT_MAX\fR, so either type can receive the value.
In codebases meant to migrate to Tcl 9, the option to write to a space
of type \fBsize_t\fR may aid in the migration.
\fBTcl_Size\fR or of type \fBint\fR. It is recommended that callers provide
a \fBTcl_Size\fR space for this purpose. If the caller provides only
an \fBint\fR space and the number of bytes in the byte-array value of
\fIobjPtr\fR is greater than \fBINT_MAX\fR, the routine will fail due
to being unable to correctly report the byte-array size to the caller.
The ability to provide an \fBint\fR space is best considered a migration
aid for codebases constrained to continue operating with Tcl releases
older than 8.7.
.PP
\fBTcl_SetByteArrayLength\fR enables a caller to change the size of a
byte-array in the internal representation of an unshared \fIobjPtr\fR to
@@ -170,8 +154,9 @@ changes the internal representation, \fBTcl_SetByteArrayLength\fR
also invalidates any string representation in \fIobjPtr\fR. If resizing
grows the byte-array, the new byte values are undefined. If \fIobjPtr\fR
does not already possess an internal byte-array, one is produced in the
same way that \fBTcl_GetByteArrayFromObj\fR does, with all the cautions
that go along with that.
same way that \fBTcl_GetBytesFromObj\fR does, also returning NULL
when any characters of the value in \fIobjPtr\fR (up to
\fInumBytes\fR of them) are not valid bytes.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewByteArrayObj\fR always returns a zero-reference object, much
+2 -2
View File
@@ -23,7 +23,7 @@ Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interp
Interpreter with which to associated callback.
.AP Tcl_InterpDeleteProc *proc in
Procedure to call when \fIinterp\fR is deleted.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -38,7 +38,7 @@ type \fBTcl_InterpDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_InterpDeleteProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
+3 -3
View File
@@ -26,11 +26,11 @@ Error message to use in the cancellation, or NULL to use a default message. If
not NULL, this object will have its reference count decremented before
\fBTcl_CancelEval\fR returns.
.AP int flags in
ORed combination of flag bits that specify additional options.
OR'ed combination of flag bits that specify additional options.
For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently
supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and
\fBTCL_CANCEL_UNWIND\fR are currently supported.
.AP ClientData clientData in
.AP void *clientData in
Currently reserved for future use.
It should be set to NULL.
.BE
@@ -47,7 +47,7 @@ Extensions can use this function to check to see if they should abort a long
running command. This function is thread sensitive and may only be called
from the thread the interpreter was created in.
.SS "FLAG BITS"
Any ORed combination of the following values may be used for the
Any OR'ed combination of the following values may be used for the
\fIflags\fR argument to procedures such as \fBTcl_CancelEval\fR:
.TP 20
\fBTCL_CANCEL_UNWIND\fR
+3 -6
View File
@@ -32,7 +32,7 @@ Tcl_Channel
Interpreter for error reporting.
.AP "const Tcl_ChannelType" *typePtr in
The new channel I/O procedures to use for \fIchannel\fR.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to channel I/O procedures.
.AP int mask in
Conditions under which \fIchannel\fR will be used: OR-ed combination of
@@ -49,11 +49,8 @@ I/O channels. Examples include compression and encryption modules. These
functions transparently stack and unstack a new channel on top of an
existing one. Any number of channels can be stacked together.
.PP
The implementation of the Tcl channel code was rewritten in 8.3.2 to
correct some problems with the previous implementation with regard to
stacked channels. Anyone using stacked channels or creating stacked
channel drivers should update to the new \fBTCL_CHANNEL_VERSION_2\fR
\fBTcl_ChannelType\fR structure. See \fBTcl_CreateChannel\fR for details.
The \fBTcl_ChannelType\fR version currently supported is
\fBTCL_CHANNEL_VERSION_5\fR. See \fBTcl_CreateChannel\fR for details.
.PP
\fBTcl_StackChannel\fR stacks a new \fIchannel\fR on an existing channel
with the same name that was registered for \fIchannel\fR by
+9 -9
View File
@@ -41,12 +41,12 @@ Tcl_Object
int
\fBTcl_ObjectDeleted\fR(\fIobject\fR)
.sp
ClientData
void *
\fBTcl_ObjectGetMetadata\fR(\fIobject, metaTypePtr\fR)
.sp
\fBTcl_ObjectSetMetadata\fR(\fIobject, metaTypePtr, metadata\fR)
.sp
ClientData
void *
\fBTcl_ClassGetMetadata\fR(\fIclass, metaTypePtr\fR)
.sp
\fBTcl_ClassSetMetadata\fR(\fIclass, metaTypePtr, metadata\fR)
@@ -64,7 +64,7 @@ Tcl_Obj *
\fBTcl_GetObjectClassName\fR(\fIinterp\fR, \fIobject\fR)
.VE "TIP 605"
.SH ARGUMENTS
.AS ClientData metadata in/out
.AS void *metadata in/out
.AP Tcl_Interp *interp in/out
Interpreter providing the context for looking up or creating an object, and
into whose result error messages will be written on failure.
@@ -81,11 +81,11 @@ automatically selected.
The name of the namespace to create for the object's private use, or NULL if a
new unused name is to be automatically selected. The namespace must not
already exist.
.AP int objc in
.AP Tcl_Size objc in
The number of elements in the \fIobjv\fR array.
.AP "Tcl_Obj *const" *objv in
The arguments to the command to create the instance of the class.
.AP int skip in
.AP Tcl_Size skip in
The number of arguments at the start of the argument array, \fIobjv\fR, that
are not arguments to any constructors. This allows the generation of correct
error messages even when complicated calling patterns are used (e.g., via the
@@ -93,7 +93,7 @@ error messages even when complicated calling patterns are used (e.g., via the
.AP Tcl_ObjectMetadataType *metaTypePtr in
The type of \fImetadata\fR being set with \fBTcl_ClassSetMetadata\fR or
retrieved with \fBTcl_ClassGetMetadata\fR.
.AP ClientData metadata in
.AP void *metadata in
An item of metadata to attach to the class, or NULL to remove the metadata
associated with a particular \fImetaTypePtr\fR.
.AP "Tcl_ObjectMapMethodNameProc" "methodNameMapper" in
@@ -200,7 +200,7 @@ a class or object.
.PP
.CS
typedef void \fBTcl_ObjectMetadataDeleteProc\fR(
ClientData \fImetadata\fR);
void *\fImetadata\fR);
.CE
.PP
The \fImetadata\fR argument gives the address of the metadata to be
@@ -213,8 +213,8 @@ associated with a class or object.
.CS
typedef int \fBTcl_CloneProc\fR(
Tcl_Interp *\fIinterp\fR,
ClientData \fIsrcMetadata\fR,
ClientData *\fIdstMetadataPtr\fR);
void *\fIsrcMetadata\fR,
void **\fIdstMetadataPtr\fR);
.CE
.PP
The \fIinterp\fR argument gives a place to write an error message when the
+1 -1
View File
@@ -18,7 +18,7 @@ const char *
\fBTcl_Concat\fR(\fIargc, argv\fR)
.SH ARGUMENTS
.AS "const char *const" argv[]
.AP int argc in
.AP Tcl_Size argc in
Number of strings.
.AP "const char *const" argv[] in
Array of strings to concatenate. Must have \fIargc\fR entries.
+3 -34
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_GetSlave, Tcl_GetParent, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
Tcl_IsSafe, Tcl_CreateChild, Tcl_GetChild, Tcl_GetParent, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -16,25 +16,13 @@ Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_Ge
int
\fBTcl_IsSafe\fR(\fIinterp\fR)
.sp
int
\fBTcl_MakeSafe\fR(\fIinterp\fR)
.sp
Tcl_Interp *
\fBTcl_CreateChild\fR(\fIinterp, name, isSafe\fR)
.sp
Tcl_Interp *
\fBTcl_CreateSlave\fR(\fIinterp, name, isSafe\fR)
.sp
Tcl_Interp *
\fBTcl_GetSlave\fR(\fIinterp, name\fR)
.sp
Tcl_Interp *
\fBTcl_GetChild\fR(\fIinterp, name\fR)
.sp
Tcl_Interp *
\fBTcl_GetMaster\fR(\fIinterp\fR)
.sp
Tcl_Interp *
\fBTcl_GetParent\fR(\fIinterp\fR)
.sp
int
@@ -81,12 +69,12 @@ Name of source command for alias.
Interpreter that contains the target command for an alias.
.AP "const char" *targetCmd in
Name of target command for alias in \fItargetInterp\fR.
.AP int argc in
.AP Tcl_Size argc in
Count of additional arguments to pass to the alias command.
.AP "const char *const" *argv in
Vector of strings, the additional arguments to pass to the alias command.
This storage is owned by the caller.
.AP int objc in
.AP Tcl_Size objc in
Count of additional value arguments to pass to the aliased command.
.AP Tcl_Obj **objv in
Vector of Tcl_Obj structures, the additional value arguments to pass to
@@ -142,38 +130,19 @@ child in which Tcl code has access only to set of Tcl commands defined as
see the manual entry for the Tcl \fBinterp\fR command for details.
If the creation of the new child interpreter failed, \fBNULL\fR is returned.
.PP
\fBTcl_CreateSlave\fR is a synonym for \fBTcl_CreateChild\fR.
.PP
\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is
.QW safe
(was created with the \fBTCL_SAFE_INTERPRETER\fR flag specified),
\fB0\fR otherwise.
.PP
\fBTcl_MakeSafe\fR marks \fIinterp\fR as
.QW safe ,
so that future
calls to \fBTcl_IsSafe\fR will return 1. It also removes all known
potentially-unsafe core functionality (both commands and variables)
from \fIinterp\fR. However, it cannot know what parts of an extension
or application are safe and does not make any attempt to remove those
parts, so safety is not guaranteed after calling \fBTcl_MakeSafe\fR.
Callers will want to take care with their use of \fBTcl_MakeSafe\fR
to avoid false claims of safety. For many situations, \fBTcl_CreateChild\fR
may be a better choice, since it creates interpreters in a known-safe state.
\fBTcl_MakeSafe\fR is deprecated and will be removed in Tcl 9.0.
.PP
\fBTcl_GetChild\fR returns a pointer to a child interpreter of
\fIinterp\fR. The child interpreter is identified by \fIname\fR.
If no such child interpreter exists, \fBNULL\fR is returned.
.PP
\fBTcl_GetSlave\fR is a synonym for \fBTcl_GetChild\fR.
.PP
\fBTcl_GetParent\fR returns a pointer to the parent interpreter of
\fIinterp\fR. If \fIinterp\fR has no parent (it is a
top-level interpreter) then \fBNULL\fR is returned.
.PP
\fBTcl_GetMaster\fR is a synonym for \fBTcl_GetParent\fR.
.PP
\fBTcl_GetInterpPath\fR stores in the result of \fIinterp\fR
the relative path between \fIinterp\fR and \fIchildInterp\fR;
\fIchildInterp\fR must be a child of \fIinterp\fR. If the computation
+53 -167
View File
@@ -9,7 +9,7 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -17,7 +17,7 @@ Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChanne
Tcl_Channel
\fBTcl_CreateChannel\fR(\fItypePtr, channelName, instanceData, mask\fR)
.sp
ClientData
void *
\fBTcl_GetChannelInstanceData\fR(\fIchannel\fR)
.sp
const Tcl_ChannelType *
@@ -80,9 +80,6 @@ Tcl_ChannelTypeVersion
Tcl_DriverBlockModeProc *
\fBTcl_ChannelBlockModeProc\fR(\fItypePtr\fR)
.sp
Tcl_DriverCloseProc *
\fBTcl_ChannelCloseProc\fR(\fItypePtr\fR)
.sp
Tcl_DriverClose2Proc *
\fBTcl_ChannelClose2Proc\fR(\fItypePtr\fR)
.sp
@@ -92,9 +89,6 @@ Tcl_DriverInputProc *
Tcl_DriverOutputProc *
\fBTcl_ChannelOutputProc\fR(\fItypePtr\fR)
.sp
Tcl_DriverSeekProc *
\fBTcl_ChannelSeekProc\fR(\fItypePtr\fR)
.sp
Tcl_DriverWideSeekProc *
\fBTcl_ChannelWideSeekProc\fR(\fItypePtr\fR)
.sp
@@ -133,7 +127,7 @@ by any other channel. Can be NULL, in which case the channel is
created without a name. If the created channel is assigned to one
of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR),
the assigned channel name will be the name of the standard channel.
.AP ClientData instanceData in
.AP void *instanceData in
Arbitrary one-word value to be associated with this channel. This
value is passed to procedures in \fItypePtr\fR when they are invoked.
.AP int mask in
@@ -144,10 +138,10 @@ The channel to operate on.
.AP int direction in
\fBTCL_READABLE\fR means the input handle is wanted; \fBTCL_WRITABLE\fR
means the output handle is wanted.
.AP ClientData *handlePtr out
.AP void **handlePtr out
Points to the location where the desired OS-specific handle should be
stored.
.AP int size in
.AP Tcl_Size size in
The size, in bytes, of buffers to allocate in this channel.
.AP int mask in
An OR-ed combination of \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR
@@ -302,16 +296,13 @@ name is registered in the (thread)-global list of all channels (result
(thread)global list of all channels (of the current thread).
Application to a channel still registered in some interpreter
is not allowed.
Also notifies the driver if the \fBTcl_ChannelType\fR version is
\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
Also notifies the driver if
\fBTcl_DriverThreadActionProc\fR is defined for it.
.PP
\fBTcl_SpliceChannel\fR adds the specified \fIchannel\fR to the
(thread)global list of all channels (of the current thread).
Application to a channel registered in some interpreter is not allowed.
Also notifies the driver if the \fBTcl_ChannelType\fR version is
\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
\fBTcl_DriverThreadActionProc\fR is defined for it.
Also notifies the driver if \fBTcl_DriverThreadActionProc\fR is defined for it.
.PP
\fBTcl_ClearChannelHandlers\fR removes all channel handlers and event
scripts associated with the specified \fIchannel\fR, thus shutting
@@ -331,10 +322,10 @@ The \fBTcl_ChannelType\fR structure contains the following fields:
typedef struct Tcl_ChannelType {
const char *\fItypeName\fR;
Tcl_ChannelTypeVersion \fIversion\fR;
Tcl_DriverCloseProc *\fIcloseProc\fR;
void *\fIcloseProc\fR; /* Not used any more*/
Tcl_DriverInputProc *\fIinputProc\fR;
Tcl_DriverOutputProc *\fIoutputProc\fR;
Tcl_DriverSeekProc *\fIseekProc\fR;
void *\fIseekProc\fR; /* Not used any more */
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
Tcl_DriverWatchProc *\fIwatchProc\fR;
@@ -363,9 +354,8 @@ The user should only use the above structure for \fBTcl_ChannelType\fR
instantiation. When referencing fields in a \fBTcl_ChannelType\fR
structure, the following functions should be used to obtain the values:
\fBTcl_ChannelName\fR, \fBTcl_ChannelVersion\fR,
\fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelCloseProc\fR,
\fBTcl_ChannelClose2Proc\fR, \fBTcl_ChannelInputProc\fR,
\fBTcl_ChannelOutputProc\fR, \fBTcl_ChannelSeekProc\fR,
\fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelClose2Proc\fR,
\fBTcl_ChannelInputProc\fR, \fBTcl_ChannelOutputProc\fR,
\fBTcl_ChannelWideSeekProc\fR, \fBTcl_ChannelThreadActionProc\fR,
\fBTcl_ChannelTruncateProc\fR,
\fBTcl_ChannelSetOptionProc\fR, \fBTcl_ChannelGetOptionProc\fR,
@@ -388,25 +378,9 @@ a pointer to the string.
.PP
The \fIversion\fR field should be set to the version of the structure
that you require. \fBTCL_CHANNEL_VERSION_2\fR is the minimum recommended.
\fBTCL_CHANNEL_VERSION_3\fR must be set to specify the \fIwideSeekProc\fR member.
\fBTCL_CHANNEL_VERSION_4\fR must be set to specify the \fIthreadActionProc\fR member
(includes \fIwideSeekProc\fR).
\fBTCL_CHANNEL_VERSION_5\fR must be set to specify the
\fItruncateProc\fR members (includes
\fIwideSeekProc\fR and \fIthreadActionProc\fR).
If it is not set to any of these, then this
\fBTcl_ChannelType\fR is assumed to have the original structure. See
\fBOLD CHANNEL TYPES\fR for more details. While Tcl will recognize
and function with either structures, stacked channels must be of at
least \fBTCL_CHANNEL_VERSION_2\fR to function correctly.
that you require. \fBTCL_CHANNEL_VERSION_5\fR is the minimum supported.
.PP
This value can be retrieved with \fBTcl_ChannelVersion\fR, which returns
one of
\fBTCL_CHANNEL_VERSION_5\fR,
\fBTCL_CHANNEL_VERSION_4\fR,
\fBTCL_CHANNEL_VERSION_3\fR,
\fBTCL_CHANNEL_VERSION_2\fR or \fBTCL_CHANNEL_VERSION_1\fR.
This value can be retrieved with \fBTcl_ChannelVersion\fR.
.SS BLOCKMODEPROC
.PP
The \fIblockModeProc\fR field contains the address of a function called by
@@ -415,7 +389,7 @@ the generic layer to set blocking and nonblocking mode on the device.
.PP
.CS
typedef int \fBTcl_DriverBlockModeProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
int \fImode\fR);
.CE
.PP
@@ -442,22 +416,23 @@ blocking mode is acceptable to it, and should this also document for
the user so that the blocking mode of the channel is not changed to an
unacceptable value. Any confusion here may lead the interpreter into a
(spurious and difficult to find) deadlock.
.SS "CLOSEPROC AND CLOSE2PROC"
.SS "CLOSE2PROC"
.PP
The \fIcloseProc\fR field contains the address of a function called by the
The \fIclose2Proc\fR field contains the address of a function called by the
generic layer to clean up driver-related information when the channel is
closed. \fICloseProc\fR must match the following prototype:
closed. \fIClose2Proc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverCloseProc\fR(
ClientData \fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR);
typedef int \fBTcl_DriverClose2Proc\fR(
void *\fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIflags\fR);
.CE
.PP
The \fIinstanceData\fR argument is the same as the value provided to
\fBTcl_CreateChannel\fR when the channel was created. The function should
release any storage maintained by the channel driver for this channel, and
close the input and output devices encapsulated by this channel. All queued
If \fIflags\fR is 0, the \fIinstanceData\fR argument is the same as the value
provided to \fBTcl_CreateChannel\fR when the channel was created. The function
should release any storage maintained by the channel driver for this channel,
and close the input and output devices encapsulated by this channel. All queued
output will have been flushed to the device before this function is called,
and no further driver operations will be invoked on this instance after
calling the \fIcloseProc\fR. If the close operation is successful, the
@@ -466,35 +441,20 @@ error code. In addition, if an error occurs and \fIinterp\fR is not NULL,
the procedure should store an error message in the interpreter's result.
.PP
Alternatively, channels that support closing the read and write sides
independently may set \fIcloseProc\fR to \fBTCL_CLOSE2PROC\fR and set
\fIclose2Proc\fR to the address of a function that matches the
following prototype:
.PP
.CS
typedef int \fBTcl_DriverClose2Proc\fR(
ClientData \fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIflags\fR);
.CE
.PP
The \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
independently may accept other flag values than 0.
Then \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
combination of \fBTCL_CLOSE_READ\fR or \fBTCL_CLOSE_WRITE\fR to
indicate that the driver should close the read and/or write side of
the channel. The channel driver may be invoked to perform
additional operations on the channel after \fIclose2Proc\fR is
called to close one or both sides of the channel. If \fIflags\fR is
\fB0\fR (zero), the driver should close the channel in the manner
described above for \fIcloseProc\fR. No further operations will be
invoked on this instance after \fIclose2Proc\fR is called with all
flags cleared. In all cases, the \fIclose2Proc\fR function should
return zero if the close operation was successful; otherwise it should
return a nonzero POSIX error code. In addition, if an error occurs and
\fIinterp\fR is not NULL, the procedure should store an error message
in the interpreter's result.
called to close one or both sides of the channel. In all cases, the
\fIclose2Proc\fR function should return zero if the close operation was
successful; otherwise it should return a nonzero POSIX error code.
In addition, if an error occurs and \fIinterp\fR is not NULL, the procedure
should store an error message in the interpreter's result.
.PP
The \fIcloseProc\fR and \fIclose2Proc\fR values can be retrieved with
\fBTcl_ChannelCloseProc\fR or \fBTcl_ChannelClose2Proc\fR, which
return a pointer to the respective function.
The \fIclose2Proc\fR value can be retrieved with \fBTcl_ChannelClose2Proc\fR,
which returns a pointer to the function.
.SS INPUTPROC
.PP
The \fIinputProc\fR field contains the address of a function called by the
@@ -503,7 +463,7 @@ internal buffer. \fIInputProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverInputProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
char *\fIbuf\fR,
int \fIbufSize\fR,
int *\fIerrorCodePtr\fR);
@@ -547,7 +507,7 @@ generic layer to transfer data from an internal buffer to the output device.
.PP
.CS
typedef int \fBTcl_DriverOutputProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
const char *\fIbuf\fR,
int \fItoWrite\fR,
int *\fIerrorCodePtr\fR);
@@ -577,17 +537,17 @@ without writing any data.
.PP
This value can be retrieved with \fBTcl_ChannelOutputProc\fR, which returns
a pointer to the function.
.SS "SEEKPROC AND WIDESEEKPROC"
.SS "WIDESEEKPROC"
.PP
The \fIseekProc\fR field contains the address of a function called by the
The \fIwideSeekProc\fR field contains the address of a function called by the
generic layer to move the access point at which subsequent input or output
operations will be applied. \fISeekProc\fR must match the following
operations will be applied. \fIWideSeekProc\fR must match the following
prototype:
.PP
.CS
typedef int \fBTcl_DriverSeekProc\fR(
ClientData \fIinstanceData\fR,
long \fIoffset\fR,
typedef long long \fBTcl_DriverWideSeekProc\fR(
void *\fIinstanceData\fR,
long long \fIoffset\fR,
int \fIseekMode\fR,
int *\fIerrorCodePtr\fR);
.CE
@@ -606,30 +566,8 @@ does not implement seeking.
The return value is the new access point or -1 in case of error. If an
error occurred, the function should not move the access point.
.PP
If there is a non-NULL \fIseekProc\fR field, the \fIwideSeekProc\fR
field may contain the address of an alternative function to use which
handles wide (i.e. larger than 32-bit) offsets, so allowing seeks
within files larger than 2GB. The \fIwideSeekProc\fR will be called
in preference to the \fIseekProc\fR, but both must be defined if the
\fIwideSeekProc\fR is defined. \fIWideSeekProc\fR must match the
following prototype:
.PP
.CS
typedef long long \fBTcl_DriverWideSeekProc\fR(
ClientData \fIinstanceData\fR,
long long \fIoffset\fR,
int \fIseekMode\fR,
int *\fIerrorCodePtr\fR);
.CE
.PP
The arguments and return values mean the same thing as with
\fIseekProc\fR above, except that the type of offsets and the return
type are different.
.PP
The \fIseekProc\fR value can be retrieved with
\fBTcl_ChannelSeekProc\fR, which returns a pointer to the function,
and similarly the \fIwideSeekProc\fR can be retrieved with
\fBTcl_ChannelWideSeekProc\fR.
The \fIwideSseekProc\fR value can be retrieved with
\fBTcl_ChannelWideSeekProc\fR, which returns a pointer to the function.
.SS SETOPTIONPROC
.PP
The \fIsetOptionProc\fR field contains the address of a function called by
@@ -638,7 +576,7 @@ the generic layer to set a channel type specific option on a channel.
.PP
.CS
typedef int \fBTcl_DriverSetOptionProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoptionName\fR,
const char *\fInewValue\fR);
@@ -679,7 +617,7 @@ channel. \fIgetOptionProc\fR must match the following prototype:
.PP
.CS
typedef int \fBTcl_DriverGetOptionProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoptionName\fR,
Tcl_DString *\fIoptionValue\fR);
@@ -717,7 +655,7 @@ notice events of interest on this channel.
.PP
.CS
typedef void \fBTcl_DriverWatchProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
int \fImask\fR);
.CE
.PP
@@ -748,9 +686,9 @@ the generic layer to retrieve a device-specific handle from the channel.
.PP
.CS
typedef int \fBTcl_DriverGetHandleProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
int \fIdirection\fR,
ClientData *\fIhandlePtr\fR);
void **\fIhandlePtr\fR);
.CE
.PP
\fIInstanceData\fR is the same as the value passed to
@@ -777,7 +715,7 @@ It should be set to NULL.
.PP
.CS
typedef int \fBTcl_DriverFlushProc\fR(
ClientData \fIinstanceData\fR);
void *\fIinstanceData\fR);
.CE
.PP
This value can be retrieved with \fBTcl_ChannelFlushProc\fR, which returns
@@ -792,7 +730,7 @@ that occur on the underlying (stacked) channel.
.PP
.CS
typedef int \fBTcl_DriverHandlerProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
int \fIinterestMask\fR);
.CE
.PP
@@ -821,7 +759,7 @@ might be maintaining using the calling thread as the associate. See
.PP
.CS
typedef void \fBTcl_DriverThreadActionProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
int \fIaction\fR);
.CE
.PP
@@ -838,7 +776,7 @@ length. It can be NULL.
.PP
.CS
typedef int \fBTcl_DriverTruncateProc\fR(
ClientData \fIinstanceData\fR,
void *\fIinstanceData\fR,
long long \fIlength\fR);
.CE
.PP
@@ -886,58 +824,6 @@ The function takes good care of inserting minus signs before
each option, commas after, and an
.QW or
before the last option.
.SH "OLD CHANNEL TYPES"
The original (8.3.1 and below) \fBTcl_ChannelType\fR structure contains
the following fields:
.PP
.CS
typedef struct Tcl_ChannelType {
const char *\fItypeName\fR;
Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
Tcl_DriverCloseProc *\fIcloseProc\fR;
Tcl_DriverInputProc *\fIinputProc\fR;
Tcl_DriverOutputProc *\fIoutputProc\fR;
Tcl_DriverSeekProc *\fIseekProc\fR;
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
Tcl_DriverWatchProc *\fIwatchProc\fR;
Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
Tcl_DriverClose2Proc *\fIclose2Proc\fR;
} \fBTcl_ChannelType\fR;
.CE
.PP
It is still possible to create channel with the above structure. The
internal channel code will determine the version. It is imperative to use
the new \fBTcl_ChannelType\fR structure if you are creating a stacked
channel driver, due to problems with the earlier stacked channel
implementation (in 8.2.0 to 8.3.1).
.PP
Prior to 8.4.0 (i.e. during the later releases of 8.3 and early part
of the 8.4 development cycle) the \fBTcl_ChannelType\fR structure
contained the following fields:
.PP
.CS
typedef struct Tcl_ChannelType {
const char *\fItypeName\fR;
Tcl_ChannelTypeVersion \fIversion\fR;
Tcl_DriverCloseProc *\fIcloseProc\fR;
Tcl_DriverInputProc *\fIinputProc\fR;
Tcl_DriverOutputProc *\fIoutputProc\fR;
Tcl_DriverSeekProc *\fIseekProc\fR;
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
Tcl_DriverWatchProc *\fIwatchProc\fR;
Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
Tcl_DriverClose2Proc *\fIclose2Proc\fR;
Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
Tcl_DriverFlushProc *\fIflushProc\fR;
Tcl_DriverHandlerProc *\fIhandlerProc\fR;
Tcl_DriverTruncateProc *\fItruncateProc\fR;
} \fBTcl_ChannelType\fR;
.CE
.PP
When the above structure is registered as a channel type, the
\fIversion\fR field should always be \fBTCL_CHANNEL_VERSION_2\fR.
.SH "SEE ALSO"
Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3), Tcl_QueueEvent(3), Tcl_StackChannel(3), Tcl_GetStdChannel(3)
.SH KEYWORDS
+3 -3
View File
@@ -29,10 +29,10 @@ Tcl channel such as returned by \fBTcl_CreateChannel\fR.
Conditions under which \fIproc\fR should be called: OR-ed combination of
\fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR and \fBTCL_EXCEPTION\fR. Specify
a zero value to temporarily disable an existing handler.
.AP Tcl_FileProc *proc in
.AP Tcl_ChannelProc *proc in
Procedure to invoke whenever the channel indicated by \fIchannel\fR meets
the conditions specified by \fImask\fR.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -48,7 +48,7 @@ what it means for a channel to be readable or writable.
.PP
.CS
typedef void \fBTcl_ChannelProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
int \fImask\fR);
.CE
.PP
+2 -2
View File
@@ -26,7 +26,7 @@ void
The channel for which to create or delete a close callback.
.AP Tcl_CloseProc *proc in
The procedure to call as the callback.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -38,7 +38,7 @@ Arbitrary one-word value to pass to \fIproc\fR.
.PP
.CS
typedef void \fBTcl_CloseProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR is the same as the value provided in the call to
+3 -3
View File
@@ -25,7 +25,7 @@ Name of command.
.AP Tcl_CmdProc *proc in
Implementation of new command: \fIproc\fR will be called whenever
\fIcmdName\fR is invoked as a command.
.AP ClientData clientData in
.AP voie *clientData in
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
@@ -75,7 +75,7 @@ and it returns NULL.
.PP
.CS
typedef int \fBTcl_CmdProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIargc\fR,
const char *\fIargv\fR[]);
@@ -131,7 +131,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_CmdDeleteProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
+2 -2
View File
@@ -29,7 +29,7 @@ a handler.
.AP Tcl_FileProc *proc in
Procedure to invoke whenever the file or device indicated
by \fIfile\fR meets the conditions specified by \fImask\fR.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -51,7 +51,7 @@ type \fBTcl_FileProc\fR:
.PP
.CS
typedef void \fBTcl_FileProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
int \fImask\fR);
.CE
.PP
-166
View File
@@ -1,166 +0,0 @@
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_CreateMathFunc, Tcl_GetMathFuncInfo, Tcl_ListMathFuncs \- Define, query and enumerate math functions for expressions
.SH "NOTICE OF EVENTUAL DEPRECATION"
.PP
The \fBTcl_CreateMathFunc\fR and \fBTcl_GetMathFuncInfo\fR functions
are rendered somewhat obsolete by the ability to create functions for
expressions by placing commands in the \fBtcl::mathfunc\fR namespace,
as described in the \fBmathfunc\fR manual page; the API described on
this page is not expected to be maintained indefinitely.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
void
\fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR)
.sp
int
\fBTcl_GetMathFuncInfo\fR(\fIinterp, name, numArgsPtr, argTypesPtr, procPtr,
clientDataPtr\fR)
.sp
Tcl_Obj *
\fBTcl_ListMathFuncs\fR(\fIinterp, pattern\fR)
.SH ARGUMENTS
.AS Tcl_ValueType *clientDataPtr out
.AP Tcl_Interp *interp in
Interpreter in which new function will be defined.
.AP "const char" *name in
Name for new function.
.AP int numArgs in
Number of arguments to new function; also gives size of \fIargTypes\fR array.
.AP Tcl_ValueType *argTypes in
Points to an array giving the permissible types for each argument to
function.
.AP Tcl_MathProc *proc in
Procedure that implements the function.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR when it is invoked.
.AP int *numArgsPtr out
Points to a variable that will be set to contain the number of
arguments to the function.
.AP Tcl_ValueType **argTypesPtr out
Points to a variable that will be set to contain a pointer to an array
giving the permissible types for each argument to the function which
will need to be freed up using \fITcl_Free\fR.
.AP Tcl_MathProc **procPtr out
Points to a variable that will be set to contain a pointer to the
implementation code for the function (or NULL if the function is
implemented directly in bytecode).
.AP ClientData *clientDataPtr out
Points to a variable that will be set to contain the clientData
argument passed to \fITcl_CreateMathFunc\fR when the function was
created if the function is not implemented directly in bytecode.
.AP "const char" *pattern in
Pattern to match against function names so as to filter them (by
passing to \fITcl_StringMatch\fR), or NULL to not apply any filter.
.BE
.SH DESCRIPTION
.PP
Tcl allows a number of mathematical functions to be used in
expressions, such as \fBsin\fR, \fBcos\fR, and \fBhypot\fR.
These functions are represented by commands in the namespace,
\fBtcl::mathfunc\fR. The \fBTcl_CreateMathFunc\fR function is
an obsolete way for applications to add additional functions
to those already provided by Tcl or to replace existing functions.
It should not be used by new applications, which should create
math functions using \fBTcl_CreateObjCommand\fR to create a command
in the \fBtcl::mathfunc\fR namespace.
.PP
In the \fBTcl_CreateMathFunc\fR interface,
\fIName\fR is the name of the function as it will appear in expressions.
If \fIname\fR does not already exist in the \fB::tcl::mathfunc\fR
namespace, then a new command is created in that namespace.
If \fIname\fR does exist, then the existing function is replaced.
\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function.
Each entry in the \fIargTypes\fR array must be
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR, \fBTCL_WIDE_INT\fR,
or \fBTCL_EITHER\fR to indicate whether the corresponding argument must be an
integer, a double-precision floating value, a wide (64-bit) integer,
or any, respectively.
.PP
Whenever the function is invoked in an expression Tcl will invoke
\fIproc\fR. \fIProc\fR should have arguments and result that match
the type \fBTcl_MathProc\fR:
.PP
.CS
typedef int \fBTcl_MathProc\fR(
ClientData \fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
Tcl_Value *\fIargs\fR,
Tcl_Value *\fIresultPtr\fR);
.CE
.PP
When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR
arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR.
\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures,
which describe the actual arguments to the function:
.PP
.CS
typedef struct Tcl_Value {
Tcl_ValueType \fItype\fR;
long \fIintValue\fR;
double \fIdoubleValue\fR;
Tcl_WideInt \fIwideValue\fR;
} \fBTcl_Value\fR;
.CE
.PP
The \fItype\fR field indicates the type of the argument and is
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR.
It will match the \fIargTypes\fR value specified for the function unless
the \fIargTypes\fR value was \fBTCL_EITHER\fR. Tcl converts
the argument supplied in the expression to the type requested in
\fIargTypes\fR, if that is necessary.
Depending on the value of the \fItype\fR field, the \fIintValue\fR,
\fIdoubleValue\fR or \fIwideValue\fR
field will contain the actual value of the argument.
.PP
\fIProc\fR should compute its result and store it either as an integer
in \fIresultPtr->intValue\fR or as a floating value in
\fIresultPtr->doubleValue\fR.
It should set also \fIresultPtr->type\fR to one of
\fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR
to indicate which value was set.
Under normal circumstances \fIproc\fR should return \fBTCL_OK\fR.
If an error occurs while executing the function, \fIproc\fR should
return \fBTCL_ERROR\fR and leave an error message in the interpreter's result.
.PP
\fBTcl_GetMathFuncInfo\fR retrieves the values associated with
function \fIname\fR that were passed to a preceding
\fBTcl_CreateMathFunc\fR call. Normally, the return code is
\fBTCL_OK\fR but if the named function does not exist, \fBTCL_ERROR\fR
is returned and an error message is placed in the interpreter's
result.
.PP
If an error did not occur, the array reference placed in the variable
pointed to by \fIargTypesPtr\fR is newly allocated, and should be
released by passing it to \fBTcl_Free\fR. Some functions (the
standard set implemented in the core, and those defined by placing
commands in the \fBtcl::mathfunc\fR namespace) do not have
argument type information; attempting to retrieve values for
them causes a NULL to be stored in the variable pointed to by
\fIprocPtr\fR and the variable pointed to by \fIclientDataPtr\fR
will not be modified. The variable pointed to by \fInumArgsPointer\fR
will contain -1, and no argument types will be stored in the variable
pointed to by \fIargTypesPointer\fR.
.PP
\fBTcl_ListMathFuncs\fR returns a Tcl value containing a list of all
the math functions defined in the interpreter whose name matches
\fIpattern\fR. The returned value has a reference count of zero.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_ListMathFuncs\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.SH "SEE ALSO"
expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
.SH KEYWORDS
expression, mathematical function
+23 -18
View File
@@ -58,7 +58,7 @@ Implementation of the new command: \fIproc\fR will be called whenever
.AP Tcl_ObjCmdProc2 *proc2 in
Implementation of the new command: \fIproc2\fR will be called whenever
\fIcmdName\fR is invoked as a command.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
@@ -101,7 +101,7 @@ and it returns NULL.
.PP
.CS
typedef int \fBTcl_ObjCmdProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]);
@@ -174,7 +174,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
.PP
.CS
typedef void \fBTcl_CmdDeleteProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
@@ -185,9 +185,9 @@ except its \fIproc2\fR argument is of type \fBTcl_ObjCmdProc2\fR.
.PP
.CS
typedef int \fBTcl_ObjCmdProc2\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
size_t \fIobjc\fR,
Tcl_Size \fIobjc\fR,
Tcl_Obj *const \fIobjv\fR[]);
.CE
.PP
@@ -224,24 +224,29 @@ pointed to by \fIinfoPtr\fR and returns 1.
A \fBTcl_CmdInfo\fR structure has the following fields:
.PP
.CS
typedef struct Tcl_CmdInfo {
typedef struct {
int \fIisNativeObjectProc\fR;
Tcl_ObjCmdProc *\fIobjProc\fR;
ClientData \fIobjClientData\fR;
void *\fIobjClientData\fR;
Tcl_CmdProc *\fIproc\fR;
ClientData \fIclientData\fR;
void *\fIclientData\fR;
Tcl_CmdDeleteProc *\fIdeleteProc\fR;
ClientData \fIdeleteData\fR;
void *\fIdeleteData\fR;
Tcl_Namespace *\fInamespacePtr\fR;
Tcl_ObjCmdProc2 *\fIobjProc2\fR;
void *\fIobjClientData2\fR;
} \fBTcl_CmdInfo\fR;
.CE
.PP
The \fIisNativeObjectProc\fR field has the value 1
if \fBTcl_CreateObjCommand\fR was called to register the command;
it is 0 if only \fBTcl_CreateCommand\fR was called.
The \fIisNativeObjectProc\fR field has the value 2 if
\fBTcl_CreateObjCommand2\fR was called to register the command;
it has the value 1 if \fBTcl_CreateObjCommand\fR was called to
register the command; it is 0 if only \fBTcl_CreateCommand\fR was called.
It allows a program to determine whether it is faster to
call \fIobjProc\fR or \fIproc\fR:
\fIobjProc\fR is normally faster
call \fIobjProc2\fR, \fIobjProc\fR or \fIproc\fR:
\fIobjProc2\fR/\fIobjProc\fR is normally faster
if \fIisNativeObjectProc\fR has the value 2;
\fIobjProc\fR/\fIobjProc\fR is normally faster
if \fIisNativeObjectProc\fR has the value 1.
The fields \fIobjProc\fR and \fIobjClientData\fR
have the same meaning as the \fIproc\fR and \fIclientData\fR
@@ -257,7 +262,7 @@ otherwise, this is a compatibility procedure
registered by \fBTcl_CreateObjCommand\fR
that simply calls the command's
value-based procedure after converting its string arguments to Tcl values.
The field \fIdeleteData\fR is the ClientData value
The field \fIdeleteData\fR is the clientData value
to pass to \fIdeleteProc\fR; it is normally the same as
\fIclientData\fR but may be set independently using the
\fBTcl_SetCommandInfo\fR procedure.
@@ -271,7 +276,7 @@ from \fBTcl_CreateObjCommand\fR in place of the command name. If the
and fills in the structure designated by \fIinfoPtr\fR.
.PP
\fBTcl_SetCommandInfo\fR is used to modify the procedures and
ClientData values associated with a command.
clientData values associated with a command.
Its \fIcmdName\fR argument is the name of a command in \fIinterp\fR.
\fIcmdName\fR may include \fB::\fR namespace qualifiers
to identify a command in a particular namespace.
@@ -287,9 +292,9 @@ copies the information from \fI*infoPtr\fR to Tcl's internal structure
for the command and returns 1.
.PP
Note that \fBTcl_SetCommandInfo\fR and
\fBTcl_SetCommandInfoFromToken\fR both allow the ClientData for a
\fBTcl_SetCommandInfoFromToken\fR both allow the clientData for a
command's deletion procedure to be given a different value than the
ClientData for its command procedure.
clientData for its command procedure.
.PP
Note that neither \fBTcl_SetCommandInfo\fR nor
\fBTcl_SetCommandInfoFromToken\fR will change a command's namespace.
+2 -2
View File
@@ -24,7 +24,7 @@ Tcl_TimerToken
How many milliseconds to wait before invoking \fIproc\fR.
.AP Tcl_TimerProc *proc in
Procedure to invoke after \fImilliseconds\fR have elapsed.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP Tcl_TimerToken token in
Token for previously created timer handler (the return value
@@ -51,7 +51,7 @@ the type \fBTcl_TimerProc\fR:
.PP
.CS
typedef void \fBTcl_TimerProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a
+4 -4
View File
@@ -29,7 +29,7 @@ Tcl_Trace
.AS Tcl_CmdObjTraceDeleteProc *deleteProc
.AP Tcl_Interp *interp in
Interpreter containing command to be traced or untraced.
.AP int level in
.AP Tcl_Size level in
Only commands at or below this nesting level will be traced unless
0 is specified. 1 means
top-level commands only, 2 means top-level commands or those that are
@@ -88,16 +88,16 @@ typedef int \fBTcl_CmdObjTraceProc\fR(
typedef int \fBTcl_CmdObjTraceProc2\fR(
\fBvoid *\fR \fIclientData\fR,
\fBTcl_Interp\fR* \fIinterp\fR,
size_t \fIlevel\fR,
Tcl_Size \fIlevel\fR,
const char *\fIcommand\fR,
\fBTcl_Command\fR \fIcommandToken\fR,
size_t \fIobjc\fR,
Tcl_Size \fIobjc\fR,
\fBTcl_Obj\fR *const \fIobjv\fR[]);
.CE
.PP
The \fIclientData\fR and \fIinterp\fR parameters are copies of the
corresponding arguments given to \fBTcl_CreateTrace\fR.
\fIClientData\fR typically points to an application-specific data
\fIclientData\fR typically points to an application-specific data
structure that describes what to do when \fIobjProc\fR is invoked. The
\fIlevel\fR parameter gives the nesting level of the command (1 for
top-level commands passed to \fBTcl_Eval\fR by the application, 2 for
+16 -21
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringTrunc, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -26,7 +26,7 @@ char *
.sp
\fBTcl_DStringEndSublist\fR(\fIdsPtr\fR)
.sp
int
Tcl_Size
\fBTcl_DStringLength\fR(\fIdsPtr\fR)
.sp
char *
@@ -34,8 +34,6 @@ char *
.sp
\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR)
.sp
\fBTcl_DStringTrunc\fR(\fIdsPtr, newLength\fR)
.sp
\fBTcl_DStringFree\fR(\fIdsPtr\fR)
.sp
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
@@ -53,10 +51,10 @@ Pointer to structure that is used to manage a dynamic string.
Pointer to characters to append to dynamic string.
.AP "const char" *element in
Pointer to characters to append as list element to dynamic string.
.AP int length in
Number of bytes from \fIbytes\fR to add to dynamic string. If -1,
.AP Tcl_Size length in
Number of bytes from \fIbytes\fR to add to dynamic string. If negative,
add all characters up to null terminating character.
.AP int newLength in
.AP Tcl_Size newLength in
New length for dynamic string, not including null terminating
character.
.AP Tcl_Interp *interp in/out
@@ -132,10 +130,6 @@ caller to fill in the new space.
even if the string is truncated to zero length, so \fBTcl_DStringFree\fR
will still need to be called.
.PP
\fBTcl_DStringTrunc\fR changes the length of a dynamic string.
This procedure is now deprecated. \fBTcl_DStringSetLength\fR should
be used instead.
.PP
\fBTcl_DStringFree\fR should be called when you are finished using
the string. It frees up any memory that was allocated for the string
and reinitializes the string's value to an empty string.
@@ -148,7 +142,8 @@ This saves the cost of allocating new memory and copying the string.
an empty string.
Since the dynamic string is reinitialized, there is no need to
further call \fBTcl_DStringFree\fR on it and it can be reused without
calling \fBTcl_DStringInit\fR.
calling \fBTcl_DStringInit\fR. The caller must ensure that the dynamic
string stored in \fIdsPtr\fR is encoded in Tcl's internal UTF-8 format.
.PP
\fBTcl_DStringGetResult\fR does the opposite of \fBTcl_DStringResult\fR.
It sets the value of \fIdsPtr\fR to the result of \fIinterp\fR and
@@ -156,15 +151,15 @@ it clears \fIinterp\fR's result.
If possible it does this by moving a pointer rather than by copying
the string.
.PP
\fBTcl_DStringToObj\fR returns a \fBTcl_Obj\fR containing the value of
the dynamic string given by \fIdsPtr\fR. It does this by moving
a pointer from \fIdsPtr\fR to a newly allocated \fBTcl_Obj\fR
and reinitializing to dynamic string to an empty string.
This saves the cost of allocating new memory and copying the string.
Since the dynamic string is reinitialized, there is no need to
further call \fBTcl_DStringFree\fR on it and it can be reused without
calling \fBTcl_DStringInit\fR.
The returned \fBTcl_Obj\fR has a reference count of 0.
\fBTcl_DStringToObj\fR returns a \fBTcl_Obj\fR containing the value of the
dynamic string given by \fIdsPtr\fR. It does this by moving a pointer from
\fIdsPtr\fR to a newly allocated \fBTcl_Obj\fR and reinitializing to dynamic
string to an empty string. This saves the cost of allocating new memory and
copying the string. Since the dynamic string is reinitialized, there is no need
to further call \fBTcl_DStringFree\fR on it and it can be reused without calling
\fBTcl_DStringInit\fR. The returned \fBTcl_Obj\fR has a reference count of 0.
The caller must ensure that the dynamic string stored in \fIdsPtr\fR is encoded
in Tcl's internal UTF-8 format.
.SH KEYWORDS
append, dynamic string, free, result
+1 -1
View File
@@ -22,7 +22,7 @@ Tcl_Pid
\fBTcl_WaitPid\fR(\fIpid, statusPtr, options\fR)
.SH ARGUMENTS
.AS Tcl_Pid *statusPtr out
.AP int numPids in
.AP Tcl_Size numPids in
Number of process ids contained in the array pointed to by \fIpidPtr\fR.
.AP int *pidPtr in
Address of array containing \fInumPids\fR process ids.
+4 -3
View File
@@ -70,7 +70,7 @@ Points to a variable that will have the value from a key/value pair
placed within it. For \fBTcl_DictObjFirst\fR and
\fBTcl_DictObjNext\fR, this may be NULL to indicate that the caller is
not interested in the value.
.AP int *sizePtr out
.AP "Tcl_Size \&| int" *sizePtr out
Points to a variable that will have the number of key/value pairs
contained within the dictionary placed within it.
.AP Tcl_DictSearch *searchPtr in/out
@@ -84,7 +84,7 @@ returned, the search record \fImust\fR be passed to
Points to a variable that will have a non-zero value written into it
when the enumeration of the key/value pairs in a dictionary has
completed, and a zero otherwise.
.AP int keyc in
.AP Tcl_Size keyc in
Indicates the number of keys that will be supplied in the \fIkeyv\fR
array.
.AP "Tcl_Obj *const" *keyv in
@@ -138,7 +138,8 @@ converted to a dictionary.
\fBTcl_DictObjSize\fR updates the given variable with the number of
key/value pairs currently in the given dictionary. The result of this
procedure is \fBTCL_OK\fR, or \fBTCL_ERROR\fR if the \fIdictPtr\fR cannot be
converted to a dictionary.
converted to a dictionary or if \fIsizePtr\fR points to a variable of type
\fBint\fR and the dict contains more than 2**31 key/value pairs.
.PP
\fBTcl_DictObjFirst\fR commences an iteration across all the key/value
pairs in the given dictionary, placing the key and value in the
+2 -2
View File
@@ -21,7 +21,7 @@ Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pendi
.AS Tcl_IdleProc clientData
.AP Tcl_IdleProc *proc in
Procedure to invoke.
.AP ClientData clientData in
.AP coid *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -43,7 +43,7 @@ type \fBTcl_IdleProc\fR:
.PP
.CS
typedef void \fBTcl_IdleProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
+3 -3
View File
@@ -43,7 +43,7 @@ is not defined, these functions are all no-ops.
\fBTcl_DumpActiveMemory\fR will output a list of all currently
allocated memory to the specified file. The information output for
each allocated block of memory is: starting and ending addresses
(excluding guard zone), size, source file where \fBckalloc\fR was
(excluding guard zone), size, source file where \fBTcl_Alloc\fR was
called to allocate the block and line number in that file. It is
especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
interpreter has been deleted.
@@ -55,8 +55,8 @@ by \fBTcl_Main\fR.
\fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
all currently allocated blocks of memory. Normally validation of a
block occurs when its freed, unless full validation is enabled, in
which case validation of all blocks occurs when \fBckalloc\fR and
\fBckfree\fR are called. This function forces the validation to occur
which case validation of all blocks occurs when \fBTcl_Alloc\fR and
\fBTcl_Free\fR are called. This function forces the validation to occur
at any point.
.SH "SEE ALSO"
+64 -62
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_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_ExternalToUtfDStringEx, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternalDStringEx, Tcl_UtfToExternal, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath \- procedures for creating and using encodings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -26,13 +26,13 @@ char *
\fBTcl_ExternalToUtfDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
.sp
int
\fBTcl_ExternalToUtfDStringEx\fR(\fIencoding, src, srcLen, flags, dstPtr\fR)
\fBTcl_ExternalToUtfDStringEx\fR(\fIinterp, encoding, src, srcLen, flags, dstPtr, errorIdxPtr\fR)
.sp
char *
\fBTcl_UtfToExternalDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
.sp
int
\fBTcl_UtfToExternalDStringEx\fR(\fIencoding, src, srcLen, flags, dstPtr\fR)
\fBTcl_UtfToExternalDStringEx\fR(\fIinterp, encoding, src, srcLen, flags, dstPtr, errorIdxPtr\fR)
.sp
int
\fBTcl_ExternalToUtf\fR(\fIinterp, encoding, src, srcLen, flags, statePtr,
@@ -42,16 +42,10 @@ int
\fBTcl_UtfToExternal\fR(\fIinterp, encoding, src, srcLen, flags, statePtr,
dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr\fR)
.sp
char *
\fBTcl_WinTCharToUtf\fR(\fItsrc, srcLen, dstPtr\fR)
.sp
TCHAR *
\fBTcl_WinUtfToTChar\fR(\fIsrc, srcLen, dstPtr\fR)
.sp
const char *
\fBTcl_GetEncodingName\fR(\fIencoding\fR)
.sp
int
Tcl_Size
\fBTcl_GetEncodingNulLength\fR(\fIencoding\fR)
.sp
int
@@ -71,12 +65,6 @@ Tcl_Obj *
.sp
int
\fBTcl_SetEncodingSearchPath\fR(\fIsearchPath\fR)
.sp
const char *
\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR)
.sp
void
\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
.SH ARGUMENTS
.AS "const Tcl_EncodingType" *dstWrotePtr in/out
.AP Tcl_Interp *interp in
@@ -94,18 +82,18 @@ Points to storage where encoding token is to be written.
.AP "const char" *src in
For the \fBTcl_ExternalToUtf\fR functions, an array of bytes in the
specified encoding that are to be converted to UTF-8. For the
\fBTcl_UtfToExternal\fR and \fBTcl_WinUtfToTChar\fR functions, an array of
\fBTcl_UtfToExternal\fR function, an array of
UTF-8 characters to be converted to the specified encoding.
.AP "const TCHAR" *tsrc in
An array of Windows TCHAR characters to convert to UTF-8.
.AP int srcLen in
.AP Tcl_Size srcLen in
Length of \fIsrc\fR or \fItsrc\fR in bytes. If the length is negative, the
encoding-specific length of the string is used.
.AP Tcl_DString *dstPtr out
Pointer to an uninitialized or free \fBTcl_DString\fR in which the converted
result will be stored.
.AP int flags in
Various flag bits OR-ed together.
This is a bit mask passed in to control the operation of the encoding functions.
\fBTCL_ENCODING_START\fR signifies that the
source buffer is the first block in a (potentially multi-block) input
stream, telling the conversion routine to reset to an initial state and
@@ -113,16 +101,15 @@ perform any initialization that needs to occur before the first byte is
converted. \fBTCL_ENCODING_END\fR signifies that the source buffer is the last
block in a (potentially multi-block) input stream, telling the conversion
routine to perform any finalization that needs to occur after the last
byte is converted and then to reset to an initial state.
\fBTCL_ENCODING_STOPONERROR\fR signifies that the conversion routine should
return immediately upon reading a source character that does not exist in
the target encoding; otherwise a default fallback character will
automatically be substituted. The flag \fBTCL_ENCODING_STRICT\fR makes the
encoder/decoder more strict in what it considers to be an invalid byte
sequence. The flag \fBTCL_ENCODING_NOCOMPLAIN\fR has
no effect, it is reserved for Tcl 9.0. The flag \fBTCL_ENCODING_MODIFIED\fR makes
\fBTcl_UtfToExternalDStringEx\fR and \fBTcl_UtfToExternal\fR produce the
byte sequence \exC0\ex80 in stead of \ex00, for the utf-8/cesu-8 encoders.
byte is converted and then to reset to an initial state. The
\fBTCL_PROFILE_*\fR bits defined in the \fBPROFILES\fR section below
control the encoding profile to be used for dealing with invalid data or
other errors in the encoding transform.
\fBTCL_ENCODING_STOPONERROR\fR is present for backward compatibility with
Tcl 8.6 and forces the encoding profile to \fBstrict\fR.
Some flags bits may not be usable with some functions as noted in the
function descriptions below.
.AP Tcl_EncodingState *statePtr in/out
Used when converting a (generally long or indefinite length) byte stream
in a piece-by-piece fashion. The conversion routine stores its current
@@ -148,6 +135,9 @@ buffer as a result of the conversion. May be NULL.
.AP int *dstCharsPtr out
Filled with the number of characters that correspond to the number of bytes
stored in the output buffer. May be NULL.
.AP Tcl_Size *errorIdxPtr out
Filled with the index of the byte or character that caused the encoding transform
to fail. May be NULL.
.AP Tcl_DString *bufPtr out
Storage for the prescribed system encoding name.
.AP "const Tcl_EncodingType" *typePtr in
@@ -222,10 +212,27 @@ When converting, if any of the characters in the source buffer cannot be
represented in the target encoding, a default fallback character will be
used. The return value is a pointer to the value stored in the DString.
.PP
\fBTcl_ExternalToUtfDStringEx\fR is the same as \fBTcl_ExternalToUtfDString\fR,
but it has an additional flags parameter. The return value is the index of
the first byte in the input string causing a conversion error.
Or TCL_INDEX_NONE if all is OK.
\fBTcl_ExternalToUtfDStringEx\fR is a more flexible version of older
\fBTcl_ExternalToUtfDString\fR function. It takes three additional parameters,
\fBinterp\fR, \fBflags\fR and \fBerrorIdxPtr\fR. The \fBflags\fR parameter may
be used to specify the profile to be used for the transform. The
\fBTCL_ENCODING_START\fR and \fBTCL_ENCODING_END\fR bits in \fBflags\fR are
ignored as the function assumes the entire source string to be decoded is passed
into the function. On success, the function returns \fBTCL_ERROR\fR with the
converted string stored in \fB*dstPtr\fR. For errors other than conversion
errors, such as invalid flags, the function returns \fBTCL_OK\fR with an error
message in \fBinterp\fR if it is not NULL.
.PP
For conversion errors, \fBTcl_ExternalToUtfDStringEx\fR returns one
of the \fBTCL_CONVERT_*\fR errors listed below for \fBTcl_ExternalToUtf\fR.
When one of these conversion errors is returned, an error message is
stored in \fBinterp\fR only if \fBerrorIdxPtr\fR is NULL. Otherwise, no error message
is stored as the function expects the caller is interested whatever is
decoded to that point and not treating this as an immediate error condition.
The index of the error location is stored in \fB*errorIdxPtr\fR.
.PP
The caller must call \fBTcl_DStringFree\fR to free up the \fB*dstPtr\fR resources
irrespective of the return value from the function.
.PP
\fBTcl_ExternalToUtf\fR converts a source buffer \fIsrc\fR from the specified
\fIencoding\fR into UTF-8. Up to \fIsrcLen\fR bytes are converted from the
@@ -248,12 +255,12 @@ the unconverted bytes that remained in \fIsrc\fR plus some further bytes
from the source stream to properly convert the formerly split-up multibyte
sequence.
.IP \fBTCL_CONVERT_SYNTAX\fR 29
The source buffer contained an invalid character sequence. This may occur
The source buffer contained an invalid byte or character sequence. This may occur
if the input stream has been damaged or if the input encoding method was
misidentified.
.IP \fBTCL_CONVERT_UNKNOWN\fR 29
The source buffer contained a character that could not be represented in
the target encoding and \fBTCL_ENCODING_STOPONERROR\fR was specified.
the target encoding.
.RE
.LP
\fBTcl_UtfToExternalDString\fR converts a source buffer \fIsrc\fR from UTF-8
@@ -265,10 +272,14 @@ characters in the source buffer cannot be represented in the target
encoding, a default fallback character will be used. The return value is
a pointer to the value stored in the DString.
.PP
\fBTcl_UtfToExternalDStringEx\fR is the same as \fBTcl_UtfToExternalDString\fR,
but it has an additional flags parameter. The return value is the index of
the first byte of an utf-8 byte-sequence in the input string causing a
conversion error. Or TCL_INDEX_NONE if all is OK.
\fBTcl_UtfToExternalDStringEx\fR is an enhanced version of
\fBTcl_UtfToExternalDString\fR that transforms UTF-8 encoded source data to a specified
\fIencoding\fR. Except for the direction of the transform, the parameters and
return values are identical to those of \fBTcl_ExternalToUtfDStringEx\fR. See
that function above for details about the same.
Irrespective of the return code from the function, the caller must free
resources associated with \fB*dstPtr\fR when the function returns.
.PP
\fBTcl_UtfToExternal\fR converts a source buffer \fIsrc\fR from UTF-8 into
the specified \fIencoding\fR. Up to \fIsrcLen\fR bytes are converted from
@@ -279,18 +290,6 @@ 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. 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
was used to create the encoding. The string returned by
@@ -320,7 +319,7 @@ the encoding name to it. The \fBTcl_DStringValue\fR is returned.
\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list
consisting of the names of all the encodings that are currently defined
or can be dynamically loaded, searching the encoding path specified by
\fBTcl_SetDefaultEncodingDir\fR. This procedure does not ensure that the
\fBTcl_SetEncodingSearchPath\fR. This procedure does not ensure that the
dynamically-loadable encoding files contain valid data, but merely that they
exist.
.PP
@@ -348,7 +347,7 @@ typedef struct Tcl_EncodingType {
Tcl_EncodingConvertProc *\fIfromUtfProc\fR;
Tcl_EncodingFreeProc *\fIfreeProc\fR;
void *\fIclientData\fR;
int \fInullSize\fR;
Tcl_Size \fInullSize\fR;
} \fBTcl_EncodingType\fR;
.CE
.PP
@@ -435,15 +434,6 @@ are not verified as existing readable filesystem directories. When
searching for encoding data files takes place, and non-existent or
non-readable filesystem directories on the \fIsearchPath\fR are silently
ignored.
.PP
\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR
are obsolete interfaces best replaced with calls to
\fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR.
They are called to access and set the first element of the \fIsearchPath\fR
list. Since Tcl searches \fIsearchPath\fR for encoding data files in
list order, these routines establish the
.QW default
directory in which to find encoding data files.
.SH "ENCODING FILES"
Space would prohibit precompiling into Tcl every possible encoding
algorithm, so many encodings are stored on disk as dynamically-loadable
@@ -592,6 +582,18 @@ to the object, it will be deleted.
.PP
\fBTcl_GetEncodingSearchPath\fR returns an object with a reference count of at
least 1.
.SH "PROFILES"
Encoding profiles define the manner in which errors in the encoding transforms
are handled by the encoding functions. An application can specify the profile
to be used by OR-ing the \fBflags\fR parameter passed to the function
with at most one of \fBTCL_ENCODING_PROFILE_TCL8\fR,
\fBTCL_ENCODING_PROFILE_STRICT\fR or \fBTCL_ENCODING_PROFILE_REPLACE\fR.
These correspond to the \fBtcl8\fR, \fBstrict\fR and \fBreplace\fR profiles
respectively. If none are specified, a version-dependent default profile is used.
For Tcl 8.7, the default profile is \fBtcl8\fR.
.PP
For details about profiles, see the \fBPROFILES\fR section in
the documentation of the \fBencoding\fR command.
.SH "SEE ALSO"
encoding(n)
.SH KEYWORDS
+2 -2
View File
@@ -69,14 +69,14 @@ The name of the ensemble command to be created.
The namespace to which the ensemble command is to be bound, or NULL
for the current namespace.
.AP int ensFlags in
An ORed set of flag bits describing the basic configuration of the
An OR'ed set of flag bits describing the basic configuration of the
ensemble. Currently only one bit has meaning, \fBTCL_ENSEMBLE_PREFIX\fR,
which is present when the ensemble command should also match
unambiguous prefixes of subcommands.
.AP Tcl_Obj *cmdNameObj in
A value holding the name of the ensemble command to look up.
.AP int flags in
An ORed set of flag bits controlling the behavior of
An OR'ed set of flag bits controlling the behavior of
\fBTcl_FindEnsemble\fR. Currently only \fBTCL_LEAVE_ERR_MSG\fR is supported.
.AP Tcl_Command token in
A normal command token that refers to an ensemble command, or which
+7 -24
View File
@@ -10,7 +10,7 @@
.so man.macros
.BS
.SH NAME
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval \- execute Tcl scripts
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -38,9 +38,6 @@ int
.sp
int
\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fB(char *) NULL\fR)
.sp
int
\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
.SH ARGUMENTS
.AS Tcl_Interp **termPtr
.AP Tcl_Interp *interp in
@@ -49,11 +46,11 @@ modified to hold the result or error message from the script.
.AP Tcl_Obj *objPtr in
A Tcl value containing the script to execute.
.AP int flags in
ORed combination of flag bits that specify additional options.
OR'ed combination of flag bits that specify additional options.
\fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported.
.AP "const char" *fileName in
Name of a file containing a Tcl script.
.AP int objc in
.AP Tcl_Size objc in
The number of values in the array pointed to by \fIobjv\fR;
this is also the number of words in the command.
.AP Tcl_Obj **objv in
@@ -67,9 +64,6 @@ first null byte are used.
Points to first byte of script to execute (null-terminated and UTF-8).
.AP "const char" *part in
String forming part of a Tcl script.
.AP va_list argList in
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.BE
.SH DESCRIPTION
@@ -107,7 +101,7 @@ in code for string comparison, you can use
which will be safely substituted by the Tcl interpreter into
.QW ^Z .
.PP
\fBTcl_EvalObjv\fR executes a single pre-parsed command instead of a
\fBTcl_EvalObjv\fR executes a single preparsed command instead of a
script. The \fIobjc\fR and \fIobjv\fR arguments contain the values
of the words for the Tcl command, one word in each value in
\fIobjv\fR. \fBTcl_EvalObjv\fR evaluates the command and returns
@@ -126,16 +120,10 @@ might be a UTF-8 special code. The string is parsed and executed directly
bytecodes. In situations where it is known that the script will never be
executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR.
\fBTcl_Eval\fR returns a completion code and result just like
\fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before
Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to
\fIinterp->result\fR (use is deprecated) where it can be accessed directly.
This makes \fBTcl_Eval\fR somewhat slower than \fBTcl_EvalEx\fR, which
does not do the copy.
\fBTcl_EvalObjEx\fR.
.PP
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
additional arguments \fInumBytes\fR and \fIflags\fR. For the
efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
over \fBTcl_Eval\fR.
additional arguments \fInumBytes\fR and \fIflags\fR.
.PP
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
@@ -151,15 +139,10 @@ It returns the result of the command and also modifies
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. 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
Any ORed combination of the following values may be used for the
Any OR'ed combination of the following values may be used for the
\fIflags\fR argument to procedures such as \fBTcl_EvalObjEx\fR:
.TP 23
\fBTCL_EVAL_DIRECT\fR
+5 -6
View File
@@ -42,7 +42,7 @@ usually means that an error occurred.
Procedure to invoke before exiting application, or (for
\fBTcl_SetExitProc\fR) NULL to uninstall the current application exit
procedure.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
@@ -64,7 +64,7 @@ otherwise causes the application to terminate without calling
returns control to its caller.
If an application exit handler has been installed (see
\fBTcl_SetExitProc\fR), that handler is invoked with an argument
consisting of the exit status (cast to ClientData); the application
consisting of the exit status (cast to void *); the application
exit handler should not return control to Tcl.
.PP
\fBTcl_Finalize\fR is similar to \fBTcl_Exit\fR except that it does not
@@ -93,7 +93,7 @@ and freeing global memory.
.PP
.CS
typedef void \fBTcl_ExitProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR parameter to \fIproc\fR is a
@@ -133,10 +133,9 @@ installed, that exit handler takes over complete responsibility for
finalization of Tcl's subsystems via \fBTcl_Finalize\fR at an
appropriate time. The argument passed to \fIproc\fR when it is
invoked will be the exit status code (as passed to \fBTcl_Exit\fR)
cast to a ClientData value.
cast to a void *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.
\fBTcl_SetExitProc\fR can not be used in stub-enabled extensions.
.SH "SEE ALSO"
exit(n)
.SH KEYWORDS
+22 -36
View File
@@ -20,7 +20,7 @@ int
int
\fBTcl_FSUnregister\fR(\fIfsPtr\fR)
.sp
ClientData
void *
\fBTcl_FSData\fR(\fIfsPtr\fR)
.sp
void
@@ -123,7 +123,7 @@ Tcl_Obj *
int
\fBTcl_FSConvertToPathType\fR(\fIinterp, pathPtr\fR)
.sp
ClientData
void *
\fBTcl_FSGetInternalRep\fR(\fIpathPtr, fsPtr\fR)
.sp
Tcl_Obj *
@@ -210,7 +210,7 @@ this structure will be returned. This parameter may be NULL.
.AP Tcl_Interp *interp in
Interpreter to use either for results, evaluation, or reporting error
messages.
.AP ClientData clientData in
.AP void *clientData in
The native description of the path value to create.
.AP Tcl_Obj *firstPtr in
The first of two path values to compare. The value may be converted
@@ -220,8 +220,8 @@ The second of two path values to compare. The value may be converted
to \fBpath\fR type.
.AP Tcl_Obj *listObj in
The list of path elements to operate on with a \fBjoin\fR operation.
.AP int elements in
If non-negative, the number of elements in the \fIlistObj\fR which should
.AP Tcl_Size elements in
The number of elements in the \fIlistObj\fR which should
be joined together. If negative, then all elements are joined.
.AP Tcl_Obj **errorPtr out
In the case of an error, filled with a value containing the name of
@@ -233,7 +233,7 @@ The value to set in the operation.
.AP Tcl_Obj **objPtrRef out
Filled with a value containing the result of the operation.
.AP Tcl_Obj *resultPtr out
Pre-allocated value in which to store (using
Preallocated value in which to store (using
\fBTcl_ListObjAppendElement\fR) the list of
files or directories which are successfully matched.
.AP int mode in
@@ -251,7 +251,7 @@ Name of a procedure to look up in the file's symbol table
Filled with the init function for this code.
.AP Tcl_LibraryInitProc **proc2Ptr out
Filled with the safe-init function for this code.
.AP ClientData *clientDataPtr out
.AP void **clientDataPtr out
Filled with the clientData value to pass to this code's unload
function when it is called.
.AP Tcl_LoadHandle *loadHandlePtr out
@@ -269,11 +269,11 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
.AP int permissions in
POSIX-style permission flags such as 0644. If a new file is created, these
permissions will be set on the created file.
.AP int *lenPtr out
.AP "Tcl_Size \&| int" *lenPtr out
If non-NULL, filled with the number of elements in the split path.
.AP Tcl_Obj *basePtr in
The base path on to which to join the given elements. May be NULL.
.AP int objc in
.AP Tcl_Size objc in
The number of elements in \fIobjv\fR.
.AP "Tcl_Obj *const" objv[] in
The elements to join to the given base path.
@@ -483,7 +483,7 @@ is a Tcl_Obj specifying the contents of the symbolic link given by
by the caller, which should call \fBTcl_DecrRefCount\fR when the result is no
longer needed. If the \fItoPtr\fR is not NULL, Tcl should create a link
of one of the types passed in in the \fIlinkAction\fR flag. This flag is
an ORed combination of \fBTCL_CREATE_SYMBOLIC_LINK\fR and \fBTCL_CREATE_HARD_LINK\fR.
an OR'ed combination of \fBTCL_CREATE_SYMBOLIC_LINK\fR and \fBTCL_CREATE_HARD_LINK\fR.
Where a choice exists (i.e.\ more than one flag is passed in), the Tcl
convention is to prefer symbolic links. When a link is successfully
created, the return value should be \fItoPtr\fR (which is therefore
@@ -678,11 +678,6 @@ of zero, they will be freed when this function returns.
\fBTcl_FSConvertToPathType\fR tries to convert the given Tcl_Obj to a valid
Tcl path type, taking account of the fact that the cwd may have changed
even if this value is already supposedly of the correct type.
The filename may begin with
.QW ~
(to indicate current user's home directory) or
.QW ~<user>
(to indicate any user's home directory).
.PP
If the conversion succeeds (i.e.\ the value is a valid path in one of
the current filesystems), then \fBTCL_OK\fR is returned. Otherwise
@@ -704,14 +699,7 @@ from the given Tcl_Obj.
.PP
If the translation succeeds (i.e.\ the value is a valid path), then it is
returned. Otherwise NULL will be returned, and an error message may be
left in the interpreter. A
.QW translated
path is one which contains no
.QW ~
or
.QW ~user
sequences (these have been expanded to their current
representation in the filesystem). The value returned is owned by the
left in the interpreter. The value returned is owned by the
caller, which must store it or call \fBTcl_DecrRefCount\fR to ensure memory is
freed. This function is of little practical use, and
\fBTcl_FSGetNormalizedPath\fR or \fBTcl_FSGetNativePath\fR are usually
@@ -720,7 +708,7 @@ better functions to use for most purposes.
\fBTcl_FSGetTranslatedStringPath\fR does the same as
\fBTcl_FSGetTranslatedPath\fR, but returns a character string or NULL.
The string returned is dynamically allocated and owned by the caller,
which must store it or call \fBckfree\fR to ensure it is freed. Again,
which must store it or call \fBTcl_Free\fR to ensure it is freed. Again,
\fBTcl_FSGetNormalizedPath\fR or \fBTcl_FSGetNativePath\fR are usually
better functions to use for most purposes.
.PP
@@ -787,7 +775,7 @@ It returns one of \fBTCL_PATH_ABSOLUTE\fR, \fBTCL_PATH_RELATIVE\fR, or
.SS "PORTABLE STAT RESULT API"
.PP
\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system heap (which
may be deallocated by being passed to \fBckfree\fR). This allows extensions to
may be deallocated by being passed to \fBTcl_Free\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
@@ -835,7 +823,7 @@ general that is not a good thing to do). \fBTCL_OK\fR will be returned.
the list of known filesystems, if it is known, and returns \fBTCL_OK\fR. If
the filesystem is not currently registered, \fBTCL_ERROR\fR is returned.
.PP
\fBTcl_FSData\fR will return the ClientData associated with the given
\fBTcl_FSData\fR will return the clientData associated with the given
filesystem, if that filesystem is registered. Otherwise it will
return NULL.
.PP
@@ -850,7 +838,7 @@ The \fBTcl_Filesystem\fR structure contains the following fields:
.CS
typedef struct Tcl_Filesystem {
const char *\fItypeName\fR;
int \fIstructureLength\fR;
Tcl_Size \fIstructureLength\fR;
Tcl_FSVersion \fIversion\fR;
Tcl_FSPathInFilesystemProc *\fIpathInFilesystemProc\fR;
Tcl_FSDupInternalRepProc *\fIdupInternalRepProc\fR;
@@ -1012,7 +1000,7 @@ Tcl's internal list of known filesystems.
.CS
typedef int \fBTcl_FSPathInFilesystemProc\fR(
Tcl_Obj *\fIpathPtr\fR,
ClientData *\fIclientDataPtr\fR);
void **\fIclientDataPtr\fR);
.CE
.SS DUPINTERNALREPPROC
.PP
@@ -1022,8 +1010,8 @@ simply not copy the internal representation, which may then need to be
regenerated later.
.PP
.CS
typedef ClientData \fBTcl_FSDupInternalRepProc\fR(
ClientData \fIclientData\fR);
typedef void *\fBTcl_FSDupInternalRepProc\fR(
void *\fIclientData\fR);
.CE
.SS FREEINTERNALREPPROC
Free the internal representation. This must be implemented if internal
@@ -1032,7 +1020,7 @@ internal representation is generated), but may otherwise be NULL.
.PP
.CS
typedef void \fBTcl_FSFreeInternalRepProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.SS INTERNALTONORMALIZEDPROC
.PP
@@ -1043,7 +1031,7 @@ representation is the normalized path.
.PP
.CS
typedef Tcl_Obj *\fBTcl_FSInternalToNormalizedProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.SS CREATEINTERNALREPPROC
.PP
@@ -1054,7 +1042,7 @@ the \fITcl_FSPathInFilesystemProc\fR for this filesystem always
immediately creates an internal representation for paths it accepts.
.PP
.CS
typedef ClientData \fBTcl_FSCreateInternalRepProc\fR(
typedef void *\fBTcl_FSCreateInternalRepProc\fR(
Tcl_Obj *\fIpathPtr\fR);
.CE
.SS NORMALIZEPATHPROC
@@ -1068,9 +1056,7 @@ must have a single unique
string representation. Depending on the filesystem,
there may be more than one unnormalized string representation which
refers to that path (e.g.\ a relative path, a path with different
character case if the filesystem is case insensitive, a path contain a
reference to a home directory such as
.QW ~ ,
character case if the filesystem is case insensitive,
a path containing symbolic
links, etc). If the very last component in the path is a symbolic
link, it should not be converted into the value it points to (but
+3 -4
View File
@@ -35,8 +35,8 @@ Tcl. For example, it is needed on some platforms in the
implementation of the \fBload\fR command.
It is also returned by the \fBinfo nameofexecutable\fR command.
.PP
The result of \fBTcl_FindExecutable\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
The result of \fBTcl_FindExecutable\fR is the full Tcl version with
build information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
.PP
On UNIX platforms this procedure is typically invoked as the very
first thing in the application's main program; it must be passed
@@ -62,7 +62,6 @@ 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.
\fBTcl_FindExecutable\fR can not be used in stub-enabled extensions.
.SH KEYWORDS
binary, executable file
+2 -5
View File
@@ -71,12 +71,9 @@ if the first such characters are
then \fIsrc\fR is expected to be in octal form; otherwise,
if the first such characters are
.QW \fB0b\fR
then \fIsrc\fR is expected to be in binary form; otherwise,
if the first such character is
.QW \fB0\fR
then \fIsrc\fR
is expected to be in octal form; otherwise, \fIsrc\fR
is expected to be in decimal form.
is expected to be in binary form; otherwise, \fIsrc\fR is
expected to be in decimal form.
.PP
\fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point
number, which is: white space; a sign; a sequence of digits; a
+1 -1
View File
@@ -28,7 +28,7 @@ be used for reading.
.AP int checkUsage in
If non-zero, then an error will be generated if the file was not opened
for the access indicated by \fIwrite\fR.
.AP ClientData *filePtr out
.AP void **filePtr out
Points to word in which to store pointer to FILE structure for
the file given by \fIchanID\fR.
.BE
+4 -4
View File
@@ -27,13 +27,13 @@ Pointer to handler function replacing \fBTcl_GetTime\fR's access to the OS.
.AP Tcl_ScaleTimeProc scaleProc in
Pointer to handler function for the conversion of time delays in the
virtual domain to real-time.
.AP ClientData clientData in
.AP void *clientData in
Value passed through to the two handler functions.
.AP Tcl_GetTimeProc *getProcPtr out
Pointer to place the currently registered get handler function into.
.AP Tcl_ScaleTimeProc *scaleProcPtr out
Pointer to place the currently registered scale handler function into.
.AP ClientData *clientDataPtr out
.AP void **clientDataPtr out
Pointer to place the currently registered pass-through value into.
.BE
.SH DESCRIPTION
@@ -83,10 +83,10 @@ The signatures of the handler functions are as follows:
.CS
typedef void \fBTcl_GetTimeProc\fR(
Tcl_Time *\fItimebuf\fR,
ClientData \fIclientData\fR);
void *\fIclientData\fR);
typedef void \fBTcl_ScaleTimeProc\fR(
Tcl_Time *\fItimebuf\fR,
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fItimebuf\fR fields contain the time to manipulate, and the
+1 -2
View File
@@ -15,14 +15,13 @@ Tcl_GetVersion \- get the version of the library at runtime
.sp
\fBTcl_GetVersion\fR(\fImajor, minor, patchLevel, type\fR)
.SH ARGUMENTS
.AS Tcl_ReleaseType *patchLevel out
.AP int *major out
Major version number of the Tcl library.
.AP int *minor out
Minor version number of the Tcl library.
.AP int *patchLevel out
The patch level of the Tcl library (or alpha or beta number).
.AP Tcl_ReleaseType *type out
.AP int *type out
The type of release, also indicates the type of patch level. Can be
one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or
\fBTCL_FINAL_RELEASE\fR.
+4 -10
View File
@@ -30,7 +30,7 @@ Tcl_HashEntry *
Tcl_HashEntry *
\fBTcl_FindHashEntry\fR(\fItablePtr, key\fR)
.sp
ClientData
void *
\fBTcl_GetHashValue\fR(\fIentryPtr\fR)
.sp
\fBTcl_SetHashValue\fR(\fIentryPtr, value\fR)
@@ -66,9 +66,8 @@ The word at \fI*newPtr\fR is set to 1 if a new entry was created
and 0 if there was already an entry for \fIkey\fR.
.AP Tcl_HashEntry *entryPtr in
Pointer to hash table entry.
.AP ClientData value in
New value to assign to hash table entry. Need not have type
ClientData, but must fit in same space as ClientData.
.AP void *value in
New value to assign to hash table entry.
.AP Tcl_HashSearch *searchPtr in
Pointer to record to use to keep track of progress in enumerating
all the entries in a hash table.
@@ -186,11 +185,6 @@ instead, it returns NULL as result.
.PP
\fBTcl_GetHashValue\fR and \fBTcl_SetHashValue\fR are used to
read and write an entry's value, respectively.
Values are stored and retrieved as type
.QW ClientData ,
which is
large enough to hold a pointer value. On almost all machines this is
large enough to hold an integer value too.
.PP
\fBTcl_GetHashKey\fR returns the key for a given hash table entry,
either as a pointer to a string, a one-word
@@ -229,7 +223,7 @@ overall information about a hash table, such as the number of
entries it contains, the number of buckets in its hash array,
and the utilization of the buckets.
It is the caller's responsibility to free the result string
by passing it to \fBckfree\fR.
by passing it to \fBTcl_Free\fR.
.PP
The header file \fBtcl.h\fR defines the actual data structures
used to implement hash tables.
+5 -1
View File
@@ -2,7 +2,7 @@
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\" All rights reserved.
'\"
.TH Tcl_Init 3 8.7 Tcl "Tcl Library Procedures"
.TH Tcl_Init 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -39,6 +39,10 @@ The pre-initialization script is executed by \fBTcl_Init\fR before accessing
the file system. The purpose is to typically prepare a custom file system
(like an embedded zip-file) to be activated before the search.
When used in stub-enabled embedders, the stubs table must be first initialized
using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR
or \fBTclZipfs_AppHook\fR before \fBTcl_SetPreInitScript\fR may be called.
.SH "SEE ALSO"
Tcl_AppInit, Tcl_Main
+3 -3
View File
@@ -63,9 +63,9 @@ Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
.IP 3) 5
Link the extension with the Tcl stubs library instead of the standard
Tcl library. For example, to use the Tcl 8.6 ABI on Unix platforms,
the library name is \fIlibtclstub8.6.a\fR; on Windows platforms, the
library name is \fItclstub86.lib\fR.
Tcl library. For example, to use the Tcl 9.0 ABI on Unix platforms,
the library name is \fIlibtclstub9.0.a\fR; on Windows platforms, the
library name is \fItclstub90.lib\fR.
.PP
If the extension also requires the Tk API, it must also call
\fBTk_InitStubs\fR to initialize the Tk stubs interface and link
+4 -4
View File
@@ -21,14 +21,14 @@ 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
The result of \fBTcl_InitSubsystems\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
The result of \fBTcl_InitSubsystems\fR is the full Tcl version with
build information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
.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,
used as utility library, no other encodings than utf-8,
iso8859-1 or utf-16 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.
be extracted from the environment, but falls back to utf-8.
.SH KEYWORDS
binary, executable file
+11 -3
View File
@@ -32,7 +32,7 @@ int
\fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR)
.sp
int
\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, intPtr\fR)
\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, indexPtr\fR)
.sp
int
\fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR)
@@ -43,6 +43,9 @@ int
int
\fBTcl_GetWideUIntFromObj\fR(\fIinterp, objPtr, uwidePtr\fR)
.sp
int
\fBTcl_GetSizeIntFromObj\fR(\fIinterp, objPtr, sizePtr\fR)
.sp
.sp
\fB#include <tclTomMath.h>\fR
.sp
@@ -61,7 +64,7 @@ int
\fBTcl_InitBignumFromDouble\fR(\fIinterp, doubleValue, bigValue\fR)
.SH ARGUMENTS
.AS Tcl_WideInt doubleValue in/out
.AP int endValue in
.AP Tcl_Size 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.
@@ -83,10 +86,14 @@ retrieval fails.
Points to place to store the integer value retrieved from \fIobjPtr\fR.
.AP long *longPtr out
Points to place to store the long integer value retrieved from \fIobjPtr\fR.
.AP Tcl_Size *indexPtr out
Points to place to store the Tcl_Size value retrieved from \fIobjPtr\fR.
.AP Tcl_WideInt *widePtr out
Points to place to store the wide integer value retrieved from \fIobjPtr\fR.
.AP Tcl_WideUInt *uwidePtr out
Points to place to store the unsigned wide integer value retrieved from \fIobjPtr\fR.
.AP Tcl_Size *sizePtr out
Points to place to store the \fBTcl_Size\fR integer value retrieved from \fIobjPtr\fR.
.AP mp_int *bigValue in/out
Points to a multi-precision integer structure declared by the LibTomMath
library.
@@ -136,7 +143,8 @@ 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_GetWideIntFromObj\fR, \fBTcl_GetSizeIntFromObj\fR,
\fBTcl_GetBignumFromObj\fR, and
\fBTcl_TakeBignumFromObj\fR routines attempt to retrieve an integral
value of the appropriate type from the Tcl value \fIobjPtr\fR. If the
attempt succeeds, then \fBTCL_OK\fR is returned, and the value is
-41
View File
@@ -1,41 +0,0 @@
'\"
'\" Copyright (c) 1989-1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Interp 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_Interp \- client-visible fields of interpreter structures
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
typedef struct {
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(
char *\fIblockPtr\fR);
.BE
.SH DESCRIPTION
.PP
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 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
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
interpreter, result
+4 -4
View File
@@ -65,7 +65,7 @@ its limits checked.
.AP int type in
The type of limit that the operation refers to. This must be either
\fBTCL_LIMIT_COMMANDS\fR or \fBTCL_LIMIT_TIME\fR.
.AP int commandLimit in
.AP Tcl_Size commandLimit in
The maximum number of commands (as reported by \fBinfo cmdcount\fR)
that may be executed in the interpreter.
.AP Tcl_Time *timeLimitPtr in/out
@@ -83,7 +83,7 @@ the handler returns. Many handlers may be attached to the same
interpreter limit; their order of execution is not defined, and they
must be identified by \fIhandlerProc\fR and \fIclientData\fR when they
are deleted.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary pointer-sized word used to pass some context to the
\fIhandlerProc\fR function.
.AP Tcl_LimitHandlerDeleteProc *deleteProc in
@@ -162,7 +162,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_LimitHandlerProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR);
.CE
.PP
@@ -179,7 +179,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_LimitHandlerDeleteProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
A limit handler may be deleted using \fBTcl_LimitRemoveHandler\fR; the
+2 -2
View File
@@ -59,7 +59,7 @@ In \fBTcl_LinkArray\fR, the additional linked types \fBTCL_LINK_CHARS\fR and
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
.AP Tcl_Size size in
.VS "TIP 312"
The number of elements in the C array. Must be greater than zero.
.VE "TIP 312"
@@ -263,7 +263,7 @@ Tcl errors.
.
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.
allocated with \fBTcl_Alloc\fR.
Whenever the Tcl variable is modified the current C string will be
freed and new memory will be allocated to hold a copy of the variable's
new value.
+12 -8
View File
@@ -59,13 +59,13 @@ points to the Tcl value that will be appended to \fIlistPtr\fR.
For \fBTcl_SetListObj\fR,
this points to the Tcl value that will be converted to a list value
containing the \fIobjc\fR elements of the array referenced by \fIobjv\fR.
.AP int *objcPtr in
.AP "Tcl_Size \&| int" *objcPtr in
Points to location where \fBTcl_ListObjGetElements\fR
stores the number of element values in \fIlistPtr\fR.
.AP Tcl_Obj ***objvPtr out
A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array
of pointers to the element values of \fIlistPtr\fR.
.AP int objc in
.AP Tcl_Size objc in
The number of Tcl values that \fBTcl_NewListObj\fR
will insert into a new list value,
and \fBTcl_ListObjReplace\fR will insert into \fIlistPtr\fR.
@@ -76,21 +76,21 @@ An array of pointers to values.
\fBTcl_NewListObj\fR will insert these values into a new list value
and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR.
Each value will become a separate list element.
.AP int *lengthPtr out
.AP "Tcl_Size \&| int" *lengthPtr out
Points to location where \fBTcl_ListObjLength\fR
stores the length of the list.
.AP int index in
.AP Tcl_Size index in
Index of the list element that \fBTcl_ListObjIndex\fR
is to return.
The first element has index 0.
.AP Tcl_Obj **objPtrPtr out
Points to place where \fBTcl_ListObjIndex\fR is to store
a pointer to the resulting list element value.
.AP int first in
.AP Tcl_Size first in
Index of the starting list element that \fBTcl_ListObjReplace\fR
is to replace.
The list's first element has index 0.
.AP int count in
.AP Tcl_Size count in
The number of elements that \fBTcl_ListObjReplace\fR
is to replace.
.BE
@@ -153,7 +153,9 @@ address \fIobjcPtr\fR. Similarly, it returns the array pointer by storing
it in the address \fIobjvPtr\fR.
The memory pointed to is managed by Tcl and should not be freed or written
to by the caller. If the list is empty, 0 is stored at \fIobjcPtr\fR
and NULL at \fIobjvPtr\fR.
and NULL at \fIobjvPtr\fR. If \fIobjcPtr\fR points to a variable
of type \fBint\fR and the list contains more than 2**31 elements, the
function returns \fBTCL_ERROR\fR.
If \fIlistPtr\fR is not already a list value, \fBTcl_ListObjGetElements\fR
will attempt to convert it to one; if the conversion fails, it returns
\fBTCL_ERROR\fR and leaves an error message in the interpreter's result
@@ -162,7 +164,9 @@ Otherwise it returns \fBTCL_OK\fR after storing the count and array pointer.
.PP
\fBTcl_ListObjLength\fR returns the number of elements in the list value
referenced by \fIlistPtr\fR.
It returns this count by storing an integer in the address \fIlengthPtr\fR.
It returns this count by storing a value in the address \fIlengthPtr\fR.
If \fIlengthPtr\fR points to a variable of type \fBint\fR and the list
contains more than 2**31 elements, the function returns \fBTCL_ERROR\fR.
If the value is not already a list value,
\fBTcl_ListObjLength\fR will attempt to convert it to one;
if the conversion fails, it returns \fBTCL_ERROR\fR
+10 -10
View File
@@ -58,10 +58,10 @@ Tcl_Method
Tcl_Object
\fBTcl_ObjectContextObject\fR(\fIcontext\fR)
.sp
int
Tcl_Size
\fBTcl_ObjectContextSkippedArgs\fR(\fIcontext\fR)
.SH ARGUMENTS
.AS ClientData clientData in
.AS void *clientData in
.AP Tcl_Interp *interp in/out
The interpreter holding the object or class to create or update a method in.
.AP Tcl_Object object in
@@ -83,10 +83,10 @@ and \fBTCL_OO_METHOD_PRIVATE\fR for a private method.
.AP Tcl_MethodType *methodTypePtr in
A description of the type of the method to create, or the type of method to
compare against.
.AP ClientData clientData in
.AP void *clientData in
A piece of data that is passed to the implementation of the method without
interpretation.
.AP ClientData *clientDataPtr out
.AP void **clientDataPtr out
A pointer to a variable in which to write the \fIclientData\fR value supplied
when the method was created. If NULL, the \fIclientData\fR value will not be
retrieved.
@@ -95,11 +95,11 @@ A reference to a method to query.
.AP Tcl_ObjectContext context in
A reference to a method-call context. Note that client code \fImust not\fR
retain a reference to a context.
.AP int objc in
.AP Tcl_Size objc in
The number of arguments to pass to the method implementation.
.AP "Tcl_Obj *const" *objv in
An array of arguments to pass to the method implementation.
.AP int skip in
.AP Tcl_Size skip in
The number of arguments passed to the method implementation that do not
represent "real" arguments.
.BE
@@ -213,7 +213,7 @@ Functions matching this signature are called when the method is invoked.
.PP
.CS
typedef int \fBTcl_MethodCallProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
Tcl_ObjectContext \fIobjectContext\fR,
int \fIobjc\fR,
@@ -234,7 +234,7 @@ through a new method being created or because the object or class is deleted.
.PP
.CS
typedef void \fBTcl_MethodDeleteProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument to a Tcl_MethodDeleteProc will be the same as
@@ -248,8 +248,8 @@ class is copied using \fBTcl_CopyObjectInstance\fR (or \fBoo::copy\fR).
.CS
typedef int \fBTcl_CloneProc\fR(
Tcl_Interp *\fIinterp\fR,
ClientData \fIoldClientData\fR,
ClientData *\fInewClientDataPtr\fR);
void *\fIoldClientData\fR,
void **\fInewClientDataPtr\fR);
.CE
.PP
The \fIinterp\fR argument gives a place to write an error message when the
+11 -11
View File
@@ -63,13 +63,13 @@ in the same way as the \fIproc2\fR argument to \fBTcl_CreateObjCommand2\fR(3)
Called instead of \fIproc\fR when a trampoline is already in use.
.AP Tcl_ObjCmdProc2 *nreProc2 in
Called instead of \fIproc2\fR when a trampoline is already in use.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value passed to \fIproc\fR, \fInreProc\fR, \fIdeleteProc\fR
and \fIobjProc\fR.
.AP Tcl_CmdDeleteProc *deleteProc in/out
Called before \fIcmdName\fR is deleted from the interpreter, allowing for
command-specific cleanup. May be NULL.
.AP int objc in
.AP Tcl_Size objc in
Number of items in \fIobjv\fR.
.AP Tcl_Obj **objv in
Words in the command.
@@ -86,10 +86,10 @@ Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
the return code is TCL_OK.
.AP Tcl_NRPostProc *postProcPtr in
A function to push.
.AP ClientData data0 in
.AP ClientData data1 in
.AP ClientData data2 in
.AP ClientData data3 in
.AP void *data0 in
.AP void *data1 in
.AP void *data2 in
.AP void *data3 in
\fIdata0\fR through \fIdata3\fR are four one-word values that will be passed
to the function designated by \fIpostProcPtr\fR when it is invoked.
.BE
@@ -147,7 +147,7 @@ a message as the interpreter's result.
.CS
typedef int
\fBTcl_NRPostProc\fR(
\fBClientData\fR \fIdata\fR[],
\fBvoid *\fR \fIdata\fR[],
\fBTcl_Interp\fR *\fIinterp\fR,
int \fIresult\fR);
.CE
@@ -163,7 +163,7 @@ stack, to evalute a script:
.CS
int
\fITheCmdOldObjProc\fR(
ClientData clientData,
void *clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -194,7 +194,7 @@ call \fITheCmdNRObjProc\fR:
.CS
int
\fITheCmdOldObjProc\fR(
ClientData clientData,
void *clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -207,7 +207,7 @@ int
.CS
int
\fITheCmdNRObjProc\fR
ClientData clientData,
void *clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -228,7 +228,7 @@ int
.CS
int
\fITheCmdNRPostProc\fR(
ClientData data[],
void *data[],
Tcl_Interp *interp,
int result)
{
+2 -2
View File
@@ -57,7 +57,7 @@ The interpreter in which the namespace exists and where name lookups
are performed. Also where error result messages are written.
.AP "const char" *name in
The name of the namespace or command to be created or accessed.
.AP ClientData clientData in
.AP void *clientData in
A context pointer by the creator of the namespace. Not interpreted by
Tcl at all.
.AP Tcl_NamespaceDeleteProc *deleteProc in
@@ -117,7 +117,7 @@ the global namespace.)
.PP
.CS
typedef void \fBTcl_NamespaceDeleteProc\fR(
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
\fBTcl_DeleteNamespace\fR deletes a namespace, calling the
+7 -7
View File
@@ -38,7 +38,7 @@ Tcl_ThreadId
void
\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR)
.sp
ClientData
void *
\fBTcl_InitNotifier\fR()
.sp
void
@@ -78,7 +78,7 @@ Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR.
Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for
events. Checks to see if any events have occurred and, if so,
queues them.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or
\fIdeleteProc\fR.
.AP "const Tcl_Time" *timePtr in
@@ -89,7 +89,7 @@ is NULL, it means there is no maximum wait time: wait forever if
necessary.
.AP Tcl_Event *evPtr in
An event to add to the event queue. The storage for the event must
have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR.
have been allocated by the caller using \fBTcl_Alloc\fR.
.AP int position in
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
\fBTCL_QUEUE_HEAD\fR, \fBTCL_QUEUE_MARK\fR, and whether to do
@@ -226,7 +226,7 @@ the event source.
.PP
.CS
typedef void \fBTcl_EventSetupProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
int \fIflags\fR);
.CE
.PP
@@ -304,7 +304,7 @@ following prototype:
.PP
.CS
typedef void \fBTcl_EventCheckProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
int \fIflags\fR);
.CE
.PP
@@ -399,7 +399,7 @@ of window events.
When \fIproc\fR returns 1, \fBTcl_ServiceEvent\fR will remove the
event from the event queue and free its storage.
Note that the storage for an event must be allocated by
the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR)
the event source (using \fBTcl_Alloc\fR)
before calling \fBTcl_QueueEvent\fR, but it
will be freed by \fBTcl_ServiceEvent\fR, not by the event source.
.PP
@@ -424,7 +424,7 @@ queue. \fIProc\fR should match the following prototype:
.CS
typedef int \fBTcl_EventDeleteProc\fR(
Tcl_Event *\fIevPtr\fR,
ClientData \fIclientData\fR);
void *\fIclientData\fR);
.CE
.PP
The \fIclientData\fR argument will be the same as the \fIclientData\fR
+3 -3
View File
@@ -27,9 +27,9 @@ When non-NULL, error information is recorded here when the value is not
in any of the numeric formats recognized by Tcl.
.AP "const char" *bytes in
Points to first byte of the string value to be examined.
.AP size_t numBytes in
.AP Tcl_Size numBytes in
The number of bytes, starting at \fIbytes\fR, that should be examined.
If the value \fBTCL_INDEX_NONE\fR is provided, then all bytes should
If \fBnumBytes\fR is negative, then all bytes should
be examined until the first \fBNUL\fR byte terminates examination.
.AP "void *" *clientDataPtr out
Points to space where a pointer value may be written through which a numeric
@@ -63,7 +63,7 @@ the same function. They differ only in how the arguments present the Tcl
value to be examined. \fBTcl_GetNumber\fR accepts a counted string
value in the arguments \fIbytes\fR and \fInumBytes\fR (or a
\fBNUL\fR-terminated string value when \fInumBytes\fR is
\fBTCL_INDEX_NONE\fR). \fBTcl_GetNumberFromObj\fR accepts the Tcl value
negative). \fBTcl_GetNumberFromObj\fR accepts the Tcl value
in \fIobjPtr\fR.
.PP
Both routines examine the Tcl value and determine whether Tcl recognizes
+2 -2
View File
@@ -111,9 +111,9 @@ which is defined as follows.
.PP
.CS
typedef struct Tcl_Obj {
int \fIrefCount\fR;
Tcl_Size \fIrefCount\fR;
char *\fIbytes\fR;
int \fIlength\fR;
Tcl_Size \fIlength\fR;
const Tcl_ObjType *\fItypePtr\fR;
union {
long \fIlongValue\fR;
+7 -2
View File
@@ -109,6 +109,7 @@ typedef struct Tcl_ObjType {
Tcl_DupInternalRepProc *\fIdupIntRepProc\fR;
Tcl_UpdateStringProc *\fIupdateStringProc\fR;
Tcl_SetFromAnyProc *\fIsetFromAnyProc\fR;
size_t \fIversion\fR;
} \fBTcl_ObjType\fR;
.CE
.SS "THE NAME FIELD"
@@ -184,8 +185,8 @@ to be treated as conventional null character-terminated C strings.
These restrictions are easily met by using Tcl's internal UTF encoding
for the string representation, same as one would do for other
Tcl routines accepting string values as arguments.
Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR
or \fBckalloc\fR. Note that \fIupdateStringProc\fRs must allocate
Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR.
Note that \fIupdateStringProc\fRs must allocate
enough storage for the string's bytes and the terminating null byte.
.PP
The \fIupdateStringProc\fR for Tcl's built-in double type, for example,
@@ -253,6 +254,10 @@ Note that if a subsidiary value has its reference count reduced to zero
during the running of a \fIfreeIntRepProc\fR, that value may be not freed
immediately, in order to limit stack usage. However, the value will be freed
before the outermost current \fBTcl_DecrRefCount\fR returns.
.SS "THE VERSION FIELD"
.PP
The \fIversion\fR member provides for future extensibility of the structure
and should be set to \fITCL_OBJTYPE_V0\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjPtr\fR argument to \fBTcl_AppendAllObjTypes\fR should be an unshared
+23 -23
View File
@@ -53,28 +53,28 @@ int
int
\fBTcl_Read\fR(\fIchannel, readBuf, bytesToRead\fR)
.sp
int
Tcl_Size
\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR)
.sp
int
Tcl_Size
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
.sp
int
Tcl_Size
\fBTcl_Ungets\fR(\fIchannel, input, inputLen, addAtEnd\fR)
.sp
int
Tcl_Size
\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR)
.sp
int
Tcl_Size
\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR)
.sp
int
Tcl_Size
\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
.sp
int
Tcl_Size
\fBTcl_ReadRaw\fR(\fIchannel, readBuf, bytesToRead\fR)
.sp
int
Tcl_Size
\fBTcl_WriteRaw\fR(\fIchannel, byteBuf, bytesToWrite\fR)
.sp
int
@@ -119,7 +119,7 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
.AP int permissions in
POSIX-style permission flags such as 0644. If a new file is created, these
permissions will be set on the created file.
.AP int argc in
.AP Tcl_Size argc in
The number of elements in \fIargv\fR.
.AP "const char" **argv in
Arguments for constructing a command pipeline. These values have the same
@@ -134,7 +134,7 @@ input of the invoking process; likewise for \fBTCL_STDOUT\fR and
redirect stdio handles to override the stdio handles for which
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it
is set, then such redirections cause an error.
.AP ClientData handle in
.AP void *handle in
Operating system specific handle for I/O to a file. For Unix this is a
file descriptor, for Windows it is a HANDLE.
.AP int readOrWrite in
@@ -154,7 +154,7 @@ from a procedure such as \fBTcl_OpenFileChannel\fR.
.AP Tcl_Obj *readObjPtr in/out
A pointer to a Tcl value in which to store the characters read from the
channel.
.AP int charsToRead in
.AP Tcl_Size charsToRead in
The number of characters to read from the channel. If the channel's encoding
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
channel.
@@ -163,7 +163,7 @@ If non-zero, data read from the channel will be appended to the value.
Otherwise, the data will replace the existing contents of the value.
.AP char *readBuf out
A buffer in which to store the bytes read from the channel.
.AP int bytesToRead in
.AP Tcl_Size bytesToRead in
The number of bytes to read from the channel. The buffer \fIreadBuf\fR must
be large enough to hold this many bytes.
.AP Tcl_Obj *lineObjPtr in/out
@@ -176,7 +176,7 @@ channel. Must have been initialized by the caller. The line read will be
appended to any data already in the dynamic string.
.AP "const char" *input in
The input to add to a channel buffer.
.AP int inputLen in
.AP Tcl_Size inputLen in
Length of the input
.AP int addAtEnd in
Flag indicating whether the input should be added to the end or
@@ -187,7 +187,7 @@ A pointer to a Tcl value whose contents will be output to the channel.
A buffer containing the characters to output to the channel.
.AP "const char" *byteBuf in
A buffer containing the bytes to output to the channel.
.AP int bytesToWrite in
.AP Tcl_Size bytesToWrite in
The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and
output to the channel.
.AP "long long" offset in
@@ -406,10 +406,10 @@ to UTF-8 based on the channel's encoding and storing the produced data in
\fIreadObjPtr\fR's string representation. The return value of
\fBTcl_ReadChars\fR is the number of characters, up to \fIcharsToRead\fR,
that were stored in \fIreadObjPtr\fR. If an error occurs while reading, the
return value is TCL_INDEX_NONE and \fBTcl_ReadChars\fR records a POSIX error code that
return value is -1 and \fBTcl_ReadChars\fR records a POSIX error code that
can be retrieved with \fBTcl_GetErrno\fR.
.PP
Setting \fIcharsToRead\fR to TCL_INDEX_NONE will cause the command to read
Setting \fIcharsToRead\fR to -1 will cause the command to read
all characters currently available (non-blocking) or everything until
eof (blocking mode).
.PP
@@ -471,14 +471,14 @@ character(s) are read and discarded.
.PP
If a line was successfully read, the return value is greater than or equal
to zero and indicates the number of bytes stored in \fIlineObjPtr\fR. If an
error occurs, \fBTcl_GetsObj\fR returns TCL_INDEX_NONE and records a POSIX error code
error occurs, \fBTcl_GetsObj\fR returns -1 and records a POSIX error code
that can be retrieved with \fBTcl_GetErrno\fR. \fBTcl_GetsObj\fR also
returns TCL_INDEX_NONE if the end of the file is reached; the \fBTcl_Eof\fR procedure
returns -1 if the end of the file is reached; the \fBTcl_Eof\fR procedure
can be used to distinguish an error from an end-of-file condition.
.PP
If the channel is in nonblocking mode, the return value can also be TCL_INDEX_NONE
If the channel is in nonblocking mode, the return value can also be -1
if no data was available or the data that was available did not contain an
end-of-line character. When TCL_INDEX_NONE is returned, the \fBTcl_InputBlocked\fR
end-of-line character. When -1 is returned, the \fBTcl_InputBlocked\fR
procedure may be invoked to determine if the channel is blocked because
of input unavailability.
.PP
@@ -496,7 +496,7 @@ head of the queue. If \fIchannel\fR has a
.QW sticky
EOF set, no data will be
added to the input queue. \fBTcl_Ungets\fR returns \fIinputLen\fR or
TCL_INDEX_NONE if an error occurs.
-1 if an error occurs.
.SH "TCL_WRITECHARS, TCL_WRITEOBJ, AND TCL_WRITE"
.PP
\fBTcl_WriteChars\fR accepts \fIbytesToWrite\fR bytes of character data at
@@ -513,7 +513,7 @@ to appear as soon as a complete line is accepted for output, set the
\fB\-buffering\fR option on the channel to \fBline\fR mode.
.PP
The return value of \fBTcl_WriteChars\fR is a count of how many bytes were
accepted for output to the channel. This is either TCL_INDEX_NONE to
accepted for output to the channel. This is either -1 to
indicate that an error occurred or another number greater than
zero to indicate success. If an error occurs, \fBTcl_WriteChars\fR records
a POSIX error code that may be retrieved with \fBTcl_GetErrno\fR.
@@ -599,7 +599,7 @@ their possible values are described in the manual entry for the Tcl
\fBfconfigure\fR command. Other options can be added by each channel type.
These channel type specific options are described in the manual entry for
the Tcl command that creates a channel of that type; for example, the
additional options for TCP based channels are described in the manual entry
additional options for TCP-based channels are described in the manual entry
for the Tcl \fBsocket\fR command.
The procedure normally returns \fBTCL_OK\fR. If an error occurs, it returns
\fBTCL_ERROR\fR and calls \fBTcl_SetErrno\fR to store an appropriate POSIX
+3 -3
View File
@@ -52,12 +52,12 @@ Length of OS listen backlog queue. Use -1 for default value.
.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
.AP void *sock in
Platform-specific handle for client TCP socket.
.AP Tcl_TcpAcceptProc *proc in
Pointer to a procedure to invoke each time a new connection is
accepted via the socket.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
@@ -129,7 +129,7 @@ the channel. \fIProc\fR must match the following prototype:
.PP
.CS
typedef void \fBTcl_TcpAcceptProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Channel \fIchannel\fR,
char *\fIhostName\fR,
int \fIport\fR);
+4 -16
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, Tcl_ConsolePanic \- report fatal error and abort
Tcl_Panic, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -15,9 +15,6 @@ Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error
void
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
.sp
void
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
.sp
const char *
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
@@ -30,10 +27,6 @@ void
A printf-style format string.
.AP "" arg in
Arguments matching the format string.
.AP va_list argList in
An argument list of arguments matching the format string.
Must have been initialized using \fBva_start\fR,
and cleared using \fBva_end\fR.
.AP Tcl_PanicProc *panicProc in
Procedure to report fatal error message and abort.
.BE
@@ -82,15 +75,14 @@ making calls into the Tcl library, or into other libraries that may
call the Tcl library, since the original call to \fBTcl_Panic\fR
indicates the Tcl library is not in a state of reliable operation.
.PP
The result of \fBTcl_SetPanicProc\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
The result of \fBTcl_SetPanicProc\fR is the full Tcl version with build
information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
.PP
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.
\fBTcl_SetPanicProc\fR can not be used in stub-enabled extensions.
.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
@@ -98,10 +90,6 @@ by any extension or application that wishes to abort the process and
have a panic message displayed the same way that panic messages from Tcl
will be displayed.
.PP
\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
taking a variable number of arguments it takes an argument list. 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
+5 -5
View File
@@ -21,7 +21,7 @@ int
Where to store error messages.
.AP "const Tcl_ArgvInfo" *argTable in
Pointer to array of option descriptors.
.AP int *objcPtr in/out
.AP "Tcl_Size \&| int" *objcPtr in/out
A pointer to variable holding number of arguments in \fIobjv\fR. Will be
modified to hold number of arguments left in the unprocessed argument list
stored in \fIremObjv\fR.
@@ -31,7 +31,7 @@ The array of arguments to be parsed.
Pointer to a variable that will hold the array of unprocessed arguments.
Should be NULL if no return of unprocessed arguments is required. If
\fIobjcPtr\fR is updated to a non-zero value, the array returned through this
must be deallocated using \fBckfree\fR.
must be deallocated using \fBTcl_Free\fR.
.BE
.SH DESCRIPTION
.PP
@@ -84,7 +84,7 @@ typedef struct {
void *\fIsrcPtr\fR;
void *\fIdstPtr\fR;
const char *\fIhelpStr\fR;
ClientData \fIclientData\fR;
void *\fIclientData\fR;
} \fBTcl_ArgvInfo\fR;
.CE
.PP
@@ -127,7 +127,7 @@ have the following signature:
.PP
.CS
typedef int (\fBTcl_ArgvFuncProc\fR)(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Obj *\fIobjPtr\fR,
void *\fIdstPtr\fR);
.CE
@@ -149,7 +149,7 @@ function will have the following signature:
.PP
.CS
typedef int (\fBTcl_ArgvGenFuncProc\fR)(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
int \fIobjc\fR,
Tcl_Obj *const *\fIobjv\fR,
+12 -34
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokens, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -33,23 +33,19 @@ const char *
.sp
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
.sp
Tcl_Obj *
\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
.sp
int
\fBTcl_EvalTokensStandard\fR(\fIinterp, tokenPtr, numTokens\fR)
.SH ARGUMENTS
.AS Tcl_Interp *usedParsePtr out
.AP Tcl_Interp *interp out
For procedures other than \fBTcl_FreeParse\fR, \fBTcl_EvalTokens\fR
and \fBTcl_EvalTokensStandard\fR, used only for error reporting;
For procedures other than \fBTcl_FreeParse\fR and
\fBTcl_EvalTokensStandard\fR, used only for error reporting;
if NULL, then no error messages are left after errors.
For \fBTcl_EvalTokens\fR and \fBTcl_EvalTokensStandard\fR,
determines the context for evaluating the
script and also is used for error reporting; must not be NULL.
For \fBTcl_EvalTokensStandard\fR, determines the context for evaluating
the script and also is used for error reporting; must not be NULL.
.AP "const char" *start in
Pointer to first character in string to parse.
.AP int numBytes in
.AP Tcl_Size numBytes in
Number of bytes in string to parse, not including any terminating null
character. If less than 0 then the script consists of all characters
following \fIstart\fR up to the first null character.
@@ -191,17 +187,6 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
some other integer value originating in an extension.
In addition, a result value or error message is left in \fIinterp\fR's
result; it can be retrieved using \fBTcl_GetObjResult\fR.
.SS "DEPRECATED FUNCTIONS"
.PP
\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
the return convention used: it returns the result in a new Tcl_Obj.
The reference count of the value returned as result has been
incremented, so the caller must
invoke \fBTcl_DecrRefCount\fR when it is finished with the value.
If an error or other exception occurs while evaluating the tokens
(such as a reference to a non-existent variable) then the return value
is NULL and an error message is left in \fIinterp\fR's result. The use
of \fBTcl_EvalTokens\fR is deprecated.
.SH "TCL_PARSE STRUCTURE"
.PP
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
@@ -211,20 +196,20 @@ return parse information in two data structures, Tcl_Parse and Tcl_Token:
.CS
typedef struct Tcl_Parse {
const char *\fIcommentStart\fR;
int \fIcommentSize\fR;
Tcl_Size \fIcommentSize\fR;
const char *\fIcommandStart\fR;
int \fIcommandSize\fR;
int \fInumWords\fR;
Tcl_Size \fIcommandSize\fR;
Tcl_Size \fInumWords\fR;
Tcl_Token *\fItokenPtr\fR;
int \fInumTokens\fR;
Tcl_Size \fInumTokens\fR;
...
} \fBTcl_Parse\fR;
typedef struct Tcl_Token {
int \fItype\fR;
const char *\fIstart\fR;
int \fIsize\fR;
int \fInumComponents\fR;
Tcl_Size \fIsize\fR;
Tcl_Size \fInumComponents\fR;
} \fBTcl_Token\fR;
.CE
.PP
@@ -464,12 +449,5 @@ There are additional fields in the Tcl_Parse structure after the
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR; they should not be
referenced by code outside of these procedures.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The result of \fBTcl_EvalTokens\fR is an unshared value with a reference count
of 1; the caller of that function should call \fBTcl_DecrRefCount\fR on the
result value to dispose of it. (The equivalent with
\fBTcl_EvalTokenStandard\fR is just the interpreter result, which can be
retrieved with \fBTcl_GetObjResult\fR.)
.SH KEYWORDS
backslash substitution, braces, command, expression, parse, token, variable substitution
+1 -1
View File
@@ -55,7 +55,7 @@ Pointer to place to store the value associated with the matching
package. It is only changed if the pointer is not NULL and the
function completed successfully. The storage can be any pointer
type with the same size as a void pointer.
.AP int objc in
.AP Tcl_Size objc in
Number of requirements.
.AP Tcl_Obj* objv[] in
Array of requirements.
+2 -2
View File
@@ -21,7 +21,7 @@ Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it
\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR)
.SH ARGUMENTS
.AS Tcl_FreeProc clientData
.AP ClientData clientData in
.AP void *clientData in
Token describing structure to be freed or reallocated. Usually a pointer
to memory for structure.
.AP Tcl_FreeProc *freeProc in
@@ -91,7 +91,7 @@ reasons, but the value is the same.
.PP
When the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR
refers to storage allocated and returned by a prior call to
\fBTcl_Alloc\fR, \fBckalloc\fR, or another function of the Tcl library,
\fBTcl_Alloc\fR or another function of the Tcl library,
then the \fIfreeProc\fR argument should be given the special value of
\fBTCL_DYNAMIC\fR.
.PP
+2 -7
View File
@@ -18,10 +18,7 @@ Tcl_PrintDouble \- Convert floating value to string
.SH ARGUMENTS
.AS Tcl_Interp *interp out
.AP Tcl_Interp *interp in
Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
controlled the conversion. As of Tcl 8.0, this argument is ignored and
the conversion is controlled by the \fBtcl_precision\fR variable
that is now shared by all interpreters.
This argument is ignored.
.AP double value in
Floating-point value to be converted.
.AP char *dst out
@@ -41,9 +38,7 @@ so that it does not look like an integer. Where \fB%g\fR would
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
.QW .0 .
.PP
If the \fBtcl_precision\fR value is non-zero, the result will have
precisely that many digits of significance. If the value is zero
(the default), the result will have the fewest digits needed to
The result will have the fewest digits needed to
represent the number in such a way that \fBTcl_NewDoubleObj\fR
will generate the same number when presented with the given string.
IEEE semantics of rounding to even apply to the conversion.
+1 -1
View File
@@ -31,7 +31,7 @@ the command at global level instead of the current stack level.
.SH DESCRIPTION
.PP
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event
on the history list and then execute it using \fBTcl_EvalObjEx\fR
on the history list and then execute it using \fBTcl_EvalObjEx\fR.
It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR,
as well as a result value containing additional information
(a result value or error message)
+8 -8
View File
@@ -64,7 +64,7 @@ identifies the beginning of the larger string.
If it is not the same as \fItext\fR, then no
.QW \fB^\fR
matches will be allowed.
.AP int index in
.AP Tcl_Size index in
Specifies which range is desired: 0 means the range of the entire
match, 1 or greater means the range that matched a parenthesized
sub-expression.
@@ -80,14 +80,14 @@ OR-ed combination of the compilation flags \fBTCL_REG_ADVANCED\fR,
\fBTCL_REG_QUOTE\fR, \fBTCL_REG_NOCASE\fR, \fBTCL_REG_NEWLINE\fR,
\fBTCL_REG_NLSTOP\fR, \fBTCL_REG_NLANCH\fR, \fBTCL_REG_NOSUB\fR, and
\fBTCL_REG_CANMATCH\fR. See below for more information.
.AP int offset in
.AP Tcl_Size offset in
The character offset into the text where matching should begin.
The value of the offset has no impact on \fB^\fR matches. This
behavior is controlled by \fIeflags\fR.
.AP int nmatches in
.AP Tcl_Size nmatches in
The number of matching subexpressions that should be remembered for
later use. If this value is 0, then no subexpression match
information will be computed. If the value is \-1, then
information will be computed. If the value is negative, then
all of the matching subexpressions will be remembered. Any other
value will be taken as the maximum number of subexpressions to
remember.
@@ -337,9 +337,9 @@ defined as follows:
.PP
.CS
typedef struct Tcl_RegExpInfo {
int \fInsubs\fR;
Tcl_Size \fInsubs\fR;
Tcl_RegExpIndices *\fImatches\fR;
long \fIextendStart\fR;
Tcl_Size \fIextendStart\fR;
} \fBTcl_RegExpInfo\fR;
.CE
.PP
@@ -355,8 +355,8 @@ follows:
.PP
.CS
typedef struct Tcl_RegExpIndices {
long \fIstart\fR;
long \fIend\fR;
Tcl_Size \fIstart\fR;
Tcl_Size \fIend\fR;
} \fBTcl_RegExpIndices\fR;
.CE
.PP
+2 -33
View File
@@ -6,12 +6,11 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures"
.TH Tcl_SaveInterpState 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState,
Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- Save and restore the
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState \- Save and restore the
state of an an interpreter.
.SH SYNOPSIS
.nf
@@ -24,12 +23,6 @@ int
\fBTcl_RestoreInterpState\fR(\fIinterp, state\fR)
.sp
\fBTcl_DiscardInterpState\fR(\fIstate\fR)
.sp
\fBTcl_SaveResult\fR(\fIinterp, savedPtr\fR)
.sp
\fBTcl_RestoreResult\fR(\fIinterp, savedPtr\fR)
.sp
\fBTcl_DiscardResult\fR(\fIsavedPtr\fR)
.SH ARGUMENTS
.AS Tcl_InterpState savedPtr
.AP Tcl_Interp *interp in
@@ -38,8 +31,6 @@ The interpreter for the operation.
The return code for the state.
.AP Tcl_InterpState state in
A token for saved state.
.AP Tcl_SavedResult *savedPtr in
A pointer to storage for saved state.
.BE
.SH DESCRIPTION
.PP
@@ -59,27 +50,5 @@ returns the \fIstatus\fR originally passed in the corresponding call to
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_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_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_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 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
If a saved result is not restored, \fBTcl_DiscardResult\fR must be called to
release it.
.SH KEYWORDS
result, state, interp
-4
View File
@@ -87,14 +87,10 @@ the value.
Which functions of a channel driver are allowed to use which bypass function
is listed below, as is which functions of the public channel API may leave a
messages in the bypass areas.
.IP \fBTcl_DriverCloseProc\fR
May use \fBTcl_SetChannelErrorInterp\fR, and only this function.
.IP \fBTcl_DriverInputProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverOutputProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverSeekProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverWideSeekProc\fR
May use \fBTcl_SetChannelError\fR, and only this function.
.IP \fBTcl_DriverSetOptionProc\fR
+3 -3
View File
@@ -14,14 +14,14 @@ Tcl_SetRecursionLimit \- set maximum allowable nesting depth in interpreter
.nf
\fB#include <tcl.h>\fR
.sp
int
Tcl_Size
\fBTcl_SetRecursionLimit\fR(\fIinterp, depth\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Interpreter whose recursion limit is to be set.
Must be greater than zero.
.AP int depth in
.AP Tcl_Size depth in
New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
.BE
@@ -29,7 +29,7 @@ New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
.PP
At any given time Tcl enforces a limit on the number of recursive
calls that may be active for \fBTcl_Eval\fR and related procedures
such as \fBTcl_GlobalEval\fR.
such as \fBTcl_EvalEx\fR.
Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with
an error.
By default the recursion limit is 1000.
+62 -195
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult \- manipulate Tcl result
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -26,246 +26,113 @@ const char *
.sp
\fBTcl_AppendResult\fR(\fIinterp, result, result, ... , \fB(char *) NULL\fR)
.sp
\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR)
.sp
\fBTcl_ResetResult\fR(\fIinterp\fR)
.sp
\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
.sp
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
.sp
\fBTcl_FreeResult\fR(\fIinterp\fR)
.SH ARGUMENTS
.AS Tcl_FreeProc sourceInterp out
.AP Tcl_Interp *interp out
Interpreter whose result is to be modified or read.
The interpreter get or set the result for.
.AP Tcl_Obj *objPtr in
Tcl value to become result for \fIinterp\fR.
A value to set the result to.
.AP char *result in
String value to become result for \fIinterp\fR or to be
appended to the existing result.
The string value set the result to, or to append to the existing result.
.AP "const char" *element in
String value to append as a list element
The string value to append as a list element
to the existing result of \fIinterp\fR.
.AP Tcl_FreeProc *freeProc in
Address of procedure to call to release storage at
\fIresult\fR, or \fBTCL_STATIC\fR, \fBTCL_DYNAMIC\fR, or
\fBTCL_VOLATILE\fR.
.AP va_list argList in
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
Pointer to a procedure to call to release storage at
\fIresult\fR.
.AP Tcl_Interp *sourceInterp in
Interpreter that the result and return options should be transferred from.
The interpreter to transfer the result and return options from.
.AP Tcl_Interp *targetInterp in
Interpreter that the result and return options should be transferred to.
The interpreter to transfer the result and return options to.
.AP int code in
Return code value that controls transfer of return options.
.BE
.SH DESCRIPTION
.PP
The procedures described here are utilities for manipulating the
result value in a Tcl interpreter.
The interpreter result may be either a Tcl value or a string.
For example, \fBTcl_SetObjResult\fR and \fBTcl_SetResult\fR
set the interpreter result to, respectively, a value and a string.
Similarly, \fBTcl_GetObjResult\fR and \fBTcl_GetStringResult\fR
return the interpreter result as a value and as a string.
The procedures always keep the string and value forms
of the interpreter result consistent.
For example, if \fBTcl_SetObjResult\fR is called to set
the result to a value,
then \fBTcl_GetStringResult\fR is called,
it will return the value's string representation.
These procedures manipulate the result of an interpreter. Some procedures
provide a Tcl_Obj interface while others provide a string interface. For
example, \fBTcl_SetObjResult\fR accepts a Tcl_Obj and \fBTcl_SetResult\fR
accepts a char *. Similarly, \fBTcl_GetObjResult\fR produces a Tcl_Obj * and
\fBTcl_GetStringResult\fR produces a char *. The procedures can be mixed and
matched. For example, if \fBTcl_SetObjResult\fR is called to set the result to
a Tcl_Obj value, and then \fBTcl_GetStringResult\fR is called, it returns a
char * (but see caveats below).
.PP
\fBTcl_SetObjResult\fR
arranges for \fIobjPtr\fR to be the result for \fIinterp\fR,
\fBTcl_SetObjResult\fR sets \fIobjPtr\fR as the result for \fIinterp\fR,
replacing any existing result.
The result is left pointing to the value
referenced by \fIobjPtr\fR.
\fIobjPtr\fR's reference count is incremented
since there is now a new reference to it from \fIinterp\fR.
The reference count for any old result value
is decremented and the old result value is freed if no
references to it remain.
.PP
\fBTcl_GetObjResult\fR returns the result for \fIinterp\fR as a value.
The value's reference count is not incremented;
if the caller needs to retain a long-term pointer to the value
they should use \fBTcl_IncrRefCount\fR to increment its reference count
in order to keep it from being freed too early or accidentally changed.
\fBTcl_GetObjResult\fR returns the result for \fIinterp\fR, without
incrementing its reference count.
.PP
\fBTcl_SetResult\fR
arranges for \fIresult\fR to be the result for the current Tcl
command in \fIinterp\fR, replacing any existing result.
The \fIfreeProc\fR argument specifies how to manage the storage
for the \fIresult\fR argument;
it is discussed in the section
\fBTHE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT\fR below.
If \fIresult\fR is \fBNULL\fR, then \fIfreeProc\fR is ignored
and \fBTcl_SetResult\fR
re-initializes \fIinterp\fR's result to point to an empty string.
\fBTcl_SetResult\fR sets \fIresult\fR as the result for \fIinterp\fR, replacing
any existing result, and calls \fIfreeProc\fR to free \fIresult\fR. See \fBTHE
TCL_FREEPROC ARGUMENT TO TCL_SETRESULT\fR below. If \fIresult\fR is
\fBNULL\fR, ignores \fIfreeProc\fR and sets the result for \fIinterp\fR to
point to the empty string.
.PP
\fBTcl_GetStringResult\fR returns the result for \fIinterp\fR as a string.
If the result was set to a value by a \fBTcl_SetObjResult\fR call,
the value form will be converted to a string and returned.
If the value's string representation contains null bytes,
this conversion will lose information.
For this reason, programmers are encouraged to
write their code to use the new value API procedures
and to call \fBTcl_GetObjResult\fR instead.
\fBTcl_GetStringResult\fR returns the result for \fIinterp\fR as a string, i.e.
the bytes of the Tcl_Obj for the result, which can be decoded using
\fBTcl_UtfToExternal\fR. This value is freed when its corresponding Tcl_Obj is
freed.Programmers are encouraged to use the newer Tcl_Obj API procedures, e.g.
to call \fBTcl_GetObjResult\fR instead.
.PP
\fBTcl_ResetResult\fR clears the result for \fIinterp\fR
and leaves the result in its normal empty initialized state.
If the result is a value,
its reference count is decremented and the result is left
pointing to an unshared value representing an empty string.
If the result is a dynamically allocated string, its memory is free*d
and the result is left as a empty string.
\fBTcl_ResetResult\fR also clears the error state managed by
\fBTcl_AddErrorInfo\fR, \fBTcl_AddObjErrorInfo\fR,
and \fBTcl_SetErrorCode\fR.
\fBTcl_ResetResult\fR sets the empty string as the result for \fIinterp\fR and
clears the error state managed by \fBTcl_AddErrorInfo\fR,
\fBTcl_AddObjErrorInfo\fR, and \fBTcl_SetErrorCode\fR.
.PP
\fBTcl_AppendResult\fR makes it easy to build up Tcl results in pieces.
It takes each of its \fIresult\fR arguments and appends them in order
to the current result associated with \fIinterp\fR.
If the result is in its initialized empty state (e.g. a command procedure
was just invoked or \fBTcl_ResetResult\fR was just called),
then \fBTcl_AppendResult\fR sets the result to the concatenation of
its \fIresult\fR arguments.
\fBTcl_AppendResult\fR may be called repeatedly as additional pieces
of the result are produced.
\fBTcl_AppendResult\fR takes care of all the
storage management issues associated with managing \fIinterp\fR's
result, such as allocating a larger result area if necessary.
It also manages conversion to and from the \fIresult\fR field of the
\fIinterp\fR so as to handle backward-compatibility with old-style
extensions.
Any number of \fIresult\fR arguments may be passed in a single
call; the last argument in the list must be a NULL pointer.
\fBTcl_AppendResult\fR builds up a result from smaller pieces, appending each
\fIresult\fR in order to the current result for \fIinterp\fR. It may be called
repeatedly as additional pieces of the result are produced, and manages the
storage for the \fIinterp\fR's result, allocating a larger result area if
necessary. It also manages conversion to and from the \fIresult\fR field of
the \fIinterp\fR to handle backward-compatibility with old-style extensions.
Any number of \fIresult\fR arguments may be passed in a single call; the last
argument in the list must be a NULL pointer.
.PP
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
instead of taking a variable number of arguments it takes an argument list.
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_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
\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR to
\fItargetInterp\fR, both of which must have been created in the same thread,
resets the result in \fIsourceInterp\fR, and moves the return options
dictionary as controlled by the return code value \fIcode\fR in the same manner
as \fBTcl_GetReturnOptions\fR.
.PP
If \fIsourceInterp\fR and \fItargetInterp\fR are the same, nothing is done.
.SH "DEPRECATED INTERFACES"
.SS "OLD STRING PROCEDURES"
.PP
Use of the following procedures is deprecated
since they manipulate the Tcl result as a string.
Procedures such as \fBTcl_SetObjResult\fR
that manipulate the result as a value
can be significantly more efficient.
The following procedures are deprecated since they manipulate the Tcl result as
a string. Procedures such as \fBTcl_SetObjResult\fR can be significantly more
efficient.
.PP
\fBTcl_AppendElement\fR is similar to \fBTcl_AppendResult\fR in
that it allows results to be built up in pieces.
However, \fBTcl_AppendElement\fR takes only a single \fIelement\fR
argument and it appends that argument to the current result
as a proper Tcl list element.
\fBTcl_AppendElement\fR adds backslashes or braces if necessary
to ensure that \fIinterp\fR's result can be parsed as a list and that
\fIelement\fR will be extracted as a single element.
Under normal conditions, \fBTcl_AppendElement\fR will add a space
character to \fIinterp\fR's result just before adding the new
list element, so that the list elements in the result are properly
separated.
However if the new list element is the first in a list or sub-list
(i.e. \fIinterp\fR's current result is empty, or consists of the
single character
\fBTcl_AppendElement\fR is like \fBTcl_AppendResult\fR, but it appends only one
piece, and also appends that piece as a list item.
\fBTcl_AppendElement\fR adds backslashes or braces as necessary to ensure that
\fIelement\fR is properly formatted as a list item. Under normal conditions,
\fBTcl_AppendElement\fR adds a space character to \fIinterp\fR's result just
before adding the new list element, so that the list elements in the result are
properly separated. However if the new list element is the first item in the
list or sublist (i.e. \fIinterp\fR's current result is empty, or consists of
the single character
.QW { ,
or ends in the characters
.QW " {" )
then no space is added.
.PP
\fBTcl_FreeResult\fR performs part of the work
of \fBTcl_ResetResult\fR.
It frees up the memory associated with \fIinterp\fR's result.
It also sets \fIinterp->freeProc\fR to zero, but does not
change \fIinterp->result\fR or clear error state.
\fBTcl_FreeResult\fR is most commonly used when a procedure
is about to replace one result value with another.
.SS "DIRECT ACCESS TO INTERP->RESULT"
.PP
It used to be legal for programs to
directly read and write \fIinterp->result\fR
to manipulate the interpreter result. The Tcl headers no longer
permit this access. 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.
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
.PP
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
the Tcl system is to manage the storage for the \fIresult\fR argument.
If \fBTcl_SetResult\fR or \fBTcl_SetObjResult\fR are called
at a time when \fIinterp\fR holds a string result,
they do whatever is necessary to dispose of the old string result
(see the \fBTcl_Interp\fR manual entry for details on this).
.PP
If \fIfreeProc\fR is \fBTCL_STATIC\fR it means that \fIresult\fR
refers to an area of static storage that is guaranteed not to be
modified until at least the next call to \fBTcl_Eval\fR.
If \fIfreeProc\fR
is \fBTCL_DYNAMIC\fR it means that \fIresult\fR was allocated with a call
to \fBTcl_Alloc\fR and is now the property of the Tcl system.
\fBTcl_SetResult\fR will arrange for the string's storage to be
released by calling \fBTcl_Free\fR when it is no longer needed.
If \fIfreeProc\fR is \fBTCL_VOLATILE\fR it means that \fIresult\fR
points to an area of memory that is likely to be overwritten when
\fBTcl_SetResult\fR returns (e.g. it points to something in a stack frame).
In this case \fBTcl_SetResult\fR will make a copy of the string in
dynamically allocated storage and arrange for the copy to be the
result for the current Tcl command.
.PP
If \fIfreeProc\fR is not one of the values \fBTCL_STATIC\fR,
\fBTCL_DYNAMIC\fR, and \fBTCL_VOLATILE\fR, then it is the address
of a procedure that Tcl should call to free the string.
This allows applications to use non-standard storage allocators.
When Tcl no longer needs the storage for the string, it will
call \fIfreeProc\fR. \fIFreeProc\fR should have arguments and
result that match the type \fBTcl_FreeProc\fR:
\fIFreeProc\fR has the following type:
.PP
.CS
typedef void \fBTcl_FreeProc\fR(
char *\fIblockPtr\fR);
.CE
.PP
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
When \fIfreeProc\fR is called, \fIblockPtr\fR is the \fIresult\fR value passed
to \fBTcl_SetResult\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The interpreter result is one of the main places that owns references to
values, along with the bytecode execution stack, argument lists, variables,
and the list and dictionary collection values.
.PP
\fBTcl_SetObjResult\fR takes a value with an arbitrary reference count
\fI(specifically including zero)\fR and guarantees to increment the reference
count. If code wishes to continue using the value after setting it as the
result, it should add its own reference to it with \fBTcl_IncrRefCount\fR.
.PP
\fBTcl_GetObjResult\fR returns the current interpreter result value. This will
have a reference count of at least 1. If the caller wishes to keep the
interpreter result value, it should increment its reference count.
.PP
\fBTcl_GetStringResult\fR does not manipulate reference counts, but the string
it returns is owned by (and has a lifetime controlled by) the current
interpreter result value; it should be copied instead of being relied upon to
persist after the next Tcl API call, as most Tcl operations can modify the
interpreter result.
.PP
\fBTcl_SetResult\fR, \fBTcl_AppendResult\fR, \fBTcl_AppendResultVA\fR,
\fBTcl_AppendElement\fR, and \fBTcl_ResetResult\fR all modify the interpreter
result. They may cause the old interpreter result to have its reference count
decremented and a new interpreter result to be allocated. After they have been
called, the reference count of the interpreter result is guaranteed to be 1.
.SH "SEE ALSO"
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
Tcl_GetReturnOptions
+9 -9
View File
@@ -250,18 +250,18 @@ and \fBTcl_ObjGetVar2\fR is (if non-NULL) a value with a reference of at least
operated upon.
.PP
The \fInewValuePtr\fR argument to \fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR
may be an arbitrary reference count value; its reference count will be
incremented on success. However, it is recommended to not use a zero reference
count value, as that makes correct handling of the error case tricky.
may be an arbitrary reference count value. Its reference count is
incremented on success. On failure, if its reference count is zero, it is
decremented and freed so the caller need do nothing with it.
.PP
The \fIpart1\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can
have any reference count; these functions never modify it. It is recommended
to not use a zero reference count for this argument.
The \fIpart1Ptr\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can
have any reference count. These functions never modify it.
.PP
The \fIpart2\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if
The \fIpart2Ptr\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if
non-NULL, should not have a zero reference count as these functions may
retain a reference to it (particularly when it is used to create an array
element that did not previously exist).
retain a reference to it, particularly when it is used to create an array
element that did not previously exist, and decrementing the reference count
later would leave them pointing to a freed Tcl_Obj.
.SH "SEE ALSO"
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar
+13 -11
View File
@@ -20,16 +20,16 @@ int
char *
\fBTcl_Merge\fR(\fIargc, argv\fR)
.sp
int
Tcl_Size
\fBTcl_ScanElement\fR(\fIsrc, flagsPtr\fR)
.sp
int
Tcl_Size
\fBTcl_ScanCountedElement\fR(\fIsrc, length, flagsPtr\fR)
.sp
int
Tcl_Size
\fBTcl_ConvertElement\fR(\fIsrc, dst, flags\fR)
.sp
int
Tcl_Size
\fBTcl_ConvertCountedElement\fR(\fIsrc, length, dst, flags\fR)
.SH ARGUMENTS
.AS "const char *const" ***argvPtr out
@@ -38,14 +38,14 @@ Interpreter to use for error reporting. If NULL, then no error message
is left.
.AP "const char" *list in
Pointer to a string with proper list structure.
.AP int *argcPtr out
.AP "Tcl_Size \&| int" *argcPtr out
Filled in with number of elements in \fIlist\fR.
.AP "const char" ***argvPtr out
\fI*argvPtr\fR will be filled in with the address of an array of
pointers to the strings that are the extracted elements of \fIlist\fR.
There will be \fI*argcPtr\fR valid entries in the array, followed by
a NULL entry.
.AP int argc in
.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP "const char *const" *argv in
Array of strings to merge together into a single list.
@@ -55,7 +55,7 @@ String that is to become an element of a list.
.AP int *flagsPtr in
Pointer to word to fill in with information about \fIsrc\fR.
The value of *\fIflagsPtr\fR must be passed to \fBTcl_ConvertElement\fR.
.AP int length in
.AP Tcl_Size length in
Number of bytes in string \fIsrc\fR.
.AP char *dst in
Place to copy converted list element. Must contain enough characters
@@ -81,7 +81,8 @@ For example, suppose that you have called \fBTcl_SplitList\fR with
the following code:
.PP
.CS
int argc, code;
Tcl_Size argc;
int code;
char *string;
char **argv;
\&...
@@ -92,12 +93,13 @@ Then you should eventually free the storage with a call like the
following:
.PP
.CS
Tcl_Free((char *) argv);
Tcl_Free(argv);
.CE
.PP
\fBTcl_SplitList\fR normally returns \fBTCL_OK\fR, which means the list was
successfully parsed.
If there was a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned
successfully parsed. If \fIsizePtr\fR points to a variable of type
\fBint\fR and the list contains more than 2**31 key/value pairs, or there was
a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned
and the interpreter's result will point to an error message describing the
problem (if \fIinterp\fR was not NULL).
If \fBTCL_ERROR\fR is returned then no memory is allocated and \fI*argvPtr\fR
+4 -4
View File
@@ -25,14 +25,14 @@ Tcl_PathType
.AP "const char" *path in
File path in a form appropriate for the current platform (see the
\fBfilename\fR manual entry for acceptable forms for path names).
.AP int *argcPtr out
.AP "Tcl_Size \&| int" *argcPtr out
Filled in with number of path elements in \fIpath\fR.
.AP "const char" ***argvPtr out
\fI*argvPtr\fR will be filled in with the address of an array of
pointers to the strings that are the extracted elements of \fIpath\fR.
There will be \fI*argcPtr\fR valid entries in the array, followed by
a NULL entry.
.AP int argc in
.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP "const char *const" *argv in
Array of path elements to merge together into a single path.
@@ -61,7 +61,7 @@ For example, suppose that you have called \fBTcl_SplitPath\fR with the
following code:
.PP
.CS
int argc;
Tcl_Size argc;
char *path;
char **argv;
\&...
@@ -72,7 +72,7 @@ Then you should eventually free the storage with a call like the
following:
.PP
.CS
Tcl_Free((char *) argv);
Tcl_Free(argv);
.CE
.PP
\fBTcl_JoinPath\fR is the inverse of \fBTcl_SplitPath\fR: it takes a
+3 -4
View File
@@ -24,8 +24,8 @@ already been incorporated (i.e., the caller has already invoked the
appropriate initialization procedure). NULL means the library
has not yet been incorporated into any interpreter.
.AP "const char" *prefix in
Prefix for library initialization function; should be properly
capitalized (first letter upper-case, all others lower-case).
Prefix for library initialization function. Normally in titlecase (first
letter upper-case, all others lower-case), but this is no longer required.
.AP Tcl_LibraryInitProc *initProc in
Procedure to invoke to incorporate this library into a trusted
interpreter.
@@ -70,8 +70,7 @@ initialization procedure to be invoked.
\fBTcl_StaticLibrary\fR was named \fBTcl_StaticPackage\fR in Tcl 8.6 and
earlier, but the old name is deprecated now.
.PP
\fBTcl_StaticLibrary\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.
\fBTcl_StaticLibrary\fR can not be used in stub-enabled extensions.
.SH KEYWORDS
initialization procedure, package, static linking
.SH "SEE ALSO"
+23 -32
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -40,7 +40,7 @@ Tcl_UniChar *
int
\fBTcl_GetUniChar\fR(\fIobjPtr, index\fR)
.sp
int
Tcl_Size
\fBTcl_GetCharLength\fR(\fIobjPtr\fR)
.sp
Tcl_Obj *
@@ -59,9 +59,6 @@ void
\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR)
.sp
void
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
.sp
void
\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
.sp
Tcl_Obj *
@@ -94,7 +91,7 @@ unless \fInumChars\fR is negative. (Applications needing null bytes
should represent them as the two-byte sequence \fI\e300\e200\fR, use
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
the string is a collection of uninterpreted bytes.)
.AP int length in
.AP Tcl_Size length in
The number of bytes to copy from \fIbytes\fR when
initializing, setting, or appending to a string value.
If negative, all bytes up to the first null are used.
@@ -103,33 +100,30 @@ Points to the first byte of an array of Unicode characters
used to set or append to a string value.
This byte array may contain embedded null characters
unless \fInumChars\fR is negative.
.AP int numChars in
.AP Tcl_Size numChars in
The number of Unicode characters to copy from \fIunicode\fR when
initializing, setting, or appending to a string value.
If negative, all characters up to the first null character are used.
.AP int index in
.AP Tcl_Size index in
The index of the Unicode character to return.
.AP int first in
.AP Tcl_Size first in
The index of the first Unicode character in the Unicode range to be
returned as a new value. If negative, behave the same as if the
value was 0.
.AP int last in
.AP Tcl_Size last in
The index of the last Unicode character in the Unicode range to be
returned as a new value. If negative, take all characters up to
the last one available.
.AP Tcl_Obj *objPtr in/out
Points to a value to manipulate.
A pointer to a value to read, or to an unshared value to modify.
.AP Tcl_Obj *appendObjPtr in
The value to append to \fIobjPtr\fR in \fBTcl_AppendObjToObj\fR.
.AP int *lengthPtr out
.AP "Tcl_Size \&| int" *lengthPtr out
The location where \fBTcl_GetStringFromObj\fR will store the length
of a value's string representation. May be (int *)NULL when not used.
.AP "const char" *string in
Null-terminated string value to append to \fIobjPtr\fR.
.AP va_list argList in
An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.AP int limit in
.AP Tcl_Size limit in
Maximum number of bytes to be appended.
.AP "const char" *ellipsis in
Suffix to append when the limit leads to string truncation.
@@ -138,11 +132,11 @@ If NULL is passed then the suffix
is used.
.AP "const char" *format in
Format control string including % conversion specifiers.
.AP int objc in
.AP Tcl_Size objc in
The number of elements to format or concatenate.
.AP Tcl_Obj *objv[] in
The array of values to format or concatenate.
.AP int newLength in
.AP Tcl_Size newLength in
New length for the string value of \fIobjPtr\fR, not including the
final null character.
.BE
@@ -191,7 +185,9 @@ Even in the limited situations where writing to this pointer is
acceptable, one should take care to respect the copy-on-write
semantics required by \fBTcl_Obj\fR's, with appropriate calls
to \fBTcl_IsShared\fR and \fBTcl_DuplicateObj\fR prior to any
in-place modification of the string representation.
in-place modification of the string representation. If \fIlengthPtr\fR
points to an \fBint\fR variable, and the string has more than 2^31 bytes,
a panic will result.
The procedure \fBTcl_GetString\fR is used in the common case
where the caller does not need the length of the string
representation.
@@ -203,18 +199,19 @@ value as a Unicode string. This is given by the returned pointer and
byte pointer is owned by the value manager and should not be modified by
the caller. The procedure \fBTcl_GetUnicode\fR is used in the common case
where the caller does not need the length of the unicode string
representation.
representation. If \fIlengthPtr\fR points to an \fBint\fR variable,
and the string has more than 2^31 unicode characters, a panic will result.
.PP
\fBTcl_GetUniChar\fR returns the \fIindex\fR'th character in the
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
value's Unicode representation. If the value's Unicode
representation is invalid, the Unicode representation is regenerated
from the value's string representation. If \fIfirst\fR < 0, then
the returned string starts at the beginning of the value. If \fIlast\fR < 0,
characters between \fIfirst\fR and \fIlast\fR (inclusive) in the value's
Unicode representation. If the value's Unicode representation
is invalid, the Unicode representation is regenerated from the value's
string representation. If \fIfirst\fR is negative, then the returned
string starts at the beginning of the value. If \fIlast\fR negative,
then the returned string ends at the end of the value.
.PP
\fBTcl_GetCharLength\fR returns the number of characters (as opposed
@@ -251,12 +248,6 @@ values may contain internal null characters). Any number of
\fIstring\fR arguments may be provided, but the last argument
must be a NULL pointer to indicate the end of the list.
.PP
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
except that instead of taking a variable number of arguments it takes an
argument list. 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.
This can be handy when the string to be appended might be
@@ -269,7 +260,7 @@ all \fIlength\fR bytes that are available from being appended, then the
appending is done so that the last bytes appended are from the
string \fIellipsis\fR. This allows for an indication of the truncation
to be left in the string.
When \fIlength\fR is \fB-1\fR, all bytes up to the first zero byte are appended,
When \fIlength\fR is negative, all bytes up to the first zero byte are appended,
subject to the limit. When \fIellipsis\fR is NULL, the default
string \fB...\fR is used. When \fIellipsis\fR is non-NULL, it must point
to a zero-byte-terminated string in Tcl's internal UTF encoding.
+1 -1
View File
@@ -24,7 +24,7 @@ message.
.AP Tcl_Obj *objPtr in
A Tcl value containing the string to perform substitutions on.
.AP int flags in
ORed combination of flag bits that specify which substitutions to
OR'ed combination of flag bits that specify which substitutions to
perform. The flags \fBTCL_SUBST_COMMANDS\fR,
\fBTCL_SUBST_VARIABLES\fR and \fBTCL_SUBST_BACKSLASHES\fR are
currently supported, and \fBTCL_SUBST_ALL\fR is provided as a
+6 -6
View File
@@ -34,7 +34,7 @@ and the Tcl \fBmemory\fR command can be used to validate and examine
memory usage.
.SH "GUARD ZONES"
.PP
When memory debugging is enabled, whenever a call to \fBckalloc\fR is
When memory debugging is enabled, whenever a call to \fBTcl_Alloc\fR is
made, slightly more memory than requested is allocated so the memory
debugging code can keep track of the allocated memory, and eight-byte
.QW "guard zones"
@@ -44,7 +44,7 @@ C #define \fBLOW_GUARD_SIZE\fR and #define \fBHIGH_GUARD_SIZE\fR
in the file \fIgeneric/tclCkalloc.c\fR \(em it can
be extended if you suspect large overwrite problems, at some cost in
performance.) A known pattern is written into the guard zones and, on
a call to \fBckfree\fR, the guard zones of the space being freed are
a call to \fBTcl_Free\fR, the guard zones of the space being freed are
checked to see if either zone has been modified in any way. If one
has been, the guard bytes and their new contents are identified, and a
.QW "low guard failed"
@@ -53,7 +53,7 @@ or
message is issued. The
.QW "guard failed"
message includes the address of the memory packet and
the file name and line number of the code that called \fBckfree\fR.
the file name and line number of the code that called \fBTcl_Free\fR.
This allows you to detect the common sorts of one-off problems, where
not enough space was allocated to contain the data written, for
example.
@@ -66,15 +66,15 @@ suspect (or know) that corruption is occurring before the Tcl
interpreter comes up far enough for you to issue commands, you can set
\fBMEM_VALIDATE\fR define, recompile tclCkalloc.c and rebuild Tcl.
This will enable memory validation from the first call to
\fBckalloc\fR, again, at a large performance impact.
\fBTcl_Alloc\fR, again, at a large performance impact.
.PP
If you are desperate and validating memory on every call to
\fBckalloc\fR and \fBckfree\fR is not enough, you can explicitly call
\fBTcl_Alloc\fR and \fBTcl_Free\fR is not enough, you can explicitly call
\fBTcl_ValidateAllMemory\fR directly at any point. It takes a \fIchar
*\fR and an \fIint\fR which are normally the filename and line number
of the caller, but they can actually be anything you want. Remember
to remove the calls after you find the problem.
.SH "SEE ALSO"
ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
Tcl_Alloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
.SH KEYWORDS
memory, debug
+126 -202
View File
@@ -1,6 +1,7 @@
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2023 Nathan Coulter
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -16,176 +17,152 @@ Summary of Tcl language syntax.
.SH DESCRIPTION
.PP
The following rules define the syntax and semantics of the Tcl language:
.IP "[1] \fBCommands.\fR"
A Tcl script is a string containing one or more commands.
Semi-colons and newlines are command separators unless quoted as
described below.
Close brackets are command terminators during command substitution
(see below) unless quoted.
.IP "[2] \fBEvaluation.\fR"
A command is evaluated in two steps.
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 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.
.IP "[3] \fBWords.\fR"
Words of a command are separated by white space (except for
newlines, which are command separators).
.IP "[4] \fBDouble quotes.\fR"
If the first character of a word is double-quote
.PQ \N'34'
then the word is terminated by the next double-quote character.
If semi-colons, close brackets, or white space characters
(including newlines) appear between the quotes then they are treated
as ordinary characters and included in the word.
Command substitution, variable substitution, and backslash substitution
are performed on the characters between the quotes as described below.
The double-quotes are not retained as part of the word.
.IP "[5] \fBArgument expansion.\fR"
If a word starts with the string
.QW {*}
followed by a non-whitespace character, then the leading
.QW {*}
is removed and the rest of the word is parsed and substituted as any other
word. After substitution, the word is parsed as a list (without command or
variable substitutions; backslash substitutions are performed as is normal for
a list and individual internal words may be surrounded by either braces or
double-quote characters), and its words are added to the command being
substituted. For instance,
.QW "cmd a {*}{b [c]} d {*}{$e f {g h}}"
is equivalent to
.QW "cmd a b {[c]} d {$e} f {g h}" .
.IP "[6] \fBBraces.\fR"
If the first character of a word is an open brace
.
.IP "[1] \fBScript.\fR"
A script is composed of zero or more commands delimited by semi-colons or
newlines.
.IP "[2] \fBCommand.\fR"
A command is composed of zero or more words delimited by whitespace. The
replacement for a substitution is included verbatim in the word. For example, a
space in the replacement is included in the word rather than becoming a
delimiter, and \fI\\\\\fR becomes a single backslash in the word. Each word is
processed from left to right and each substitution is performed as soon as it
is complete.
For example, the command
.RS
.PP
.CS
set y [set x 0][incr x][incr x]
.CE
.PP
is composed of three words, and sets the value of \fIy\fR to \fI012\fR.
.PP
If hash
.PQ #
is the first character of what would otherwise be the first word of a command,
all characters up to the next newline are ignored.
.RE
.
.IP "[3] \fBBraced word.\fR"
If a word is enclosed in braces
.PQ {
and rule [5] does not apply, then
the word is terminated by the matching close brace
.PQ } "" .
Braces nest within the word: for each additional open
brace there must be an additional close brace (however,
if an open brace or close brace within the word is
quoted with a backslash then it is not counted in locating the
matching close brace).
No substitutions are performed on the characters between the
braces except for backslash-newline substitutions described
below, nor do semi-colons, newlines, close brackets,
or white space receive any special interpretation.
The word will consist of exactly the characters between the
outer braces, not including the braces themselves.
.IP "[7] \fBCommand substitution.\fR"
If a word contains an open bracket
and
.PQ } ""
, the braces are removed and the enclosed characters become the word. No
substitutions are performed. Nested pairs of braces may occur within the word.
A brace preceded by an odd number of backslashes is not considered part of a
pair, and neither brace nor the backslashes are removed from the word.
.
.IP "[4] \fBQuoted word.\fR"
If a word is enclosed in double quotes
.PQ \N'34'
, the double quotes are removed and the enclosed characters become the word.
Substitutions are performed.
.
.IP "[5] \fBList.\fR"
A list has the form of a single command. Newline is whitespace, and semicolon
has no special interpretation. There is no script evaluation so there is no
argument expansion, variable substitution, or command substitution: Dollar-sign
and open bracket have no special interpretation, and what would be argument
expansion in a script is invalid in a list.
.
.IP "[6] \fBArgument expansion.\fR"
If
.QW {*}
prefixes a word, it is removed. After any remaining enclosing braces or quotes
are processed and applicable substitutions performed, the word, which must
be a list, is removed from the command, and in its place each word in the
list becomes an additional word in the command. For example,
.CS
cmd a {*}{b [c]} d {*}{$e f {g h}}
.CE
is equivalent to
.CS
cmd a b {[c]} d {$e} f {g h} .
.CE
.
.IP "[7] \fBEvaluation.\fR"
To evaluate a script, an interpreter evaluates each successive command. The
first word identifies a procedure, and the remaining words are passed to that
procedure for further evaluation. The procedure interprets each argument in
its own way, e.g. as an integer, variable name, list, mathematical expression,
script, or in some other arbitrary way. The result of the last command is the
result of the script.
.
.IP "[8] \fBCommand substitution.\fR"
Each pair of brackets
.PQ [
then Tcl performs \fIcommand substitution\fR.
To do this it invokes the Tcl interpreter recursively to process
the characters following the open bracket as a Tcl script.
The script may contain any number of commands and must be terminated
by a close bracket
.PQ ] "" .
The result of the script (i.e. the result of its last command) is
substituted into the word in place of the brackets and all of the
characters between them.
There may be any number of command substitutions in a single word.
Command substitution is not performed on words enclosed in braces.
.IP "[8] \fBVariable substitution.\fR"
If a word contains a dollar-sign
and
.PQ ] ""
encloses a script and is replaced by the result of that script.
.IP "[9] \fBVariable substitution.\fR"
Each of the following forms begins with dollar sign
.PQ $
followed by one of the forms
described below, then Tcl performs \fIvariable
substitution\fR: the dollar-sign and the following characters are
replaced in the word by the value of a variable.
Variable substitution may take any of the following forms:
and is replaced by the value of the identified variable. \fIname\fR names the
variable and is composed of ASCII letters (\fBA\fR\(en\fBZ\fR and
\fBa\fR\(en\fBz\fR), digits (\fB0\fR\(en\fB9\fR), underscores, or namespace
delimiters (two or more colons). \fIindex\fR is the name of an individual
variable within an array variable, and may be empty.
.RS
.TP 15
\fB$\fIname\fR
.
\fIName\fR is the name of a scalar variable; the name is a sequence
of one or more characters that are a letter, digit, underscore,
or namespace separators (two or more colons).
Letters and digits are \fIonly\fR the standard ASCII ones (\fB0\fR\(en\fB9\fR,
\fBA\fR\(en\fBZ\fR and \fBa\fR\(en\fBz\fR).
\fIname\fR may not be empty.
.TP 15
\fB$\fIname\fB(\fIindex\fB)\fR
.
\fIName\fR gives the name of an array variable and \fIindex\fR gives
the name of an element within that array.
\fIName\fR must contain only letters, digits, underscores, and
namespace separators, and may be an empty string.
Letters and digits are \fIonly\fR the standard ASCII ones (\fB0\fR\(en\fB9\fR,
\fBA\fR\(en\fBZ\fR and \fBa\fR\(en\fBz\fR).
Command substitutions, variable substitutions, and backslash
substitutions are performed on the characters of \fIindex\fR.
\fIname\fR may be empty. Substitutions are performed on \fIindex\fR.
.TP 15
\fB${\fIname\fB}\fR
\fIname\fR may be empty.
.TP 15
\fB${\fIname(index)\fB}\fR
.
\fIName\fR is the name of a scalar variable or array element. It may contain
any characters whatsoever except for close braces. It indicates an array
element if \fIname\fR is in the form
.QW \fIarrayName\fB(\fIindex\fB)\fR
where \fIarrayName\fR does not contain any open parenthesis characters,
.QW \fB(\fR ,
or close brace characters,
.QW \fB}\fR ,
and \fIindex\fR can be any sequence of characters except for close brace
characters. No further
substitutions are performed during the parsing of \fIname\fR.
.PP
There may be any number of variable substitutions in a single word.
Variable substitution is not performed on words enclosed in braces.
.PP
Note that variables may contain character sequences other than those listed
above, but in that case other mechanisms must be used to access them (e.g.,
via the \fBset\fR command's single-argument form).
\fIname\fR may be empty. No substitutions are performed.
.RE
.IP "[9] \fBBackslash substitution.\fR"
If a backslash
Variables that are not accessible through one of the forms above may be
accessed through other mechanisms, e.g. the \fBset\fR command.
.IP "[10] \fBBackslash substitution.\fR"
Each backslash
.PQ \e
appears within a word then \fIbackslash substitution\fR occurs.
In all cases but those described below the backslash is dropped and
the following character is treated as an ordinary
character and included in the word.
This allows characters such as double quotes, close brackets,
and dollar signs to be included in words without triggering
special processing.
The following table lists the backslash sequences that are
handled specially, along with the value that replaces each sequence.
that is not part of one of the forms listed below is removed, and the next
character is included in the word verbatim, which allows the inclusion of
characters that would normally be interpreted, namely whitespace, braces,
brackets, double quote, dollar sign, and backslash. The following sequences
are replaced as described:
.RS
.RS
.RS
.TP 7
\e\fBa\fR
Audible alert (bell) (Unicode U+000007).
Audible alert (bell) (U+7).
.TP 7
\e\fBb\fR
Backspace (Unicode U+000008).
Backspace (U+8).
.TP 7
\e\fBf\fR
Form feed (Unicode U+00000C).
Form feed (U+C).
.TP 7
\e\fBn\fR
Newline (Unicode U+00000A).
Newline (U+A).
.TP 7
\e\fBr\fR
Carriage-return (Unicode U+00000D).
Carriage-return (U+D).
.TP 7
\e\fBt\fR
Tab (Unicode U+000009).
Tab (U+9).
.TP 7
\e\fBv\fR
Vertical tab (Unicode U+00000B).
Vertical tab (U+B).
.TP 7
\e\fB<newline>\fIwhiteSpace\fR
.
A single space character replaces the backslash, newline, and all spaces
and tabs after the newline. This backslash sequence is unique in that it
is replaced in a separate pre-pass before the command is actually parsed.
This means that it will be replaced even when it occurs between braces,
and the resulting space will be treated as a word separator if it is not
in braces or quotes.
Newline preceded by an odd number of backslashes, along with the consecutive
spaces and tabs that immediately follow it, is replaced by a single space.
Because this happens before the command is split into words, it occurs even
within braced words, and if the resulting space may subsequently be treated as
a word delimiter.
.TP 7
\e\e
Backslash
@@ -193,83 +170,30 @@ Backslash
.TP 7
\e\fIooo\fR
.
The digits \fIooo\fR (one, two, or three of them) give a eight-bit octal
value for the Unicode character that will be inserted, in the range
\fI000\fR\(en\fI377\fR (i.e., the range U+000000\(enU+0000FF).
The parser will stop just before this range overflows, or when
the maximum of three digits is reached. The upper bits of the Unicode
character will be 0.
Up to three octal digits form an eight-bit value for a Unicode character in the
range \fI0\fR\(en\fI377\fR, i.e. U+0\(enU+FF. Only the digits that result in a
number in this range are consumed.
.TP 7
\e\fBx\fIhh\fR
.
The hexadecimal digits \fIhh\fR (one or two of them) give an eight-bit
hexadecimal value for the Unicode character that will be inserted. The upper
bits of the Unicode character will be 0 (i.e., the character will be in the
range U+000000\(enU+0000FF).
Up to two hexadecimal digits form an eight-bit value for a Unicode character in
the range \fI0\fR\(en\fIFF\fR.
.TP 7
\e\fBu\fIhhhh\fR
.
The hexadecimal digits \fIhhhh\fR (one, two, three, or four of them) give a
sixteen-bit hexadecimal value for the Unicode character that will be
inserted. The upper bits of the Unicode character will be 0 (i.e., the
character will be in the range U+000000\(enU+00FFFF).
Up to four hexadecimal digits form a 16-bit value for a Unicode character in
the range \fI0\fR\(en\fIFFFF\fR.
.TP 7
\e\fBU\fIhhhhhhhh\fR
.
The hexadecimal digits \fIhhhhhhhh\fR (one up to eight of them) give a
twenty-one-bit hexadecimal value for the Unicode character that will be
inserted, in the range U+000000\(enU+10FFFF. The parser will stop just
before this range overflows, or when the maximum of eight digits
is reached. The upper bits of the Unicode character will be 0.
.RS
.PP
The range U+00D800\(enU+00DFFF is reserved for surrogates, which
are illegal on their own. Therefore, such sequences will result in
the replacement character U+FFFD. Surrogate pairs should be
encoded as single \e\fBU\fIhhhhhhhh\fR character.
Up to eight hexadecimal digits form a 21-bit value for a Unicode character in
the range \fI0\fR\(en\fI10FFFF\fR. Only the digits that result in a number in
this range are consumed.
.RE
.RE
.PP
Backslash substitution is not performed on words enclosed in braces,
except for backslash-newline as described above.
.RE
.IP "[10] \fBComments.\fR"
If a hash character
.PQ #
appears at a point where Tcl is
expecting the first character of the first word of a command,
then the hash character and the characters that follow it, up
through the next newline, are treated as a comment and ignored.
The comment character only has significance when it appears
at the beginning of a command.
.IP "[11] \fBOrder of substitution.\fR"
Each character is processed exactly once by the Tcl interpreter
as part of creating the words of a command.
For example, if variable substitution occurs then no further
substitutions are performed on the value of the variable; the
value is inserted into the word verbatim.
If command substitution occurs then the nested command is
processed entirely by the recursive call to the Tcl interpreter;
no substitutions are performed before making the recursive
call and no additional substitutions are performed on the result
of the nested script.
.RS
.PP
Substitutions take place from left to right, and each substitution is
evaluated completely before attempting to evaluate the next. Thus, a
sequence like
.PP
.CS
set y [set x 0][incr x][incr x]
.CE
.PP
will always set the variable \fIy\fR to the value, \fI012\fR.
.RE
.IP "[12] \fBSubstitution and word boundaries.\fR"
Substitutions do not affect the word boundaries of a command,
except for argument expansion as specified in rule [5].
For example, during variable substitution the entire value of
the variable becomes part of a single word, even if the variable's
value contains spaces.
.
.SH KEYWORDS
backslash, command, comment, script, substitution, variable
'\" Local Variables:
+4 -4
View File
@@ -88,7 +88,7 @@ The initial value for the checksum algorithm.
.AP "unsigned char" *bytes in
An array of bytes to run the checksum algorithm over, or NULL to get the
recommended initial value for the checksum algorithm.
.AP int length in
.AP Tcl_Size length in
The number of bytes in the array.
.AP int mode in
What mode to operate the stream in. Should be either
@@ -107,9 +107,9 @@ if the currently compressed data must be made available for access using
into a state where the decompressor can recover from on corruption, or
\fBTCL_ZLIB_FINALIZE\fR to ensure that the stream is finished and that any
trailer demanded by the format is written.
.AP int count in
The maximum number of bytes to get from the stream, or -1 to get all remaining
bytes from the stream's buffers.
.AP Tcl_Size count in
The maximum number of bytes to get from the stream, or -1 to get
all remaining bytes from the stream's buffers.
.AP Tcl_Obj *compDict in
A byte array value that is the compression dictionary to use with the stream.
Note that this is \fInot a Tcl dictionary\fR, and it is recommended that this
+7 -2
View File
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Tcl_Main 3 8.4 Tcl "Tcl Library Procedures"
.TH Tcl_Main 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -29,7 +29,7 @@ Tcl_Obj *
\fBTcl_SetMainLoop\fR(\fImainLoopProc\fR)
.SH ARGUMENTS
.AS Tcl_MainLoopProc *mainLoopProc
.AP int argc in
.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
Array of strings containing command-line arguments. On Windows, when
@@ -203,6 +203,11 @@ 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.
.PP
The difference between Tcl_MainEx and Tcl_MainExW is that the arguments
are passed as characters or wide characters. When used in stub-enabled
embedders, the stubs table must be first initialized using one of
\fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_SetStartupScript\fR takes a value (or NULL) for its \fIpath\fR
+5 -7
View File
@@ -67,7 +67,7 @@ Id of the thread waited upon.
.AP Tcl_ThreadCreateProc *proc in
This procedure will act as the \fBmain()\fR of the newly created
thread. The specified \fIclientData\fR will be its sole argument.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary information. Passed as sole argument to the \fIproc\fR.
.AP int stackSize in
The size of the stack given to the new thread.
@@ -107,8 +107,6 @@ and join it.
Restrictions: On some UNIX systems the pthread-library does not
contain the functionality to specify the stack size of a thread. The
specified value for the stack size is ignored on these systems.
Windows currently does not support joinable threads. This
flag value is therefore ignored on this platform.
.PP
Tcl provides the \fBTcl_ExitThread\fR and \fBTcl_FinalizeThread\fR functions
for terminating threads and invoking optional per-thread exit
@@ -158,9 +156,9 @@ A condition variable is used as a signaling mechanism:
a thread can lock a mutex and then wait on a condition variable
with \fBTcl_ConditionWait\fR. This atomically releases the mutex lock
and blocks the waiting thread until another thread calls
\fBTcl_ConditionNotify\fR. The caller of \fBTcl_ConditionNotify\fR should
\fBTcl_ConditionNotify\fR. The caller of \fBTcl_ConditionNotify\fR may
have the associated mutex held by previously calling \fBTcl_MutexLock\fR,
but this is not enforced. Notifying the
but this tends to produce more thread context switches. Notifying the
condition variable unblocks all threads waiting on the condition variable,
but they do not proceed until the mutex is released with \fBTcl_MutexUnlock\fR.
The implementation of \fBTcl_ConditionWait\fR automatically locks
@@ -208,7 +206,7 @@ value and then finishes.
.CS
static \fBTcl_ThreadCreateType\fR
MyThreadImplFunc(
ClientData clientData)
void *clientData)
{
int i, limit = (int) clientData;
for (i=0 ; i<limit ; i++) {
@@ -223,7 +221,7 @@ would do this:
.PP
.CS
int limit = 1000000000;
ClientData limitData = (void*)((intptr_t) limit);
void *limitData = (void*)((intptr_t) limit);
Tcl_ThreadId id; \fI/* holds identity of thread created */\fR
int result;
+3 -3
View File
@@ -22,13 +22,13 @@ int
int
\fBTcl_UniCharToTitle\fR(\fIch\fR)
.sp
int
Tcl_Size
\fBTcl_UtfToUpper\fR(\fIstr\fR)
.sp
int
Tcl_Size
\fBTcl_UtfToLower\fR(\fIstr\fR)
.sp
int
Tcl_Size
\fBTcl_UtfToTitle\fR(\fIstr\fR)
.SH ARGUMENTS
.AS char *str in/out
+5 -5
View File
@@ -13,7 +13,7 @@ Tcl_CommandTraceInfo, Tcl_TraceCommand, Tcl_UntraceCommand \- monitor renames an
.nf
\fB#include <tcl.h>\fR
.sp
ClientData
void *
\fBTcl_CommandTraceInfo(\fIinterp, cmdName, flags, proc, prevClientData\fB)\fR
.sp
int
@@ -32,9 +32,9 @@ OR'ed collection of the values \fBTCL_TRACE_RENAME\fR and
\fBTCL_TRACE_DELETE\fR.
.AP Tcl_CommandTraceProc *proc in
Procedure to call when specified operations occur to \fIcmdName\fR.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary argument to pass to \fIproc\fR.
.AP ClientData prevClientData in
.AP void *prevClientData in
If non-NULL, gives last value returned by \fBTcl_CommandTraceInfo\fR,
so this call will return information about next trace. If NULL, this
call will return information about first trace.
@@ -65,7 +65,7 @@ match the type \fBTcl_CommandTraceProc\fR:
.PP
.CS
typedef void \fBTcl_CommandTraceProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIoldName\fR,
const char *\fInewName\fR,
@@ -74,7 +74,7 @@ typedef void \fBTcl_CommandTraceProc\fR(
.PP
The \fIclientData\fR and \fIinterp\fR parameters will have the same
values as those passed to \fBTcl_TraceCommand\fR when the trace was
created. \fIClientData\fR typically points to an application-specific
created. \fIclientData\fR typically points to an application-specific
data structure that describes what to do when \fIproc\fR is invoked.
\fIOldName\fR gives the name of the command being renamed, and
\fInewName\fR gives the name that the command is being renamed to (or
+17 -14
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 8.7 Tcl "Tcl Library Procedures"
.TH Tcl_TraceVar 3 9.0 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -24,13 +24,13 @@ int
.sp
\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
.sp
ClientData
void *
\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR
.sp
ClientData
void *
\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR
.SH ARGUMENTS
.AS Tcl_VarTraceProc prevClientData
.AS void *prevClientData
.AP Tcl_Interp *interp in
Interpreter containing variable.
.AP "const char" *varName in
@@ -46,7 +46,7 @@ Not all flags are used by all
procedures. See below for more information.
.AP Tcl_VarTraceProc *proc in
Procedure to invoke whenever one of the traced operations occurs.
.AP ClientData clientData in
.AP void *clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP "const char" *name1 in
Name of scalar or array variable (without array index).
@@ -54,7 +54,7 @@ Name of scalar or array variable (without array index).
For a trace on an element of an array, gives the index of the
element. For traces on scalar variables or on whole arrays,
is NULL.
.AP ClientData prevClientData in
.AP void *prevClientData in
If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or
\fBTcl_VarTraceInfo2\fR, so this call will return information about
next trace. If NULL, this call will return information about first
@@ -107,7 +107,7 @@ before an array set, but that will trigger write traces.
\fBTCL_TRACE_RESULT_DYNAMIC\fR
The result of invoking the \fIproc\fR is a dynamically allocated
string that will be released by the Tcl library via a call to
\fBckfree\fR. Must not be specified at the same time as
\fBTcl_Free\fR. Must not be specified at the same time as
\fBTCL_TRACE_RESULT_OBJECT\fR.
.TP
\fBTCL_TRACE_RESULT_OBJECT\fR
@@ -124,7 +124,7 @@ It should have arguments and result that match the type
.PP
.CS
typedef char *\fBTcl_VarTraceProc\fR(
ClientData \fIclientData\fR,
void *\fIclientData\fR,
Tcl_Interp *\fIinterp\fR,
const char *\fIname1\fR,
const char *\fIname2\fR,
@@ -134,12 +134,14 @@ typedef char *\fBTcl_VarTraceProc\fR(
The \fIclientData\fR and \fIinterp\fR parameters will
have the same values as those passed to \fBTcl_TraceVar\fR when the
trace was created.
\fIClientData\fR typically points to an application-specific
\fIclientData\fR typically points to an application-specific
data structure that describes what to do when \fIproc\fR
is invoked.
\fIName1\fR and \fIname2\fR give the name of the traced variable
in the normal two-part form (see the description of \fBTcl_TraceVar2\fR
below for details).
\fIName1\fR and \fIname2\fR give the name of the variable that
triggered the callback in the normal two-part form (see the description
of \fBTcl_TraceVar2\fR below for details). In case \fIname1\fR is an
alias to an array element (created through facilities such as \fBupvar\fR),
\fIname2\fR holds the index of the array element, rather than NULL.
\fIFlags\fR is an OR-ed combination of bits providing several
pieces of information.
One of the bits \fBTCL_TRACE_READS\fR, \fBTCL_TRACE_WRITES\fR,
@@ -308,7 +310,7 @@ The return value must be a pointer to a static character string
containing an error message,
unless (\fIexactly\fR one of) the \fBTCL_TRACE_RESULT_DYNAMIC\fR and
\fBTCL_TRACE_RESULT_OBJECT\fR flags is set, which specify that the result is
either a dynamic string (to be released with \fBckfree\fR) or a
either a dynamic string (to be released with \fBTcl_Free\fR) or a
Tcl_Obj* (cast to char* and to be released with
\fBTcl_DecrRefCount\fR) containing the error message.
If a trace procedure returns an error, no further traces are
@@ -333,7 +335,8 @@ 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.
condition, but Tcl 9 no longer supports this. Any supported code
must 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

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