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/tbeszt.x | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pkg/tbtables/tbeszt.x (limited to 'pkg/tbtables/tbeszt.x') diff --git a/pkg/tbtables/tbeszt.x b/pkg/tbtables/tbeszt.x new file mode 100644 index 00000000..f7fc0ff3 --- /dev/null +++ b/pkg/tbtables/tbeszt.x @@ -0,0 +1,24 @@ +include # needed for SZB_CHAR +include "tbtables.h" + +# tbeszt -- length of char element +# This routine returns the amount of space (unit = char) taken up in a +# table file by a character string. This may be different from the length +# of the string as would be returned by the strlen function, say, because +# the element in the table is packed, and the space is rounded up to a +# multiple of SZB_CHAR bytes. +# +# Phil Hodge, 28-Jul-1994 Function created. +# Phil Hodge, 31-Oct-1994 Check for data type = TY_CHAR. + +int procedure tbeszt (cptr) + +pointer cptr # i: pointer to column descriptor +#-- + +begin + if (COL_DTYPE(cptr) == TY_CHAR) # old notation + return (COL_LEN(cptr)) + else + return ((-COL_DTYPE(cptr) + SZB_CHAR-1) / SZB_CHAR) +end -- cgit