aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/nsppkern/gktmfopen.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/gio/nsppkern/gktmfopen.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/gio/nsppkern/gktmfopen.x')
-rw-r--r--sys/gio/nsppkern/gktmfopen.x45
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