Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/string bring in EXAMPLES from openbsd.



details:   https://anonhg.NetBSD.org/src/rev/10c27f899861
branches:  trunk
changeset: 535145:10c27f899861
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Aug 11 07:50:04 2002 +0000

description:
bring in EXAMPLES from openbsd.

diffstat:

 lib/libc/string/strcspn.3 |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 2dc5ff1a7a32 -r 10c27f899861 lib/libc/string/strcspn.3
--- a/lib/libc/string/strcspn.3 Sun Aug 11 07:46:56 2002 +0000
+++ b/lib/libc/string/strcspn.3 Sun Aug 11 07:50:04 2002 +0000
@@ -34,9 +34,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     from: @(#)strcspn.3    8.1 (Berkeley) 6/4/93
-.\"    $NetBSD: strcspn.3,v 1.6 2002/02/07 07:00:32 ross Exp $
+.\"    $NetBSD: strcspn.3,v 1.7 2002/08/11 07:50:04 yamt Exp $
 .\"
-.Dd June 4, 1993
+.Dd August 11, 2002
 .Dt STRCSPN 3
 .Os
 .Sh NAME
@@ -68,6 +68,20 @@
 .Fn strcspn
 function
 returns the number of characters spanned.
+.Sh EXAMPLES
+The following call to
+.Fn strcspn
+will return 3, since the first three characters of string
+.Fa s
+do not occur in string
+.Fa charset :
+.Bd -literal -offset indent
+char *s = "foobar";
+char *charset = "bar";
+size_t span;
+
+span = strcspn(s, charset);
+.Ed
 .Sh SEE ALSO
 .Xr index 3 ,
 .Xr memchr 3 ,



Home | Main Index | Thread Index | Old Index