aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/photcal/mctable/mctfree.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 /noao/digiphot/photcal/mctable/mctfree.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctfree.x')
-rw-r--r--noao/digiphot/photcal/mctable/mctfree.x20
1 files changed, 20 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctfree.x b/noao/digiphot/photcal/mctable/mctfree.x
new file mode 100644
index 00000000..f7f3e2c0
--- /dev/null
+++ b/noao/digiphot/photcal/mctable/mctfree.x
@@ -0,0 +1,20 @@
+include "../lib/mctable.h"
+
+
+# MCT_FREE - Free table structure and data buffer associated with it.
+
+procedure mct_free (table)
+
+pointer table # table descriptor
+
+begin
+ # Check pointer and magic number.
+ if (table == NULL)
+ call error (0, "mct_free: Null table pointer")
+ if (MCT_MAGIC (table) != MAGIC)
+ call error (0, "mct_free: Bad magic number")
+
+ # Free the table.
+ call mfree (MCT_DATA (table), MCT_TYPE (table))
+ call mfree (table, TY_STRUCT)
+end