aboutsummaryrefslogtreecommitdiff
path: root/sys/qpoe/qpdeletef.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/qpdeletef.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/qpdeletef.x')
-rw-r--r--sys/qpoe/qpdeletef.x35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/qpoe/qpdeletef.x b/sys/qpoe/qpdeletef.x
new file mode 100644
index 00000000..b7c41189
--- /dev/null
+++ b/sys/qpoe/qpdeletef.x
@@ -0,0 +1,35 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <syserr.h>
+include "qpoe.h"
+
+# QP_DELETEF -- Delete a header parameter. It is an error if the named header
+# parameter does not exist. Deletions are permanent once the datafile is
+# updated.
+
+procedure qp_deletef (qp, param)
+
+pointer qp #I QPOE descriptor
+char param[ARB] #I parameter name
+
+pointer sym
+pointer qp_gpsym()
+errchk qp_gpsym, syserrs
+
+begin
+ # Access the named parameter.
+ sym = qp_gpsym (qp, param)
+ if (sym == NULL)
+ call syserrs (SYS_QPUKNPAR, param)
+ else if (and (S_FLAGS(sym), SF_DELETED) != 0)
+ return
+
+ # If the parameter value is stored in its own lfile, delete it.
+ if (S_LFILE(sym) > LF_STATICPARS)
+ call fm_lfdelete (QP_FM(qp), S_LFILE(sym))
+
+ # Set the delete bit in the symbol descriptor.
+ S_FLAGS(sym) = or (S_FLAGS(sym), SF_DELETED)
+
+ QP_MODIFIED(qp) = YES
+end