Seth Woolley's Man Viewer

Tcl_SetStdChannel(3) - Tcl_GetStdChannel, Tcl_SetStdChannel - procedures for retrieving and replacing the standard channels - man 3 Tcl_SetStdChannel

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

Tcl_GetStdChannel(3)        Tcl Library Procedures        Tcl_GetStdChannel(3)


       Tcl_GetStdChannel,  Tcl_SetStdChannel  -  procedures for retrieving and
       replacing the standard channels

       #include <tcl.h>


       Tcl_SetStdChannel(channel, type)

       int           type      (in(1,8))      The identifier for the standard chan-
                                         nel  to  retrieve or modify.  Must be
                                         one  of  TCL_STDIN,  TCL_STDOUT,   or

       Tcl_Channel   channel   (in(1,8))      The  channel  to use as the new value
                                         for the specified standard channel.

       Tcl defines three special channels that are used by various I/O related
       commands  if(3,n) no other channels are specified.  The standard input chan-
       nel has a channel name of stdin and is used  by  read(2,n,1 builtins)  and  gets(3,n).   The
       standard output channel is named(5,8) stdout and is used by puts(3,n).  The stan-
       dard error(8,n) channel is named(5,8) stderr and is used  for  reporting  errors.
       In addition, the standard channels are inherited by any child processes
       created using exec(3,n,1 builtins) or open(2,3,n) in(1,8) 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

       A new channel can be set(7,n,1 builtins) for the standard channel specified by type  by
       calling  Tcl_SetStdChannel  with  a  new channel or NULL in(1,8) 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(7,n,1 builtins) to NULL.

       If Tcl_GetStdChannel is called before Tcl_SetStdChannel, Tcl will  con-
       struct a new channel to wrap the appropriate platform-specific standard
       file(1,n) 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(7,n,1 builtins) 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 automati-
       cally set(7,n,1 builtins) 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(8,n) being last.

       See Tcl_StandardChannels for a general treatise about standard channels
       and the behaviour of the Tcl library with regard to them.

       Tcl_Close(3), Tcl_CreateChannel(3), Tcl_Main(3), tclsh(1)

       standard channel, standard input, standard output, standard error(8,n)

Tcl                                   7.5                 Tcl_GetStdChannel(3)

References for this manual (incoming links)