(_c >= 'A' && _c <= 'Z') ? _c + ('a' - 'A') : _c; \
})
-#define DEFINE_STRTOLOWER(type, name) \
- void name(type *s) { \
- if (!s) \
- return; \
- for (; *s; s++) \
- *s = TOLOWER(*s); \
+#define DEFINE_STRTOLOWER(type, name) \
+ type* name(type *s) { \
+ if (!s) \
+ return NULL; \
+ for (type *p = s; *p; p++) \
+ *p = TOLOWER(*p); \
+ return s; \
}
DEFINE_STRTOLOWER(char, strtolower8);
return s ? (strlen16(s) + 1) * sizeof(*s) : 0;
}
-void strtolower8(char *s);
-void strtolower16(char16_t *s);
+char* strtolower8(char *s);
+char16_t* strtolower16(char16_t *s);
int strncmp8(const char *s1, const char *s2, size_t n);
int strncmp16(const char16_t *s1, const char16_t *s2, size_t n);