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/tcheck/wrtcheck.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/tcheck/wrtcheck.x')
-rw-r--r-- | pkg/utilities/nttools/tcheck/wrtcheck.x | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/tcheck/wrtcheck.x b/pkg/utilities/nttools/tcheck/wrtcheck.x new file mode 100644 index 00000000..b14ec542 --- /dev/null +++ b/pkg/utilities/nttools/tcheck/wrtcheck.x @@ -0,0 +1,61 @@ +# WRT_CHECK -- Write the table values that pass the check + +procedure wrt_check (tp, irow, keylist, command, title) + +pointer tp # i: Table descriptor +int irow # i: Table row number +char keylist[ARB] # i: List of keywords to print +char command[ARB] # io: Expression used in check +bool title # io: Print title? +#-- +int ic +pointer sp, tabname, ldir, keyword, newcmd, value, root, col + +int fnldir(), gstrcpy(), word_fetch() + +begin + call smark (sp) + call salloc (tabname, SZ_FNAME, TY_CHAR) + call salloc (ldir, SZ_FNAME, TY_CHAR) + call salloc (keyword, SZ_FNAME, TY_CHAR) + call salloc (newcmd, SZ_FNAME, TY_CHAR) + call salloc (value, SZ_LINE, TY_CHAR) + + # Print title if this is the first error found in this table + + if (title) { + title = false + call tbtnam (tp, Memc[tabname], SZ_FNAME) + root = tabname + fnldir (Memc[tabname], Memc[ldir], SZ_FNAME) + + call printf ("#\n#%11t%-60s\n#\n") + call pargstr (Memc[root]) + } + + # Truncate command to 60 characters + + if (gstrcpy (command, Memc[newcmd], 60) == 60) + call strcat (" ...", Memc[newcmd], SZ_FNAME) + + # Print each keyword name, value, and associated command + + ic = 1 + while (word_fetch (keylist, ic, Memc[keyword], SZ_FNAME) > 0) { + call tbcfnd (tp, Memc[keyword], col, 1) + if (col != NULL) { + call tbegtt (tp, col, irow, Memc[value], SZ_LINE) + + call printf ("%-5d%-20s%-20s%-30s\n") + call pargi (irow) + call pargstr (Memc[keyword]) + call pargstr (Memc[value]) + call pargstr (Memc[newcmd]) + + } else { + call printf ("%-5d%-20s missing\n") + call pargi (irow) + call pargstr (Memc[keyword]) + } + } + call sfree (sp) +end |