aboutsummaryrefslogtreecommitdiff
path: root/sys/clio/clepset.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/clio/clepset.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/clio/clepset.x')
-rw-r--r--sys/clio/clepset.x48
1 files changed, 48 insertions, 0 deletions
diff --git a/sys/clio/clepset.x b/sys/clio/clepset.x
new file mode 100644
index 00000000..df0dce03
--- /dev/null
+++ b/sys/clio/clepset.x
@@ -0,0 +1,48 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <clio.h>
+include "clpset.h"
+
+# CLEPSET -- Edit a pset. What exactly this operation implies depends
+# upon the CL. To the application, it means any external operation which
+# can modify the pset.
+
+procedure clepset (pp)
+
+pointer pp #I pset descriptor
+
+pointer sp, lbuf
+bool streq()
+int getlline()
+errchk flush, getlline, clc_scan
+
+begin
+ call smark (sp)
+ call salloc (lbuf, SZ_COMMAND, TY_CHAR)
+
+ # Edit pset and dump edited version back to CLIN. It is not
+ # necessary to write the pset to the CL before editing as the
+ # cache is "write-through" and any clputs will already have
+ # updated the CL version of the pset as well as the cache version.
+
+ call flush (STDOUT)
+ call fprintf (CLOUT, "eparam %s; dparam %s > %s\n")
+ call pargstr (PS_PSETNAME(pp))
+ call pargstr (PS_PSETNAME(pp))
+ call pargstr (IPCOUT)
+ call flush (CLOUT)
+
+ # Parse the new "param = value" statements returned by dparam and
+ # update the parameter cache.
+
+ while (getlline (CLIN, Memc[lbuf], SZ_COMMAND) != EOF)
+ if (streq (Memc[lbuf], IPCDONEMSG))
+ break
+ else
+ call clc_scan (Memc[lbuf])
+
+ # Delete the old parameter entries.
+ call clc_compress()
+
+ call sfree (sp)
+end