home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / c / string.arc / STRPBRK.C < prev    next >
C/C++ Source or Header  |  1984-12-31  |  768b  |  25 lines

  1. /*  File   : strpbrk.c
  2.     Author : Richard A. O'Keefe.
  3.     Updated: 11 April 1984
  4.     Defines: strpbrk()
  5.  
  6.     strpbrk(s1, s2) returns NullS if no character of s2 occurs in s1, or
  7.     a pointer to the first character of s1 which occurs in s2  if  there
  8.     is one.  It generalises strchr (v7=index).  It wouldn't be useful to
  9.     consider NUL as part of s2, as that would occur in every s1.
  10. */
  11.  
  12. #include "strings.h"
  13. #include "_str2set.h"
  14.  
  15. char *strpbrk(str, set)
  16.     register _char_ *str;
  17.     char *set;
  18.     {
  19.     _str2set(set);
  20.     while (_set_vec[*str] != _set_ctr)
  21.         if (!*str++) return NullS;
  22.     return str;
  23.     }
  24.