diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/gio/gki/gkiredir.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/gio/gki/gkiredir.x')
-rw-r--r-- | sys/gio/gki/gkiredir.x | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/gio/gki/gkiredir.x b/sys/gio/gki/gkiredir.x new file mode 100644 index 00000000..3e204bf0 --- /dev/null +++ b/sys/gio/gki/gkiredir.x @@ -0,0 +1,34 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <config.h> +include <gki.h> + +# GKI_REDIR -- Redirect (or set) a graphics stream. All i/o will be to the +# file FD until the graphics stream is reset in another call to GKI_REDIR. +# The current encoded value for a stream is retured so that a subsequent call +# (with FD=0) may be made to undo the redirection. A call with FD<0 may be +# used to stat the stream without changing anything. NOTE: This procedure +# (or either GKI_INLINE_KERNEL or GKI_SUBKERNEL) must be called before using +# the GKI package for a graphics stream. + +procedure gki_redir (stream, fd, old_fd, old_type) + +int stream # graphics stream to be redirected +int fd # file to be connected to the stream +int old_fd, old_type # old values for later restoration + +include "gki.com" + +begin + if (fd == NULL) { + gk_type[stream] = old_type + gk_fd[stream] = old_fd + } else { + old_type = gk_type[stream] + old_fd = gk_fd[stream] + if (fd > 0) { + gk_type[stream] = TY_FILE + gk_fd[stream] = fd + } + } +end |