diff options
Diffstat (limited to 'noao/twodspec/apextract/apalloc.x')
-rw-r--r-- | noao/twodspec/apextract/apalloc.x | 34 |
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 |