aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/stdgraph/stgoutput.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/stdgraph/stgoutput.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/gio/stdgraph/stgoutput.x')
-rw-r--r--sys/gio/stdgraph/stgoutput.x28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/gio/stdgraph/stgoutput.x b/sys/gio/stdgraph/stgoutput.x
new file mode 100644
index 00000000..098af6e7
--- /dev/null
+++ b/sys/gio/stdgraph/stgoutput.x
@@ -0,0 +1,28 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "stdgraph.h"
+
+# STG_OUTPUT2 -- Encode two arguments using the program given and write the
+# encoded character string to the output file.
+
+procedure stg_output2 (fd, program, arg1, arg2)
+
+int fd # output file
+char program[ARB] # encoder program defining encoding
+int arg1 # argument to be placed in register 1
+int arg2 # argument to be placed in register 2
+
+int stg_encode()
+include "stdgraph.com"
+
+begin
+ # Set up encoder.
+ g_reg[1] = arg1
+ g_reg[2] = arg2
+ g_reg[E_IOP] = 1
+
+ # Encode the output string and write the encoded string to the output
+ # file.
+ if (stg_encode (g_xy, g_mem, g_reg) == OK)
+ call write (fd, g_mem, g_reg[E_IOP] - 1)
+end