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/tbcnit.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbcnit.x')
-rw-r--r-- | pkg/tbtables/tbcnit.x | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/tbtables/tbcnit.x b/pkg/tbtables/tbcnit.x new file mode 100644 index 00000000..142f6cc8 --- /dev/null +++ b/pkg/tbtables/tbcnit.x @@ -0,0 +1,33 @@ +include <tbset.h> +include "tbtables.h" + +# tbcnit -- change column units +# This procedure replaces the units for a column. The column descriptor +# is updated, and if the table is not read-only the descriptor is also +# written back into the table. +# +# Phil Hodge, 19-Oct-1989 allow changing units 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 tbcnit (tp, cp, colunits) + +pointer tp # i: pointer to table descriptor +pointer cp # i: pointer to a column descriptor +char colunits[ARB] # i: new value of units for column +#-- +errchk tbcwcd, tbfnit + +begin + call strcpy (colunits, COL_UNITS(cp), SZ_COLUNITS) + + if (!TB_READONLY(tp)) { + # Save modified column descriptor in table file. + if (TB_TYPE(tp) == TBL_TYPE_FITS) + call tbfnit (tp, cp, colunits) + else + call tbcwcd (tp, cp) + TB_MODIFIED(tp) = true + } +end |