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/tbtables/tbcnam.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/tbtables/tbcnam.x')
-rw-r--r-- | pkg/tbtables/tbcnam.x | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/tbtables/tbcnam.x b/pkg/tbtables/tbcnam.x new file mode 100644 index 00000000..9c0ab180 --- /dev/null +++ b/pkg/tbtables/tbcnam.x @@ -0,0 +1,33 @@ +include <tbset.h> +include "tbtables.h" + +# tbcnam -- change column name +# This procedure replaces the column name. The column descriptor is +# updated, and if the table is not read-only the modified descriptor +# is also written back into the table. +# +# Phil Hodge, 19-Oct-1989 allow changing column name for a read-only table +# Phil Hodge, 3-Apr-1995 Set TB_MODIFIED to true. +# Phil Hodge, 9-Apr-1995 Modify for FITS tables. +# Phil Hodge, 14-Apr-1998 Change calling sequence of tbcwcd. + +procedure tbcnam (tp, cp, colname) + +pointer tp # i: pointer to table descriptor +pointer cp # i: pointer to a column descriptor +char colname[ARB] # i: column name +#-- +errchk tbcwcd, tbfnam + +begin + call strcpy (colname, COL_NAME(cp), SZ_COLNAME) + + if (!TB_READONLY(tp)) { + # Save modified column descriptor in table file. + if (TB_TYPE(tp) == TBL_TYPE_FITS) + call tbfnam (tp, cp, colname) + else + call tbcwcd (tp, cp) + TB_MODIFIED(tp) = true + } +end |