summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strstr.3
diff options
context:
space:
mode:
authorderaadt <>2005-03-30 03:04:19 +0000
committerderaadt <>2005-03-30 03:04:19 +0000
commit1228747c59a633553cbbe9bf77bcf13d6371ca5f (patch)
tree497eaca30513e775d09718188ce2fb4fde797781 /src/lib/libc/string/strstr.3
parent3b040f7dfaf37c407ea6ede1c8c2092e6bf903fd (diff)
downloadopenbsd-1228747c59a633553cbbe9bf77bcf13d6371ca5f.tar.gz
openbsd-1228747c59a633553cbbe9bf77bcf13d6371ca5f.tar.bz2
openbsd-1228747c59a633553cbbe9bf77bcf13d6371ca5f.zip
strcasestr(3), a case-insensitive version of strstr(3). already in netbsd
and freebsd, apparently written by torek, the man we never see anymore; submitted by jcs, but he is not around right now for the libc major crank so i sneak it in for him
Diffstat (limited to 'src/lib/libc/string/strstr.3')
-rw-r--r--src/lib/libc/string/strstr.332
1 files changed, 19 insertions, 13 deletions
diff --git a/src/lib/libc/string/strstr.3 b/src/lib/libc/string/strstr.3
index 64396e7885..2c8fa1888f 100644
--- a/src/lib/libc/string/strstr.3
+++ b/src/lib/libc/string/strstr.3
@@ -29,18 +29,20 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strstr.3,v 1.7 2005/02/25 03:12:44 cloder Exp $ 32.\" $OpenBSD: strstr.3,v 1.8 2005/03/30 03:04:19 deraadt Exp $
33.\" 33.\"
34.Dd June 29, 1991 34.Dd June 29, 1991
35.Dt STRSTR 3 35.Dt STRSTR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
38.Nm strstr 38.Nm strstr , strcasestr
39.Nd locate a substring in a string 39.Nd locate a substring in a string
40.Sh SYNOPSIS 40.Sh SYNOPSIS
41.Fd #include <string.h> 41.Fd #include <string.h>
42.Ft char * 42.Ft char *
43.Fn strstr "const char *big" "const char *little" 43.Fn strstr "const char *big" "const char *little"
44.Ft char *
45.Fn strcasestr "const char *big" "const char *little"
44.Sh DESCRIPTION 46.Sh DESCRIPTION
45The 47The
46.Fn strstr 48.Fn strstr
@@ -48,23 +50,27 @@ function locates the first occurrence of the NUL-terminated string
48.Fa little 50.Fa little
49in the NUL-terminated string 51in the NUL-terminated string
50.Fa big . 52.Fa big .
53.Pp
54The
55.Fn strcasestr
56function is similar to
57.Fn strstr
58but ignores the case of both strings.
59.Pp
51If 60If
52.Fa little 61.Fa little
53is the empty string, 62is an empty string,
54.Fn strstr 63.Fa big
55returns 64is returned;
56.Fa big ;
57if 65if
58.Fa little 66.Fa little
59occurs nowhere in 67occurs nowhere in
60.Fa big , 68.Fa big ,
61.Fn strstr 69.Dv NULL
62returns 70is returned;
63.Dv NULL ; 71otherwise a pointer to the first character of the first occurrence of
64otherwise 72.Fa little
65.Fn strstr 73is returned.
66returns a pointer to the first character of the first occurrence of
67.Fa little .
68.Sh SEE ALSO 74.Sh SEE ALSO
69.Xr memchr 3 , 75.Xr memchr 3 ,
70.Xr strchr 3 , 76.Xr strchr 3 ,