source: buchla-68k/orig/CLIBRARY/MEMCMPU.C@ d21fc6f

Last change on this file since d21fc6f was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 649 bytes
RevLine 
[3ae31e9]1/*
2 ============================================================================
3 memcmpu -- compare two memory areas while ignoring case
4 Version 4 -- 1987-06-15 -- D.N. Lynx Crowe
5 ============================================================================
6*/
7
8#include "ctype.h"
9
10int
11memcmpu(s1, s2, n)
12register char *s1, *s2;
13int n;
14{
15 register char c1, c2;
16
17 while (n) {
18
19 c1 = *s1++;
20 c2 = *s2++;
21
22 if (isascii(c1) && islower(c1))
23 c1 = _toupper(c1);
24
25 if (isascii(c2) && islower(c2))
26 c2 = _toupper(c2);
27
28 if (c1 < c2)
29 return(-1);
30
31 if (c1 > c2)
32 return(1);
33
34 n--;
35 }
36
37 return(0);
38}
Note: See TracBrowser for help on using the repository browser.