diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/nttools/lib/allrows.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/lib/allrows.x')
-rw-r--r-- | pkg/utilities/nttools/lib/allrows.x | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/lib/allrows.x b/pkg/utilities/nttools/lib/allrows.x new file mode 100644 index 00000000..086e6a4a --- /dev/null +++ b/pkg/utilities/nttools/lib/allrows.x @@ -0,0 +1,29 @@ +include <tbset.h> + +# ALLROWS -- Return a pointer to an array containing the indices of all +# the rows in a table. The calling procedure must free the array when it +# is through with it. +# +# B.Simon 11-Dec-87 First Code + +procedure allrows (tp, numrow, rowptr) + +pointer tp # i: Table descriptor +int numrow # o: Number of rows in the table +pointer rowptr # o: Pointer to array of indices + +int irow + +int tbpsta() + +errchk tbpsta, malloc + +begin + + numrow = tbpsta (tp, TBL_NROWS) + call malloc (rowptr, numrow, TY_INT) + + do irow = 1, numrow + Memi[rowptr+irow-1] = irow + +end |