aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/plopen.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/plio/plopen.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/plio/plopen.x')
-rw-r--r--sys/plio/plopen.x30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/plio/plopen.x b/sys/plio/plopen.x
new file mode 100644
index 00000000..6510ebe5
--- /dev/null
+++ b/sys/plio/plopen.x
@@ -0,0 +1,30 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <plset.h>
+include <plio.h>
+
+# PL_OPEN -- Open a mask. If the input buffer pointer is NULL an inactive
+# mask descriptor is allocated, otherwise the pointer is taken to point to
+# an encoded mask, which is decoded and loaded to create an active descriptor.
+
+pointer procedure pl_open (smp)
+
+pointer smp #I stored mask pointer or NULL
+
+pointer pl
+errchk calloc, pl_load
+
+begin
+ # Allocate and initialize an inactive descriptor.
+ call calloc (pl, LEN_PLDES, TY_STRUCT)
+
+ call amovki (1, PL_PLANE(pl,1), PL_MAXDIM)
+ PL_MAGIC(pl) = PL_MAGICVAL
+ PL_LLINC(pl) = PL_STARTINC
+
+ # Load the saved mask, if any.
+ if (smp != NULL)
+ call pl_load (pl, smp)
+
+ return (pl)
+end