PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
strcspn.c
1
#define SYSCLIB_DISABLE_BUILTINS
2
#include <
sysclib.h
>
3
4
char
*__strchrnul(
const
char
*s,
int
c);
5
6
#define BITOP(a,b,op) \
7
((a)[(size_t)(b)/(8*sizeof *(a))] op (size_t)1<<((size_t)(b)%(8*sizeof *(a))))
8
9
size_t
strcspn(
const
char
*s,
const
char
*c)
10
{
11
const
char
*a = s;
12
size_t
byteset[32/
sizeof
(size_t)];
13
14
if
(!c[0] || !c[1])
return
__strchrnul(s, *c)-a;
15
16
memset(byteset, 0,
sizeof
byteset);
17
for
(; *c && BITOP(byteset, *(
unsigned
char
*)c, |=); c++);
18
for
(; *s && !BITOP(byteset, *(
unsigned
char
*)s, &); s++);
19
return
s-a;
20
}
sysclib.h
iop
system
sysclib
src
musl
string
strcspn.c
Generated on Thu Nov 14 2024 05:25:29 for PS2SDK by
1.9.8