summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcspn.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strcspn.3')
-rw-r--r--src/lib/libc/string/strcspn.331
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/libc/string/strcspn.3 b/src/lib/libc/string/strcspn.3
index cc9e5c2fe3..37e8f163f1 100644
--- a/src/lib/libc/string/strcspn.3
+++ b/src/lib/libc/string/strcspn.3
@@ -33,8 +33,7 @@
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.\" from: @(#)strcspn.3 5.3 (Berkeley) 6/29/91 36.\" $OpenBSD: strcspn.3,v 1.5 2000/04/21 15:24:20 aaron Exp $
37.\" $Id: strcspn.3,v 1.1.1.1 1995/10/18 08:42:22 deraadt Exp $
38.\" 37.\"
39.Dd June 29, 1991 38.Dd June 29, 1991
40.Dt STRCSPN 3 39.Dt STRCSPN 3
@@ -49,27 +48,36 @@
49.Sh DESCRIPTION 48.Sh DESCRIPTION
50The 49The
51.Fn strcspn 50.Fn strcspn
52function 51function spans the initial part of the null-terminated string
53spans the initial part of the null-terminated string
54.Fa s 52.Fa s
55as long as the characters from 53as long as the characters from
56.Fa s 54.Fa s
57do not occur in string 55do not occur in string
58.Fa charset 56.Fa charset
59(it 57(it spans the
60spans the
61.Em complement 58.Em complement
62of 59of
63.Fa charset ) . 60.Fa charset ) .
64.Sh RETURN VALUES 61.Sh RETURN VALUES
65The 62The
66.Fn strcspn 63.Fn strcspn
67function 64function returns the number of characters spanned.
68returns the number of characters spanned. 65.Sh EXAMPLES
66The following call to
67.Fn strcspn
68will return 3, since the first three characters of string
69.Fa s
70do not occur in string
71.Fa charset :
72.Bd -literal -offset indent
73char *s = "foobar";
74char *charset = "bar";
75size_t span;
76
77span = strcspn(s, charset);
78.Ed
69.Sh SEE ALSO 79.Sh SEE ALSO
70.Xr index 3 ,
71.Xr memchr 3 , 80.Xr memchr 3 ,
72.Xr rindex 3 ,
73.Xr strchr 3 , 81.Xr strchr 3 ,
74.Xr strpbrk 3 , 82.Xr strpbrk 3 ,
75.Xr strrchr 3 , 83.Xr strrchr 3 ,
@@ -80,6 +88,5 @@ returns the number of characters spanned.
80.Sh STANDARDS 88.Sh STANDARDS
81The 89The
82.Fn strcspn 90.Fn strcspn
83function 91function conforms to
84conforms to
85.St -ansiC . 92.St -ansiC .