From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/tbtables/tbywer.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkg/tbtables/tbywer.x (limited to 'pkg/tbtables/tbywer.x') diff --git a/pkg/tbtables/tbywer.x b/pkg/tbtables/tbywer.x new file mode 100644 index 00000000..6c3585b1 --- /dev/null +++ b/pkg/tbtables/tbywer.x @@ -0,0 +1,32 @@ +include "tbtables.h" + +define FRAC_INCR 1.2 # fractional increase in allrows +define DEFNUMROWS 100 # minimum increase in allrows + +# tbywer -- write empty rows +# The purpose of this routine is to allocate more space for rows for a +# column-ordered 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_ALLROWS then tbtchs will be called to +# rewrite the table and increase the allocated number of rows by a default +# amount. +# +# Note that TB_NROWS will not be updated. +# +# Phil Hodge, 4-Mar-1998 Subroutine created, extracted from tbtwer. + +procedure tbywer (tp, rownum) + +pointer tp # i: pointer to table descriptor +int rownum # i: (actual) row number in table +#-- +int allrows # allocated number of rows +errchk tbtchs + +begin + if (rownum > TB_ALLROWS(tp)) { + allrows = rownum * FRAC_INCR + DEFNUMROWS + call tbtchs (tp, -1, -1, -1, allrows) # change table size + } +end -- cgit