Category : C Source Code
Archive   : ECSTR.ZIP
Filename : STRCSPN.C

Output of file : STRCSPN.C contained in archive : ECSTR.ZIP
/* File : strcspn.c
Author : Richard A. O'Keefe.
Updated: 11 April 1984
Defines: strspn()

strcspn(s1, s2) returns the length of the longest prefix of s1
consisting entirely of characters which are NOT in s2 ("c" is
"complement"). NUL is considered to be part of s2. As _str2set
will never include NUL in a set, we have to check for it explicitly.

#include "strings.h"
#include "_str2set.h"

int strcspn(str, set)
register _char_ *str;
char *set;
register int L;

for (L = 0; *str && _set_vec[*str++] != _set_ctr; L++) ;
return L;

  3 Responses to “Category : C Source Code
Archive   : ECSTR.ZIP
Filename : STRCSPN.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: