7 void *memcpy(void *dest, const void *src, size_t n);
8 void *memmove(void *dest, const void *src, size_t n);
9 void *memset(void *s, int c, size_t n);
10 int memcmp(const void *s1, const void *s2, size_t n);
11 int sprintf(char * buf, const char *fmt, ...);
13 // yes, linux has fancy ones. We don't care. This stuff gets used
14 // hardly at all. And the pain of including those files is just too high.
16 //extern inline void strcpy(char *dst, char *src) {while (*src) *dst++ = *src++;}
18 //extern inline int strlen(char *src) { int i = 0; while (*src++) i++; return i;}
20 static inline size_t strnlen(const char *src, size_t max)
23 while((*src++) && (i < max)) {
29 static inline size_t strlen(const char *src)
38 static inline char *strchr(const char *s, int c)
48 static inline char *strdup(const char *s)
50 size_t sz = strlen(s) + 1;
57 static inline char *strncpy(char *to, const char *from, int count)
59 register char *ret = to;
63 if ((*to++ = *from++) == '\0')
74 static inline int strcmp(const char *s1, const char *s2)
78 while ((r = (*s1 - *s2)) == 0 && *s1) {
85 static inline int strncmp(const char *s1, const char *s2, int maxlen)
89 for (i = 0; i < maxlen; i++) {
97 static inline int isspace(int c)
100 case ' ': case '\f': case '\n':
101 case '\r': case '\t': case '\v':
108 static inline int isdigit(int c)
110 return (c >= '0' && c <= '9');
113 static inline int isxdigit(int c)
115 return ((c >= '0' && c <= '9') ||
116 (c >= 'a' && c <= 'f') ||
117 (c >= 'A' && c <= 'F'));
120 static inline int isupper(int c)
122 return (c >= 'A' && c <= 'Z');
125 static inline int islower(int c)
127 return (c >= 'a' && c <= 'z');
130 static inline int toupper(int c)
137 static inline int tolower(int c)
143 #endif /* STRING_H */