diff options
Diffstat (limited to 'pkg/tbtables/tbhkeq.x')
-rw-r--r-- | pkg/tbtables/tbhkeq.x | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/tbtables/tbhkeq.x b/pkg/tbtables/tbhkeq.x new file mode 100644 index 00000000..c77c27e3 --- /dev/null +++ b/pkg/tbtables/tbhkeq.x @@ -0,0 +1,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 |