Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6557 serge 1
/*
2
FUNCTION
3
	<>---case-insensitive wide character string compare
4
 
5
INDEX
6
	wcscasecmp
7
 
8
ANSI_SYNOPSIS
9
	#include 
10
	int wcscasecmp(const wchar_t *<[a]>, const wchar_t *<[b]>);
11
 
12
TRAD_SYNOPSIS
13
	#include 
14
	int wcscasecmp(<[a]>, <[b]>)
15
	wchar_t *<[a]>;
16
	wchar_t *<[b]>;
17
 
18
DESCRIPTION
19
	<> 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), <> returns a
26
	number greater than zero.  If the two strings match,
27
	<> returns zero.  If <<*<[a]>>> sorts
28
	lexicographically before <<*<[b]>>>, <> returns a
29
	number less than zero.
30
 
31
PORTABILITY
32
POSIX-1.2008
33
 
34
<> requires no supporting OS subroutines. It uses
35
tolower() from elsewhere in this library.
36
 
37
QUICKREF
38
	wcscasecmp
39
*/
40
 
41
#include 
42
#include 
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
}