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/nsppkern/gktmfopen.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/gio/nsppkern/gktmfopen.x')
-rw-r--r-- | sys/gio/nsppkern/gktmfopen.x | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/gio/nsppkern/gktmfopen.x b/sys/gio/nsppkern/gktmfopen.x new file mode 100644 index 00000000..97ab92f9 --- /dev/null +++ b/sys/gio/nsppkern/gktmfopen.x @@ -0,0 +1,45 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <knet.h> +include <mach.h> +include <fset.h> +include "gkt.h" + +define SZ_DDSTR 256 + + +# GKT_MFOPEN -- Open the NSPP metacode output file. The device is connected +# to FIO as a binary file. Metacode output to the device will be spooled +# and then disposed of to the device when the file descriptor we return is +# later closed. + +int procedure gkt_mfopen (tty, mode) + +pointer tty # pointer to graphcap entry for device +int mode # access mode + +int fd +pointer sp, ddstr +int fopnbf(), ttygets() +extern zopnpl(), zardpl(), zawrpl(), zawtpl(), zsttpl(), zclspl() +errchk fopnbf + +begin + call smark (sp) + call salloc (ddstr, SZ_DDSTR, TY_CHAR) + + # The DD string is used to pass device dependent information to the + # NSPP graphics device driver. + + if (ttygets (tty, "DD", Memc[ddstr], SZ_DDSTR) <= 0) + call error (1, "nsppkern: missing DD parameter in graphcap") + + fd = fopnbf (Memc[ddstr], mode, + zopnpl, zardpl, zawrpl, zawtpl, zsttpl, zclspl) + + # Set the FIO buffer size to the size of a metafile record. + call fseti (fd, F_BUFSIZE, SZ_MFRECORD) + + call sfree (sp) + return (fd) +end |