17 while (
max-- && *s !=
'\0' )
23char *(
strcpy)(
char *dst,
const char *src)
27 while ( (*p++ = *src++) )
33char *(
strncpy)(
char *dst,
const char *src,
size_t n)
38 for ( i = 0; i < n && src[i]; ++i )
47int (
strcmp)(
const char *_s1,
const char *_s2)
54 }
while ( s1 && s1 == s2 );
56 return (s1 < s2) ? -1 : (s1 > s2);
59int (
strncmp)(
const char *_s1,
const char *_s2,
size_t n)
61 for (
size_t i = 0; i < n; i++)
62 if ( _s1[i] != _s2[i] )
63 return _s1[i] - _s2[i];
68void *(
memset)(
void *s,
int c,
size_t n)
78void *(
memcpy)(
void *_d,
const void *_s,
size_t n)
89int (
memcmp)(
const void *s1,
const void *s2,
size_t n)
91 const unsigned char *u1 = s1, *u2 = s2;
94 for ( ; !res && n; --n )
static unsigned int str(void)
size_t strnlen(const char *str, size_t max)
void *() memset(void *s, int c, size_t n)
size_t() strlen(const char *str)
int() memcmp(const void *s1, const void *s2, size_t n)
int() strncmp(const char *_s1, const char *_s2, size_t n)
char *() strcpy(char *dst, const char *src)
void *() memcpy(void *_d, const void *_s, size_t n)
char *() strncpy(char *dst, const char *src, size_t n)
int() strcmp(const char *_s1, const char *_s2)