OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc2/] [newlib/] [libc/] [string/] [wcscasecmp.c] - Blame information for rev 520

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/*
2
FUNCTION
3
        <<wcscasecmp>>---case-insensitive wide character string compare
4
 
5
INDEX
6
        wcscasecmp
7
 
8
ANSI_SYNOPSIS
9
        #include <wchar.h>
10
        int wcscasecmp(const wchar_t *<[a]>, const wchar_t *<[b]>);
11
 
12
TRAD_SYNOPSIS
13
        #include <wchar.h>
14
        int wcscasecmp(<[a]>, <[b]>)
15
        wchar_t *<[a]>;
16
        wchar_t *<[b]>;
17
 
18
DESCRIPTION
19
        <<wcscasecmp>> compares the wide character string at <[a]> to
20
        the wide character string at <[b]> in a case-insensitive manner.
21
 
22
RETURNS
23
 
24
        If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
25
        both are converted to uppercase), <<wcscasecmp>> returns a
26
        number greater than zero.  If the two strings match,
27
        <<wcscasecmp>> returns zero.  If <<*<[a]>>> sorts
28
        lexicographically before <<*<[b]>>>, <<wcscasecmp>> returns a
29
        number less than zero.
30
 
31
PORTABILITY
32
POSIX-1.2008
33
 
34
<<wcscasecmp>> requires no supporting OS subroutines. It uses
35
tolower() from elsewhere in this library.
36
 
37
QUICKREF
38
        wcscasecmp
39
*/
40
 
41
#include <wchar.h>
42
#include <wctype.h>
43
 
44
int
45
_DEFUN (wcscasecmp, (s1, s2),
46
        _CONST wchar_t *s1 _AND
47
        _CONST wchar_t *s2)
48
{
49
  while (*s1 != '\0' && towlower(*s1) == towlower(*s2))
50
    {
51
      s1++;
52
      s2++;
53
    }
54
 
55
  return towlower(*s1) - towlower(*s2);
56
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.