aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/threed/titable/generic
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/nttools/threed/titable/generic
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/threed/titable/generic')
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/mkpkg22
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tichb.x52
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tichc.x54
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tichd.x52
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tichi.x52
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tichr.x52
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tichs.x52
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tirowsb.x71
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tirowsc.x72
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tirowsd.x71
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tirowsi.x71
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tirowsr.x71
-rw-r--r--pkg/utilities/nttools/threed/titable/generic/tirowss.x71
13 files changed, 763 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/threed/titable/generic/mkpkg b/pkg/utilities/nttools/threed/titable/generic/mkpkg
new file mode 100644
index 00000000..f65f2f1c
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/mkpkg
@@ -0,0 +1,22 @@
+# Update the generic routines.
+
+default:
+ $checkout libpkg.a ../../
+ $update libpkg.a
+ $checkin libpkg.a ../../
+$exit
+
+libpkg.a:
+ tirowsb.x <tbset.h>
+ tirowsc.x <tbset.h>
+ tirowsd.x <tbset.h>
+ tirowsi.x <tbset.h>
+ tirowsr.x <tbset.h>
+ tirowss.x <tbset.h>
+ tichb.x <tbset.h>
+ tichc.x <tbset.h>
+ tichd.x <tbset.h>
+ tichi.x <tbset.h>
+ tichr.x <tbset.h>
+ tichs.x <tbset.h>
+ ;
diff --git a/pkg/utilities/nttools/threed/titable/generic/tichb.x b/pkg/utilities/nttools/threed/titable/generic/tichb.x
new file mode 100644
index 00000000..895c6aab
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tichb.x
@@ -0,0 +1,52 @@
+include <tbset.h>
+
+# TICH -- Copy data from input header into scalar cell in output.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+
+
+procedure tichb (itp, ihc, otp, ocp, orow)
+
+pointer itp # i: input table descriptor
+int ihc # i: header keyword index
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+int orow # i: row where to insert
+#--
+bool buf
+pointer sp, kwname, kwval
+int datatype, parnum
+
+string corrupt "Corrupted header in input table."
+
+int nscan()
+
+begin
+ call smark (sp)
+ call salloc (kwname, SZ_LINE, TY_CHAR)
+ call salloc (kwval, SZ_PARREC, TY_CHAR)
+
+ # Build keyword name and look for it.
+ call sprintf (Memc[kwname], SZ_LINE, "TCV_%03d")
+ call pargi (ihc)
+ call tbhfkr (itp, Memc[kwname], datatype, Memc[kwval], parnum)
+
+ # Parse and read value. We assume that the keyword existence
+ # was confirmed by previously finding the paired TCD_ keyword.
+ if (parnum > 0) {
+ call sscan (Memc[kwval])
+ call gargb (buf)
+ if (nscan() < 1) call error (1, corrupt)
+ } else
+ call error (1, corrupt)
+
+ # Write value into scalar cell.
+ call tbcptb (otp, ocp, buf, orow, orow)
+
+ call sfree (sp)
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tichc.x b/pkg/utilities/nttools/threed/titable/generic/tichc.x
new file mode 100644
index 00000000..0685918e
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tichc.x
@@ -0,0 +1,54 @@
+include <tbset.h>
+
+# TICH -- Copy data from input header into scalar cell in output.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+
+
+procedure ticht (itp, ihc, otp, ocp, orow, maxch)
+
+pointer itp # i: input table descriptor
+int ihc # i: header keyword index
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+int orow # i: row where to insert
+int maxch
+#--
+pointer buf
+pointer sp, kwname, kwval
+int datatype, parnum
+
+string corrupt "Corrupted header in input table."
+
+int nscan()
+
+begin
+ call smark (sp)
+ call salloc (buf, maxch + 1, TY_CHAR)
+ call salloc (kwname, SZ_LINE, TY_CHAR)
+ call salloc (kwval, SZ_PARREC, TY_CHAR)
+
+ # Build keyword name and look for it.
+ call sprintf (Memc[kwname], SZ_LINE, "TCV_%03d")
+ call pargi (ihc)
+ call tbhfkr (itp, Memc[kwname], datatype, Memc[kwval], parnum)
+
+ # Parse and read value. We assume that the keyword existence
+ # was confirmed by previously finding the paired TCD_ keyword.
+ if (parnum > 0) {
+ call sscan (Memc[kwval])
+ call gargwrd (buf, maxch)
+ if (nscan() < 1) call error (1, corrupt)
+ } else
+ call error (1, corrupt)
+
+ # Write value into scalar cell.
+ call tbcptt (otp, ocp, buf, maxch, orow, orow)
+
+ call sfree (sp)
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tichd.x b/pkg/utilities/nttools/threed/titable/generic/tichd.x
new file mode 100644
index 00000000..331b9813
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tichd.x
@@ -0,0 +1,52 @@
+include <tbset.h>
+
+# TICH -- Copy data from input header into scalar cell in output.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+
+
+procedure tichd (itp, ihc, otp, ocp, orow)
+
+pointer itp # i: input table descriptor
+int ihc # i: header keyword index
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+int orow # i: row where to insert
+#--
+double buf
+pointer sp, kwname, kwval
+int datatype, parnum
+
+string corrupt "Corrupted header in input table."
+
+int nscan()
+
+begin
+ call smark (sp)
+ call salloc (kwname, SZ_LINE, TY_CHAR)
+ call salloc (kwval, SZ_PARREC, TY_CHAR)
+
+ # Build keyword name and look for it.
+ call sprintf (Memc[kwname], SZ_LINE, "TCV_%03d")
+ call pargi (ihc)
+ call tbhfkr (itp, Memc[kwname], datatype, Memc[kwval], parnum)
+
+ # Parse and read value. We assume that the keyword existence
+ # was confirmed by previously finding the paired TCD_ keyword.
+ if (parnum > 0) {
+ call sscan (Memc[kwval])
+ call gargd (buf)
+ if (nscan() < 1) call error (1, corrupt)
+ } else
+ call error (1, corrupt)
+
+ # Write value into scalar cell.
+ call tbcptd (otp, ocp, buf, orow, orow)
+
+ call sfree (sp)
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tichi.x b/pkg/utilities/nttools/threed/titable/generic/tichi.x
new file mode 100644
index 00000000..fe01a4ac
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tichi.x
@@ -0,0 +1,52 @@
+include <tbset.h>
+
+# TICH -- Copy data from input header into scalar cell in output.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+
+
+procedure tichi (itp, ihc, otp, ocp, orow)
+
+pointer itp # i: input table descriptor
+int ihc # i: header keyword index
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+int orow # i: row where to insert
+#--
+int buf
+pointer sp, kwname, kwval
+int datatype, parnum
+
+string corrupt "Corrupted header in input table."
+
+int nscan()
+
+begin
+ call smark (sp)
+ call salloc (kwname, SZ_LINE, TY_CHAR)
+ call salloc (kwval, SZ_PARREC, TY_CHAR)
+
+ # Build keyword name and look for it.
+ call sprintf (Memc[kwname], SZ_LINE, "TCV_%03d")
+ call pargi (ihc)
+ call tbhfkr (itp, Memc[kwname], datatype, Memc[kwval], parnum)
+
+ # Parse and read value. We assume that the keyword existence
+ # was confirmed by previously finding the paired TCD_ keyword.
+ if (parnum > 0) {
+ call sscan (Memc[kwval])
+ call gargi (buf)
+ if (nscan() < 1) call error (1, corrupt)
+ } else
+ call error (1, corrupt)
+
+ # Write value into scalar cell.
+ call tbcpti (otp, ocp, buf, orow, orow)
+
+ call sfree (sp)
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tichr.x b/pkg/utilities/nttools/threed/titable/generic/tichr.x
new file mode 100644
index 00000000..b81dd97b
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tichr.x
@@ -0,0 +1,52 @@
+include <tbset.h>
+
+# TICH -- Copy data from input header into scalar cell in output.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+
+
+procedure tichr (itp, ihc, otp, ocp, orow)
+
+pointer itp # i: input table descriptor
+int ihc # i: header keyword index
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+int orow # i: row where to insert
+#--
+real buf
+pointer sp, kwname, kwval
+int datatype, parnum
+
+string corrupt "Corrupted header in input table."
+
+int nscan()
+
+begin
+ call smark (sp)
+ call salloc (kwname, SZ_LINE, TY_CHAR)
+ call salloc (kwval, SZ_PARREC, TY_CHAR)
+
+ # Build keyword name and look for it.
+ call sprintf (Memc[kwname], SZ_LINE, "TCV_%03d")
+ call pargi (ihc)
+ call tbhfkr (itp, Memc[kwname], datatype, Memc[kwval], parnum)
+
+ # Parse and read value. We assume that the keyword existence
+ # was confirmed by previously finding the paired TCD_ keyword.
+ if (parnum > 0) {
+ call sscan (Memc[kwval])
+ call gargr (buf)
+ if (nscan() < 1) call error (1, corrupt)
+ } else
+ call error (1, corrupt)
+
+ # Write value into scalar cell.
+ call tbcptr (otp, ocp, buf, orow, orow)
+
+ call sfree (sp)
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tichs.x b/pkg/utilities/nttools/threed/titable/generic/tichs.x
new file mode 100644
index 00000000..5dbce604
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tichs.x
@@ -0,0 +1,52 @@
+include <tbset.h>
+
+# TICH -- Copy data from input header into scalar cell in output.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-97 - Task created (I.Busko)
+
+
+procedure tichs (itp, ihc, otp, ocp, orow)
+
+pointer itp # i: input table descriptor
+int ihc # i: header keyword index
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+int orow # i: row where to insert
+#--
+short buf
+pointer sp, kwname, kwval
+int datatype, parnum
+
+string corrupt "Corrupted header in input table."
+
+int nscan()
+
+begin
+ call smark (sp)
+ call salloc (kwname, SZ_LINE, TY_CHAR)
+ call salloc (kwval, SZ_PARREC, TY_CHAR)
+
+ # Build keyword name and look for it.
+ call sprintf (Memc[kwname], SZ_LINE, "TCV_%03d")
+ call pargi (ihc)
+ call tbhfkr (itp, Memc[kwname], datatype, Memc[kwval], parnum)
+
+ # Parse and read value. We assume that the keyword existence
+ # was confirmed by previously finding the paired TCD_ keyword.
+ if (parnum > 0) {
+ call sscan (Memc[kwval])
+ call gargs (buf)
+ if (nscan() < 1) call error (1, corrupt)
+ } else
+ call error (1, corrupt)
+
+ # Write value into scalar cell.
+ call tbcpts (otp, ocp, buf, orow, orow)
+
+ call sfree (sp)
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tirowsb.x b/pkg/utilities/nttools/threed/titable/generic/tirowsb.x
new file mode 100644
index 00000000..f87a0861
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tirowsb.x
@@ -0,0 +1,71 @@
+include <tbset.h>
+
+#
+# TIROWS -- Expand row selector into array and copy it into output
+# table cell.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-1997 - Task created (I.Busko)
+# 7-Feb-2000 - For datatype = 'c', make buf an array of strings (P.Hodge)
+
+
+procedure tirowsb (itp, icp, otp, ocp, rowsel, orow, len, buf)
+
+pointer itp # i: input table descriptor
+pointer icp # i: input column descriptor
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+char rowsel[ARB] # i: row selector
+int orow # i: row in output table where to write into
+int len # i: buffer length
+bool buf[ARB]
+#--
+double undefd
+real undefr
+pointer pcode
+int undefi, i, nelem, irow, numrow, alength
+short undefs
+
+pointer trsopen()
+int tbpsta(), tbalen()
+bool trseval()
+
+begin
+ # Loop over selected rows on input table.
+ pcode = trsopen (itp, rowsel)
+ numrow = tbpsta (itp, TBL_NROWS)
+ nelem = 0
+ do irow = 1, numrow {
+ if (trseval (itp, irow, pcode)) {
+ nelem = nelem + 1
+ if (nelem > len) {
+ nelem = len
+ break
+ }
+ # Get element and store in buffer.
+ call tbegtb (itp, icp, irow, buf[nelem])
+ }
+ }
+ call trsclose (pcode)
+
+ # Write buffer into array cell element.
+ call tbaptb (otp, ocp, orow, buf, 1, nelem)
+
+ # If number of selected rows in current input table
+ # is smaller than output table array length, fill
+ # remaining array elements with INDEF.
+ alength = tbalen (ocp)
+ if (alength > nelem) {
+ undefd = INDEFD
+ undefr = INDEFR
+ undefi = INDEFI
+ undefs = INDEFS
+ do i = nelem+1, alength {
+ call tbaptb (otp, ocp, orow, false, i, 1)
+ }
+ }
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tirowsc.x b/pkg/utilities/nttools/threed/titable/generic/tirowsc.x
new file mode 100644
index 00000000..01d11000
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tirowsc.x
@@ -0,0 +1,72 @@
+include <tbset.h>
+
+#
+# TIROWS -- Expand row selector into array and copy it into output
+# table cell.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-1997 - Task created (I.Busko)
+# 7-Feb-2000 - For datatype = 'c', make buf an array of strings (P.Hodge)
+
+
+procedure tirowst (itp, icp, otp, ocp, rowsel, orow, maxch, len, buf)
+
+pointer itp # i: input table descriptor
+pointer icp # i: input column descriptor
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+char rowsel[ARB] # i: row selector
+int orow # i: row in output table where to write into
+int maxch # i: max length of string
+int len # i: buffer length
+char buf[maxch,ARB] # i: work buffer
+#--
+double undefd
+real undefr
+pointer pcode
+int undefi, i, nelem, irow, numrow, alength
+short undefs
+
+pointer trsopen()
+int tbpsta(), tbalen()
+bool trseval()
+
+begin
+ # Loop over selected rows on input table.
+ pcode = trsopen (itp, rowsel)
+ numrow = tbpsta (itp, TBL_NROWS)
+ nelem = 0
+ do irow = 1, numrow {
+ if (trseval (itp, irow, pcode)) {
+ nelem = nelem + 1
+ if (nelem > len) {
+ nelem = len
+ break
+ }
+ # Get element and store in buffer.
+ call tbegtt (itp, icp, irow, buf[1,nelem], maxch)
+ }
+ }
+ call trsclose (pcode)
+
+ # Write buffer into array cell element.
+ call tbaptt (otp, ocp, orow, buf, maxch, 1, nelem)
+
+ # If number of selected rows in current input table
+ # is smaller than output table array length, fill
+ # remaining array elements with INDEF.
+ alength = tbalen (ocp)
+ if (alength > nelem) {
+ undefd = INDEFD
+ undefr = INDEFR
+ undefi = INDEFI
+ undefs = INDEFS
+ do i = nelem+1, alength {
+ call tbaptt (otp, ocp, orow, "", maxch, i, 1)
+ }
+ }
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tirowsd.x b/pkg/utilities/nttools/threed/titable/generic/tirowsd.x
new file mode 100644
index 00000000..3af5468c
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tirowsd.x
@@ -0,0 +1,71 @@
+include <tbset.h>
+
+#
+# TIROWS -- Expand row selector into array and copy it into output
+# table cell.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-1997 - Task created (I.Busko)
+# 7-Feb-2000 - For datatype = 'c', make buf an array of strings (P.Hodge)
+
+
+procedure tirowsd (itp, icp, otp, ocp, rowsel, orow, len, buf)
+
+pointer itp # i: input table descriptor
+pointer icp # i: input column descriptor
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+char rowsel[ARB] # i: row selector
+int orow # i: row in output table where to write into
+int len # i: buffer length
+double buf[ARB]
+#--
+double undefd
+real undefr
+pointer pcode
+int undefi, i, nelem, irow, numrow, alength
+short undefs
+
+pointer trsopen()
+int tbpsta(), tbalen()
+bool trseval()
+
+begin
+ # Loop over selected rows on input table.
+ pcode = trsopen (itp, rowsel)
+ numrow = tbpsta (itp, TBL_NROWS)
+ nelem = 0
+ do irow = 1, numrow {
+ if (trseval (itp, irow, pcode)) {
+ nelem = nelem + 1
+ if (nelem > len) {
+ nelem = len
+ break
+ }
+ # Get element and store in buffer.
+ call tbegtd (itp, icp, irow, buf[nelem])
+ }
+ }
+ call trsclose (pcode)
+
+ # Write buffer into array cell element.
+ call tbaptd (otp, ocp, orow, buf, 1, nelem)
+
+ # If number of selected rows in current input table
+ # is smaller than output table array length, fill
+ # remaining array elements with INDEF.
+ alength = tbalen (ocp)
+ if (alength > nelem) {
+ undefd = INDEFD
+ undefr = INDEFR
+ undefi = INDEFI
+ undefs = INDEFS
+ do i = nelem+1, alength {
+ call tbaptd (otp, ocp, orow, undefd, i, 1)
+ }
+ }
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tirowsi.x b/pkg/utilities/nttools/threed/titable/generic/tirowsi.x
new file mode 100644
index 00000000..6cf4b069
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tirowsi.x
@@ -0,0 +1,71 @@
+include <tbset.h>
+
+#
+# TIROWS -- Expand row selector into array and copy it into output
+# table cell.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-1997 - Task created (I.Busko)
+# 7-Feb-2000 - For datatype = 'c', make buf an array of strings (P.Hodge)
+
+
+procedure tirowsi (itp, icp, otp, ocp, rowsel, orow, len, buf)
+
+pointer itp # i: input table descriptor
+pointer icp # i: input column descriptor
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+char rowsel[ARB] # i: row selector
+int orow # i: row in output table where to write into
+int len # i: buffer length
+int buf[ARB]
+#--
+double undefd
+real undefr
+pointer pcode
+int undefi, i, nelem, irow, numrow, alength
+short undefs
+
+pointer trsopen()
+int tbpsta(), tbalen()
+bool trseval()
+
+begin
+ # Loop over selected rows on input table.
+ pcode = trsopen (itp, rowsel)
+ numrow = tbpsta (itp, TBL_NROWS)
+ nelem = 0
+ do irow = 1, numrow {
+ if (trseval (itp, irow, pcode)) {
+ nelem = nelem + 1
+ if (nelem > len) {
+ nelem = len
+ break
+ }
+ # Get element and store in buffer.
+ call tbegti (itp, icp, irow, buf[nelem])
+ }
+ }
+ call trsclose (pcode)
+
+ # Write buffer into array cell element.
+ call tbapti (otp, ocp, orow, buf, 1, nelem)
+
+ # If number of selected rows in current input table
+ # is smaller than output table array length, fill
+ # remaining array elements with INDEF.
+ alength = tbalen (ocp)
+ if (alength > nelem) {
+ undefd = INDEFD
+ undefr = INDEFR
+ undefi = INDEFI
+ undefs = INDEFS
+ do i = nelem+1, alength {
+ call tbapti (otp, ocp, orow, undefi, i, 1)
+ }
+ }
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tirowsr.x b/pkg/utilities/nttools/threed/titable/generic/tirowsr.x
new file mode 100644
index 00000000..c6754eaf
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tirowsr.x
@@ -0,0 +1,71 @@
+include <tbset.h>
+
+#
+# TIROWS -- Expand row selector into array and copy it into output
+# table cell.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-1997 - Task created (I.Busko)
+# 7-Feb-2000 - For datatype = 'c', make buf an array of strings (P.Hodge)
+
+
+procedure tirowsr (itp, icp, otp, ocp, rowsel, orow, len, buf)
+
+pointer itp # i: input table descriptor
+pointer icp # i: input column descriptor
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+char rowsel[ARB] # i: row selector
+int orow # i: row in output table where to write into
+int len # i: buffer length
+real buf[ARB]
+#--
+double undefd
+real undefr
+pointer pcode
+int undefi, i, nelem, irow, numrow, alength
+short undefs
+
+pointer trsopen()
+int tbpsta(), tbalen()
+bool trseval()
+
+begin
+ # Loop over selected rows on input table.
+ pcode = trsopen (itp, rowsel)
+ numrow = tbpsta (itp, TBL_NROWS)
+ nelem = 0
+ do irow = 1, numrow {
+ if (trseval (itp, irow, pcode)) {
+ nelem = nelem + 1
+ if (nelem > len) {
+ nelem = len
+ break
+ }
+ # Get element and store in buffer.
+ call tbegtr (itp, icp, irow, buf[nelem])
+ }
+ }
+ call trsclose (pcode)
+
+ # Write buffer into array cell element.
+ call tbaptr (otp, ocp, orow, buf, 1, nelem)
+
+ # If number of selected rows in current input table
+ # is smaller than output table array length, fill
+ # remaining array elements with INDEF.
+ alength = tbalen (ocp)
+ if (alength > nelem) {
+ undefd = INDEFD
+ undefr = INDEFR
+ undefi = INDEFI
+ undefs = INDEFS
+ do i = nelem+1, alength {
+ call tbaptr (otp, ocp, orow, undefr, i, 1)
+ }
+ }
+end
diff --git a/pkg/utilities/nttools/threed/titable/generic/tirowss.x b/pkg/utilities/nttools/threed/titable/generic/tirowss.x
new file mode 100644
index 00000000..91c678c3
--- /dev/null
+++ b/pkg/utilities/nttools/threed/titable/generic/tirowss.x
@@ -0,0 +1,71 @@
+include <tbset.h>
+
+#
+# TIROWS -- Expand row selector into array and copy it into output
+# table cell.
+#
+#
+#
+#
+# Revision history:
+# ----------------
+# 20-Jan-1997 - Task created (I.Busko)
+# 7-Feb-2000 - For datatype = 'c', make buf an array of strings (P.Hodge)
+
+
+procedure tirowss (itp, icp, otp, ocp, rowsel, orow, len, buf)
+
+pointer itp # i: input table descriptor
+pointer icp # i: input column descriptor
+pointer otp # i: output table descriptor
+pointer ocp # i: output column descriptor
+char rowsel[ARB] # i: row selector
+int orow # i: row in output table where to write into
+int len # i: buffer length
+short buf[ARB]
+#--
+double undefd
+real undefr
+pointer pcode
+int undefi, i, nelem, irow, numrow, alength
+short undefs
+
+pointer trsopen()
+int tbpsta(), tbalen()
+bool trseval()
+
+begin
+ # Loop over selected rows on input table.
+ pcode = trsopen (itp, rowsel)
+ numrow = tbpsta (itp, TBL_NROWS)
+ nelem = 0
+ do irow = 1, numrow {
+ if (trseval (itp, irow, pcode)) {
+ nelem = nelem + 1
+ if (nelem > len) {
+ nelem = len
+ break
+ }
+ # Get element and store in buffer.
+ call tbegts (itp, icp, irow, buf[nelem])
+ }
+ }
+ call trsclose (pcode)
+
+ # Write buffer into array cell element.
+ call tbapts (otp, ocp, orow, buf, 1, nelem)
+
+ # If number of selected rows in current input table
+ # is smaller than output table array length, fill
+ # remaining array elements with INDEF.
+ alength = tbalen (ocp)
+ if (alength > nelem) {
+ undefd = INDEFD
+ undefr = INDEFR
+ undefi = INDEFI
+ undefs = INDEFS
+ do i = nelem+1, alength {
+ call tbapts (otp, ocp, orow, undefs, i, 1)
+ }
+ }
+end