home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name stsverfy -- Verify that all characters in one string
- * appear in another.
- *
- * Synopsis index = stsverfy(pcheck,psearch);
- *
- * int index Position of leftmost character of
- * pcheck that is not in psearch
- * char *pcheck Pointer to string to be checked
- * char *psearch Pointer to string to be searched
- *
- * Description STSVERFY returns the position of the first (leftmost)
- * character of pcheck which does not appear in psearch.
- * If all characters of pcheck do appear in psearch, -1 is
- * returned; if pcheck has length 0, 0 is returned.
- *
- * Returns index The position of first character of pcheck
- * not found in psearch.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <string.h>
-
- #include <bstring.h>
-
- #define FOUND (-1)
-
- int stsverfy(pcheck,psearch)
- register char *pcheck;
- char *psearch;
- {
- register int i;
- register char ch;
-
- if (strlen(pcheck) == 0)
- return(0);
-
- /* pcheck is not null, so check for each character in psearch */
-
- for (i = 0; (ch = *pcheck++); i++)
- if (stschind(ch,psearch) == -1) /* Character not found */
- return(i);
-
- return(FOUND); /* All characters found. */
- }