diff options
author | allanjude <allanjude@FreeBSD.org> | 2014-05-25 18:40:32 +0000 |
---|---|---|
committer | allanjude <allanjude@FreeBSD.org> | 2014-05-25 18:40:32 +0000 |
commit | 001dede6f087701477030b809e4935e3c02c6cbd (patch) | |
tree | b68ad46d17d88792d8e3f25f5f37179713899603 /lib/libc | |
parent | d85652abc40ed50334d17518ab7b133357c7aea0 (diff) | |
download | FreeBSD-src-001dede6f087701477030b809e4935e3c02c6cbd.zip FreeBSD-src-001dede6f087701477030b809e4935e3c02c6cbd.tar.gz |
Merge strcspn.3 into strspn.3 and clarify the explaination of what they do
Detach strcspn.3 from the build
Add strcspn.3 to MLINKS do it will be symlinked to strspn.3
Approved by: eadler (mentor), bcr (mentor)
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/string/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/libc/string/strcspn.3 | 88 | ||||
-rw-r--r-- | lib/libc/string/strspn.3 | 44 |
3 files changed, 37 insertions, 98 deletions
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index 9ad5cbb..731f4fc 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -30,7 +30,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/string/Symbol.map MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ - strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strdup.3 strerror.3 \ + strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \ string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \ strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \ wcswidth.3 wcsxfrm.3 wmemchr.3 @@ -60,6 +60,7 @@ MLINKS+=strerror.3 perror.3 \ strerror.3 sys_nerr.3 MLINKS+=strlcpy.3 strlcat.3 MLINKS+=strlen.3 strnlen.3 +MLINKS+=strspn.3 strcspn.3 MLINKS+=strstr.3 strcasestr.3 \ strstr.3 strnstr.3 \ strstr.3 strcasestr_l.3 diff --git a/lib/libc/string/strcspn.3 b/lib/libc/string/strcspn.3 deleted file mode 100644 index 0331ca1..0000000 --- a/lib/libc/string/strcspn.3 +++ /dev/null @@ -1,88 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Chris Torek and the American National Standards Committee X3, -.\" on Information Processing Systems. -.\" -.\" 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. 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. -.\" -.\" @(#)strcspn.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD$ -.\" -.Dd June 4, 1993 -.Dt STRCSPN 3 -.Os -.Sh NAME -.Nm strcspn -.Nd span the complement of a string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In string.h -.Ft size_t -.Fn strcspn "const char *s" "const char *charset" -.Sh DESCRIPTION -The -.Fn strcspn -function -spans the initial part of the null-terminated string -.Fa s -as long as the characters from -.Fa s -do not occur in string -.Fa charset -(it -spans the -.Em complement -of -.Fa charset ) . -In other words, it computes the string array index in -.Fa s -of the first character of -.Fa s -which is also in -.Fa charset , -else the index of the first null character. -.Sh RETURN VALUES -The -.Fn strcspn -function -returns the number of characters spanned. -.Sh SEE ALSO -.Xr memchr 3 , -.Xr strchr 3 , -.Xr strpbrk 3 , -.Xr strrchr 3 , -.Xr strsep 3 , -.Xr strspn 3 , -.Xr strstr 3 , -.Xr strtok 3 -.Sh STANDARDS -The -.Fn strcspn -function -conforms to -.St -isoC . diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3 index 2ba6a6b..605e54f 100644 --- a/lib/libc/string/strspn.3 +++ b/lib/libc/string/strspn.3 @@ -32,11 +32,12 @@ .\" @(#)strspn.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 24, 2014 .Dt STRSPN 3 .Os .Sh NAME -.Nm strspn +.Nm strspn , +.Nm strcspn .Nd span a string .Sh LIBRARY .Lb libc @@ -44,6 +45,8 @@ .In string.h .Ft size_t .Fn strspn "const char *s" "const char *charset" +.Ft size_t +.Fn strcspn "const char *s" "const char *charset" .Sh DESCRIPTION The .Fn strspn @@ -54,22 +57,43 @@ as long as the characters from .Fa s occur in the null-terminated string .Fa charset . -In other words, it computes the string array index in -.Fa s +In other words, it computes the string array index of the first character of .Fa s which is not in .Fa charset , else the index of the first null character. +.Pp +The +.Fn strcspn +function +spans the initial part of the null-terminated string +.Fa s +as long as the characters from +.Fa s +do not occur in the null-terminated string +.Fa charset +(it +spans the +.Em complement +of +.Fa charset ) . +In other words, it computes the string array index +of the first character of +.Fa s +which is also in +.Fa charset , +else the index of the first null character. .Sh RETURN VALUES The .Fn strspn -function -returns the number of characters spanned. +and +.Fn strcspn +functions +return the number of characters spanned. .Sh SEE ALSO .Xr memchr 3 , .Xr strchr 3 , -.Xr strcspn 3 , .Xr strpbrk 3 , .Xr strrchr 3 , .Xr strsep 3 , @@ -79,6 +103,8 @@ returns the number of characters spanned. .Sh STANDARDS The .Fn strspn -function -conforms to +and +.Fn strcspn +functions +conform to .St -isoC . |