summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strchr.3
diff options
context:
space:
mode:
authorespie <>1999-09-21 16:44:01 +0000
committerespie <>1999-09-21 16:44:01 +0000
commiteddda6bf00c124288aea38cccb8f6cbd44e6a13b (patch)
tree78f295f62064116a7fdc2f6a38a0d0813eb4d2ad /src/lib/libc/string/strchr.3
parent7888080e5d9ce71af4015e34c3c3a0a0d3d3119a (diff)
downloadopenbsd-eddda6bf00c124288aea38cccb8f6cbd44e6a13b.tar.gz
openbsd-eddda6bf00c124288aea38cccb8f6cbd44e6a13b.tar.bz2
openbsd-eddda6bf00c124288aea38cccb8f6cbd44e6a13b.zip
index/rindex as deprecated synonyms to strchr/strrchr.
Diffstat (limited to 'src/lib/libc/string/strchr.3')
-rw-r--r--src/lib/libc/string/strchr.318
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/libc/string/strchr.3 b/src/lib/libc/string/strchr.3
index 2980f9bc87..5b117b83ca 100644
--- a/src/lib/libc/string/strchr.3
+++ b/src/lib/libc/string/strchr.3
@@ -33,18 +33,21 @@
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.5 1999/06/06 06:57:52 pjanzen Exp $ 36.\" $OpenBSD: strchr.3,v 1.6 1999/09/21 16:44:01 espie 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.Nm index
43.Nd locate first occurrence of a character in a string 44.Nd locate first occurrence of a character in a string
44.Sh SYNOPSIS 45.Sh SYNOPSIS
45.Fd #include <string.h> 46.Fd #include <string.h>
46.Ft char * 47.Ft char *
47.Fn strchr "const char *s" "int c" 48.Fn strchr "const char *s" "int c"
49.Ft char *
50.Fn index "const char *s" "int c"
48.Sh DESCRIPTION 51.Sh DESCRIPTION
49The 52The
50.Fn strchr 53.Fn strchr
@@ -60,6 +63,11 @@ is
60.Fn strchr 63.Fn strchr
61locates the terminating 64locates the terminating
62.Ql \e0 . 65.Ql \e0 .
66.Pp
67The
68.Fn index
69function is an old synonym for
70.Fn strchr .
63.Sh RETURN VALUES 71.Sh RETURN VALUES
64The 72The
65.Fn strchr 73.Fn strchr
@@ -79,9 +87,7 @@ char *s = "foobar";
79p = strchr(s, 'o'); 87p = strchr(s, 'o');
80.Ed 88.Ed
81.Sh SEE ALSO 89.Sh SEE ALSO
82.Xr index 3 ,
83.Xr memchr 3 , 90.Xr memchr 3 ,
84.Xr rindex 3 ,
85.Xr strcspn 3 , 91.Xr strcspn 3 ,
86.Xr strpbrk 3 , 92.Xr strpbrk 3 ,
87.Xr strrchr 3 , 93.Xr strrchr 3 ,
@@ -95,3 +101,7 @@ The
95function 101function
96conforms to 102conforms to
97.St -ansiC . 103.St -ansiC .
104.Pp
105The
106.Fn index
107function is deprecated and shouldn't be used in new code.