summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcasecmp.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strcasecmp.3')
-rw-r--r--src/lib/libc/string/strcasecmp.376
1 files changed, 56 insertions, 20 deletions
diff --git a/src/lib/libc/string/strcasecmp.3 b/src/lib/libc/string/strcasecmp.3
index 3870362216..bb39df895a 100644
--- a/src/lib/libc/string/strcasecmp.3
+++ b/src/lib/libc/string/strcasecmp.3
@@ -1,7 +1,8 @@
1.\" $OpenBSD: strcasecmp.3,v 1.13 2015/11/24 09:14:35 daniel Exp $ 1.\" $OpenBSD: strcasecmp.3,v 1.14 2017/09/05 03:16:13 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: November 24 2015 $ 35.Dd $Mdocdate: September 5 2017 $
35.Dt STRCASECMP 3 36.Dt STRCASECMP 3
36.Os 37.Os
37.Sh NAME 38.Sh NAME
38.Nm strcasecmp , 39.Nm strcasecmp ,
39.Nm strncasecmp 40.Nm strcasecmp_l ,
41.Nm strncasecmp ,
42.Nm strncasecmp_l
40.Nd compare strings, ignoring case 43.Nd compare strings, ignoring case
41.Sh SYNOPSIS 44.Sh SYNOPSIS
42.In strings.h 45.In strings.h
43.Ft int 46.Ft int
44.Fn strcasecmp "const char *s1" "const char *s2" 47.Fo strcasecmp
48.Fa "const char *s1"
49.Fa "const char *s2"
50.Fc
45.Ft int 51.Ft int
46.Fn strncasecmp "const char *s1" "const char *s2" "size_t len" 52.Fo strcasecmp_l
53.Fa "const char *s1"
54.Fa "const char *s2"
55.Fa "locale_t locale"
56.Fc
57.Ft int
58.Fo strncasecmp
59.Fa "const char *s1"
60.Fa "const char *s2"
61.Fa "size_t len"
62.Fc
63.Ft int
64.Fo strncasecmp_l
65.Fa "const char *s1"
66.Fa "const char *s2"
67.Fa "size_t len"
68.Fa "locale_t locale"
69.Fc
47.Sh DESCRIPTION 70.Sh DESCRIPTION
48The 71These functions compare the NUL-terminated strings
49.Fn strcasecmp
50and
51.Fn strncasecmp
52functions compare the NUL-terminated strings
53.Fa s1 72.Fa s1
54and 73and
55.Fa s2 74.Fa s2
@@ -66,27 +85,44 @@ is greater than
66.Ql \e0 . 85.Ql \e0 .
67.Pp 86.Pp
68.Fn strncasecmp 87.Fn strncasecmp
69compares at most 88and
89.Fn strncasecmp_l
90compare at most
70.Fa len 91.Fa len
71characters. 92characters.
93.Pp
94On
95.Ox ,
96these functions always use the C locale and ignore
97the global locale, the thread-specific locale, and the
98.Fa locale
99argument.
100.Sh ENVIRONMENT
101On other operating systems, the behaviour of
102.Fn strcasecmp
103and
104.Fn strncasecmp
105may depend on the
106.Dv LC_CTYPE
107.Xr locale 1 .
72.Sh SEE ALSO 108.Sh SEE ALSO
73.Xr bcmp 3 ,
74.Xr memcmp 3 ,
75.Xr strcmp 3 , 109.Xr strcmp 3 ,
76.Xr strcoll 3 , 110.Xr strcoll 3 ,
77.Xr strxfrm 3 , 111.Xr strxfrm 3 ,
78.Xr wcscasecmp 3 112.Xr wcscasecmp 3
79.Sh STANDARDS 113.Sh STANDARDS
80The 114These functions conform to
81.Fn strcasecmp
82and
83.Fn strncasecmp
84functions conform to
85.St -p1003.1-2008 . 115.St -p1003.1-2008 .
86.Sh HISTORY 116.Sh HISTORY
87The 117The
88.Fn strcasecmp 118.Fn strcasecmp
89and 119and
90.Fn strncasecmp 120.Fn strncasecmp
91functions first appeared in 121functions have been available since
92.Bx 4.3 Tahoe . 122.Bx 4.3 Tahoe ,
123and
124.Fn strcasecmp_l
125and
126.Fn strncasecmp_l
127since
128.Ox 6.2 .