home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
STRSPN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
548b
|
29 lines
/* from Henry Spencer's stringlib */
#include <string.h>
/*
* strspn - find length of initial segment of s consisting entirely
* of characters from accept
*/
size_t
strspn(s, accept)
const char *s;
const char *accept;
{
register const char *sscan;
register const char *ascan;
register size_t count;
count = 0;
for (sscan = s; *sscan != '\0'; sscan++) {
for (ascan = accept; *ascan != '\0'; ascan++)
if (*sscan == *ascan)
break;
if (*ascan == '\0')
return(count);
count++;
}
return(count);
}