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 *memchr(const void *s, int c, size_t n);
12 #if !defined(__PRE_RAM__)
13 int sprintf(char * buf, const char *fmt, ...);
16 // simple string functions
18 static inline size_t strnlen(const char *src, size_t max)
21 while((*src++) && (i < max)) {
27 static inline size_t strlen(const char *src)
36 static inline char *strchr(const char *s, int c)
45 #if !defined(__PRE_RAM__)
46 static inline char *strdup(const char *s)
48 size_t sz = strlen(s) + 1;
55 static inline char *strncpy(char *to, const char *from, int count)
57 register char *ret = to;
61 if ((*to++ = *from++) == '\0')
72 static inline void strcpy(char *dst, const char *src)
78 static inline int strcmp(const char *s1, const char *s2)
82 while ((r = (*s1 - *s2)) == 0 && *s1) {
89 static inline int strncmp(const char *s1, const char *s2, int maxlen)
93 for (i = 0; i < maxlen; i++) {
101 static inline int isspace(int c)
104 case ' ': case '\f': case '\n':
105 case '\r': case '\t': case '\v':
112 static inline int isdigit(int c)
114 return (c >= '0' && c <= '9');
117 static inline int isxdigit(int c)
119 return ((c >= '0' && c <= '9') ||
120 (c >= 'a' && c <= 'f') ||
121 (c >= 'A' && c <= 'F'));
124 static inline int isupper(int c)
126 return (c >= 'A' && c <= 'Z');
129 static inline int islower(int c)
131 return (c >= 'a' && c <= 'z');
134 static inline int toupper(int c)
141 static inline int tolower(int c)
147 #endif /* STRING_H */