aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbcftl.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/tbtables/tbcftl.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/tbtables/tbcftl.x')
-rw-r--r--pkg/tbtables/tbcftl.x23
1 files changed, 23 insertions, 0 deletions
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 <tbset.h>
+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