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/tbzwer.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbzwer.x')
-rw-r--r-- | pkg/tbtables/tbzwer.x | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pkg/tbtables/tbzwer.x b/pkg/tbtables/tbzwer.x new file mode 100644 index 00000000..4ac46540 --- /dev/null +++ b/pkg/tbtables/tbzwer.x @@ -0,0 +1,34 @@ +include "tbtables.h" + +define NUM_EXTRA 1000 # number of extra "rows" to add for text file + +# tbzwer -- write empty rows +# The purpose of this routine is to allocate more space for rows for a +# text table. If the specified row is within the range of +# existing rows, the table itself will not be modified. +# +# If rownum is greater than TB_NROWS but less than TB_ALLROWS, then only +# TB_NROWS will be updated. If rownum is greater than TB_ALLROWS, then +# tbzsiz will be called to reallocate space for the table columns. +# +# Phil Hodge, 4-Mar-1998 Subroutine created, extracted from tbtwer. +# Phil Hodge, 7-Jun-1999 Add TB_MAXPAR(tp) to calling sequence of tbzsiz. + +procedure tbzwer (tp, rownum) + +pointer tp # i: pointer to table descriptor +int rownum # i: (actual) row number in table +#-- +int old_allrows # current allocated number of rows +errchk tbzsiz + +begin + if (rownum > TB_ALLROWS(tp)) { + old_allrows = TB_ALLROWS(tp) + TB_ALLROWS(tp) = rownum + NUM_EXTRA + call tbzsiz (tp, TB_MAXPAR(tp), old_allrows) + } + + if (rownum > TB_NROWS(tp)) + TB_NROWS(tp) = rownum +end |