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 /sys/mwcs/mwclose.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/mwcs/mwclose.x')
-rw-r--r-- | sys/mwcs/mwclose.x | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/mwcs/mwclose.x b/sys/mwcs/mwclose.x new file mode 100644 index 00000000..441a78c2 --- /dev/null +++ b/sys/mwcs/mwclose.x @@ -0,0 +1,36 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <syserr.h> +include <error.h> +include "mwcs.h" + +# MW_CLOSE -- Close a MWCS descriptor and deallocate all resources used +# by the descriptor. Any CTRAN descriptors which have been opened on +# the MWCS are automatically closed if not already manually closed by +# the application. + +procedure mw_close (mw) + +pointer mw #U pointer to MWCS descriptor + +int i +pointer ct + +begin + # Free any still allocated CTRAN descriptors. + do i = 1, MAX_CTRAN { + ct = MI_CTRAN(mw,i) + if (ct != NULL) + iferr (call mw_ctfree (ct)) + call erract (EA_WARN) + } + + # Free the string and data buffers. + if (MI_SBUF(mw) != NULL) + call mfree (MI_SBUF(mw), TY_CHAR) + if (MI_DBUF(mw) != NULL) + call mfree (MI_DBUF(mw), TY_DOUBLE) + + # Free the main descriptor. + call mfree (mw, TY_STRUCT) +end |