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 #if !defined(__PRE_RAM__)
12 int sprintf(char * buf, const char *fmt, ...);
15 // simple string functions
17 static inline size_t strnlen(const char *src, size_t max)
20 while((*src++) && (i < max)) {
26 static inline size_t strlen(const char *src)
35 static inline char *strchr(const char *s, int c)
44 #if !defined(__PRE_RAM__)
45 static inline char *strdup(const char *s)
47 size_t sz = strlen(s) + 1;
54 static inline char *strncpy(char *to, const char *from, int count)
56 register char *ret = to;
60 if ((*to++ = *from++) == '\0')
71 static inline void strcpy(char *dst, const char *src)
77 static inline int strcmp(const char *s1, const char *s2)
81 while ((r = (*s1 - *s2)) == 0 && *s1) {
88 static inline int strncmp(const char *s1, const char *s2, int maxlen)
92 for (i = 0; i < maxlen; i++) {
100 static inline int isspace(int c)
103 case ' ': case '\f': case '\n':
104 case '\r': case '\t': case '\v':
111 static inline int isdigit(int c)
113 return (c >= '0' && c <= '9');
116 static inline int isxdigit(int c)
118 return ((c >= '0' && c <= '9') ||
119 (c >= 'a' && c <= 'f') ||
120 (c >= 'A' && c <= 'F'));
123 static inline int isupper(int c)
125 return (c >= 'A' && c <= 'Z');
128 static inline int islower(int c)
130 return (c >= 'a' && c <= 'z');
133 static inline int toupper(int c)
140 static inline int tolower(int c)
146 #endif /* STRING_H */