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/threed/titable/ticc.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/threed/titable/ticc.x')
-rw-r--r-- | pkg/utilities/nttools/threed/titable/ticc.x | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/threed/titable/ticc.x b/pkg/utilities/nttools/threed/titable/ticc.x new file mode 100644 index 00000000..81283904 --- /dev/null +++ b/pkg/utilities/nttools/threed/titable/ticc.x @@ -0,0 +1,56 @@ + +# TICC -- Copy data from column in input to cell array in output. +# +# +# +# +# Revision history: +# ---------------- +# 20-Jan-97 - Task created (I.Busko) + + +procedure ticc (itp, icp, otp, ocp, dtype, maxlen, rowsel, row) + +pointer itp # i: input table descriptor +pointer icp # i: input column descriptor +pointer otp # i: output table descriptor +pointer ocp # i: output column descriptor +int dtype # i: data type of both input and output columns +int maxlen # i: array length +char rowsel[ARB] # i: work string for row selector +int row # i: row where to insert +#-- +pointer sp, buf +int maxch + +begin + # Alloc buffer of apropriate length and type. + maxch = 1 + if (dtype < 0) { + maxch = - dtype + dtype = TY_CHAR + } + call smark (sp) + call salloc (buf, maxlen*(maxch + 1), dtype) + + # Copy. + switch (dtype) { + case TY_CHAR: + call tirowst (itp, icp, otp, ocp, rowsel, row, maxch, maxlen, + Memc[buf]) + case TY_BOOL: + call tirowsb (itp, icp, otp, ocp, rowsel, row, maxlen, Memb[buf]) + case TY_SHORT: + call tirowss (itp, icp, otp, ocp, rowsel, row, maxlen, Mems[buf]) + case TY_INT, TY_LONG: + call tirowsi (itp, icp, otp, ocp, rowsel, row, maxlen, Memi[buf]) + case TY_REAL: + call tirowsr (itp, icp, otp, ocp, rowsel, row, maxlen, Memr[buf]) + case TY_DOUBLE: + call tirowsd (itp, icp, otp, ocp, rowsel, row, maxlen, Memd[buf]) + default: + call error (1, "Non-supported data type.") + } + + call sfree (sp) +end |