home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / STR / MEMICMP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  488 b   |  25 lines

  1. /* memicmp.c (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes */
  2.  
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. int memicmp (const void *s1, const void *s2, size_t n)
  7. {
  8.   size_t i;
  9.   int d;
  10.     
  11.   for (i = 0; i < n; ++i)
  12.     {
  13.       d = tolower (((unsigned char *)s1)[i])
  14.         - tolower (((unsigned char *)s2)[i]);
  15.       if (d != 0)
  16.         {
  17.           if (d > 0)
  18.             return (1);
  19.           else
  20.             return (-1);
  21.         }
  22.     }
  23.   return (0);
  24. }
  25.