summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2000-04-21 15:24:21 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2000-04-21 15:24:21 +0000
commitf427a49cebae937b58bd921c20803593806f0d90 (patch)
tree9b34e9c6151a86aa2c4ccd5da3329e545598269f /lib/libc/string
parentf3b3a991bbd7e54d2e2f1b8c8bbf4eb4d4d22e28 (diff)
Flesh out libc string function man pages.
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/bcmp.35
-rw-r--r--lib/libc/string/bcopy.35
-rw-r--r--lib/libc/string/bm.34
-rw-r--r--lib/libc/string/bstring.317
-rw-r--r--lib/libc/string/bzero.38
-rw-r--r--lib/libc/string/ffs.38
-rw-r--r--lib/libc/string/memccpy.39
-rw-r--r--lib/libc/string/memchr.315
-rw-r--r--lib/libc/string/memcmp.315
-rw-r--r--lib/libc/string/memcpy.311
-rw-r--r--lib/libc/string/memmove.38
-rw-r--r--lib/libc/string/memset.315
-rw-r--r--lib/libc/string/strcasecmp.35
-rw-r--r--lib/libc/string/strcat.321
-rw-r--r--lib/libc/string/strchr.35
-rw-r--r--lib/libc/string/strcmp.38
-rw-r--r--lib/libc/string/strcoll.38
-rw-r--r--lib/libc/string/strcpy.317
-rw-r--r--lib/libc/string/strcspn.314
-rw-r--r--lib/libc/string/strdup.39
-rw-r--r--lib/libc/string/string.35
-rw-r--r--lib/libc/string/strlcpy.312
-rw-r--r--lib/libc/string/strlen.314
-rw-r--r--lib/libc/string/strmode.38
-rw-r--r--lib/libc/string/strpbrk.310
-rw-r--r--lib/libc/string/strrchr.39
-rw-r--r--lib/libc/string/strsep.35
-rw-r--r--lib/libc/string/strspn.311
-rw-r--r--lib/libc/string/strstr.38
-rw-r--r--lib/libc/string/strtok.327
-rw-r--r--lib/libc/string/strxfrm.38
31 files changed, 141 insertions, 183 deletions
diff --git a/lib/libc/string/bcmp.3 b/lib/libc/string/bcmp.3
index 15ebd39cccc..d880c1e6f08 100644
--- a/lib/libc/string/bcmp.3
+++ b/lib/libc/string/bcmp.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bcmp.3,v 1.4 1999/06/29 18:01:30 aaron Exp $
+.\" $OpenBSD: bcmp.3,v 1.5 2000/04/21 15:24:18 aaron Exp $
.\"
.Dd April 19, 1991
.Dt BCMP 3
@@ -46,8 +46,7 @@
.Sh DESCRIPTION
The
.Fn bcmp
-function
-compares byte string
+function compares byte string
.Fa b1
against byte string
.Fa b2 ,
diff --git a/lib/libc/string/bcopy.3 b/lib/libc/string/bcopy.3
index da144e7d178..b290418f4a3 100644
--- a/lib/libc/string/bcopy.3
+++ b/lib/libc/string/bcopy.3
@@ -32,7 +32,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bcopy.3,v 1.4 1999/06/29 18:01:31 aaron Exp $
+.\" $OpenBSD: bcopy.3,v 1.5 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd April 19, 1991
.Dt BCOPY 3
@@ -47,8 +47,7 @@
.Sh DESCRIPTION
The
.Fn bcopy
-function
-copies
+function copies
.Fa len
bytes from string
.Fa src
diff --git a/lib/libc/string/bm.3 b/lib/libc/string/bm.3
index afab2334db2..15277de8853 100644
--- a/lib/libc/string/bm.3
+++ b/lib/libc/string/bm.3
@@ -32,7 +32,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bm.3,v 1.4 1999/06/29 17:49:24 aaron Exp $
+.\" $OpenBSD: bm.3,v 1.5 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1999
.Dt BM 3
@@ -59,7 +59,7 @@ occurrence of a byte string within another byte string.
evaluates
.Fa patlen
bytes starting at
-.Fa pattern ,
+.Fa pattern
and returns a pointer to a structure describing them.
The bytes referenced by
.Fa pattern
diff --git a/lib/libc/string/bstring.3 b/lib/libc/string/bstring.3
index 0dda6c7278c..85283321c83 100644
--- a/lib/libc/string/bstring.3
+++ b/lib/libc/string/bstring.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bstring.3,v 1.3 1999/06/06 15:17:31 aaron Exp $
+.\" $OpenBSD: bstring.3,v 1.4 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd April 19, 1991
.Dt BSTRING 3
@@ -96,14 +96,15 @@ and
conform to
.St -ansiC .
.Sh HISTORY
-The functions
+The
.Fn bzero
and
.Fn memccpy
-appeared in
-.Bx 4.3 ;
-the functions
-.Fn bcmp ,
-.Fn bcopy ,
-appeared in
+functions appeared in
+.Bx 4.3 .
+The
+.Fn bcmp
+and
+.Fn bcopy
+functions appeared in
.Bx 4.2 .
diff --git a/lib/libc/string/bzero.3 b/lib/libc/string/bzero.3
index 4a35aafa1be..a735d5ef3f2 100644
--- a/lib/libc/string/bzero.3
+++ b/lib/libc/string/bzero.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bzero.3,v 1.4 1999/06/29 18:01:32 aaron Exp $
+.\" $OpenBSD: bzero.3,v 1.5 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd April 19, 1991
.Dt BZERO 3
@@ -46,8 +46,7 @@
.Sh DESCRIPTION
The
.Fn bzero
-function
-writes
+function writes
.Fa len
zero bytes to the string
.Fa b .
@@ -62,6 +61,5 @@ does nothing.
.Sh HISTORY
A
.Fn bzero
-function
-appeared in
+function appeared in
.Bx 4.3 .
diff --git a/lib/libc/string/ffs.3 b/lib/libc/string/ffs.3
index 9ef08aef8e8..dc7a20741e6 100644
--- a/lib/libc/string/ffs.3
+++ b/lib/libc/string/ffs.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: ffs.3,v 1.2 1996/08/19 08:34:01 tholo Exp $
+.\" $OpenBSD: ffs.3,v 1.3 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd April 19, 1991
.Dt FFS 3
@@ -46,12 +46,10 @@
.Sh DESCRIPTION
The
.Fn ffs
-function
-finds the first bit set in
+function finds the first bit set in
.Fa value
and returns the index of that bit.
-Bits are numbered starting from 1, starting at the right-most
-bit.
+Bits are numbered starting from 1, starting at the rightmost bit.
A return value of 0 means that the argument was zero.
.Sh SEE ALSO
.Xr bitstring 3
diff --git a/lib/libc/string/memccpy.3 b/lib/libc/string/memccpy.3
index 873d3f784b5..feedeff3a64 100644
--- a/lib/libc/string/memccpy.3
+++ b/lib/libc/string/memccpy.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: memccpy.3,v 1.5 1999/06/29 18:01:32 aaron Exp $
+.\" $OpenBSD: memccpy.3,v 1.6 2000/04/21 15:24:19 aaron Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -46,14 +46,15 @@
.Sh DESCRIPTION
The
.Fn memccpy
-function
-copies bytes from string
+function copies bytes from string
.Fa src
to string
.Fa dst .
If the character
.Fa c
-(as converted to an unsigned char) occurs in the string
+(as converted to an
+.Li unsigned char )
+occurs in the string
.Fa src ,
the copy stops and a pointer to the byte after the copy of
.Fa c
diff --git a/lib/libc/string/memchr.3 b/lib/libc/string/memchr.3
index 0bcdde698e8..632c440b5b8 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.4 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: memchr.3,v 1.5 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt MEMCHR 3
@@ -48,18 +48,16 @@
.Sh DESCRIPTION
The
.Fn memchr
-function
-locates the first occurrence of
+function locates the first occurrence of
.Fa c
-(converted to an unsigned char)
+(converted to an
+.Li unsigned char )
in string
.Fa b .
.Sh RETURN VALUES
The
.Fn memchr
-function
-returns a pointer to the byte located,
-or
+function returns a pointer to the byte located, or
.Dv NULL
if no such byte exists within
.Fa len
@@ -76,6 +74,5 @@ bytes.
.Sh STANDARDS
The
.Fn memchr
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/memcmp.3 b/lib/libc/string/memcmp.3
index 34c5f608611..db4fef364bd 100644
--- a/lib/libc/string/memcmp.3
+++ b/lib/libc/string/memcmp.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memcmp.3,v 1.3 1996/12/10 09:06:11 deraadt Exp $
+.\" $OpenBSD: memcmp.3,v 1.4 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt MEMCMP 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn memcmp
-function
-compares byte string
+function compares byte string
.Fa b1
against byte string
.Fa b2 .
@@ -59,10 +58,11 @@ bytes long.
.Sh RETURN VALUES
The
.Fn memcmp
-function
-returns zero if the two strings are identical,
+function returns zero if the two strings are identical,
otherwise returns the difference between the first two differing bytes
-(treated as unsigned char values, so that
+(treated as
+.Li unsigned char
+values, so that
.Sq Li \e200
is greater than
.Sq Li \&\e0 ,
@@ -77,6 +77,5 @@ Zero-length strings are always identical.
.Sh STANDARDS
The
.Fn memcmp
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3
index 75eb00b2d56..030eadff20c 100644
--- a/lib/libc/string/memcpy.3
+++ b/lib/libc/string/memcpy.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memcpy.3,v 1.2 1996/08/19 08:34:06 tholo Exp $
+.\" $OpenBSD: memcpy.3,v 1.3 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt MEMCPY 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn memcpy
-function
-copies
+function copies
.Fa len
bytes from string
.Fa src
@@ -58,8 +57,7 @@ to string
.Sh RETURN VALUES
The
.Fn memcpy
-function
-returns the original value of
+function returns the original value of
.Fa dst .
.Sh SEE ALSO
.Xr bcopy 3 ,
@@ -69,8 +67,7 @@ returns the original value of
.Sh STANDARDS
The
.Fn memcpy
-function
-conforms to
+function conforms to
.St -ansiC .
.Sh BUGS
In this implementation
diff --git a/lib/libc/string/memmove.3 b/lib/libc/string/memmove.3
index 95f6b7596c7..026dab0f9fb 100644
--- a/lib/libc/string/memmove.3
+++ b/lib/libc/string/memmove.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memmove.3,v 1.2 1996/08/19 08:34:07 tholo Exp $
+.\" $OpenBSD: memmove.3,v 1.3 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt MEMMOVE 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn memmove
-function
-copies
+function copies
.Fa len
bytes from string
.Fa src
@@ -70,6 +69,5 @@ function returns the original value of
.Sh STANDARDS
The
.Fn memmove
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/memset.3 b/lib/libc/string/memset.3
index e1d8583732a..9da14983c7c 100644
--- a/lib/libc/string/memset.3
+++ b/lib/libc/string/memset.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memset.3,v 1.3 1997/08/24 21:56:45 deraadt Exp $
+.\" $OpenBSD: memset.3,v 1.4 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt MEMSET 3
@@ -48,18 +48,18 @@
.Sh DESCRIPTION
The
.Fn memset
-function
-writes
+function writes
.Fa len
bytes of value
.Fa c
-(converted to an unsigned char) to the string
+(converted to an
+.Li unsigned char )
+to the string
.Fa b .
.Sh RETURN VALUES
The
.Fn memset
-function
-returns the original value of
+function returns the original value of
.Fa b .
.Sh SEE ALSO
.Xr bzero 3 ,
@@ -67,6 +67,5 @@ returns the original value of
.Sh STANDARDS
The
.Fn memset
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strcasecmp.3 b/lib/libc/string/strcasecmp.3
index be4e96a1c56..3cfc76e36fe 100644
--- a/lib/libc/string/strcasecmp.3
+++ b/lib/libc/string/strcasecmp.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strcasecmp.3,v 1.5 1999/06/06 15:17:32 aaron Exp $
+.\" $OpenBSD: strcasecmp.3,v 1.6 2000/04/21 15:24:19 aaron Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -53,8 +53,7 @@ The
.Fn strcasecmp
and
.Fn strncasecmp
-functions
-compare the null-terminated strings
+functions compare the null-terminated strings
.Fa s1
and
.Fa s2
diff --git a/lib/libc/string/strcat.3 b/lib/libc/string/strcat.3
index 6a7c51c487c..e9e5163bd36 100644
--- a/lib/libc/string/strcat.3
+++ b/lib/libc/string/strcat.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcat.3,v 1.7 1999/06/06 06:57:52 pjanzen Exp $
+.\" $OpenBSD: strcat.3,v 1.8 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd July 8, 1997
.Dt STRCAT 3
@@ -53,8 +53,7 @@ The
.Fn strcat
and
.Fn strncat
-functions
-append a copy of the null-terminated string
+functions append a copy of the null-terminated string
.Fa append
to the end of the null-terminated string
.Fa s ,
@@ -66,8 +65,7 @@ must have sufficient space to hold the result.
.Pp
The
.Fn strncat
-function
-appends not more than
+function appends not more than
.Fa count
characters where space for the terminating
.Ql \e0
@@ -78,8 +76,7 @@ The
.Fn strcat
and
.Fn strncat
-functions
-return the pointer
+functions return the pointer
.Fa s .
.Sh EXAMPLES
The following appends
@@ -109,9 +106,10 @@ The above will copy as many characters from
.Dq Li input
to
.Dq Li buf
-as will
-fit. It then appends as many characters from suffix as will fit (or none
-if there is no space). For operations like this, the
+as will fit.
+It then appends as many characters from suffix as will fit (or none
+if there is no space).
+For operations like this, the
.Xr strlcpy 3
and
.Xr strlcat 3
@@ -133,6 +131,5 @@ The
.Fn strcat
and
.Fn strncat
-functions
-conform to
+functions conform to
.St -ansiC .
diff --git a/lib/libc/string/strchr.3 b/lib/libc/string/strchr.3
index 5b117b83cad..1333a305d66 100644
--- a/lib/libc/string/strchr.3
+++ b/lib/libc/string/strchr.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strchr.3,v 1.6 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: strchr.3,v 1.7 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRCHR 3
@@ -98,8 +98,7 @@ p = strchr(s, 'o');
.Sh STANDARDS
The
.Fn strchr
-function
-conforms to
+function conforms to
.St -ansiC .
.Pp
The
diff --git a/lib/libc/string/strcmp.3 b/lib/libc/string/strcmp.3
index a1f59b4dd98..c1173a423a7 100644
--- a/lib/libc/string/strcmp.3
+++ b/lib/libc/string/strcmp.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcmp.3,v 1.4 1999/06/06 15:17:32 aaron Exp $
+.\" $OpenBSD: strcmp.3,v 1.5 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRCMP 3
@@ -53,8 +53,7 @@ The
.Fn strcmp
and
.Fn strncmp
-functions
-lexicographically compare the null-terminated strings
+functions lexicographically compare the null-terminated strings
.Fa s1
and
.Fa s2 .
@@ -88,6 +87,5 @@ The
.Fn strcmp
and
.Fn strncmp
-functions
-conform to
+functions conform to
.St -ansiC .
diff --git a/lib/libc/string/strcoll.3 b/lib/libc/string/strcoll.3
index 20af998885e..5d3e44ee966 100644
--- a/lib/libc/string/strcoll.3
+++ b/lib/libc/string/strcoll.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcoll.3,v 1.2 1996/08/19 08:34:12 tholo Exp $
+.\" $OpenBSD: strcoll.3,v 1.3 2000/04/21 15:24:19 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRCOLL 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn strcoll
-function
-lexicographically compares the null-terminated strings
+function lexicographically compares the null-terminated strings
.Fa s1
and
.Fa s2
@@ -69,6 +68,5 @@ is greater than, equal to, or less than
.Sh STANDARDS
The
.Fn strcoll
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strcpy.3 b/lib/libc/string/strcpy.3
index aab10f9ba8e..1dbeafa6e86 100644
--- a/lib/libc/string/strcpy.3
+++ b/lib/libc/string/strcpy.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcpy.3,v 1.9 1999/06/29 18:01:33 aaron Exp $
+.\" $OpenBSD: strcpy.3,v 1.10 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRCPY 3
@@ -53,8 +53,7 @@ The
.Fn strcpy
and
.Fn strncpy
-functions
-copy the string
+functions copy the string
.Fa src
to
.Fa dst
@@ -87,8 +86,7 @@ The
.Fn strcpy
and
.Fn strncpy
-functions
-return
+functions return
.Fa dst .
.Sh EXAMPLES
The following sets
@@ -120,7 +118,8 @@ The following copies as many characters from
.Va input
to
.Va buf
-as will fit and null terminates the result. Because
+as will fit and null terminates the result.
+Because
.Fn strncpy
does
.Em not
@@ -134,7 +133,8 @@ buf[sizeof(buf) - 1] = '\e0';
.Pp
Note that
.Xr strlcpy 3
-is a better choice for this kind of operation. The equivalent using
+is a better choice for this kind of operation.
+The equivalent using
.Xr strlcpy 3
is simply:
.Bd -literal -offset indent
@@ -151,6 +151,5 @@ The
.Fn strcpy
and
.Fn strncpy
-functions
-conform to
+functions conform to
.St -ansiC .
diff --git a/lib/libc/string/strcspn.3 b/lib/libc/string/strcspn.3
index 6f7233a3e4e..37e8f163f18 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.4 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: strcspn.3,v 1.5 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRCSPN 3
@@ -48,23 +48,20 @@
.Sh DESCRIPTION
The
.Fn strcspn
-function
-spans the initial part of the null-terminated string
+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
+(it spans the
.Em complement
of
.Fa charset ) .
.Sh RETURN VALUES
The
.Fn strcspn
-function
-returns the number of characters spanned.
+function returns the number of characters spanned.
.Sh EXAMPLES
The following call to
.Fn strcspn
@@ -91,6 +88,5 @@ span = strcspn(s, charset);
.Sh STANDARDS
The
.Fn strcspn
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strdup.3 b/lib/libc/string/strdup.3
index 73c144d6e4c..457b8322cff 100644
--- a/lib/libc/string/strdup.3
+++ b/lib/libc/string/strdup.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strdup.3,v 1.7 1999/06/04 19:14:56 aaron Exp $
+.\" $OpenBSD: strdup.3,v 1.8 2000/04/21 15:24:20 aaron Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -46,13 +46,10 @@
.Sh DESCRIPTION
The
.Fn strdup
-function
-allocates sufficient memory for a copy
-of the string
+function allocates sufficient memory for a copy of the string
.Fa s ,
does the copy, and returns a pointer to it.
-The pointer may subsequently be used as an
-argument to the function
+The pointer may subsequently be used as an argument to the function
.Xr free 3 .
.Pp
If insufficient memory is available,
diff --git a/lib/libc/string/string.3 b/lib/libc/string/string.3
index ee74224967e..7a67b96b53a 100644
--- a/lib/libc/string/string.3
+++ b/lib/libc/string/string.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: string.3,v 1.7 1999/06/06 15:17:32 aaron Exp $
+.\" $OpenBSD: string.3,v 1.8 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd April 19, 1991
.Dt STRING 3
@@ -157,6 +157,5 @@ The
.Fn strstr ,
and
.Fn strtok
-functions
-conform to
+functions conform to
.St -ansiC .
diff --git a/lib/libc/string/strlcpy.3 b/lib/libc/string/strlcpy.3
index b07e30e6ea3..03a80e6c792 100644
--- a/lib/libc/string/strlcpy.3
+++ b/lib/libc/string/strlcpy.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strlcpy.3,v 1.6 1999/09/04 02:22:46 pjanzen Exp $
+.\" $OpenBSD: strlcpy.3,v 1.7 2000/04/21 15:24:20 aaron Exp $
.\"
.\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
.\" All rights reserved.
@@ -43,7 +43,8 @@ The
.Fn strlcpy
and
.Fn strlcat
-functions copy and concatenate strings respectively. They are designed
+functions copy and concatenate strings respectively.
+They are designed
to be safer, more consistent, and less error prone replacements for
.Xr strncpy 3
and
@@ -55,7 +56,8 @@ and
take the full size of the buffer (not just the length) and guarantee to
NUL-terminate the result (as long as
.Fa size
-is larger than 0). Note that you should include a byte for the NUL in
+is larger than 0).
+Note that you should include a byte for the NUL in
.Fa size .
.Pp
The
@@ -82,8 +84,8 @@ The
.Fn strlcpy
and
.Fn strlcat
-functions return the total length of the string they tried to
-create. For
+functions return the total length of the string they tried to create.
+For
.Fn strlcpy
that means the length of
.Fa src .
diff --git a/lib/libc/string/strlen.3 b/lib/libc/string/strlen.3
index 9db28cd1842..759e724056d 100644
--- a/lib/libc/string/strlen.3
+++ b/lib/libc/string/strlen.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strlen.3,v 1.3 1999/06/04 19:14:56 aaron Exp $
+.\" $OpenBSD: strlen.3,v 1.4 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRLEN 3
@@ -48,22 +48,18 @@
.Sh DESCRIPTION
The
.Fn strlen
-function
-computes the length of the string
+function computes the length of the string
.Fa s .
.Sh RETURN VALUES
The
.Fn strlen
-function
-returns
-the number of characters that precede the
-terminating NUL
+function returns the number of characters that precede the terminating
+.Tn NUL
character.
.Sh SEE ALSO
.Xr string 3
.Sh STANDARDS
The
.Fn strlen
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strmode.3 b/lib/libc/string/strmode.3
index 3703a7adafd..bf311f1f995 100644
--- a/lib/libc/string/strmode.3
+++ b/lib/libc/string/strmode.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strmode.3,v 1.7 2000/02/29 03:45:12 aaron Exp $
+.\" $OpenBSD: strmode.3,v 1.8 2000/04/21 15:24:20 aaron Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -46,8 +46,7 @@
.Sh DESCRIPTION
The
.Fn strmode
-function
-converts a file
+function converts a file
.Fa mode
(the type and permission information associated with an inode, see
.Xr stat 2 )
@@ -150,8 +149,7 @@ it will be a space.
.Sh RETURN VALUES
The
.Fn strmode
-function
-always returns 0.
+function always returns 0.
.Sh SEE ALSO
.Xr chmod 1 ,
.Xr find 1 ,
diff --git a/lib/libc/string/strpbrk.3 b/lib/libc/string/strpbrk.3
index c7b7731ec2b..52bf13b9245 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.4 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: strpbrk.3,v 1.5 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRPBRK 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn strpbrk
-function
-locates in the null-terminated string
+function locates in the null-terminated string
.Fa s
the first occurrence of any character in the string
.Fa charset
@@ -57,7 +56,7 @@ and returns a pointer to this character.
If no characters from
.Fa charset
occur anywhere in
-.Fa s
+.Fa s ,
.Fn strpbrk
returns
.Dv NULL .
@@ -73,6 +72,5 @@ returns
.Sh STANDARDS
The
.Fn strpbrk
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strrchr.3 b/lib/libc/string/strrchr.3
index 8de041810bc..394fc2aad3b 100644
--- a/lib/libc/string/strrchr.3
+++ b/lib/libc/string/strrchr.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strrchr.3,v 1.5 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: strrchr.3,v 1.6 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRRCHR 3
@@ -55,7 +55,9 @@ function locates the last occurrence of the character
.Fa c
in the string
.Fa s .
-The terminating NUL character is considered part of the string.
+The terminating
+.Tn NUL
+character is considered part of the string.
If
.Fa c
is
@@ -98,8 +100,7 @@ p = strrchr(s, 'o');
.Sh STANDARDS
The
.Fn strrchr
-function
-conforms to
+function conforms to
.St -ansiC .
.Pp
The
diff --git a/lib/libc/string/strsep.3 b/lib/libc/string/strsep.3
index 9f44a22d9bc..b15915ab376 100644
--- a/lib/libc/string/strsep.3
+++ b/lib/libc/string/strsep.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strsep.3,v 1.7 2000/03/04 22:19:32 aaron Exp $
+.\" $OpenBSD: strsep.3,v 1.8 2000/04/21 15:24:20 aaron Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -97,8 +97,7 @@ for (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;)
.Sh HISTORY
The
.Fn strsep
-function
-is intended as a replacement for the
+function is intended as a replacement for the
.Fn strtok
function.
While the
diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3
index 8274a06b65f..ca965aeb184 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.5 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: strspn.3,v 1.6 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRSPN 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn strspn
-function
-spans the initial part of the null-terminated string
+function spans the initial part of the null-terminated string
.Fa s
as long as the characters from
.Fa s
@@ -58,8 +57,7 @@ occur in string
.Sh RETURN VALUES
The
.Fn strspn
-function
-returns the number of characters spanned.
+function returns the number of characters spanned.
.Sh EXAMPLES
The following call to
.Fn strspn
@@ -86,6 +84,5 @@ span = strspn(s, charset);
.Sh STANDARDS
The
.Fn strspn
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strstr.3 b/lib/libc/string/strstr.3
index 3287cce0ce0..10beea42ca3 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.4 1999/09/21 16:44:01 espie Exp $
+.\" $OpenBSD: strstr.3,v 1.5 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRSTR 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn strstr
-function
-locates the first occurrence of the null-terminated string
+function locates the first occurrence of the null-terminated string
.Fa little
in the null-terminated string
.Fa big .
@@ -82,6 +81,5 @@ returns a pointer to the first character of the first occurrence of
.Sh STANDARDS
The
.Fn strstr
-function
-conforms to
+function conforms to
.St -ansiC .
diff --git a/lib/libc/string/strtok.3 b/lib/libc/string/strtok.3
index fa2ec28cf09..143ffc2e426 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.10 1999/11/09 11:20:13 art Exp $
+.\" $OpenBSD: strtok.3,v 1.11 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRTOK 3
@@ -55,8 +55,7 @@ This interface is obsoleted by
.Pp
The
.Fn strtok
-function
-is used to isolate sequential tokens in a null-terminated string,
+function is used to isolate sequential tokens in a null-terminated string,
.Fa str .
These tokens are separated in the string by at least one of the
characters in
@@ -81,9 +80,8 @@ The
.Fn strtok
and
.Fn strtok_r
-functions
-return a pointer to the beginning of each subsequent token in the string,
-after replacing the separator character itself with an
+functions return a pointer to the beginning of each subsequent token
+in the string, after replacing the separator character itself with an
.Tn ASCII NUL
character.
When no more tokens remain, a null pointer is returned.
@@ -116,13 +114,19 @@ for ((p = strtok_r(s, " ", &last)); p; (p = strtok_r(NULL, " ", &last)), i++) {
tokens[i] = '\e0';
.Ed
.Pp
-That is, tokens[0] will point to
+That is,
+.Li tokens[0]
+will point to
.Qq cat ,
-tokens[1] will point to
+.Li tokens[1]
+will point to
.Qq dog ,
-tokens[2] will point to
+.Li tokens[2]
+will point to
.Qq horse ,
-and tokens[3] will point to
+and
+.Li tokens[3]
+will point to
.Qq cow .
.Sh SEE ALSO
.Xr memchr 3 ,
@@ -136,8 +140,7 @@ and tokens[3] will point to
.Sh STANDARDS
The
.Fn strtok
-function
-conforms to
+function conforms to
.St -ansiC .
.Sh BUGS
The System V
diff --git a/lib/libc/string/strxfrm.3 b/lib/libc/string/strxfrm.3
index 3ebdd42c290..1e5338993ae 100644
--- a/lib/libc/string/strxfrm.3
+++ b/lib/libc/string/strxfrm.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strxfrm.3,v 1.2 1996/08/19 08:34:28 tholo Exp $
+.\" $OpenBSD: strxfrm.3,v 1.3 2000/04/21 15:24:20 aaron Exp $
.\"
.Dd June 29, 1991
.Dt STRXFRM 3
@@ -48,8 +48,7 @@
.Sh DESCRIPTION
The
.Fn strxfrm
-function
-does something horrible (see
+function does something horrible (see
.Tn ANSI
standard).
In this implementation it just copies.
@@ -63,6 +62,5 @@ In this implementation it just copies.
.Sh STANDARDS
The
.Fn strxfrm
-function
-conforms to
+function conforms to
.St -ansiC .