aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbcnam.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/tbtables/tbcnam.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbcnam.x')
-rw-r--r--pkg/tbtables/tbcnam.x33
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