From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/tbtables/tbhkeq.x | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pkg/tbtables/tbhkeq.x (limited to 'pkg/tbtables/tbhkeq.x') 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 + +# 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 -- cgit