|
|
1.1 ! root 1: /*LINTLIBRARY*/ ! 2: /* ! 3: * Return the number of characters in the maximum leading segment ! 4: * of string which consists solely of characters from charset. ! 5: */ ! 6: int ! 7: strspn(string, charset) ! 8: char *string; ! 9: char *charset; ! 10: { ! 11: register char *p, *q; ! 12: ! 13: for(q=string; *q != '\0'; ++q) { ! 14: for(p=charset; *p != '\0' && *p != *q; ++p) ! 15: ; ! 16: if(*p == '\0') ! 17: break; ! 18: } ! 19: return(q-string); ! 20: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.