other versions
- wheezy 8.4.19-5
conflicting packages
Tcl_GetStdChannel(3tcl) | Tcl Library Procedures | Tcl_GetStdChannel(3tcl) |
NAME¶
Tcl_GetStdChannel, Tcl_SetStdChannel - procedures for retrieving and replacing the standard channelsSYNOPSIS¶
#include <tcl.h>Tcl_Channel Tcl_GetStdChannel(type)Tcl_SetStdChannel(channel, type)
ARGUMENTS¶
- int type (in)
- The identifier for the standard channel to retrieve or modify. Must be one of TCL_STDIN, TCL_STDOUT, or TCL_STDERR.
- Tcl_Channel channel (in)
- The channel to use as the new value for the specified
standard channel.
DESCRIPTION¶
Tcl defines three special channels that are used by various I/O related commands if no other channels are specified. The standard input channel has a channel name of stdin and is used by read and gets. The standard output channel is named stdout and is used by puts. The standard error channel is named stderr and is used for reporting errors. In addition, the standard channels are inherited by any child processes created using exec or open in the absence of any other redirections. The standard channels are actually aliases for other normal channels. The current channel associated with a standard channel can be retrieved by calling Tcl_GetStdChannel with one of TCL_STDIN, TCL_STDOUT, or TCL_STDERR as the type. The return value will be a valid channel, or NULL. A new channel can be set for the standard channel specified by type by calling Tcl_SetStdChannel with a new channel or NULL in the channel argument. If the specified channel is closed by a later call to Tcl_Close, then the corresponding standard channel will automatically be set to NULL. If a non-NULL value for channel is passed to Tcl_SetStdChannel, then that same value should be passed to Tcl_RegisterChannel, like so:Tcl_RegisterChannel(NULL, channel);
SEE ALSO¶
Tcl_Close(3tcl), Tcl_CreateChannel(3tcl), Tcl_Main(3tcl), tclsh(1)KEYWORDS¶
standard channel, standard input, standard output, standard error7.5 | Tcl |