aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbhisc.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/tbtables/tbhisc.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/tbtables/tbhisc.x')
-rw-r--r--pkg/tbtables/tbhisc.x35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/tbtables/tbhisc.x b/pkg/tbtables/tbhisc.x
new file mode 100644
index 00000000..7e6baee1
--- /dev/null
+++ b/pkg/tbtables/tbhisc.x
@@ -0,0 +1,35 @@
+include <ctype.h>
+include <tbset.h>
+
+# tbhisc -- is the keyword a comment?
+# If the input keyword is blank or is "history" or "comment" then this
+# procedure returns true. Actual blanks and tabs are both considered
+# to be blank, and the search for non-blank characters ends with EOS
+# or with the end of the keyword.
+
+bool procedure tbhisc (keyword)
+
+char keyword[ARB] # Name of parameter
+
+char uckey[SZ_KEYWORD] # keyword converted to upper case
+int k # loop index
+bool streq()
+
+begin
+ call strcpy (keyword, uckey, SZ_KEYWORD)
+ call strupr (uckey)
+
+ if (streq (uckey, "HISTORY"))
+ return (true)
+ else if (streq (uckey, "COMMENT"))
+ return (true)
+ else {
+ do k = 1, SZ_KEYWORD {
+ if (uckey[k] == EOS)
+ return (true)
+ else if (!IS_WHITE(uckey[k]))
+ return (false)
+ }
+ return (true)
+ }
+end