summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
* 2001-07-17 Andreas Kupries <andreas_kupries@users.sourceforge.net>andreas_kupries2001-07-171-2/+16
| | | | | | | | | | * generic/tclIO.c (GetInput): Fixed [SF #427196]. Memory was overwritten because a buffer was used after a change of the requested buffersize together with that requested buffersize and not its actual size, which was smaller. Note that the continous reuse of the smaller buffer negatively impacts performance. The system never allocates a buffer with the newly requested bigger buffersize.
* * Note that "tclbench" (see project "tcllib") was extended withandreas_kupries2001-05-191-22/+172
| | | | | | | | | | | | | | | | | | performance benchmarks for [fcopy] too. * doc/fcopy.n: Updated to reflect the extended behaviour of 'fcopy'. * tests/io.test: Added tests 'io-52.9', 'io-52.10' and 'io-52.11' to test the handling of encodings by 'fcopy' / 'TclCopychannel' [Bug #209210]. * generic/tclIO.c: Split of both 'Tcl_ReadChars' and 'Tcl_WriteChars' into a public error checking and an internal working part. The public functions now use the new internal ones. The new functions are 'DoReadChars' and 'DoWriteChars'. Extended 'CopyData' to use the new functions 'DoXChars' when required by the encodings on the input and output channels [Bug #209210].
* 2001-03-30 Andreas Kupries <andreas_kupries@users.sourceforge.net>andreas_kupries2001-03-301-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * All of the changes below belong to TIP #10 [Tcl I/O Enhancement: Thread-Aware Channels]. See also [Patch #403358] at SF. * generic/tclIO.h (struct ChannelState, line 236f): Extended the structure with a new field of type 'Tcl_ThreadId' to hold the id of the thread currently managing all channels with this state. Note: This structure is shared by all channels in a stack of transformations. * generic/tclIO.c (Tcl_CreateChannel, lines 1058-1065): Modified to store the Id of the current thread in the 'ChannelState' of the new channel. * generic/tclIO.c (Tcl_SpliceChannel, lines 2265-2270): Modified in the same manner as 'Tcl_CreateChannel' as the channel will be managed by the current thread afterward. * generic/tclIO.c (Tcl_GetChannelThread, lines 1478-1503): * generic/tcl.decls (Tcl_GetChannelThread, lines 1504-1506): New API function to retrieve the Id of the managing thread from a channel. Implementation and declaration. * generic/tclTest.c (TestChannelCmd, lines 4520-4532): Added subcommand 'mthread' to query a channel about its managing thread.
* 2000-01-30 Don Porter <dgp@users.sourceforge.net>dgp2001-01-301-11/+14
| | | | | | | | | | * generic/tclIO.c (CopyData): Moved code that updates the count of how many bytes are left to copy. Corrects bug that when writing occurs in the background, the copy loop could be escaped without updating the count, causing CopyData() to try to copy more bytes than the toRead value originally passed to TclCopyChannel(), leading to hangs and misreporting of number of bytes copied. [Bug 118203, Patch 103432]
* * generic/tclIO.c (Tcl_NotifyChannel): removed #ifdef around codehobbs2000-10-281-90/+18
| | | | for old channel structures, placed preserve/release around statePtr
* * generic/tclIO.c (CloseChannel): the statePtr for a channel washobbs2000-10-271-2/+5
| | | | | not being freed when the last channel in a stack was freed, causing a mem leak.
* * tests/cmdAH.test: extra tests for 'file channels' that includehobbs2000-10-061-8/+28
| | | | | | | multiple interpreter tests and channel sharing * generic/tclIO.c (Tcl_GetChannelNamesEx): corrected function (and consequently 'file channels') to return channels that are actually registered for this specific interp, rather than this thread.
* up-port of the stacked channel implementation rewrite in 8.3.2 tohobbs2000-09-281-1611/+2489
| | | | 8.4a2 code base, merged in with some existing new 8.4a2 features.
* * generic/tclTest.c:hobbs2000-05-191-1158/+243
| | | | | | | | | | | | | * generic/tclIO.c: moved channel test commands from tclIO.c to tclTest.c. * generic/tclIO.h: new file, split out from tclIO.c to allow test commands to be moved to tclTest.c. * generic/tclStubInit.c: * generic/tclIntDecls.h: * generic/tclInt.decls: removed TclTestChannel*Cmd from internal stubs table and added TclChannelEventScriptInvoker to the internal stubs table so it can be used from the test code.
* lint chan = NULL inithobbs2000-05-081-2/+2
|
* 2000-05-02 Andreas Kupries <a.kupries@westend.com>kupries2000-05-021-82/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Overall changes: (1) Implementation of joinable threads for all platforms. (2) Additional API's for channels. Required to allow the thread extension to move channels between threads. * generic/tcl.decls (lines 1360f): Added Tcl_JoinThread, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting and Tcl_ClearChannelHandlers (slots 394 to 400). * generic/tclIO.c: Implemented Tcl_IsChannelRegistered, Tcl_IsChannelShared, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting and Tcl_ClearChannelHandlers. Tcl_CutChannel uses code from CloseChannel. Replaced this code by a call to Tcl_CutChannel. Replaced several code fragments adding channels to the channel list with calls to Tcl_SpliceChannel. Removed now unused variables from CloseChannel and Tcl_UnstackChannel. Tcl_ClearChannelHandlers uses code from Tcl_Close. Replaced this code by a call to Tcl_ClearChannelHandlers. Removed now unused variables from Tcl_Close. Added the subcommands 'cut', 'forgetch', 'splice' and 'isshared' to the test code (TclTestChannelCmd). * unix/tclUnixThread.c: Implemented Tcl_JoinThread using the pthread-functionality. * win/tclWinThrd.c: Fixed several small typos in comments. Implemented Tcl_JoinThread using a platform independent emulation layer (see generic/tclThreadJoin.c below). Added 'joinLock' to serialize Tcl_CreateThread and TclpExitThread to prevent a race for joinable threads. * mac/tclMacThrd.c: Implemented Tcl_JoinThread using a platform independent emulation layer (see generic/tclThreadJoin.c below). Due to the cooperative nature of threading on this platform the race mentioned above is not present. * generic/tclThreadJoin.c: New file. Contains a platform independent emulation layer helping in the implementation of joinable threads for the win and mac platforms. * generic/tclInt.h: Added declarations for TclJoinThread, TclRememberJoinableThread and TclSignalExitThread. These procedures define the API of the emulation layer for joinable threads (see generic/tclThreadJoin.c above). * win/Makefile.in: * win/makefile.vc: Added generic/tclTheadJoin.o to the rules. * mac/: I don't know to which file generic/tclTheadJoin.o has to be added to so that it compiles. Sorry. * unix/tclUnixChan.c: #ifdef'd the thread-local list of file channels as it prevents us from transfering channels. To restore this we may need an extended interface to drivers in the future. Target: 9.0. Found while testing the new transfer of channels. The information in this list for a channel was left behind and then crashed the system during finalization. * generic/tclThreadTest.c: Added -joinable flag to 'testthread create'. Added subcommand 'testthread join'. * doc/CrtChannel.3: Added documentation for Tcl_IsChannelRegistered, Tcl_IsChannelShared, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting and Tcl_ClearChannelHandlers. * doc/Thread.3: Added documentation for Tcl_JoinThread. * tests/thread.test: Added tests for joining of threads.
* 2000-04-05 Andreas Kupries <a.kupries@westend.com>kupries2000-04-051-1/+2
| | | | | | | | * generic/tclIO.c (Tcl_UnstackChannel, line 1831): Forcing interest mask to the correct value after an unstack and re-initialization of the notifier via the watchProc. Without this the first fileevent after an unstack will come through and be processed, but no more. [Bug: ??].
* * generic/tclCmdIL.c: added -unique option to lsorthobbs1999-12-211-3/+3
| | | | * generic/tclThreadTest.c: changed thread ids to longs [Bug: 3902]
* * generic/tclDate.c:hobbs1999-12-081-11/+13
| | | | | | | | | | | | * unix/Makefile.in: fixed make gendate to swap const with CONST so it uses the Tcl defined CONST type [Bug: 3521] * generic/tclIO.c: removed panic that could occur in FlushChannel when a "blocking" channel would receive EAGAIN, instead treating it the same as non-blocking. [Bug: 3773] * generic/tclUtil.c: fixed Tcl_ScanCountedElement to not step beyond the end of the counted string [Bug: 3336]
* * generic/tclIO.c: fix from Kupries for Tcl_UnstackChannel thathobbs1999-12-011-54/+87
| | | | correctly handles resetting translation and encoding.
* 1999-08-19 Jeff Hobbs <hobbs@scriptics.com>hobbs1999-08-191-3/+6
| | | | | * generic/tclIO.c: changed Tcl_GetChannelNames* to use K&R style headers (style guide, also pleases HP cc)
* 1999-08-18 Jeff Hobbs <hobbs@scriptics.com>hobbs1999-08-191-7/+35
| | | | | | | | | | | | | | * doc/OpenFileChnl.3: * doc/file.n: * tests/cmdAH.test: * tclIO.c: * tclCmdAH.c: added "file channels ?pattern?" tcl command, with associated Tcl_GetChannelNames and Tcl_GetChannelNamesEx public C APIs (added to tcl.decls as well), with docs and tests. * generic/tclCompile.c: add TCL_TOKEN_VARIABLE to the part types that cause differed compilation for exprs, to correct the expr double-evaluation problem for vars. Added test cases.
* * generic/tclListObj.c:core_8_2_b3_baseredman1999-08-101-35/+1
| | | | | | | | | | | | | | | | * generic/tcl.decls: * generic/tclDecls.h: Applied patch from Jim Ingham to change the prototype of Tcl_ListObjGetElements to have the last argument have a CONST so that you can feed it the objv that you get from the standard TclObj command proc. * generic/tclAlloc.c: * generic/tclCmdIL.c: * generic/tclIO.c: * generic/tclThread.c: * win/tclWinThrd.c: * unix/tclUnixThrd.c: Fixed Brent's changes so that they work on Windows (and he fixed the bug in the Unix thread implementation).
* 1 Added use of Tcl_GetAllocMutex to tclAlloc.c and tclCkalloc.c so theywelch1999-08-101-1/+74
| | | | | | | | can be linked against alternate thread packages. 2 Added Tcl_GetChannelNames to tclIO.c 3 Added TclVarTraceExists hook so "info exists" triggers read traces exactly like it did in Tcl 7.6 4 Stubs table changes to reflect new internal and external APIs
* updated trf patch to fix problems created when adapting Kupries'hobbs1999-07-301-51/+81
| | | | previous patch to our specs.
* * Changed version to 8.2b2.redman1999-07-221-2/+3
| | | | | | | | | | | | | | | | | | * win/tclWinPort.h: Block out include of sys/*.h in order to build extensions with MetroWerks compiler for Win32. [Bug: 2385] * generic/tclCmdMZ.c: * generic/tclIO.c: Fix ANSI-style prototypes based on patch from Ulrich Ring. [Bug: 2391] * unix/Makefile.in: Need to make install-sh executable before calling (with chmod +x). [Bug: 2413] * tests/var.test: * generic/tclVar.c: Fixed bug that caused a seg. fault when using "array set a(b) {}", which is a bad array name anyway. Now the "array set" command will return an error in this case. Added test case and fixed existing test. [Bug: 2427]
* Name change from Tcl_ReplaceChannel to Tcl_StackChannelwelch1999-07-021-110/+337
| | | | Added new code that modifies the channel in place.
* Initial version of the Tcl_ReplaceChannel and Tcl_UndoReplaceChannelwelch1999-06-301-2/+303
| | | | functions.
* added -encoding to the list of legal options used in the error message whenhershey1999-05-181-2/+2
| | | | | a bad option is used. Because the fconfigure command is configurable (so more option can be added), the error string is hardcoded.
* Resynced with mainline.rjohnson1999-04-211-1/+1
|
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-1488/+3038
|
* Fixed the Tcl_NotifyChannel bug, plus added a test case for it.welch1998-10-301-12/+4
| | | | | | Simply replaced Tcl_RegisterChannel/UnregisterChannel with Tcl_Preserve/Tcl_Release was all it took. Chanels are already "eventually freed"
* Replaced SCCS strings, fixed binary filescore_8_0_3stanton1998-09-141-1/+1
|
* plugin updateswelch1998-06-271-3/+16
|
* fixed bug that caused file events to not be reported on buffered datastanton1998-06-091-8/+43
|
* Initial revisionrjohnson1998-03-261-0/+6013