home *** CD-ROM | disk | FTP | other *** search
- /* Searches string str for first occurence of character chr. If found */
- /* the position of the character in the string is returned (the first */
- /* character has position 0). If the character is not found a -1 is */
- /* returned. */
-
- #include "plplot.h"
- #ifdef PLSTDC
- #include <string.h>
- #else
- extern char *strchr();
- #endif
-
- PLINT strpos(str,chr)
- char *str,chr;
- {
- char *temp;
-
- if (temp = strchr(str,chr))
- return((PLINT)(temp - str));
- else
- return((PLINT)-1);
- }
-