diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/string/Makefile.inc | 8 | ||||
-rw-r--r-- | lib/libc/string/index.3 | 82 | ||||
-rw-r--r-- | lib/libc/string/memchr.3 | 4 | ||||
-rw-r--r-- | lib/libc/string/rindex.3 | 82 | ||||
-rw-r--r-- | lib/libc/string/strchr.3 | 18 | ||||
-rw-r--r-- | lib/libc/string/strcspn.3 | 4 | ||||
-rw-r--r-- | lib/libc/string/strpbrk.3 | 4 | ||||
-rw-r--r-- | lib/libc/string/strrchr.3 | 18 | ||||
-rw-r--r-- | lib/libc/string/strspn.3 | 4 | ||||
-rw-r--r-- | lib/libc/string/strstr.3 | 4 | ||||
-rw-r--r-- | lib/libc/string/strtok.3 | 4 |
11 files changed, 39 insertions, 193 deletions
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index ff11ecac6c5..1e84f70a985 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.7 1999/04/25 00:10:07 millert Exp $ +# $OpenBSD: Makefile.inc,v 1.8 1999/09/21 16:44:01 espie Exp $ # string sources .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string ${LIBCSRCDIR}/string @@ -114,13 +114,15 @@ strrchr.ln: rindex.c lint ${LINTFLAGS} -DSTRRCHR ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} \ ${LIBCSRCDIR}/string/rindex.c -MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ - memcmp.3 memcpy.3 memmove.3 memset.3 rindex.3 strcasecmp.3 strcat.3 \ +MAN+= bm.3 bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 memccpy.3 memchr.3 \ + memcmp.3 memcpy.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strerror.3 \ string.3 strlen.3 strmode.3 strdup.3 strpbrk.3 strrchr.3 strsep.3 \ strsignal.3 strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 strlcpy.3 MLINKS+=bm.3 bm_comp.3 bm.3 bm_exec.3 bm.3 bm_free.3 +MLINKS+=strchr.3 index.3 +MLINKS+=strrchr.3 rindex.3 MLINKS+=strcasecmp.3 strncasecmp.3 MLINKS+=strcat.3 strncat.3 MLINKS+=strcmp.3 strncmp.3 diff --git a/lib/libc/string/index.3 b/lib/libc/string/index.3 deleted file mode 100644 index e70b13c55b4..00000000000 --- a/lib/libc/string/index.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" Copyright (c) 1990, 1991 The Regents of the University of California. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $OpenBSD: index.3,v 1.5 1999/06/29 18:01:32 aaron Exp $ -.\" -.Dd April 19, 1991 -.Dt INDEX 3 -.Os -.Sh NAME -.Nm index -.Nd locate character in string -.Sh SYNOPSIS -.Fd #include <string.h> -.Ft char * -.Fn index "const char *s" "int c" -.Sh DESCRIPTION -The -.Fn index -function -locates the first character matching -.Fa c -(converted to a -.Li char ) -in the null-terminated string -.Fa s . -.Sh RETURN VALUES -If the character -.Fa c -is found, a pointer to it is returned; otherwise, -.Dv NULL -is returned. -If -.Fa c -is '\e0', -.Fn index -locates the terminating '\e0'. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr rindex 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh HISTORY -An -.Fn index -function appeared in -.At v6 . diff --git a/lib/libc/string/memchr.3 b/lib/libc/string/memchr.3 index 81c524458ca..0bcdde698e8 100644 --- a/lib/libc/string/memchr.3 +++ b/lib/libc/string/memchr.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: memchr.3,v 1.3 1999/06/29 18:01:32 aaron Exp $ +.\" $OpenBSD: memchr.3,v 1.4 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt MEMCHR 3 @@ -65,8 +65,6 @@ if no such byte exists within .Fa len bytes. .Sh SEE ALSO -.Xr index 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strpbrk 3 , diff --git a/lib/libc/string/rindex.3 b/lib/libc/string/rindex.3 deleted file mode 100644 index d4bcbbea541..00000000000 --- a/lib/libc/string/rindex.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" Copyright (c) 1990, 1991 The Regents of the University of California. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek. -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $OpenBSD: rindex.3,v 1.4 1999/06/29 18:01:33 aaron Exp $ -.\" -.Dd April 19, 1991 -.Dt RINDEX 3 -.Os -.Sh NAME -.Nm rindex -.Nd locate character in string -.Sh SYNOPSIS -.Fd #include <string.h> -.Ft char * -.Fn rindex "const char *s" "int c" -.Sh DESCRIPTION -The -.Fn rindex -function -locates the last character -matching -.Fa c -(converted to a -.Li char ) -in the null-terminated string -.Fa s . -If the character c is found, a pointer to it is returned; otherwise, -.Dv NULL -is returned. -If -.Fa c -is -.Ql \e0 , -.Fn rindex -locates the terminating -.Ql \e0 . -.Sh SEE ALSO -.Xr index 3 , -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strcspn 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh HISTORY -A -.Fn rindex -function appeared in -.At v6 . diff --git a/lib/libc/string/strchr.3 b/lib/libc/string/strchr.3 index 2980f9bc873..5b117b83cad 100644 --- a/lib/libc/string/strchr.3 +++ b/lib/libc/string/strchr.3 @@ -33,18 +33,21 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strchr.3,v 1.5 1999/06/06 06:57:52 pjanzen Exp $ +.\" $OpenBSD: strchr.3,v 1.6 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRCHR 3 .Os .Sh NAME -.Nm strchr +.Nm strchr , +.Nm index .Nd locate first occurrence of a character in a string .Sh SYNOPSIS .Fd #include <string.h> .Ft char * .Fn strchr "const char *s" "int c" +.Ft char * +.Fn index "const char *s" "int c" .Sh DESCRIPTION The .Fn strchr @@ -60,6 +63,11 @@ is .Fn strchr locates the terminating .Ql \e0 . +.Pp +The +.Fn index +function is an old synonym for +.Fn strchr . .Sh RETURN VALUES The .Fn strchr @@ -79,9 +87,7 @@ char *s = "foobar"; p = strchr(s, 'o'); .Ed .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strcspn 3 , .Xr strpbrk 3 , .Xr strrchr 3 , @@ -95,3 +101,7 @@ The function conforms to .St -ansiC . +.Pp +The +.Fn index +function is deprecated and shouldn't be used in new code. diff --git a/lib/libc/string/strcspn.3 b/lib/libc/string/strcspn.3 index de6aff5ebd4..6f7233a3e4e 100644 --- a/lib/libc/string/strcspn.3 +++ b/lib/libc/string/strcspn.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strcspn.3,v 1.3 1999/06/04 16:39:27 aaron Exp $ +.\" $OpenBSD: strcspn.3,v 1.4 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRCSPN 3 @@ -80,9 +80,7 @@ size_t span; span = strcspn(s, charset); .Ed .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strpbrk 3 , .Xr strrchr 3 , diff --git a/lib/libc/string/strpbrk.3 b/lib/libc/string/strpbrk.3 index 66b9cb26838..c7b7731ec2b 100644 --- a/lib/libc/string/strpbrk.3 +++ b/lib/libc/string/strpbrk.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strpbrk.3,v 1.3 1999/06/29 18:01:33 aaron Exp $ +.\" $OpenBSD: strpbrk.3,v 1.4 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRPBRK 3 @@ -62,9 +62,7 @@ occur anywhere in returns .Dv NULL . .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strrchr 3 , diff --git a/lib/libc/string/strrchr.3 b/lib/libc/string/strrchr.3 index 9f288f0b5f2..8de041810bc 100644 --- a/lib/libc/string/strrchr.3 +++ b/lib/libc/string/strrchr.3 @@ -33,18 +33,21 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strrchr.3,v 1.4 1999/06/06 06:57:52 pjanzen Exp $ +.\" $OpenBSD: strrchr.3,v 1.5 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRRCHR 3 .Os .Sh NAME -.Nm strrchr +.Nm strrchr , +.Nm rindex .Nd locate last occurrence of a character in a string .Sh SYNOPSIS .Fd #include <string.h> .Ft char * .Fn strrchr "const char *s" "int c" +.Ft char * +.Fn rindex "const char *s" "int c" .Sh DESCRIPTION The .Fn strrchr @@ -60,6 +63,11 @@ is .Fn strrchr locates the terminating .Ql \e0 . +.Pp +The +.Fn rindex +function is an old synonym for +.Fn strrchr . .Sh RETURN VALUES The .Fn strrchr @@ -79,9 +87,7 @@ char *s = "foobar"; p = strrchr(s, 'o'); .Ed .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strpbrk 3 , @@ -95,3 +101,7 @@ The function conforms to .St -ansiC . +.Pp +The +.Fn rindex +function is deprecated and shouldn't be used in new code. diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3 index f8834dfecc0..8274a06b65f 100644 --- a/lib/libc/string/strspn.3 +++ b/lib/libc/string/strspn.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strspn.3,v 1.4 1999/06/04 16:30:01 aaron Exp $ +.\" $OpenBSD: strspn.3,v 1.5 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRSPN 3 @@ -75,9 +75,7 @@ size_t span; span = strspn(s, charset); .Ed .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strpbrk 3 , diff --git a/lib/libc/string/strstr.3 b/lib/libc/string/strstr.3 index 773163ecc65..3287cce0ce0 100644 --- a/lib/libc/string/strstr.3 +++ b/lib/libc/string/strstr.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strstr.3,v 1.3 1999/06/29 18:01:33 aaron Exp $ +.\" $OpenBSD: strstr.3,v 1.4 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRSTR 3 @@ -71,9 +71,7 @@ otherwise returns a pointer to the first character of the first occurrence of .Fa little . .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strpbrk 3 , diff --git a/lib/libc/string/strtok.3 b/lib/libc/string/strtok.3 index 287d1bf1315..afe851f5bc8 100644 --- a/lib/libc/string/strtok.3 +++ b/lib/libc/string/strtok.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strtok.3,v 1.8 1999/07/03 16:21:31 aaron Exp $ +.\" $OpenBSD: strtok.3,v 1.9 1999/09/21 16:44:01 espie Exp $ .\" .Dd June 29, 1991 .Dt STRTOK 3 @@ -112,9 +112,7 @@ tokens[2] will point to and tokens[3] will point to .Qq cow . .Sh SEE ALSO -.Xr index 3 , .Xr memchr 3 , -.Xr rindex 3 , .Xr strchr 3 , .Xr strcspn 3 , .Xr strpbrk 3 , |