diff options
author | schwarze <> | 2017-09-05 03:16:14 +0000 |
---|---|---|
committer | schwarze <> | 2017-09-05 03:16:14 +0000 |
commit | f63c4fd91b8483c7d4364046fd6ef2d2679dd63a (patch) | |
tree | d7f851bfa426cf869a3a3aec05ffba386b6f2ce5 /src/lib/libc/string/wcscasecmp.3 | |
parent | c1d0fec9b838e4df93e396d54f1e4b9a41f7401a (diff) | |
download | openbsd-f63c4fd91b8483c7d4364046fd6ef2d2679dd63a.tar.gz openbsd-f63c4fd91b8483c7d4364046fd6ef2d2679dd63a.tar.bz2 openbsd-f63c4fd91b8483c7d4364046fd6ef2d2679dd63a.zip |
New POSIX xlocale implementation written from scratch.libressl-v2.6.1
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.
With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.
Diffstat (limited to 'src/lib/libc/string/wcscasecmp.3')
-rw-r--r-- | src/lib/libc/string/wcscasecmp.3 | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/src/lib/libc/string/wcscasecmp.3 b/src/lib/libc/string/wcscasecmp.3 index daf397aece..9db4a829b9 100644 --- a/src/lib/libc/string/wcscasecmp.3 +++ b/src/lib/libc/string/wcscasecmp.3 | |||
@@ -1,7 +1,8 @@ | |||
1 | .\" $OpenBSD: wcscasecmp.3,v 1.4 2013/07/16 15:21:11 schwarze Exp $ | 1 | .\" $OpenBSD: wcscasecmp.3,v 1.5 2017/09/05 03:16:14 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991, 1993 | 3 | .\" Copyright (c) 1990, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | ||
5 | .\" | 6 | .\" |
6 | .\" This code is derived from software contributed to Berkeley by | 7 | .\" This code is derived from software contributed to Berkeley by |
7 | .\" Chris Torek. | 8 | .\" Chris Torek. |
@@ -31,25 +32,43 @@ | |||
31 | .\" | 32 | .\" |
32 | .\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 | 33 | .\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 |
33 | .\" | 34 | .\" |
34 | .Dd $Mdocdate: July 16 2013 $ | 35 | .Dd $Mdocdate: September 5 2017 $ |
35 | .Dt WCSCASECMP 3 | 36 | .Dt WCSCASECMP 3 |
36 | .Os | 37 | .Os |
37 | .Sh NAME | 38 | .Sh NAME |
38 | .Nm wcscasecmp , | 39 | .Nm wcscasecmp , |
39 | .Nm wcsncasecmp | 40 | .Nm wcscasecmp_l , |
41 | .Nm wcsncasecmp , | ||
42 | .Nm wcsncasecmp_l | ||
40 | .Nd compare wide strings, ignoring case | 43 | .Nd compare wide strings, ignoring case |
41 | .Sh SYNOPSIS | 44 | .Sh SYNOPSIS |
42 | .In wchar.h | 45 | .In wchar.h |
43 | .Ft int | 46 | .Ft int |
44 | .Fn wcscasecmp "const wchar_t *s1" "const wchar_t *s2" | 47 | .Fo wcscasecmp |
48 | .Fa "const wchar_t *s1" | ||
49 | .Fa "const wchar_t *s2" | ||
50 | .Fc | ||
45 | .Ft int | 51 | .Ft int |
46 | .Fn wcsncasecmp "const wchar_t *s1" "const wchar_t *s2" "size_t len" | 52 | .Fo wcscasecmp_l |
53 | .Fa "const wchar_t *s1" | ||
54 | .Fa "const wchar_t *s2" | ||
55 | .Fa "locale_t locale" | ||
56 | .Fc | ||
57 | .Ft int | ||
58 | .Fo wcsncasecmp | ||
59 | .Fa "const wchar_t *s1" | ||
60 | .Fa "const wchar_t *s2" | ||
61 | .Fa "size_t len" | ||
62 | .Fc | ||
63 | .Ft int | ||
64 | .Fo wcsncasecmp_l | ||
65 | .Fa "const wchar_t *s1" | ||
66 | .Fa "const wchar_t *s2" | ||
67 | .Fa "size_t len" | ||
68 | .Fa "locale_t locale" | ||
69 | .Fc | ||
47 | .Sh DESCRIPTION | 70 | .Sh DESCRIPTION |
48 | The | 71 | These functions compare the wide strings |
49 | .Fn wcscasecmp | ||
50 | and | ||
51 | .Fn wcsncasecmp | ||
52 | functions compare the wide strings | ||
53 | .Fa s1 | 72 | .Fa s1 |
54 | and | 73 | and |
55 | .Fa s2 | 74 | .Fa s2 |
@@ -61,28 +80,49 @@ is lexicographically greater than, equal to, or less than | |||
61 | after translation of each corresponding wide character to lower case. | 80 | after translation of each corresponding wide character to lower case. |
62 | The wide strings themselves are not modified. | 81 | The wide strings themselves are not modified. |
63 | .Pp | 82 | .Pp |
83 | For the translation to lower case, | ||
84 | .Fn wcscasecmp | ||
85 | and | ||
86 | .Fn wcsncasecmp | ||
87 | use the thread-specific locale as defined with | ||
88 | .Xr uselocale 3 , | ||
89 | falling back to the global locale defined with | ||
90 | .Xr setlocale 3 . | ||
91 | .Fn wcscasecmp_l | ||
92 | and | ||
93 | .Fn wcsncasecmp_l | ||
94 | use the | ||
95 | .Fa locale | ||
96 | argument instead. | ||
97 | .Pp | ||
64 | .Fn wcsncasecmp | 98 | .Fn wcsncasecmp |
65 | compares at most | 99 | and |
100 | .Fn wcsncasecmp_l | ||
101 | compare at most | ||
66 | .Fa len | 102 | .Fa len |
67 | wide characters. | 103 | wide characters. |
68 | .Sh SEE ALSO | 104 | .Sh SEE ALSO |
105 | .Xr newlocale 3 , | ||
106 | .Xr setlocale 3 , | ||
69 | .Xr strcasecmp 3 , | 107 | .Xr strcasecmp 3 , |
70 | .Xr wcscmp 3 , | 108 | .Xr wcscmp 3 , |
71 | .Xr wmemcmp 3 | 109 | .Xr wmemcmp 3 |
72 | .Sh STANDARDS | 110 | .Sh STANDARDS |
73 | The | 111 | These functions conform to |
74 | .Fn wcscasecmp | ||
75 | and | ||
76 | .Fn wcsncasecmp | ||
77 | functions conform to | ||
78 | .St -p1003.1-2008 . | 112 | .St -p1003.1-2008 . |
79 | .Sh HISTORY | 113 | .Sh HISTORY |
80 | The | 114 | The |
81 | .Fn wcscasecmp | 115 | .Fn wcscasecmp |
82 | and | 116 | and |
83 | .Fn wcsncasecmp | 117 | .Fn wcsncasecmp |
84 | functions first appeared in | 118 | functions have been available since |
85 | .Ox 5.0 . | 119 | .Ox 5.0 , |
120 | and | ||
121 | .Fn wcscasecmp_l | ||
122 | and | ||
123 | .Fn wcsncasecmp_l | ||
124 | since | ||
125 | .Ox 6.2 . | ||
86 | .Sh AUTHORS | 126 | .Sh AUTHORS |
87 | The | 127 | The |
88 | .Ox | 128 | .Ox |