aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbscol.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/tbscol.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbscol.x')
-rw-r--r--pkg/tbtables/tbscol.x32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkg/tbtables/tbscol.x b/pkg/tbtables/tbscol.x
new file mode 100644
index 00000000..549706d4
--- /dev/null
+++ b/pkg/tbtables/tbscol.x
@@ -0,0 +1,32 @@
+include "tbtables.h"
+
+# If we need to reallocate the space for column selector descriptors,
+# this is the amount we will add to the current size.
+define INCR_MAX_SELCOLS 20
+
+# tbscol -- add a new column to the list of selected columns
+# If a column selector is in effect, this routine adds one column to the
+# list of selected columns. This would be called primarily when creating
+# a new column.
+#
+# Phil Hodge, 2-Mar-1998 Subroutine created.
+
+procedure tbscol (tp, cp)
+
+pointer tp # i: pointer to table descriptor
+pointer cp # i: pointer to column descriptor
+#--
+errchk tcs_addcol
+
+begin
+ if (TB_COLUMN_SELECT(tp) == YES) { # column selection is in effect
+
+ if (TB_NSEL_COLS(tp) + 1 > TB_MAX_SELCOLS(tp)) {
+ TB_MAX_SELCOLS(tp) = TB_NSEL_COLS(tp) + INCR_MAX_SELCOLS
+ call realloc (TB_SELCOL_PTR(tp), TB_MAX_SELCOLS(tp), TY_POINTER)
+ }
+
+ call tcs_addcol (tp, cp,
+ TB_SELCOL(tp,1), TB_NSEL_COLS(tp), TB_MAX_SELCOLS(tp))
+ }
+end