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/tbcftl.x | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pkg/tbtables/tbcftl.x (limited to 'pkg/tbtables/tbcftl.x') diff --git a/pkg/tbtables/tbcftl.x b/pkg/tbtables/tbcftl.x new file mode 100644 index 00000000..c8386031 --- /dev/null +++ b/pkg/tbtables/tbcftl.x @@ -0,0 +1,23 @@ +include +include "tbtables.h" + +# tbcftl -- length of print format +# This procedure reads from the column print format the number of char +# necessary to print an element from the column using that format. +# +# Phil Hodge, 14-Apr-1998 Use strcpy instead of strupk; remove pformat. + +procedure tbcftl (colptr, lenfmt) + +pointer colptr # i: pointer to column descriptor +int lenfmt # o: number of char to print using colfmt +#-- +int ip, ival # stuff for using ctoi to get lenfmt +int ctoi() + +begin + ip = 2 # set ip to skip over the leading '%' + if (ctoi (COL_FMT(colptr), ip, ival) <= 0) + ival = 25 # a default value + lenfmt = abs (ival) # be careful of e.g. "%-12s" +end -- cgit