aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/photcal/mctable/mctsput.x
diff options
context:
space:
mode:
Diffstat (limited to 'noao/digiphot/photcal/mctable/mctsput.x')
-rw-r--r--noao/digiphot/photcal/mctable/mctsput.x291
1 files changed, 291 insertions, 0 deletions
diff --git a/noao/digiphot/photcal/mctable/mctsput.x b/noao/digiphot/photcal/mctable/mctsput.x
new file mode 100644
index 00000000..e5adbba5
--- /dev/null
+++ b/noao/digiphot/photcal/mctable/mctsput.x
@@ -0,0 +1,291 @@
+include "../lib/mctable.h"
+
+
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputc (table, value)
+
+pointer table # table descriptor
+char value # data value
+
+int row, col # nxt row, and column
+errchk mct_putc
+
+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_CHAR)
+ 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_putc (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputs (table, value)
+
+pointer table # table descriptor
+short value # data value
+
+int row, col # nxt row, and column
+errchk mct_puts
+
+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_SHORT)
+ 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_puts (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputi (table, value)
+
+pointer table # table descriptor
+int value # data value
+
+int row, col # nxt row, and column
+errchk mct_puti
+
+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_INT)
+ 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_puti (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputl (table, value)
+
+pointer table # table descriptor
+long value # data value
+
+int row, col # nxt row, and column
+errchk mct_putl
+
+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_LONG)
+ 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_putl (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputr (table, value)
+
+pointer table # table descriptor
+real value # data value
+
+int row, col # nxt row, and column
+errchk mct_putr
+
+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_REAL)
+ 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_putr (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputd (table, value)
+
+pointer table # table descriptor
+double value # data value
+
+int row, col # nxt row, and column
+errchk mct_putd
+
+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_DOUBLE)
+ 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_putd (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputx (table, value)
+
+pointer table # table descriptor
+complex value # data value
+
+int row, col # nxt row, and column
+errchk mct_putx
+
+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_COMPLEX)
+ 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_putx (table, row, col, value)
+end
+
+# MCT_SPUT - Put value sequentally (generic)
+
+procedure mct_sputp (table, value)
+
+pointer table # table descriptor
+pointer value # data value
+
+int row, col # nxt row, and column
+errchk mct_putp
+
+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_POINTER)
+ 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_putp (table, row, col, value)
+end