home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / STR / STRSPN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  387 b   |  19 lines

  1. /* strspn.c (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes */
  2.  
  3. #include <string.h>
  4.  
  5. size_t strspn (const char *string1, const char *string2)
  6. {
  7.   char table[256];
  8.   size_t i;
  9.  
  10.   memset (table, 0, 256);
  11.   while (*string2 != 0)
  12.     table[(unsigned char)*string2++] = 1;
  13.   table[0] = 0;
  14.   i = 0;
  15.   while (table[(unsigned char)string1[i]])
  16.     ++i;
  17.   return (i);
  18. }
  19.