8 static inline void * memcpy(
void * _s1,
const void * _s2,
size_t n) {
9 uint8_t * s1 = (uint8_t *) _s1;
10 const uint8_t * s2 = (uint8_t *) _s2;
13 for (i = 0; i < n; i++)
19 static inline void * memmove(
void * _s1,
const void * _s2,
size_t n) {
20 uint8_t * s1 = (uint8_t *) _s1;
21 const uint8_t * s2 = (uint8_t *) _s2;
25 for (i = 0; i < n; i++)
30 for (i = 0; i < n; i++)
37 static inline int memcmp(
const void * _s1,
const void * _s2,
size_t n) {
38 uint8_t * s1 = (uint8_t *) _s1;
39 const uint8_t * s2 = (uint8_t *) _s2;
42 for (i = 0; i < n; i++, s1++, s2++) {
45 }
else if (*s1 > *s2) {
53 static inline void * memset(
void * _s,
int c,
size_t n) {
54 uint8_t * s = (uint8_t *) _s;
57 for (i = 0; i < n; i++)
63 static inline const void * memchr(
const void * _s,
int c,
size_t n) {
64 const uint8_t * s = (uint8_t *) _s;
67 for (i = 0; i < n; i++, s++)
74 static inline char * strcat(
char * s1,
const char * s2) {
88 static inline char * strcpy(
char * s1,
const char * s2) {
91 while ((*s1++ = *s2++));
96 static inline char * strncpy(
char * s1,
const char * s2,
size_t n) {
100 for (i = 0; i < n; i++) {
111 static inline char * strchr(
const char * s,
char c) {
121 static inline char * strrchr(
const char * s,
char c) {
122 const char * r =
NULL;
133 static inline size_t strlen(
const char * s) {
142 static inline char * strncat(
char * s1,
const char * s2,
size_t n) {
152 static inline int strcmp(
const char * s1,
const char * s2) {
158 }
else if (*s1 < *s2) {
160 }
else if (*s1 > *s2) {
170 static inline int strncmp(
const char * s1,
const char * s2,
size_t n) {
171 while (*s1 && *s2 && n) {
176 }
else if (*s1 < *s2) {
178 }
else if (*s1 > *s2) {
189 static inline char * strdup(
const char * s) {
190 return strcpy((
char *)
malloc(strlen(s) + 1), s);
193 static inline char * strstr(
const char * s1,
const char * s2) {
194 size_t l = strlen(s2);
197 if (!strncmp(s1, s2, l))