aboutsummaryrefslogtreecommitdiff
path: root/sys/qpoe/gen/qpaddc.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/gen/qpaddc.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/gen/qpaddc.x')
-rw-r--r--sys/qpoe/gen/qpaddc.x29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/qpoe/gen/qpaddc.x b/sys/qpoe/gen/qpaddc.x
new file mode 100644
index 00000000..64264e20
--- /dev/null
+++ b/sys/qpoe/gen/qpaddc.x
@@ -0,0 +1,29 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "../qpoe.h"
+
+# QP_ADD -- Set the value of a parameter, creating the parameter if it does
+# not already exist. This works for the most common case of simple scalar
+# valued header parameters, although any parameter may be written into it it
+# already exists. Additional control over the parameter attributes is possible
+# if the parameter is explicitly created with qp_addf before being written into.
+
+procedure qp_addc (qp, param, value, comment)
+
+pointer qp #I QPOE descriptor
+char param[ARB] #I parameter name
+char value #I parameter value
+char comment[ARB] #I comment field, if creating parameter
+
+char datatype[1]
+errchk qp_accessf, qp_addf
+string dtypes SPPTYPES
+int qp_accessf()
+
+begin
+ if (qp_accessf (qp, param) == NO) {
+ datatype[1] = dtypes[TY_CHAR]
+ call qp_addf (qp, param, datatype, 1, comment, 0)
+ }
+ call qp_putc (qp, param, value)
+end