summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
Commit message (Collapse)AuthorAgeFilesLines
* Missed a spot.dkf2010-03-201-2/+2
|
* Allow [fcopy] to move more than 2GB per call. Frederic Bonnet identified issue.dkf2010-03-201-38/+48
|
* * generic/tclIORTrans.c (ReflectInput, ReflectOutput,andreas_kupries2010-03-171-1/+29
| | | | | | | | | | | | | ReflectSeekWide): [Bug 2921116]: Added missing TclEventuallyFree calls for preserved ReflectedTransform* structures. Reworked ReflectInput to preserve the structure for its whole life, not only in InvokeTclMethod. * generic/tclIO.c (Tcl_GetsObj): [Bug 2921116]: Regenerate topChan, may have been changed by a self-modifying transformation. * tests/ioTrans/test (iortrans-4.8, iortrans-4.9, iortrans-5.11, iortrans-7.4, iortrans-8.3): New test cases.
* More tidying up (whitespace, spelling, useless parentheses, useless casts)dkf2010-02-241-37/+45
|
* * generic/tclIO.c (CreateScriptRecord): [Bug 2918110]: Initializeandreas_kupries2010-01-181-6/+23
| | | | | | | | the EventScriptRecord (esPtr) fully before handing it to Tcl_CreateChannelHandler for registration. Otherwise a reflected channel calling 'chan postevent' (== Tcl_NotifyChannel) in its 'watchProc' will cause the function 'TclChannelEventScriptInvoker' to be run on an uninitialized structure.
* Killed c99/c++ comments left in by the IO patch.andreas_kupries2009-12-091-6/+1
|
* * generic/tclIO.c: [Bug 2901998]: Applied Alexandre Ferrieux'sandreas_kupries2009-12-091-5/+48
| | | | | | patch fixing the inconsistent buffered I/O. Tcl's I/O now flushes buffered output before reading, discards buffered input before writing, etc.
* Fix [Bug 2849797]: channel name inconsistencies as suggested by DKFnijtmans2009-11-181-5/+11
| | | | | | minor *** POTENTIAL INCOMPATIBILITY *** because Tcl_CreateChannel() and its derivatives, now sometimes ignore their "chanName" argument.
* * generic/tclIO.c (CopyData): [Bug 2895565]. Dropped bogosityandreas_kupries2009-11-121-9/+12
| | | | | | * tests/io.test: which used the number of _written_ bytes or character to update the counters for the read bytes/characters. New test io-53.11. This is a forward port from the 8.5 branch.
* Fix [Bug 2888099] (close discards ENOSPC error) by saving the errnoferrieux2009-11-101-2/+17
| | | | | from the first of two FlushChannel()s. Uneasy to test; might need specific channel drivers. Four-hands with aku.
* Some small bits of tidying up.dkf2009-11-091-16/+14
|
* * generic/tclIO.c (FlushChannel): Skip OutputProc for low-levelandreas_kupries2009-10-231-2/+6
| | | | | | 0-length writes. When closing pipes which have already been closed not skipping leads to spurious SIG_PIPE signals. Reported by Mikhail Teterin <mi+thun@aldan.algebra.com>.
* * generic/tclIO.c: Revised ReadChars and FilterInputBytes routinesdgp2009-10-191-17/+27
| | | | | | | to permit reads to continue up to the string limits of Tcl values. Before revisions, large read attempts could panic when as little as half the limiting value length was reached. [Patch 2107634] Thanks to Sean Morrison and Bob Parker for their roles in the fix.
* * generic/tclDictObj.c: Updated freeIntRepProc routines sodgp2009-09-301-1/+2
| | | | | | | | | | | | | | | * generic/tclExecute.c: that they set the typePtr field to * generic/tclIO.c: NULL so that the Tcl_Obj is not left * generic/tclIndexObj.c: in an inconsistent state. * generic/tclInt.h: [Bug 2857044] * generic/tclListObj.c: * generic/tclNamesp.c: * generic/tclOOCall.c: * generic/tclObj.c: * generic/tclPathObj.c: * generic/tclProc.c: * generic/tclRegexp.c: * generic/tclStringObj.c:
* * generic/tclExecute.c: fix potential uninitialized variable use anddas2009-09-071-1/+2
| | | | | | | | | | | | * generic/tclFCmd.c: null dereference flagged by clang static * generic/tclProc.c: analyzer. * generic/tclTimer.c: * generic/tclUtf.c: * generic/tclExecute.c: silence false positives from clang static * generic/tclIO.c: analyzer about potential null dereference. * generic/tclScan.c: * generic/tclCompExpr.c:
* * generic/tclIO.c (Tcl_GetChannelHandle): Do not crash forandreas_kupries2009-07-231-1/+9
| | | | | | | | * generic/tclPipe.c (FileForRedirect): getHandleProc == NULL, this is allowed. Provide a nice error message in the bypass area. Updated caller to check the bypass for a mesage. This fixes the bug [Bug 2826248] reported by Andy Sonnenburg <andy22286@users.sourceforge.net>
* - eliminate some unnessary type castsnijtmans2009-02-101-8/+8
| | | | | - some internal const decorations - spacing
* Style fixes (unfouling whitespace, sorting comments, removing useless casts, ↵dkf2009-01-091-33/+31
| | | | etc.)
* * generic/tclIO.c (Tcl_CloseEx,CloseWrite,CloseChannelPart,ChanCloseHalf):andreas_kupries2008-12-181-18/+247
| | | | | | | | | | | | | Rewrite the half-close to properly flush the channel, like is done for a full close, going through FlushChannel, and using the flag BG_FLUSH_SCHEDULED (async flush during close). New functions CloseWrite, CloseChannelPart, new flag CHANNEL_CLOSEDWRITE. * tests/chanio.test (chanio-28.[67]): Reactivated these tests. Replaced tclsh -> [interpreter] to get correct executable for the pipe process, and added after cancel to kill the fail timers when we are done. Removed the explicits calls to [flush], now that [close] handles this correctly.
* Add missing flush for half-close of the write sideferrieux2008-12-181-1/+16
|
* TIP #332 IMPLEMENTATION - Half-Close for Bidirectional Channelsferrieux2008-12-181-1/+126
|
* * generic/tclIO.c (SetChannelFromAny and related): Modified theandreas_kupries2008-12-111-2/+15
| | | | | | | | * tests/io.test: internal representation of the tclChannelType to contain not only the ChannelState pointer, but also a reference to the interpreter it was made in. Invalidate and recompute the internal representation when it is used in a different interpreter (Like cmdName intrep's). Added testcase. [Bug 2407783].
* TIP #337 IMPLEMENTATIONdgp2008-12-091-3/+3
| | | | | | | | | | | | | | | | | | | * doc/BackgdErr.3: Converted internal routine * doc/interp.n: TclBackgroundException() into public routine * generic/tcl.decls: Tcl_BackgroundException(). * generic/tclEvent.c: * generic/tclInt.decls: * generic/tclDecls.h: make genstubs * generic/tclIntDecls.h: * generic/tclStubInit.c: * generic/tclIO.c: Update callers. * generic/tclIOCmd.c: * generic/tclInterp.c: * generic/tclTimer.c: *** POTENTIAL INCOMPATIBILITY only for extensions using the converted internal routine ***
* A bit more readability refactoring.dkf2008-12-091-278/+294
|
* * generic/tclIO.c (TclFinalizeIOSubsystem): Replaced Alexandreandreas_kupries2008-12-021-3/+3
| | | | | Ferrieux's first patch for [Bug 2270477] with a gentler version, also supplied by him.
* Eliminate 3 calls to Tcl_SetResult, asnijtmans2008-11-251-9/+2
| | | | | examples how it should have been done. purpose: contribute in the TIP #340 discussion.
* * generic/tclIO.c (TclFinalizeIOSubsystem): Applied Alexandreandreas_kupries2008-11-251-2/+2
| | | | | Ferrieux's patch for [Bug 2270477] to prevent infinite looping during finalization of channels not bound to interpreters.
* Fix IsChannelExisting name comparison [Bug 2333466]ferrieux2008-11-231-2/+2
|
* add "-Wno-implicit-int" for gcc, as on UNIXnijtmans2008-11-061-3/+3
| | | | eliminate an 'array index out of bounds' warning on HP-UX'
* Style improvements - invoking callbacks without visual junk.dkf2008-10-261-50/+48
|
* Add "const" to many internalnijtmans2008-10-161-2/+2
| | | | | const tables. No functional or API change.
* * doc/ChnlStack.3: CONSTified the typePtr argumentnijtmans2008-10-041-5/+5
| | | | | | | | | | | * doc/CrtChannel.3: of Tcl_CreateChannel and Tcl_StackChannel * generic/tcl.decls and the return value of Tcl_GetChannelType * generic/tcl.h * generic/tclIO.h * generic/tclIO.c * ChangeLog * generic/tclDecls.h: regenerated This change complies with TIP #27.
* * win/tclWinChan.c (FileWideSeekProc): Accepted a patch byandreas_kupries2008-05-231-5/+8
| | | | | | | | | | | | Alexandre Ferrieux <ferrieux@users.sourceforge.net> to fix the [Bug 1965787]. 'tell' now works for locations > 2 GB as well instead of going negative. * generic/tclIO.c (Tcl_SetChannelBufferSize): Accepted a patch by * tests/io.test: Alexandre Ferrieux <ferrieux@users.sourceforge.net> * tests/chanio.test: to fix the [Bug 1969953]. Buffersize outside of the supported range are now clipped to nearest boundary instead of ignored.
* * generic/tclIO.c (CopyData): Applied another patch by Alexandreandreas_kupries2008-04-151-6/+8
| | | | | | | * io.test (io-53.8a): Ferrieux <ferrieux@users.sourceforge.net>, * chanio.test (chan-io-53.8a): to shift EOF handling to the async part of the command if a callback is specified, should the channel be at EOF already when fcopy is called. Testcase by myself.
* * tests/io.test (io-53.10): Testcase for bi-directionaly fcopy.andreas_kupries2008-04-071-27/+39
| | | | | | | | * tests/chanio.test: * generic/tclIO.c: Additional changes to data structures for fcopy * generic/tclIO.h: and channels to perform proper cleanup in case of a channel having two background copy operations running as is now possible.
* * generic/tclIO.c (BUSY_STATE, CheckChannelErrors,andreas_kupries2008-04-071-4/+8
| | | | | | TclCopyChannel): New macro, and the places using it. This change allows for bi-directional fcopy on channels. Thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for the patch.
* * generic/tclIO.c (CopyData): Applied patch [Bug 1932639] toandreas_kupries2008-04-031-14/+24
| | | | | | * tests/io.test: prevent fcopy from calling -command synchronously * tests/chanio.test: the first time. Thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for report and patch.
* * generic/tclIO.c (CopyData): Applied patch for the fcopy problemandreas_kupries2008-04-021-2/+2
| | | | | | | [Bug 780533], with many thanks to Alexandre Ferrieux <ferrieux@users.sourceforge.net> for tracking it down and providing a solution. Still have to convert his test script into a proper test case.
* * generic/tclIO.c (TclGetsObjBinary): operate on topmost channel.hobbs2008-01-201-7/+13
| | | | [Bug 1869405] (Ficicchia)
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* make tclChannelType static (fix 'make checkstubs')das2007-12-101-2/+2
|
* * tests/io.test, tests/chanio.test (io-73.1): Make sure to invalidatehobbs2007-12-091-6/+8
| | | | | * generic/tclIO.c (SetChannelFromAny): internal rep only after validating channel rep. [Bug 1847044]
* * generic/tclIO.h: Create Tcl_Obj for Tcl channels to reducehobbs2007-12-051-41/+283
| | | | | | | * generic/tclIO.c: overhead in lookup by Tcl_GetChannel. New * generic/tclIOCmd.c: TclGetChannelFromObj for internal use. * generic/tclIO.c (WriteBytes, WriteChars): add opt check to avoid EOL translation when not linebuffered or using lf. [Bug 1845092]
* * generic/tclIO.c: Simplify test and improve accuracy of errordgp2007-11-281-5/+4
| | | | message in latest changes.
* -eofchar must support no eofchar.patthoyts2007-11-281-3/+3
|
* * doc/chan.n: "Fix" the limitation on channel -eofchardgp2007-11-271-13/+18
| | | | | | | * doc/fconfigure.n: values to single byte characters by documenting * generic/tclIO.c: it and making it fail loudly. Thanks to * tests/chan.test: Stuart Cassoff for contributing the fix. [Bug 800753]
* Simplifications (fewer casts, less manual bit twiddling)dkf2007-11-191-192/+191
|
* [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-9/+9
| | | | objTypes.
* fix (unsigned char*) vs. (char*) warningsdas2007-11-081-2/+2
|
* (DoWriteChars): special case for 1-byte channel write.hobbs2007-11-071-6/+11
|