diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/tbtables/tbtbod.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/tbtables/tbtbod.x')
-rw-r--r-- | pkg/tbtables/tbtbod.x | 28 |
1 files changed, 28 insertions, 0 deletions
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 <mach.h> +include <tbset.h> +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 |