home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name stschind -- Returns the position of the first occurrence
- * of a character within a string
- *
- * Synopsis index = stschind(check,psearch);
- *
- * int index The position of check within psearch
- * char check Character to be searched for
- * char *psearch Pointer to the string to be searched
- *
- * Description STSCHIND searches the string psearch for the character
- * check, returning the position of its first occurrence.
- * If the character does not occur, -1 is returned.
- *
- * See also STSINDEX.
- *
- * Returns index The position of check in psearch
- *
- * Version 2.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bstring.h>
-
- #define NOTFOUND (-1)
-
- int stschind(check,psearch)
- char check;
- register char *psearch;
- {
- register int i;
- register char chs;
-
- for (i = 0; (chs = *psearch++); i++)
- if (check == chs)
- return(i); /* Found at i..quit and return i*/
-
- return(NOTFOUND);
- }