xref: /dflybsd-src/lib/libc/string/memmem.3 (revision d118ff3c3a4b3be37ffc939d7b34ef753cc61733)
1716024cdSPeter Avalos.\" Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com>
2716024cdSPeter Avalos.\"
3716024cdSPeter Avalos.\" Redistribution and use in source and binary forms, with or without
4716024cdSPeter Avalos.\" modification, are permitted provided that the following conditions
5716024cdSPeter Avalos.\" are met:
6716024cdSPeter Avalos.\" 1. Redistributions of source code must retain the above copyright
7716024cdSPeter Avalos.\"    notice, this list of conditions and the following disclaimer.
8716024cdSPeter Avalos.\" 2. Redistributions in binary form must reproduce the above copyright
9716024cdSPeter Avalos.\"    notice, this list of conditions and the following disclaimer in the
10716024cdSPeter Avalos.\"    documentation and/or other materials provided with the distribution.
11716024cdSPeter Avalos.\" 3. The name of the author may not be used to endorse or promote
12716024cdSPeter Avalos.\"    products derived from this software without specific prior written
13716024cdSPeter Avalos.\"    permission.
14716024cdSPeter Avalos.\"
15716024cdSPeter Avalos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16716024cdSPeter Avalos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17716024cdSPeter Avalos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18716024cdSPeter Avalos.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19716024cdSPeter Avalos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20716024cdSPeter Avalos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21716024cdSPeter Avalos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22716024cdSPeter Avalos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23716024cdSPeter Avalos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24716024cdSPeter Avalos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25716024cdSPeter Avalos.\" SUCH DAMAGE.
26716024cdSPeter Avalos.\"
270d5acd74SJohn Marino.\" $FreeBSD: head/lib/libc/string/memmem.3 152746 2005-11-24 06:56:21Z ru $
28716024cdSPeter Avalos.\"
29716024cdSPeter Avalos.Dd August 24, 2005
30716024cdSPeter Avalos.Dt MEMMEM 3
31716024cdSPeter Avalos.Os
32716024cdSPeter Avalos.Sh NAME
33716024cdSPeter Avalos.Nm memmem
34716024cdSPeter Avalos.Nd "locate a byte substring in a byte string"
35716024cdSPeter Avalos.Sh LIBRARY
36716024cdSPeter Avalos.Lb libc
37716024cdSPeter Avalos.Sh SYNOPSIS
38716024cdSPeter Avalos.In string.h
39716024cdSPeter Avalos.Ft "void *"
40716024cdSPeter Avalos.Fo memmem
41716024cdSPeter Avalos.Fa "const void *big" "size_t big_len"
42716024cdSPeter Avalos.Fa "const void *little" "size_t little_len"
43716024cdSPeter Avalos.Fc
44716024cdSPeter Avalos.Sh DESCRIPTION
45716024cdSPeter AvalosThe
46716024cdSPeter Avalos.Fn memmem
47716024cdSPeter Avalosfunction
48716024cdSPeter Avaloslocates the first occurrence of the byte string
49716024cdSPeter Avalos.Fa little
50716024cdSPeter Avalosin the byte string
51716024cdSPeter Avalos.Fa big .
52716024cdSPeter Avalos.Sh RETURN VALUES
53716024cdSPeter AvalosIf
54716024cdSPeter Avalos.Fa big_len
55716024cdSPeter Avalosis smaller than
56716024cdSPeter Avalos.Fa little_len ,
57716024cdSPeter Avalosif
58716024cdSPeter Avalos.Fa little_len
59716024cdSPeter Avalosis 0, if
60716024cdSPeter Avalos.Fa big_len
61716024cdSPeter Avalosis 0 or if
62716024cdSPeter Avalos.Fa little
63716024cdSPeter Avalosoccurs nowhere in
64716024cdSPeter Avalos.Fa big ,
65716024cdSPeter Avalos.Dv NULL
66716024cdSPeter Avalosis returned;
67716024cdSPeter Avalosotherwise a pointer to the first character of the first occurrence of
68716024cdSPeter Avalos.Fa little
69716024cdSPeter Avalosis returned.
70716024cdSPeter Avalos.Sh SEE ALSO
71716024cdSPeter Avalos.Xr memchr 3 ,
72716024cdSPeter Avalos.Xr strchr 3 ,
73716024cdSPeter Avalos.Xr strstr 3
74716024cdSPeter Avalos.Sh CONFORMING TO
75716024cdSPeter Avalos.Fn memmem
76716024cdSPeter Avalosis a GNU extension.
77716024cdSPeter Avalos.Sh HISTORY
78716024cdSPeter AvalosThe
79716024cdSPeter Avalos.Fn memmem
80716024cdSPeter Avalosfunction first appeared in
81716024cdSPeter Avalos.Fx 6.0 .
82716024cdSPeter Avalos.Sh AUTHORS
83*d118ff3cSFranco Fichtner.An Pascal Gloor Aq Mt pascal.gloor@spale.com
84716024cdSPeter Avalos.Sh BUGS
85716024cdSPeter AvalosThis function was broken in Linux libc up to and including version 5.0.9
86716024cdSPeter Avalosand in GNU libc prior to version 2.1.
87