PS2SDK
PS2 Homebrew Libraries
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
_
a
c
d
e
f
g
i
l
m
n
p
q
r
s
t
u
v
Variables
_
c
d
f
g
i
k
m
n
p
q
r
s
t
u
v
w
Typedefs
a
d
h
i
l
m
n
p
r
s
t
w
Enumerations
_
a
c
d
g
i
l
m
n
o
p
s
t
v
Enumerator
c
d
e
g
i
n
p
s
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
u
v
w
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
strlen.c
1
#define SYSCLIB_DISABLE_BUILTINS
2
#include <
sysclib.h
>
3
#include <stdint.h>
4
#include <limits.h>
5
6
#define ALIGN (sizeof(size_t))
7
#define ONES ((size_t)-1/UCHAR_MAX)
8
#define HIGHS (ONES * (UCHAR_MAX/2+1))
9
#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS)
10
11
size_t
strlen(
const
char
*s)
12
{
13
const
char
*a = s;
14
#ifdef __GNUC__
15
typedef
size_t
__attribute__
((__may_alias__)) word;
16
const
word *w;
17
for
(; (uintptr_t)s % ALIGN; s++)
if
(!*s)
return
s-a;
18
for
(w = (
const
void
*)s; !HASZERO(*w); w++);
19
s = (
const
void
*)w;
20
#endif
21
for
(; *s; s++);
22
return
s-a;
23
}
__attribute__
typedef __attribute__
Definition
tlbfunc.c:60
sysclib.h
iop
system
sysclib
src
musl
string
strlen.c
Generated on Sat May 17 2025 02:56:35 for PS2SDK by
1.12.0