diff options
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctgetrow.x')
-rw-r--r-- | noao/digiphot/photcal/mctable/mctgetrow.x | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctgetrow.x b/noao/digiphot/photcal/mctable/mctgetrow.x new file mode 100644 index 00000000..bc46b06e --- /dev/null +++ b/noao/digiphot/photcal/mctable/mctgetrow.x @@ -0,0 +1,25 @@ +include "../lib/mctable.h" + + +# MCT_GETROW - Get pointer to row data values. + +pointer procedure mct_getrow (table, row) + +pointer table # table descriptor +int row # row number + +begin + # Check the pointer and magic number. + if (table == NULL) + call error (0, "mct_getrow: Null table pointer") + if (MCT_MAGIC (table) != MAGIC) + call error (0, "mct_getrow: Bad magic number") + + # Return the pointer to a row buffer, or NULL. + # if row is out of range + if (row < 1 || row > MCT_NPROWS (table)) + call error (0, "mct_getrow: Bad row number") + + # Return row pointer. + return (MCT_DATA (table) + (row - 1) * MCT_MAXCOL (table)) +end |