aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/tcheck/wrtcheck.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/nttools/tcheck/wrtcheck.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/tcheck/wrtcheck.x')
-rw-r--r--pkg/utilities/nttools/tcheck/wrtcheck.x61
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