#include #include #include char *_strlwr(char *str) { char *s = strdup(str); char *ptr = s; while(*ptr) { *ptr = tolower(*ptr); ptr++; } return s; } int _stricmp(char *s1, char *s2) { char *tmp = s1, *tmp2 = s2; while(*tmp && tolower(*tmp) == tolower(*tmp2)) { tmp++; tmp2++; } if(!*tmp && !*tmp2) return 0; if(*tmp > *tmp2) return 1; if(*tmp < *tmp2) return -1; return 0; /* i don't think so... */ }