aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbhkeq.x
blob: c77c27e37f990e37101f4a01ce43a7d0a3fb439e (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
include <tbset.h>

# tbhkeq -- keywords equal?
# This procedure compares an SPP string (i.e. one terminated with an EOS)
# with the keyword at the beginning of a parameter record.  Such a keyword
# is padded on the right with blanks rather than being terminated with EOS.
# There must not be any embedded blanks in the keyword.

# Phil Hodge, 10-Jul-91  Remove unnecessary ELSE before last IF statement.

bool procedure tbhkeq (sppstr, parrec)

char	sppstr[SZ_KEYWORD]	# i: string terminated with EOS
char	parrec[SZ_PARREC]	# i: parameter record; keyword is blank padded
#--
int	k

begin
	do k = 1, SZ_KEYWORD {
	    if (sppstr[k] == EOS) {
		if (parrec[k] == ' ')
		    return (true)
		else
		    return (false)
	    }
	    if (sppstr[k] != parrec[k])
		return (false)
	}
	return (true)
end