~z88dk-team/z88dk-pkg/trunk

« back to all changes in this revision

Viewing changes to libsrc/strings/stricmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-02-12 08:23:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080212082349-wgijt44scmgje90o
Tags: 1.7.ds1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - build z88dk and z88dk-bin binary packages for lpia too
  - update Maintainer field as per spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *      Small C+ String Library
3
 
 *
4
 
 *      Taken from c68 archive
5
 
 *
6
 
 *      Added to Small C+ archive 1/3/99 djm
7
 
 */
8
 
 
9
 
 
10
 
 
11
 
/*
12
 
 *      s t r i c m p
13
 
 *
14
 
 *  compare string s1 to s2 - ignore case
15
 
 *
16
 
 *  returns:
17
 
 *      -ve     less than
18
 
 *      0       equal
19
 
 *      +ve     greater than
20
 
 *
21
 
 *  AMENDMENT HISTORY
22
 
 *  ~~~~~~~~~~~~~~~~~
23
 
 *  21 Jun 94   DJW   - Casts added to correctly handle characters with
24
 
 *                      internal values above 127.
25
 
 *
26
 
 *  28 Aug 94   DJW   - Changes to make certain that string treated as
27
 
 *                      'unsigned char' as required by ANSI.
28
 
 *
29
 
 *  26 Jan 95   DJW   - Added 'const' keywords to parameter definitions
30
 
 *
31
 
 *   1 Mar 99   djm   - Converted to Small C (no const etc)
32
 
 */
33
 
 
34
 
 
35
 
/*
36
 
 *      A little black magic..
37
 
 */
38
 
 
39
 
 
40
 
#include <string.h>
41
 
 
42
 
 
43
 
stricmp(scan1, scan2)
44
 
unsigned char *scan1;
45
 
unsigned char *scan2;
46
 
{
47
 
    unsigned char c1, c2;
48
 
 
49
 
    do {
50
 
        c1 = tolower(*scan1++);
51
 
        c2 = tolower(*scan2++);
52
 
    } while (c1 && (c1 == c2));
53
 
 
54
 
    return(c1 - c2);
55
 
}
56