27 #include <sys/cdefs.h> 
   30 #include <sys/libkern.h> 
   31 #include <sys/limits.h> 
   32 #include <sys/types.h> 
   34 #define IDX(c)  ((u_char)(c) / LONG_BIT) 
   35 #define BIT(c)  ((u_long)1 << ((u_char)(c) % LONG_BIT)) 
   38 strspn(
const char *s, 
const char *charset)
 
   46         u_long tbl[(UCHAR_MAX + 1) / LONG_BIT];
 
   53         tbl[3] = tbl[2] = tbl[1] = tbl[0] = 0;
 
   55         for (idx = 0; idx < 
sizeof(tbl) / 
sizeof(tbl[0]); idx++)
 
   58         for (; *charset != 
'\0'; charset++) {
 
   67                 if ((tbl[idx] & bit) == 0)
 
size_t strspn(const char *s, const char *charset)