int dircmp_incase(char *s1, char *s2) { char _s1[strlen(s1)+1]; char _s2[strlen(s2)+1]; to_lower(s1, _s1); to_lower(s2, _s2); return dircmp(_s1, _s2); }
/* strcmp: return <0 if s<t, 0 if s==t, >0 if s>t */ int strcmp(int reverse, int foldCase, int dirMode, char *s, char *t) { if (dirMode) { return dircmp(reverse, foldCase, s, t); } for (; (*s == *t) || (foldCase && noCaseSame(*s, *t)); s++, t++) { if (*s == '\0') return 0; } if (reverse) return (-1 * (*s - *t)); return (*s - *t); }