aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/sgikern/sgiclose.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/gio/sgikern/sgiclose.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/gio/sgikern/sgiclose.x')
-rw-r--r--sys/gio/sgikern/sgiclose.x30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/gio/sgikern/sgiclose.x b/sys/gio/sgikern/sgiclose.x
new file mode 100644
index 00000000..380cd01f
--- /dev/null
+++ b/sys/gio/sgikern/sgiclose.x
@@ -0,0 +1,30 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "sgi.h"
+
+# SGI_CLOSE -- Close the SGI translation kernel. Close the spool file so
+# the output is finally plotted. Free up storage.
+
+procedure sgi_close()
+
+include "sgi.com"
+
+begin
+ # If there is anything in the metafile, flush it and add a frame
+ # advance if required for the device.
+
+ if (g_ndraw > 0 || g_nframes > 0) {
+ # Does this device require a frame advance at end of metafile?
+ if (SGI_ENDFRAME(g_kt) == YES)
+ call sgk_frame (g_out)
+ }
+
+ # Close output metafile, disposing of it to the host system.
+ call sgk_close (g_out)
+
+ # Free kernel data structures.
+ call mfree (SGI_SBUF(g_kt), TY_CHAR)
+ call mfree (g_kt, TY_STRUCT)
+
+ g_kt = NULL
+end