aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/photcal/mctable/mctsget.gx
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/mctsget.gx
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctsget.gx')
-rw-r--r--noao/digiphot/photcal/mctable/mctsget.gx42
1 files changed, 42 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctsget.gx b/noao/digiphot/photcal/mctable/mctsget.gx
new file mode 100644
index 00000000..3f8d6bfb
--- /dev/null
+++ b/noao/digiphot/photcal/mctable/mctsget.gx
@@ -0,0 +1,42 @@
+include "../lib/mctable.h"
+
+
+$for (csilrdxp)
+# MCT_SGET - Get value sequentally (generic)
+
+int procedure mct_sget$t (table, value)
+
+pointer table # table descriptor
+PIXEL value # data value (output)
+
+int row, col # next row, and column
+PIXEL mct_get$t()
+
+begin
+ # Check pointer and magic number.
+ if (table == NULL)
+ call error (0, "mct_sget: Null table pointer")
+ if (MCT_MAGIC (table) != MAGIC)
+ call error (0, "mct_sget: Bad magic number")
+
+ # Check table type.
+ if (MCT_TYPE (table) != TY_PIXEL)
+ call error (0, "mct_sget: Wrong table type")
+
+ # Get next position.
+ row = max (MCT_NGROWS (table), 1)
+ col = MCT_NGCOLS (table) + 1
+
+ # Test if it's necessary to go to the next row.
+ if (col > MCT_MAXCOL (table)) {
+ col = 1
+ row = row + 1
+ }
+
+ # Get value and return status.
+ iferr (value = mct_get$t (table, row, col))
+ return (EOF)
+ else
+ return (OK)
+end
+$endfor