diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/nttools/gtedit/gtwrhead.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/gtedit/gtwrhead.x')
-rw-r--r-- | pkg/utilities/nttools/gtedit/gtwrhead.x | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/gtedit/gtwrhead.x b/pkg/utilities/nttools/gtedit/gtwrhead.x new file mode 100644 index 00000000..2b941be4 --- /dev/null +++ b/pkg/utilities/nttools/gtedit/gtwrhead.x @@ -0,0 +1,47 @@ +include <gset.h> +include <tbset.h> + +# GT_WRHEAD -- Write out the column names of the table + +procedure gt_wrhead (gd, tp) + +pointer gd # Graphics descriptor +pointer tp # Table descriptor + +pointer sp +pointer cname, cunits, cfmt # pointers to scratch space for column info +pointer ctext, cp +int i, colnum, datatype, lendata, lenfmt, ncols + +pointer tbpsta(), tbcnum() + +begin + # Allocate some space + call smark (sp) + call salloc (cname, SZ_LINE, TY_CHAR) + call salloc (cunits, SZ_LINE, TY_CHAR) + call salloc (cfmt, SZ_COLFMT, TY_CHAR) + call salloc (ctext, SZ_LINE, TY_CHAR) + + # Deactivate the workstation + call gdeactivate (gd, 0) + # Now get the info on the columns + ncols = tbpsta (tp, TBL_NCOLS) + + call printf ("Column names:\n\n") + do i = 1, ncols { + cp = tbcnum (tp, i) + call tbcinf (cp, + colnum, Memc[cname], Memc[cunits], Memc[cfmt], + datatype, lendata, lenfmt) + + # Print column name (and include trailing blanks) + # (calling sequence of inquotes modified by PEH on 13 Jan 1995) + call inquotes (Memc[cname], Memc[cname], SZ_LINE, YES) + call printf ("%-16s \n") + call pargstr (Memc[cname]) + + } + call greactivate (gd, AW_PAUSE) + call sfree (sp) +end |