/* ============================================================================ memcmpu -- compare two memory areas while ignoring case Version 4 -- 1987-06-15 -- D.N. Lynx Crowe ============================================================================ */ #include "ctype.h" int memcmpu(void *vp1, void *vp2, int n) { char *cp1 = vp1; char *cp2 = vp2; register char c1, c2; while (n) { c1 = *cp1++; c2 = *cp2++; if (isascii(c1) && islower(c1)) c1 = _toupper(c1); if (isascii(c2) && islower(c2)) c2 = _toupper(c2); if (c1 < c2) return(-1); if (c1 > c2) return(1); n--; } return(0); }