}
#endif
+#ifdef CONFIG_BUILT_IN_STRCASECMP
+int strcasecmp(const char * s1, const char * s2) {
+ while (1) {
+ int cmp = (tolower(*s1) - tolower(*s2));
+
+ if ((cmp != 0) || (*s1 == '\0') || (*s2 == '\0')) {
+ return cmp;
+ }
+
+ ++s1;
+ ++s2;
+ }
+}
+
+#endif
+
#ifdef CONFIG_BUILT_IN_STRNCMP
int strncmp(const char * s1, const char * s2, size_t limit) {
}
#endif
+#ifdef CONFIG_BUILT_IN_STRNCASECMP
+int strncasecmp(const char * s1, const char * s2, size_t limit) {
+ size_t i = 0;
+
+ while (i < limit) {
+ int cmp = (tolower(*s1) - tolower(*s2));
+
+ if ((cmp != 0) || (*s1 == '\0') || (*s2 == '\0')) {
+ return cmp;
+ }
+
+ ++s1;
+ ++s2;
+ ++i;
+ }
+
+ return 0;
+}
+#endif
+
#ifdef CONFIG_BUILT_IN_STRCAT
char * strcat(char * s1, const char * s2) {
uint64_t atox(const char * buf) {
uint64_t ret = 0;
+ if (*(buf + 1) == 'x') {
+ buf += 2;
+ }
+
while (isxdigit(*buf)) {
ret <<= 4;
uint64_t ret = 0;
char * buf = (char *)nptr;
+ if (*(buf + 1) == 'x') {
+ buf += 2;
+ }
+
while (isxdigit(*buf)) {
ret <<= 4;
return NULL;
}
#endif
+
+
+void str_tolower(char * s) {
+ while (isalpha(*s)) {
+ if (!islower(*s)) {
+ *s = tolower(*s);
+ }
+ s++;
+ }
+}
+
+
+void str_toupper(char * s) {
+ while (isalpha(*s)) {
+ if (!isupper(*s)) {
+ *s = toupper(*s);
+ }
+ s++;
+ }
+}