xref: /titanic_41/usr/src/man/man3c/wcscasecmp.3c (revision 2cd8d409f7a1b4749ee611cec28b63f45eb9f84d)
1*2cd8d409SGarrett D'Amore.\"
2*2cd8d409SGarrett D'Amore.\" This file and its contents are supplied under the terms of the
3*2cd8d409SGarrett D'Amore.\" Common Development and Distribution License ("CDDL"), version 1.0.
4*2cd8d409SGarrett D'Amore.\" You may only use this file in accordance with the terms of version
5*2cd8d409SGarrett D'Amore.\" 1.0 of the CDDL.
6*2cd8d409SGarrett D'Amore.\"
7*2cd8d409SGarrett D'Amore.\" A full copy of the text of the CDDL should have accompanied this
8*2cd8d409SGarrett D'Amore.\" source.  A copy of the CDDL is also available via the Internet at
9*2cd8d409SGarrett D'Amore.\" http://www.illumos.org/license/CDDL.
10*2cd8d409SGarrett D'Amore.\"
11*2cd8d409SGarrett D'Amore.\"
12*2cd8d409SGarrett D'Amore.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
13*2cd8d409SGarrett D'Amore.\"
14*2cd8d409SGarrett D'Amore.Dd "Nov 4, 2014"
15*2cd8d409SGarrett D'Amore.Dt WCSCASECMP 3C
16*2cd8d409SGarrett D'Amore.Os
17*2cd8d409SGarrett D'Amore.Sh NAME
18*2cd8d409SGarrett D'Amore.Nm wcscasecmp ,
19*2cd8d409SGarrett D'Amore.Nm wcscasecmp_l ,
20*2cd8d409SGarrett D'Amore.Nm wcsncasecmp ,
21*2cd8d409SGarrett D'Amore.Nm wcsncasecmp_l
22*2cd8d409SGarrett D'Amore.Nd case-insensitive wide-character string comparison
23*2cd8d409SGarrett D'Amore.Sh SYNOPSIS
24*2cd8d409SGarrett D'Amore.In wchar.h
25*2cd8d409SGarrett D'Amore.
26*2cd8d409SGarrett D'Amore.Ft int
27*2cd8d409SGarrett D'Amore.Fo wcscasecmp
28*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws1"
29*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws2"
30*2cd8d409SGarrett D'Amore.Fc
31*2cd8d409SGarrett D'Amore.
32*2cd8d409SGarrett D'Amore.Ft int
33*2cd8d409SGarrett D'Amore.Fo wcscasecmp_l
34*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws1"
35*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws2"
36*2cd8d409SGarrett D'Amore.Fa "locale_t loc"
37*2cd8d409SGarrett D'Amore.Fc
38*2cd8d409SGarrett D'Amore.
39*2cd8d409SGarrett D'Amore.Ft int
40*2cd8d409SGarrett D'Amore.Fo wcsncasecmp
41*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws1"
42*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws2"
43*2cd8d409SGarrett D'Amore.Fa "size_t n"
44*2cd8d409SGarrett D'Amore.Fc
45*2cd8d409SGarrett D'Amore.
46*2cd8d409SGarrett D'Amore.Ft int
47*2cd8d409SGarrett D'Amore.Fo wcsncasecmp_l
48*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws1"
49*2cd8d409SGarrett D'Amore.Fa "const wchar_t *ws2"
50*2cd8d409SGarrett D'Amore.Fa "size_t n"
51*2cd8d409SGarrett D'Amore.Fa "locale_t loc"
52*2cd8d409SGarrett D'Amore.Fc
53*2cd8d409SGarrett D'Amore.Sh DESCRIPTION
54*2cd8d409SGarrett D'AmoreThese functions perform case-insensitive comparison of wide-character
55*2cd8d409SGarrett D'Amorestrings
56*2cd8d409SGarrett D'Amore.Fa ws1
57*2cd8d409SGarrett D'Amoreand
58*2cd8d409SGarrett D'Amore.Fa ws2 .
59*2cd8d409SGarrett D'AmorePairs of wide-characters from each of
60*2cd8d409SGarrett D'Amore.Fa ws1
61*2cd8d409SGarrett D'Amoreand
62*2cd8d409SGarrett D'Amore.Fa ws2
63*2cd8d409SGarrett D'Amoreare compared consecutively, ignoring differences in case (if the
64*2cd8d409SGarrett D'Amore.\"POSIX\." locale upper case characters are treated as lower case).  If
65*2cd8d409SGarrett D'Amorethe two values are different, the comparision stops and either
66*2cd8d409SGarrett D'Amorea negative value is returned if the character from
67*2cd8d409SGarrett D'Amore.Fa ws1
68*2cd8d409SGarrett D'Amoreis less than that from
69*2cd8d409SGarrett D'Amore.Fa ws2 ,
70*2cd8d409SGarrett D'Amoreor a positive is returned if the character from
71*2cd8d409SGarrett D'Amore.Fa ws1
72*2cd8d409SGarrett D'Amoreis greater than that from
73*2cd8d409SGarrett D'Amore.Fa ws2 .
74*2cd8d409SGarrett D'AmoreThe comparison also stops if both characters are null wide-characters,
75*2cd8d409SGarrett D'Amoreor, in the case of
76*2cd8d409SGarrett D'Amore.Fn wcsncasecmp
77*2cd8d409SGarrett D'Amoreand
78*2cd8d409SGarrett D'Amore.Fn wcsncasecmp_l ,
79*2cd8d409SGarrett D'Amoreafter
80*2cd8d409SGarrett D'Amore.Fa n
81*2cd8d409SGarrett D'Amorecomparisons have been made without finding a difference.  In either of
82*2cd8d409SGarrett D'Amorethese two cases, 0 is returned.
83*2cd8d409SGarrett D'Amore.Lp
84*2cd8d409SGarrett D'AmoreThe
85*2cd8d409SGarrett D'Amore.Fn wcscasecmp
86*2cd8d409SGarrett D'Amoreand
87*2cd8d409SGarrett D'Amore.Fn wcsncasecmp
88*2cd8d409SGarrett D'Amorefunctions use the
89*2cd8d409SGarrett D'Amore.Dv LC_CTYPE
90*2cd8d409SGarrett D'Amorecategory of the current locale to determine case.  The
91*2cd8d409SGarrett D'Amore.Fn wcscasecmp_l
92*2cd8d409SGarrett D'Amoreand
93*2cd8d409SGarrett D'Amore.Fn wcsncasecmp_l
94*2cd8d409SGarrett D'Amorefunctions use the
95*2cd8d409SGarrett D'Amore.Dv LC_CTYPE
96*2cd8d409SGarrett D'Amorecategory of the locale pointed to by
97*2cd8d409SGarrett D'Amore.Fa loc
98*2cd8d409SGarrett D'Amoreto determine case.
99*2cd8d409SGarrett D'Amore.Lp
100*2cd8d409SGarrett D'AmorePassing
101*2cd8d409SGarrett D'Amore.Dv LC_GLOBAL_LOCALE
102*2cd8d409SGarrett D'Amorefor
103*2cd8d409SGarrett D'Amore.Fa loc
104*2cd8d409SGarrett D'Amoreresults in undefined behavior.
105*2cd8d409SGarrett D'Amore.Lp
106*2cd8d409SGarrett D'AmoreThe
107*2cd8d409SGarrett D'Amore.Fn wcscasecmp ,
108*2cd8d409SGarrett D'Amore.Fn wcsncasecmp ,
109*2cd8d409SGarrett D'Amore.Fn wcscasecmp_l ,
110*2cd8d409SGarrett D'Amoreand
111*2cd8d409SGarrett D'Amore.Fn wcsncasecmp_l
112*2cd8d409SGarrett D'Amorefunctions are the wide-character equivalents of the
113*2cd8d409SGarrett D'Amore.Fn strcasecmp ,
114*2cd8d409SGarrett D'Amore.Fn strncasecmp ,
115*2cd8d409SGarrett D'Amore.Fn strcasemp_l ,
116*2cd8d409SGarrett D'Amoreand
117*2cd8d409SGarrett D'Amore.Fn strncasecmp_l
118*2cd8d409SGarrett D'Amorefunctions, respectively.
119*2cd8d409SGarrett D'Amore.Sh RETURN VALUES
120*2cd8d409SGarrett D'AmoreThese functions return a negative value if, ignoring case,
121*2cd8d409SGarrett D'Amore.Fa ws1
122*2cd8d409SGarrett D'Amoreis less than
123*2cd8d409SGarrett D'Amore.Fa ws1 ,
124*2cd8d409SGarrett D'Amoreor a positive value  if
125*2cd8d409SGarrett D'Amore.Fa ws1
126*2cd8d409SGarrett D'Amoreis greater than
127*2cd8d409SGarrett D'Amore.Fa ws2 ,
128*2cd8d409SGarrett D'Amoreor 0 if the both
129*2cd8d409SGarrett D'Amore.Fa ws1
130*2cd8d409SGarrett D'Amoreand
131*2cd8d409SGarrett D'Amore.Fa ws2
132*2cd8d409SGarrett D'Amoreare the same.
133*2cd8d409SGarrett D'Amore.Sh ERRORS
134*2cd8d409SGarrett D'AmoreNone.
135*2cd8d409SGarrett D'Amore.Sh INTERFACE STABILITY
136*2cd8d409SGarrett D'Amore.Sy Standard .
137*2cd8d409SGarrett D'Amore.Sh MT-LEVEL
138*2cd8d409SGarrett D'Amore.Sy MT-Safe .
139*2cd8d409SGarrett D'Amore.Sh SEE ALSO
140*2cd8d409SGarrett D'Amore.Xr newlocale 3C ,
141*2cd8d409SGarrett D'Amore.Xr setlocale 3C ,
142*2cd8d409SGarrett D'Amore.Xr strcasecmp 3C ,
143*2cd8d409SGarrett D'Amore.Xr strcasecmp_l 3C ,
144*2cd8d409SGarrett D'Amore.Xr strncasecmp 3C ,
145*2cd8d409SGarrett D'Amore.Xr strncasecmp_l 3C ,
146*2cd8d409SGarrett D'Amore.Xr uselocale 3C ,
147*2cd8d409SGarrett D'Amore.Xr wchar.h 3HEAD ,
148*2cd8d409SGarrett D'Amore.Xr locale 5 ,
149*2cd8d409SGarrett D'Amore.Xr standards 5
150*2cd8d409SGarrett D'Amore.Sh STANDARDS
151*2cd8d409SGarrett D'AmoreThe
152*2cd8d409SGarrett D'Amore.Fn wcscasecmp ,
153*2cd8d409SGarrett D'Amore.Fn wcsncasecmp ,
154*2cd8d409SGarrett D'Amore.Fn wcscasecmp_l ,
155*2cd8d409SGarrett D'Amoreand
156*2cd8d409SGarrett D'Amore.Fn wcsncasecmp_l
157*2cd8d409SGarrett D'Amorefunctions were introduced in
158*2cd8d409SGarrett D'Amore.St -p1003.1-2008 .
159