From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- 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