summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclIO.c (Tcl_CreateChannel): allow Tcl std channelhobbs2006-07-101-3/+8
| | | | inheritance to be #defined out (default remains in).
* * generic/tclIO.c (ReadChars): Added check and panic andandreas_kupries2006-04-051-2/+77
| | | | | | | | | | | | | | | | | | | | | commentary to a piece of code which relies on BUFFER_PADDING to create enough space at the beginning of each buffer forthe insertion of partial multi-byte data at the beginning of a buffer. To explain why this code is ok, and as precaution if someone twiddled the BUFFER_PADDING into uselessness. * generic/tclIO.c (ReadChars): [SF Tcl Bug 1462248]. Added code temporarily suppress the use of TCL_ENCODING_END set when eof was reached while the buffer we are converting is not truly the last buffer in the queue. together with the Utf bug below it was possible to completely bollox the buffer data structures, eventually crashing Tcl. * generic/tclEncoding.c (UtfToUtfProc): Fixed problem where the function accessed memory beyond the end of the input buffer. When TCL_ENCODING_END is set and the last bytes of the buffer start a multi-byte sequence. This bug contributed to [SF Tcl Bug 1462248].
* Invokes TclpFinalizeSockets() as part of the TclFinalizeIOSubsystem() call.vasiljevic2006-03-101-3/+16
|
* * generic/tclIO.c: Made several routines tolerant ofdgp2006-02-151-25/+41
| | | | * generic/tclIOUtil.c: interp == NULL arguments. [Bug 1380662]
* * generic/tclIO.c (TclFinalizeIOSubsystem): preserve statePtrhobbs2005-11-181-10/+13
| | | | until we netrieve next statePtr from it.
* * generic/tclIO.c (TclFinalizeIOSubsystem): Applied Pat Thoyts'andreas_kupries2005-11-181-2/+6
| | | | | | | patch for [SF Tcl Bug 1359094]. This moves the retrieval of the next channel state to the end of the loop, as the called closeproc may close other channels, i.e. modify the list we are iterating, invalidating any pointer retrieved earlier.
* Backed off change from 2005-10-04 (see ChangeLog and Tcl Bug# 1323992vasiljevic2005-10-141-14/+2
| | | | for more info.
* Added some more clarifying comments in Tcl_ClearChannelHandlers()vasiljevic2005-10-131-6/+5
|
* Temporary ifdef TCL_THREADS changes done to de-activate pendingvasiljevic2005-10-131-1/+8
| | | | event processing when channel is being closed/cutted.
* Tcl_ClearChannelHandlers(): now deletes any outstandingvasiljevic2005-10-041-2/+14
| | | | | timer for the channel. Also, prevents events still in the event queue from triggering on the current channel.
* bug 1225727Kevin B Kenny2005-06-221-1/+2
|
* * generic/tclIO.c (Tcl_SetChannelBufferSize): Lowest size limitdavygrvy2005-04-141-8/+9
| | | | | | | | | | * tests/io.test: changed from ten bytes to one byte. Need * tests/iogt.test: for this change was proven by Ross Cartlidge <rossc@cisco.com> where [read stdin 1] was grabbing 10 bytes followed by starting a child process that was intended to continue reading from stdin. Even with -buffersize set to one, nine chars were getting lost by the buffersize over reading for the native read() caused by [read].
* TIP#218 IMPLEMENTATIONandreas_kupries2005-01-271-15/+57
| | | | | | | | | | | | | | | | | | | | | * generic/tclDecls.h: Regenerated from tcl.decls. * generic/tclStubInit.c: * doc/CrtChannel.3: Documentation of extended API, * generic/tcl.decls: extended testsuite, and * generic/tcl.h: implementation. Removal of old * generic/tclIO.c: driver-specific TclpCut/Splice * generic/tclInt.h: functions. Replaced with generic * tests/io.test: thread-action calls through the * unix/tclUnixChan.c: new hooks. Update of all builtin * unix/tclUnixPipe.c: channel drivers to version 4. * unix/tclUnixSock.c: Windows drivers extended to * win/tclWinChan.c: manage thread state in a thread * win/tclWinConsole.c: action handler. * win/tclWinPipe.c: * win/tclWinSerial.c: * win/tclWinSock.c: * mac/tclMacChan.c:
* Fix [Bug 1025359] to make sure wide seeks don't lose errorsdkf2004-09-101-5/+5
|
* * generic/tclIO.h (CHANNEL_INCLOSE): New flag. Set inandreas_kupries2004-07-151-1/+48
| | | | | | | | | | | | | | | | | | | | | | * generic/tclIO.c (Tcl_UnregisterChannel): 'Tcl_Close' while the * generic/tclIO.c (Tcl_Close): close callbacks are run. Checked in 'Tcl_Close' and 'Tcl_Unregister' to prevent recursive call of 'close' in the close-callbacks. This is a possible error made by implementors of virtual filesystems based on 'tclvfs', thinking that they have to close the channel in the close handler for the filesystem. * generic/tclIO.c: * generic/tclIO.h: * Not reverting, but #ifdef'ing the changes from May 19, 2004 out of the core. This removes the ***POTENTIAL INCOMPATIBILITY*** for channel drivers it introduced. This has become possible due to Expect gaining a BlockModeProc and now handling blockingg and non-blocking modes correctly. Thus [SF Tcl Bug 943274] is still fixed if a recent enough version of Expect is used. * doc/CrtChannel.3: Added warning about usage of a channel without a BlockModeProc.
* Removed one bogus clearance of the has-more flag. Erroneously keptandreas_kupries2004-05-191-3/+1
| | | | after shifting the code.
* * tclIO.c: Fixed [SF Tcl Bug 943274]. This is the same problem asandreas_kupries2004-05-191-6/+91
| | | | | | | | | | | | | * tclIO.h: [SF Tcl Bug 462317], see ChangeLog entry 2001-09-26. The fix done at that time is incomplete. It is possible to get around it if the actual read operation is defered and not executed in the event handler itself. Instead of tracking if we are in an read caused by a synthesized fileevent we now track if the OS has delivered a true event = actual data and bypass the driver if a read finds that there is no actual data waiting. The flag is cleared by a short or full read.
* * generic/tclIO.c (Tcl_SetChannelOption): Fixed [SF Tcl Bugandreas_kupries2004-04-231-1/+10
| | | | | 930851]. When changing the eofchar we have to zap the related flags to prevent them from prematurely aborting the next read.
* * generic/tclIO.c (Tcl_Ungets): fixes improper filling of the channel buffer.davygrvy2004-02-021-3/+2
| | | | [Bug 405995]
* * generic/tclIO.c (UpdateInterest): When dropping interest inandreas_kupries2003-04-111-7/+38
| | | | | | | TCL_READABLE now dropping interest in TCL_EXCEPTION too. This fixes a bug where Expect detects eof on a file prematurely on solaris 2.6 and higher. A much more complete explanation is in the code itself (40 lines of comments for a one-line change :)
* Experimental change. Easier to check in and later back out if thereandreas_kupries2003-04-101-1/+13
| | | | | | are problems than to try and compile everything manually on all the platforms. This way the AS auto-build gets the change without fuss, and I can read the logs tomorrow.
* (HaveVersion): correctly decl statichobbs2003-02-191-2/+2
|
* * generic/tclIO.c (Tcl_GetsObj): Minor changemdejong2003-02-171-2/+2
| | | | | | so that eol is only assigned at the top of the TCL_TRANSLATE_AUTO case block. The other cases assign eol so this does not change any functionality.
* * generic/tclIO.c (Tcl_CutChannel, Tcl_SpliceChannel):mdejong2003-01-261-1/+5
| | | | | | | | | | | | | | | | Invoke TclpCutFileChannel and TclpSpliceFileChannel. * generic/tclInt.h: Declare TclpCutFileChannel and TclpSpliceFileChannel. * unix/tclUnixChan.c (FileCloseProc, TclpOpenFileChannel, Tcl_MakeFileChannel, TclpCutFileChannel, TclpSpliceFileChannel): Implement thread load data cut and splice for file channels. This avoids an invalid memory ref when compiled with -DDEPRECATED. * win/tclWinChan.c (FileCloseProc, TclpCutFileChannel, TclpSpliceFileChannel): Implement thread load data cut and splice for file channels. This avoids an invalid memory ref that was showing up in the thread extension.
* stringObj unicode Tcl_SetObjLength fixesvincentdarley2003-01-241-1/+7
|
* * tests/io.test:andreas_kupries2002-07-301-2/+16
| | | | | | | | | * generic/tclIO.c (WriteChars): Added flag to break out of loop if nothing of the input is consumed at all, to prevent infinite looping of called with a non-UTF-8 string. Fixes Bug 584603 (partially). Added new test "io-60.1". Might need additional changes to Tcl_Main so that unprintable results are printed as binary data.
* TIP#91 implementation; makes old style channels binary compatible withdkf2002-05-241-53/+141
| | | | new TIP#72-enabled Tcl. See http://purl.org/tcl/tip/91 for details.
* * generic/tclEncoding.c (EscapeFromUtfProc):hobbs2002-04-181-26/+59
| | | | | | * generic/tclIO.c (WriteChars, Tcl_Close): corrected the handling of outputting end escapes for escape-based encodings. [Bug #526524] (yamamoto)
* * generic/tclEncoding.c: Fix typo in comment.mdejong2002-03-111-16/+18
| | | | | | | | * generic/tclIO.c (DoReadChars, ReadBytes, ReadChars): Use NULL value instead of pointer set to NULL to make things more clear. Reorder arguments so that they match the function signatures. Cleanup little typos and add more descriptive comment.
* * tests/encoding.test: added encoding-23.* testshobbs2002-03-021-4/+11
| | | | | | | * generic/tclIO.c (FilterInputBytes): reset the TCL_ENCODING_START flags in the ChannelState when using 'gets'. [Bug #523988] Also reduced the value of ENCODING_LINESIZE from 30 to 20 as this seems to improve the performance of 'gets' according to tclbench.
* TIP#72 implementation. See ChangeLog for details.dkf2002-02-151-34/+69
| | | | | This version builds clean on Solaris/SPARC, with GCC and CC, both with and without threads and both in 32-bit and 64-bit mode.
* * Sought out and eliminated instances of CONST-casting that are nodgp2002-01-261-3/+3
| | | | longer needed after the TIP 27 effort.
* Make -eofchar and -translation options read only formdejong2002-01-251-3/+11
| | | | | | | | | | | | | | | server sockets. [Bug 496733] * generic/tclIO.c (Tcl_GetChannelOption, Tcl_SetChannelOption): Instead of returning nothing for the -translation option on a server socket, always return "auto". Return the empty string enclosed in quotes for the -eofchar option on a server socket. Fixup -eofchar usage message so that it matches the implementation. * tests/io.test: Add -eofchar tests and -translation tests to ensure options are read only on server sockets. * tests/socket.test: Update tests to account for -eofchar and -translation option changes.
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-5/+5
| | | | | | | | | | | generic/tclIOUtil.c, generic/tclPipe.c, generic/tclResult.c, generic/tclUtil.c, generic/tclVar.c and mac/tclMacResource.c according to TIP 27. Tcl_TranslateFileName rewritten as wrapper around VFS-aware version. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes source incompatibilities: argv arguments of Tcl_Concat, Tcl_JoinPath, Tcl_OpenCommandChannel, Tcl_Merge; argvPtr arguments of Tcl_SplitList and Tcl_SplitPath.
* * generic/tclIO.c (WriteChars): Fix for SF #506297, reported byandreas_kupries2002-01-211-1/+19
| | | | | | | | | | | | | | Martin Forssen <ruric@users.sourceforge.net>. The encoding chosen in the script exposing the bug writes out three intro characters when TCL_ENCODING_START is set, but does not consume any input as TCL_ENCODING_END is cleared. As some output was generated the enclosing loop calls UtfToExternal again, again with START set. Three more characters in the out and still no use of input ... To break this infinite loop we remove TCL_ENCODING_START from the set of flags after the first call (no condition is required, the later calls remove an unset flag, which is a no-op). This causes the subsequent calls to UtfToExternal to consume and convert the actual input.
* * More TIP 27 updates in tclIOUtil.c and tclIndexObj.c that weredgp2002-01-171-2/+2
| | | | | | | overlooked before. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes a source incompatibility in the tablePtr arguments of the Tcl_GetIndexFromObj* routines.
* * Updated APIs in generic/tclUtf.c and generic/tclRegexp.c accordingdgp2002-01-171-2/+2
| | | | to the guidelines of TIP 27. Updated callers.
* * Updated APIs in generic/tclIOUtil.c and generic/tclPosixStr.cdgp2002-01-151-2/+9
| | | | according to the guidelines of TIP 27. Updated callers. [Patch 499196]
* * Updated APIs in the file generic/tclIO.c according to the guidelinesdgp2002-01-151-34/+36
| | | | | | | | | | | of TIP 27. Several minor documentation corrections as well. * Updated channel driver interface according to the guidelines of TIP 27. See also [Bug 500348]. * Moved Tcl_EolTranslation enum declaration from generic/tcl.h to generic/tclInt.h (renamed to TclEolTranslation). It is not used anywhere in Tcl's public interface.
* * Applied #219311 on behalf of Rolf Schroedterandreas_kupries2001-12-171-14/+29
| | | | | <schroedter@users.sourceforge.net> to prevent fcopy on serial ports from flooding the event queue.
* * generic/tclIO.c (Tcl_GetsObj): Applied patch for bug #491341 asandreas_kupries2001-12-121-4/+4
| | | | | provided by Don Porter <dgp@users.sourceforge.net>. Fixes assumption of having an empty Tcl_Obj to work with.
* See ChangeLogandreas_kupries2001-11-071-7/+17
|
* Undo of mistaken commit. Sorry!dgp2001-10-161-2/+2
|
* * Added test to demonstrate memory corruption problems. [Bug 219393].dgp2001-10-161-2/+2
|
* Added necessary casts to ClientData on a pair of calls to Tcl_PreserveKevin B Kenny2001-09-281-3/+3
| | | | and Tcl_Release.
* * Added Tcl_Preserve()dgp2001-09-281-2/+3
| | | | | and Tcl_Release() to fix segfault introduced by the 2001-09-26 changes. [Bug 465494]
* * The changes below fix [Bug #462317] where Expect tried to readandreas_kupries2001-09-271-16/+42
| | | | | | | | | | | | | | | | | | | | | | | more than was in the buffers and then blocked in the OS call as its pty channel driver provides no blockmodeproc through which the OS could be notified of blocking-behaviour. Because of this the general I/O core has to take more care than usual to preserve the semantics of non-blocking channels. * generic/tclIO.c (Tcl_ReadRaw): Do not read from the driver if the channel is non-blocking and the fileevent causing the read was generated by a timer. We do not know if there is data available from the OS. Instead of going to the OS for more and potentially blocking we simply signal EWOULDBLOCK to the higher levels to cause the system to wait for true fileevents. (GetInput): Same as before. (ChannelTimerProc): Added set and clear of CHANNEL_TIMER_FEV. * generic/tclIO.h (CHANNEL_TIMER_FEV): New flag for channels. Is set if a fileevent was generated by a timer, the channel is not blocking and the driver did not provide a blockmodeproc. In that case the I/O core has to be especially careful about going to the driver for more data.
* Changes due to TIP#49 "Tcl_OutputBuffered" from Rolf Schroedterdkf2001-09-061-46/+47
|
* fs updatevincentdarley2001-08-231-4/+8
|
* Changes from TIP#17 "Redo Tcl's filesystem"vincentdarley2001-07-311-43/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following files were impacted. * doc/Access.3: * doc/FileSystem.3: * doc/OpenFileChnl.3: * doc/file.n: * doc/glob.n: * generic/tcl.decls: * generic/tcl.h: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclDate.c: * generic/tclDecls.h: * generic/tclEncoding.c: * generic/tclFCmd.c: * generic/tclFileName.c: * generic/tclGetDate.y: * generic/tclIO.c: * generic/tclIOCmd.c: * generic/tclIOUtil.c: * generic/tclInt.decls: * generic/tclInt.h: * generic/tclIntDecls.h: * generic/tclLoad.c: * generic/tclStubInit.c: * generic/tclTest.c: * generic/tclUtil.c: * library/init.tcl: * mac/tclMacFCmd.c: * mac/tclMacFile.c: * mac/tclMacInit.c: * mac/tclMacPort.h: * mac/tclMacResource.c: * mac/tclMacTime.c: * tests/cmdAH.test: * tests/event.test: * tests/fCmd.test: * tests/fileName.test: * tests/io.test: * tests/ioCmd.test: * tests/proc-old.test: * tests/registry.test: * tests/unixFCmd.test: * tests/winDde.test: * tests/winFCmd.test: * unix/mkLinks: * unix/tclUnixFCmd.c: * unix/tclUnixFile.c: * unix/tclUnixInit.c: * unix/tclUnixPipe.c: * win/tclWinFCmd.c: * win/tclWinFile.c: * win/tclWinInit.c: * win/tclWinPipe.c