Loading...
--- Libc/Libc-1725.40.4/string/FreeBSD/index.3
+++ Libc/Libc-320/string/FreeBSD/index.3
@@ -11,6 +11,10 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
@@ -28,56 +32,42 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)index.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/string/index.3,v 1.12 2007/01/09 00:28:12 imp Exp $
+.\" $FreeBSD: src/lib/libc/string/index.3,v 1.8 2002/12/18 13:33:03 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 *"
+.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
+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 ,
@@ -87,16 +77,14 @@
.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
+Its prototype existed previously in
+.Aq Pa string.h
+before it was moved to
+.Aq Pa strings.h
for
.St -p1003.1-2001
compliance.