home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d473 / cnewssrc / cnews_src.lzh / libfake / strnicmp.c < prev    next >
C/C++ Source or Header  |  1990-12-25  |  629b  |  33 lines

  1. /*
  2.  *    strnicmp
  3.  *
  4.  *    Amiga (Manx) Library
  5.  */
  6.  
  7. #ifndef lint
  8. static char RCSid_strnicmp[] =
  9.     "$Id: strnicmp.c,v 1.1 90/12/25 15:23:23 crash Exp Locker: crash $";
  10. #endif /* lint */
  11.  
  12. #ifndef LATTICE
  13. #define _tolower(x)        (((x) & 0x5F) | 0x20)
  14. #define _toupper(x)        ((x) & 0x5F)
  15.  
  16. strnicmp(a, b, l)
  17. register char *a, *b;
  18. register int l;
  19. {
  20.     while (l > 0 && *a && *b && (_toupper(*a) == _toupper(*b)))
  21.         l--, a++, b++;
  22.     return( l ? (_toupper(*a) - _toupper(*b)) : 0 );
  23. }
  24.  
  25. stricmp(a, b)
  26. register char *a, *b;
  27. {
  28.     while (*a && *b && (_toupper(*a) == _toupper(*b)))
  29.         a++, b++;
  30.     return( _toupper(*a) - _toupper(*b) );
  31. }
  32. #endif /* !LATTICE */
  33.