aboutsummaryrefslogtreecommitdiff
path: root/sys/qpoe/qpsavewcs.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/qpoe/qpsavewcs.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/qpsavewcs.x')
-rw-r--r--sys/qpoe/qpsavewcs.x35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/qpoe/qpsavewcs.x b/sys/qpoe/qpsavewcs.x
new file mode 100644
index 00000000..35293d62
--- /dev/null
+++ b/sys/qpoe/qpsavewcs.x
@@ -0,0 +1,35 @@
+include "qpoe.h"
+
+# QP_SAVEWCS -- Save the given WCS in the QPOE header, as a variable length
+# binary array (machine independent) in the default WCS parameter QPWCS.
+
+procedure qp_savewcs (qp, mw)
+
+pointer qp #I QPOE descriptor
+pointer mw #I MWCS descriptor
+
+pointer bp
+int buflen, nchars
+int mw_save(), qp_accessf()
+errchk mw_save, qp_accessf, qp_addf, qp_write
+string s_opaque "opaque"
+string s_qpwcs QPWCS
+
+begin
+ bp = NULL
+ buflen = 0
+
+ # Encode the WCS as a machine independent binary array.
+ nchars = mw_save (mw, bp, buflen)
+
+ # Save it in the QPOE header.
+ if (nchars > 0) {
+ if (qp_accessf (qp, s_qpwcs) == NO)
+ call qp_addf (qp, s_qpwcs,
+ s_opaque, 0, "World coordinate system", SF_INHERIT)
+ call qp_write (qp, s_qpwcs, Memc[bp], nchars, 1, s_opaque)
+ }
+
+ if (bp != NULL)
+ call mfree (bp, TY_CHAR)
+end