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 void *malloc(size_t size);
12 int sprintf(char * buf, const char *fmt, ...);
14 // yes, linux has fancy ones. We don't care. This stuff gets used
15 // hardly at all. And the pain of including those files is just too high.
17 //extern inline void strcpy(char *dst, char *src) {while (*src) *dst++ = *src++;}
19 //extern inline int strlen(char *src) { int i = 0; while (*src++) i++; return i;}
21 static inline size_t strnlen(const char *src, size_t max)
24 while((*src++) && (i < max)) {
30 static inline size_t strlen(const char *src)
39 static inline char *strchr(const char *s, int c)
48 static inline char *strdup(const char *s)
50 size_t sz = strlen(s) + 1;
56 static inline char *strncpy(char *to, const char *from, int count)
58 register char *ret = to;
62 if ((*to++ = *from++) == '\0')
73 static inline int strcmp(const char *s1, const char *s2)
77 while ((r = (*s1 - *s2)) == 0 && *s1) {
84 static inline int isspace(int c)
87 case ' ': case '\f': case '\n':
88 case '\r': case '\t': case '\v':
95 static inline int isdigit(int c)
97 return (c >= '0' && c <= '9');
100 static inline int isxdigit(int c)
102 return ((c >= '0' && c <= '9') ||
103 (c >= 'a' && c <= 'f') ||
104 (c >= 'A' && c <= 'F'));
107 static inline int isupper(int c)
109 return (c >= 'A' && c <= 'Z');
112 static inline int islower(int c)
114 return (c >= 'a' && c <= 'z');
117 static inline int toupper(int c)
124 static inline int tolower(int c)
130 #endif /* STRING_H */