aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/photcal/mctable/mctclear.gx
diff options
context:
space:
mode:
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctclear.gx')
-rw-r--r--noao/digiphot/photcal/mctable/mctclear.gx33
1 files changed, 33 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctclear.gx b/noao/digiphot/photcal/mctable/mctclear.gx
new file mode 100644
index 00000000..58eacba9
--- /dev/null
+++ b/noao/digiphot/photcal/mctable/mctclear.gx
@@ -0,0 +1,33 @@
+include "../lib/mctable.h"
+
+
+$for (csilrdxp)
+# MCT_CLEAR - Clear all table values with given value. Do not reset any
+# table counter.
+
+procedure mct_clear$t (table, value)
+
+pointer table # table descriptor
+PIXEL value # value
+
+begin
+ # Check pointer and magic number
+ if (table == NULL)
+ call error (0, "mct_clear: Null table pointer")
+ if (MCT_MAGIC (table) != MAGIC)
+ call error (0, "mct_clear: Bad magic number")
+
+ # Check table type
+ if (MCT_TYPE (table) != TY_PIXEL)
+ call error (0, "mct_clear: Wrong table type")
+
+ # Move value to data buffer
+ $if (datatype == p)
+ call amovki (value, Memi[MCT_DATA (table)],
+ MCT_MAXROW (table) * MCT_MAXCOL (table))
+ $else
+ call amovk$t (value, Mem$t[MCT_DATA (table)],
+ MCT_MAXROW (table) * MCT_MAXCOL (table))
+ $endif
+end
+$endfor