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/tbtbod.x | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pkg/tbtables/tbtbod.x (limited to 'pkg/tbtables/tbtbod.x') diff --git a/pkg/tbtables/tbtbod.x b/pkg/tbtables/tbtbod.x new file mode 100644 index 00000000..ece8f25a --- /dev/null +++ b/pkg/tbtables/tbtbod.x @@ -0,0 +1,28 @@ +include +include +include "tbtables.h" +define SZ_PACKED_REC (SZ_PARREC/SZB_CHAR) # size of packed par record + +# tbtbod -- beginning of data +# This function returns the offset (in char) of the first element in the +# data portion of a table relative to the beginning of the file. The offset +# includes a size-information record, maxpar records that may contain user +# parameters, and maxcols records that may contain column descriptors. +# The input arguments maxpar and maxcols would normally be TB_MAXPAR(tp) +# and TB_MAXCOLS(tp). +# +# Phil Hodge, 14-Apr-1998 Change SZ_COLSTRUCT to SZ_COLDEF. + +long procedure tbtbod (maxpar, maxcols) + +int maxpar # i: current maximum number of header parameters +int maxcols # i: current maximum number of columns +#-- +long offset + +begin + offset = SZ_SIZINFO + + maxpar * SZ_PACKED_REC + + maxcols * SZ_COLDEF + 1 + return (offset) +end -- cgit