diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/twodspec/apextract/apalloc.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
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 |