diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /noao/digiphot/photcal/mctable/mctsput.gx | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctsput.gx')
-rw-r--r-- | noao/digiphot/photcal/mctable/mctsput.gx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctsput.gx b/noao/digiphot/photcal/mctable/mctsput.gx new file mode 100644 index 00000000..5b1b92f2 --- /dev/null +++ b/noao/digiphot/photcal/mctable/mctsput.gx @@ -0,0 +1,40 @@ +include "../lib/mctable.h" + + +$for (csilrdxp) +# MCT_SPUT - Put value sequentally (generic) + +procedure mct_sput$t (table, value) + +pointer table # table descriptor +PIXEL value # data value + +int row, col # nxt row, and column +errchk mct_put$t + +begin + # Check pointer and magic number + if (table == NULL) + call error (0, "mct_sput: Null table pointer") + if (MCT_MAGIC (table) != MAGIC) + call error (0, "mct_sput: Bad magic number") + + # Check table type + if (MCT_TYPE (table) != TY_PIXEL) + call error (0, "mct_sput: Wrong table type") + + # Get next position + row = max (MCT_NPROWS (table), 1) + col = MCT_NPCOLS (table) + 1 + + # Test if it's necessary to go to + # the next row. + if (col > MCT_MAXCOL (table)) { + col = 1 + row = row + 1 + } + + # Enter value + call mct_put$t (table, row, col, value) +end +$endfor |