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 int strcmp(const char *s1, const char *s2)
75 while ((r = (*s1 - *s2)) == 0 && *s1) {
82 static inline int strncmp(const char *s1, const char *s2, int maxlen)
86 for (i = 0; i < maxlen; i++) {
94 static inline int isspace(int c)
97 case ' ': case '\f': case '\n':
98 case '\r': case '\t': case '\v':
105 static inline int isdigit(int c)
107 return (c >= '0' && c <= '9');
110 static inline int isxdigit(int c)
112 return ((c >= '0' && c <= '9') ||
113 (c >= 'a' && c <= 'f') ||
114 (c >= 'A' && c <= 'F'));
117 static inline int isupper(int c)
119 return (c >= 'A' && c <= 'Z');
122 static inline int islower(int c)
124 return (c >= 'a' && c <= 'z');
127 static inline int toupper(int c)
134 static inline int tolower(int c)
140 #endif /* STRING_H */