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 /pkg/tbtables/tbcnum.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbcnum.x')
-rw-r--r-- | pkg/tbtables/tbcnum.x | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/tbtables/tbcnum.x b/pkg/tbtables/tbcnum.x new file mode 100644 index 00000000..1bf6b90c --- /dev/null +++ b/pkg/tbtables/tbcnum.x @@ -0,0 +1,35 @@ +include "tbtables.h" + +# tbcnum -- get column pointer from number +# This function returns the column pointer corresponding to a given +# column number, or NULL if the column number is out of range. +# +# Phil Hodge, 2-Mar-1998 Map selected column descriptor to actual descriptor. + +pointer procedure tbcnum (tp, colnum) + +pointer tp # i: pointer to table descriptor +int colnum # i: column number (not pointer) +#-- +pointer cp +pointer tcs_column() + +begin + # Value to be returned if column number is out of range. + cp = NULL + + if (colnum < 1) + return (cp) + + if (TB_COLUMN_SELECT(tp) == YES) { # column selector was used + if (colnum <= TB_NSEL_COLS(tp)) { + cp = tcs_column (TB_SELCOL(tp,colnum)) + } + } else { # column selector not used + if (colnum <= TB_NCOLS(tp)) { + cp = TB_COLINFO(tp,colnum) + } + } + + return (cp) +end |