aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/stdgraph/stgoutput.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/stdgraph/stgoutput.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
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