Tcl_GetStdChannel (3)
procedures for retrieving and replacing the standard channels
SYNOPSIS
#include <tcl.h>
Tcl_Channel
Tcl_GetStdChannel(type)
Tcl_SetStdChannel(channel, type)
ARGUMENTS
Tcl_Channel channel in
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 Tcl_GetStdChannel is called before Tcl_SetStdChannel, Tcl will
construct a new channel to wrap the appropriate platform-specific standard
file handle. If Tcl_SetStdChannel is called before
Tcl_GetStdChannel, then the default channel will not be created.
If one of the standard channels is set to NULL, either by calling
Tcl_SetStdChannel with a null channel argument, or by calling
Tcl_Close on the channel, then the next call to Tcl_CreateChannel
will automatically set the standard channel with the newly created channel. If
more than one standard channel is NULL, then the standard channels will be
assigned starting with standard input, followed by standard output, with
standard error being last.
SEE ALSO
KEYWORDS
standard channel, standard input, standard output, standard error
'\"
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: @(#) $Id: StringObj.3,v 1.2 1998/09/14 18:39:50 stanton Exp $
'\"
'\" The definitions below are for supplemental macros used in Tcl/Tk
'\" manual entries.
'\"
'\" .AP type name in/out ?indent?
'\" Start paragraph describing an argument to a library procedure.
'\" type is type of argument (int, etc.), in/out is either "in", "out",
'\" or "in/out" to describe whether procedure reads or modifies arg,
'\" and indent is equivalent to second arg of .IP (shouldn't ever be
'\" needed; use .AS below instead)
'\"
'\" .AS ?type? ?name?
'\" Give maximum sizes of arguments for setting tab stops. Type and
'\" name are examples of largest possible arguments that will be passed
'\" to .AP later. If args are omitted, default tab stops are used.
'\"
'\" .BS
'\" Start box enclosure. From here until next .BE, everything will be
'\" enclosed in one large box.
'\"
'\" .BE
'\" End of box enclosure.
'\"
'\" .CS
'\" Begin code excerpt.
'\"
'\" .CE
'\" End code excerpt.
'\"
'\" .VS ?version? ?br?
'\" Begin vertical sidebar, for use in marking newly-changed parts
'\" of man pages. The first argument is ignored and used for recording
'\" the version when the .VS was added, so that the sidebars can be
'\" found and removed when they reach a certain age. If another argument
'\" is present, then a line break is forced before starting the sidebar.
'\"
'\" .VE
'\" End of vertical sidebar.
'\"
'\" .DS
'\" Begin an indented unfilled display.
'\"
'\" .DE
'\" End of indented unfilled display.
'\"
'\" .SO
'\" Start of list of standard options for a Tk widget. The
'\" options follow on successive lines, in four columns separated
'\" by tabs.
'\"
'\" .SE
'\" End of list of standard options for a Tk widget.
'\"
'\" .OP cmdName dbName dbClass
'\" Start of description of a specific option. cmdName gives the
'\" option's name as specified in the class command, dbName gives
'\" the option's name in the option database, and dbClass gives
'\" the option's class in the option database.
'\"
'\" .UL arg1 arg2
'\" Print arg1 underlined, then print arg2 normally.
'\"
'\" RCS: @(#) $Id: man.macros,v 1.2 1998/09/14 18:39:54 stanton Exp $
'\"
'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
t .wh -1.3i ^B
^l \n(.l
b
'\" # Start an argument description
AP
!"\\$4"" .TP \\$4
\{\
!"\\$2"" .TP \\n()Cu
.TP 15
|