aboutsummaryrefslogtreecommitdiff
path: root/noao/twodspec/apextract/apalloc.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 /noao/twodspec/apextract/apalloc.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/twodspec/apextract/apalloc.x')
-rw-r--r--noao/twodspec/apextract/apalloc.x34
1 files changed, 34 insertions, 0 deletions
diff --git a/noao/twodspec/apextract/apalloc.x b/noao/twodspec/apextract/apalloc.x
new file mode 100644
index 00000000..086db650
--- /dev/null
+++ b/noao/twodspec/apextract/apalloc.x
@@ -0,0 +1,34 @@
+include "apertures.h"
+
+# AP_ALLOC -- Allocate and initialize an aperture structure.
+
+procedure ap_alloc (ap)
+
+pointer ap # Aperture
+
+begin
+ call calloc (ap, AP_LEN, TY_STRUCT)
+ AP_TITLE(ap) = NULL
+ AP_CV(ap) = NULL
+ AP_IC(ap) = NULL
+ AP_SELECT(ap) = YES
+end
+
+
+# AP_FREE -- Free an aperture structure and related CURFIT structures.
+
+procedure ap_free (ap)
+
+pointer ap # Aperture
+
+begin
+ if (ap != NULL) {
+ if (AP_TITLE(ap) != NULL)
+ call mfree (AP_TITLE(ap), TY_CHAR)
+ if (AP_CV(ap) != NULL)
+ call cvfree (AP_CV(ap))
+ if (AP_IC(ap) != NULL)
+ call ic_closer (AP_IC(ap))
+ call mfree (ap, TY_STRUCT)
+ }
+end