#include <stdint.h>
#include <string.h>
Go to the source code of this file.
|
#define | BITOP(a, b, op) ((a)[(size_t)(b) / (8 * sizeof *(a))] op(size_t) 1 << ((size_t)(b) % (8 * sizeof *(a)))) |
|
|
size_t | strspn (const char *s, const char *c) |
|
◆ BITOP
#define BITOP |
( |
|
a, |
|
|
|
b, |
|
|
|
op |
|
) |
| ((a)[(size_t)(b) / (8 * sizeof *(a))] op(size_t) 1 << ((size_t)(b) % (8 * sizeof *(a)))) |
◆ strspn()
size_t strspn |
( |
const char * |
s, |
|
|
const char * |
c |
|
) |
| |
Definition at line 7 of file strspn.c.
10 size_t byteset[32 /
sizeof(size_t)] = {0};
25 return (uintptr_t)s - (uintptr_t)a;
28 for(; *c &&
BITOP(byteset, *(
const unsigned char*)c, |=); c++)
34 for(; *s &&
BITOP(byteset, *(
const unsigned char*)s, &); s++)
41 return (uintptr_t)s - (uintptr_t)a;
References BITOP.