diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2023-11-20 13:32:47 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2023-11-20 13:32:47 (GMT) |
commit | 88a32b8959860e8891f73548cc49b33749949a8f (patch) | |
tree | 4430b7baf3d0eb3bd90404e69470d8fb730978de /generic/tclIO.c | |
parent | ee8ac648cb65c6e491229e0192fa5b7b4b6e3d06 (diff) | |
parent | c3de06ef3212fee8a8d4b4fed7ec8b2fc2b8273d (diff) | |
download | tcl-88a32b8959860e8891f73548cc49b33749949a8f.zip tcl-88a32b8959860e8891f73548cc49b33749949a8f.tar.gz tcl-88a32b8959860e8891f73548cc49b33749949a8f.tar.bz2 |
Merge core-8-branch
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 884f4a8..3b36457 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -4934,7 +4934,7 @@ Tcl_GetsObj( * two times, as gs.bytesWrote is not 0 on the first pass. This feels * once to much, as the data is anyway not used. */ - + /* Set eol to the position that caused the encoding error, and then * continue to gotEOL, which stores the data that was decoded * without error to objPtr. This allows the caller to do something @@ -7616,6 +7616,33 @@ Tcl_Eof( return GotFlag(statePtr, CHANNEL_EOF) ? 1 : 0; } + +/* + *---------------------------------------------------------------------- + * + * TclChannelGetBlockingMode -- + * + * Returns 1 if the channel is in blocking mode (default), 0 otherwise. + * + * Results: + * 1 or 0, always. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TclChannelGetBlockingMode( + Tcl_Channel chan) +{ + ChannelState *statePtr = ((Channel *) chan)->state; + /* State of real channel structure. */ + + return GotFlag(statePtr, CHANNEL_NONBLOCKING) ? 0 : 1; +} + /* *---------------------------------------------------------------------- * |