summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strchr.3
diff options
context:
space:
mode:
authoraaron <>1999-06-04 17:26:27 +0000
committeraaron <>1999-06-04 17:26:27 +0000
commitb54ee9c910d2afd114c02825c362ba253d8bf917 (patch)
treeebcba47bac644d62639dc613eddfb560f2e15f5f /src/lib/libc/string/strchr.3
parenta75229263ddbca710a9fdffc776c5bfdad7c5dfe (diff)
downloadopenbsd-b54ee9c910d2afd114c02825c362ba253d8bf917.tar.gz
openbsd-b54ee9c910d2afd114c02825c362ba253d8bf917.tar.bz2
openbsd-b54ee9c910d2afd114c02825c362ba253d8bf917.zip
add examples
Diffstat (limited to 'src/lib/libc/string/strchr.3')
-rw-r--r--src/lib/libc/string/strchr.332
1 files changed, 21 insertions, 11 deletions
diff --git a/src/lib/libc/string/strchr.3 b/src/lib/libc/string/strchr.3
index c3bc2f8817..f4b4aef976 100644
--- a/src/lib/libc/string/strchr.3
+++ b/src/lib/libc/string/strchr.3
@@ -33,14 +33,14 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: strchr.3,v 1.3 1997/12/29 22:31:50 deraadt Exp $ 36.\" $OpenBSD: strchr.3,v 1.4 1999/06/04 17:26:26 aaron Exp $
37.\" 37.\"
38.Dd June 29, 1991 38.Dd June 29, 1991
39.Dt STRCHR 3 39.Dt STRCHR 3
40.Os 40.Os
41.Sh NAME 41.Sh NAME
42.Nm strchr 42.Nm strchr
43.Nd locate character in string 43.Nd locate first occurence of a character in a string
44.Sh SYNOPSIS 44.Sh SYNOPSIS
45.Fd #include <string.h> 45.Fd #include <string.h>
46.Ft char * 46.Ft char *
@@ -48,13 +48,11 @@
48.Sh DESCRIPTION 48.Sh DESCRIPTION
49The 49The
50.Fn strchr 50.Fn strchr
51function locates the first occurrence of 51function locates the first occurrence of the character
52.Ar c 52.Fa c
53in the string pointed to by 53in the string
54.Ar s . 54.Fa s .
55The terminating 55The terminating NUL character is considered part of the string.
56.Dv NUL
57character is considered part of the string.
58If 56If
59.Fa c 57.Fa c
60is 58is
@@ -63,11 +61,23 @@ is
63locates the terminating 61locates the terminating
64.Ql \e0 . 62.Ql \e0 .
65.Sh RETURN VALUES 63.Sh RETURN VALUES
66The function 64The
67.Fn strchr 65.Fn strchr
68returns a pointer to the located character, or 66function returns a pointer to the located character or
69.Dv NULL 67.Dv NULL
70if the character does not appear in the string. 68if the character does not appear in the string.
69.Sh EXAMPLES
70After the following call to
71.Fn strchr ,
72.Va p
73will point to the string
74.Qq oobar :
75.Bd -literal -offset indent
76char *p;
77char *s = "foobar";
78
79p = strchr(s, 'o');
80.Ed
71.Sh SEE ALSO 81.Sh SEE ALSO
72.Xr index 3 , 82.Xr index 3 ,
73.Xr memchr 3 , 83.Xr memchr 3 ,