aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/photcal/mctable/mctreset.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/mctreset.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctreset.x')
-rw-r--r--noao/digiphot/photcal/mctable/mctreset.x28
1 files changed, 28 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctreset.x b/noao/digiphot/photcal/mctable/mctreset.x
new file mode 100644
index 00000000..c90959d2
--- /dev/null
+++ b/noao/digiphot/photcal/mctable/mctreset.x
@@ -0,0 +1,28 @@
+include "../lib/mctable.h"
+
+
+# MCT_RESET - Reset table counters, and set all table values to INDEF.
+
+procedure mct_reset (table)
+
+pointer table # table descriptor
+
+errchk mct_indef()
+
+begin
+ # Check pointer and magic number.
+ if (table == NULL)
+ call error (0, "mct_reset: Null table pointer")
+ if (MCT_MAGIC (table) != MAGIC)
+ call error (0, "mct_reset: Bad magic number")
+
+ # Clear table counters.
+ MCT_NPCOLS (table) = 0
+ MCT_NPROWS (table) = 0
+ MCT_NGCOLS (table) = 0
+ MCT_NGROWS (table) = 0
+
+ # Clear table buffer.
+ call mct_indef (table, MCT_DATA (table),
+ MCT_NPROWS (table) * MCT_NPCOLS (table))
+end