aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbhisc.x
blob: 7e6baee1ae0dfc47fe5b523d15c2c7a0e6510533 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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