summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcoll.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strcoll.3')
-rw-r--r--src/lib/libc/string/strcoll.353
1 files changed, 40 insertions, 13 deletions
diff --git a/src/lib/libc/string/strcoll.3 b/src/lib/libc/string/strcoll.3
index d421200b62..4ba1f22677 100644
--- a/src/lib/libc/string/strcoll.3
+++ b/src/lib/libc/string/strcoll.3
@@ -1,4 +1,7 @@
1.\" $OpenBSD: strcoll.3,v 1.10 2017/09/05 03:16:13 schwarze Exp $
2.\"
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
2.\" All rights reserved. 5.\" All rights reserved.
3.\" 6.\"
4.\" This code is derived from software contributed to Berkeley by 7.\" This code is derived from software contributed to Berkeley by
@@ -29,45 +32,69 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 33.\" SUCH DAMAGE.
31.\" 34.\"
32.\" $OpenBSD: strcoll.3,v 1.9 2013/06/05 03:39:23 tedu Exp $ 35.Dd $Mdocdate: September 5 2017 $
33.\"
34.Dd $Mdocdate: June 5 2013 $
35.Dt STRCOLL 3 36.Dt STRCOLL 3
36.Os 37.Os
37.Sh NAME 38.Sh NAME
38.Nm strcoll 39.Nm strcoll ,
40.Nm strcoll_l
39.Nd compare strings according to current collation 41.Nd compare strings according to current collation
40.Sh SYNOPSIS 42.Sh SYNOPSIS
41.In string.h 43.In string.h
42.Ft int 44.Ft int
43.Fn strcoll "const char *s1" "const char *s2" 45.Fn strcoll "const char *s1" "const char *s2"
46.Ft int
47.Fn strcoll_l "const char *s1" "const char *s2" "locale_t locale"
44.Sh DESCRIPTION 48.Sh DESCRIPTION
45The 49The
46.Fn strcoll 50.Fn strcoll
47function lexicographically compares the NUL-terminated strings 51and
52.Fn strcoll_l
53functions lexicographically compare the NUL-terminated strings
48.Fa s1 54.Fa s1
49and 55and
50.Fa s2 56.Fa s2
51according to the current locale collation 57according to the current locale collation
52and returns an integer greater than, equal to, or less than 0, 58and return an integer greater than, equal to, or less than 0,
53according to whether 59according to whether
54.Fa s1 60.Fa s1
55is greater than, equal to, or less than 61is greater than, equal to, or less than
56.Fa s2 . 62.Fa s2 .
63.Pp
64On
65.Ox ,
66they have the same effect as
67.Xr strcmp 3 ,
68and the global locale, the thread-specific locale, and the
69.Fa locale
70argument are ignored.
71.Sh ENVIRONMENT
72On other operating systems, the behaviour of
73.Fn strcoll
74may depend on the
75.Dv LC_CTYPE
76.Xr locale 1 .
57.Sh SEE ALSO 77.Sh SEE ALSO
58.Xr bcmp 3 , 78.Xr newlocale 3 ,
59.Xr memcmp 3 ,
60.Xr setlocale 3 , 79.Xr setlocale 3 ,
61.Xr strcasecmp 3 ,
62.Xr strcmp 3 , 80.Xr strcmp 3 ,
63.Xr strxfrm 3 81.Xr strxfrm 3 ,
82.Xr wcscoll 3
64.Sh STANDARDS 83.Sh STANDARDS
65The 84The
66.Fn strcoll 85.Fn strcoll
67function conforms to 86function conforms to
68.St -ansiC . 87.St -ansiC ,
88and
89.Fn strcoll_l
90to
91.St -p1003.1-2008 .
69.Sh HISTORY 92.Sh HISTORY
70The 93The
71.Fn strcoll 94.Fn strcoll
72function first appeared in 95function has been available since
73.Bx 4.3 Reno . 96.Bx 4.3 Reno ,
97and
98.Fn strcoll_l
99since
100.Ox 6.2 .