/*lgMatch determine whether match to a keyword occurs on command line, * return value is 0 if no match, and position of match within string if hit */ #include "istrstr.h" #include "cddefines.h" #include "lgmatch.h" int lgMatch(char *chKey, char *chCard) { int lgMatch_v; long int i; # ifdef DEBUG_FUN fputs( "<+>lgMatch()\n", debug_fp ); # endif /* cobalt blue routine that returns 0 if string is not in other, * else returns position of chKey within chCard */ i = istrstr(chCard,chKey); if( i == 0 ) { /* did not find match, returned false */ lgMatch_v = FALSE; } else { /* value was position with chCard, return this to lgMatch */ lgMatch_v = i; } # ifdef DEBUG_FUN fputs( " <->lgMatch()\n", debug_fp ); # endif return( lgMatch_v ); }