Loading...
--- Libc/Libc-583/string/index.3
+++ Libc/Libc-262/string/index.3
@@ -32,56 +32,42 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)index.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/string/index.3,v 1.11 2003/09/08 19:57:15 ru Exp $
+.\" $FreeBSD: src/lib/libc/string/index.3,v 1.6 2001/10/01 16:09:00 ru Exp $
.\"
.Dd June 4, 1993
.Dt INDEX 3
.Os
.Sh NAME
-.Nm index , rindex
+.Nm index
.Nd locate character in string
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In strings.h
-.Ft "char *"
+.In string.h
+.Ft char *
.Fn index "const char *s" "int c"
-.Ft "char *"
-.Fn rindex "const char *s" "int c"
.Sh DESCRIPTION
The
.Fn index
function
-locates the first occurrence of
+locates the first character matching
.Fa c
(converted to a
-.Vt char )
-in the string pointed to by
+.Em char )
+in the null-terminated string
.Fa s .
-The terminating null character is considered to be part of the string;
-therefore, if
+.Sh RETURN VALUES
+A pointer to the character is returned if it is found; otherwise
+.Dv NULL
+is returned.
+If
.Fa c
-is
-.Ql \e0 ,
-the functions locate the terminating
-.Ql \e0 .
-.Pp
-The
-.Fn rindex
-function is identical to
-.Fn index ,
-except that it locates the last occurrence of
-.Fa c .
-.Sh RETURN VALUES
-The functions
+is '\e0',
.Fn index
-and
-.Fn rindex
-return a pointer to the located character, or
-.Dv NULL
-if the character does not appear in the string.
+locates the terminating '\e0'.
.Sh SEE ALSO
.Xr memchr 3 ,
+.Xr rindex 3 ,
.Xr strchr 3 ,
.Xr strcspn 3 ,
.Xr strpbrk 3 ,
@@ -91,16 +77,7 @@
.Xr strstr 3 ,
.Xr strtok 3
.Sh HISTORY
-The
+A
.Fn index
-and
-.Fn rindex
-functions appeared in
+function appeared in
.At v6 .
-Their prototypes existed previously in
-.In string.h
-before they were moved to
-.In strings.h
-for
-.St -p1003.1-2001
-compliance.