Browse Source

Flesh out libc string function man pages.

OPENBSD_2_7
aaron 24 years ago
parent
commit
b419710bcf
31 changed files with 141 additions and 183 deletions
  1. +2
    -3
      src/lib/libc/string/bcmp.3
  2. +2
    -3
      src/lib/libc/string/bcopy.3
  3. +2
    -2
      src/lib/libc/string/bm.3
  4. +9
    -8
      src/lib/libc/string/bstring.3
  5. +3
    -5
      src/lib/libc/string/bzero.3
  6. +3
    -5
      src/lib/libc/string/ffs.3
  7. +5
    -4
      src/lib/libc/string/memccpy.3
  8. +6
    -9
      src/lib/libc/string/memchr.3
  9. +7
    -8
      src/lib/libc/string/memcmp.3
  10. +4
    -7
      src/lib/libc/string/memcpy.3
  11. +3
    -5
      src/lib/libc/string/memmove.3
  12. +7
    -8
      src/lib/libc/string/memset.3
  13. +2
    -3
      src/lib/libc/string/strcasecmp.3
  14. +9
    -12
      src/lib/libc/string/strcat.3
  15. +2
    -3
      src/lib/libc/string/strchr.3
  16. +3
    -5
      src/lib/libc/string/strcmp.3
  17. +3
    -5
      src/lib/libc/string/strcoll.3
  18. +8
    -9
      src/lib/libc/string/strcpy.3
  19. +5
    -9
      src/lib/libc/string/strcspn.3
  20. +3
    -6
      src/lib/libc/string/strdup.3
  21. +2
    -3
      src/lib/libc/string/string.3
  22. +7
    -5
      src/lib/libc/string/strlcpy.3
  23. +5
    -9
      src/lib/libc/string/strlen.3
  24. +3
    -5
      src/lib/libc/string/strmode.3
  25. +4
    -6
      src/lib/libc/string/strpbrk.3
  26. +5
    -4
      src/lib/libc/string/strrchr.3
  27. +2
    -3
      src/lib/libc/string/strsep.3
  28. +4
    -7
      src/lib/libc/string/strspn.3
  29. +3
    -5
      src/lib/libc/string/strstr.3
  30. +15
    -12
      src/lib/libc/string/strtok.3
  31. +3
    -5
      src/lib/libc/string/strxfrm.3

+ 2
- 3
src/lib/libc/string/bcmp.3 View File

@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd April 19, 1991
.Dt BCMP 3 .Dt BCMP 3
@ -46,8 +46,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn bcmp .Fn bcmp
function
compares byte string
function compares byte string
.Fa b1 .Fa b1
against byte string against byte string
.Fa b2 , .Fa b2 ,


+ 2
- 3
src/lib/libc/string/bcopy.3 View File

@ -32,7 +32,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd April 19, 1991
.Dt BCOPY 3 .Dt BCOPY 3
@ -47,8 +47,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn bcopy .Fn bcopy
function
copies
function copies
.Fa len .Fa len
bytes from string bytes from string
.Fa src .Fa src


+ 2
- 2
src/lib/libc/string/bm.3 View File

@ -32,7 +32,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1999
.Dt BM 3 .Dt BM 3
@ -59,7 +59,7 @@ occurrence of a byte string within another byte string.
evaluates evaluates
.Fa patlen .Fa patlen
bytes starting at bytes starting at
.Fa pattern ,
.Fa pattern
and returns a pointer to a structure describing them. and returns a pointer to a structure describing them.
The bytes referenced by The bytes referenced by
.Fa pattern .Fa pattern


+ 9
- 8
src/lib/libc/string/bstring.3 View File

@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd April 19, 1991
.Dt BSTRING 3 .Dt BSTRING 3
@ -96,14 +96,15 @@ and
conform to conform to
.St -ansiC . .St -ansiC .
.Sh HISTORY .Sh HISTORY
The functions
The
.Fn bzero .Fn bzero
and and
.Fn memccpy .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 . .Bx 4.2 .

+ 3
- 5
src/lib/libc/string/bzero.3 View File

@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd April 19, 1991
.Dt BZERO 3 .Dt BZERO 3
@ -46,8 +46,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn bzero .Fn bzero
function
writes
function writes
.Fa len .Fa len
zero bytes to the string zero bytes to the string
.Fa b . .Fa b .
@ -62,6 +61,5 @@ does nothing.
.Sh HISTORY .Sh HISTORY
A A
.Fn bzero .Fn bzero
function
appeared in
function appeared in
.Bx 4.3 . .Bx 4.3 .

+ 3
- 5
src/lib/libc/string/ffs.3 View File

@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd April 19, 1991
.Dt FFS 3 .Dt FFS 3
@ -46,12 +46,10 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn ffs .Fn ffs
function
finds the first bit set in
function finds the first bit set in
.Fa value .Fa value
and returns the index of that bit. 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. A return value of 0 means that the argument was zero.
.Sh SEE ALSO .Sh SEE ALSO
.Xr bitstring 3 .Xr bitstring 3


+ 5
- 4
src/lib/libc/string/memccpy.3 View File

@ -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 .\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -46,14 +46,15 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn memccpy .Fn memccpy
function
copies bytes from string
function copies bytes from string
.Fa src .Fa src
to string to string
.Fa dst . .Fa dst .
If the character If the character
.Fa c .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 , .Fa src ,
the copy stops and a pointer to the byte after the copy of the copy stops and a pointer to the byte after the copy of
.Fa c .Fa c


+ 6
- 9
src/lib/libc/string/memchr.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt MEMCHR 3 .Dt MEMCHR 3
@ -48,18 +48,16 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn memchr .Fn memchr
function
locates the first occurrence of
function locates the first occurrence of
.Fa c .Fa c
(converted to an unsigned char)
(converted to an
.Li unsigned char )
in string in string
.Fa b . .Fa b .
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn memchr .Fn memchr
function
returns a pointer to the byte located,
or
function returns a pointer to the byte located, or
.Dv NULL .Dv NULL
if no such byte exists within if no such byte exists within
.Fa len .Fa len
@ -76,6 +74,5 @@ bytes.
.Sh STANDARDS .Sh STANDARDS
The The
.Fn memchr .Fn memchr
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 7
- 8
src/lib/libc/string/memcmp.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt MEMCMP 3 .Dt MEMCMP 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn memcmp .Fn memcmp
function
compares byte string
function compares byte string
.Fa b1 .Fa b1
against byte string against byte string
.Fa b2 . .Fa b2 .
@ -59,10 +58,11 @@ bytes long.
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn memcmp .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 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 .Sq Li \e200
is greater than is greater than
.Sq Li \&\e0 , .Sq Li \&\e0 ,
@ -77,6 +77,5 @@ Zero-length strings are always identical.
.Sh STANDARDS .Sh STANDARDS
The The
.Fn memcmp .Fn memcmp
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 4
- 7
src/lib/libc/string/memcpy.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt MEMCPY 3 .Dt MEMCPY 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn memcpy .Fn memcpy
function
copies
function copies
.Fa len .Fa len
bytes from string bytes from string
.Fa src .Fa src
@ -58,8 +57,7 @@ to string
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn memcpy .Fn memcpy
function
returns the original value of
function returns the original value of
.Fa dst . .Fa dst .
.Sh SEE ALSO .Sh SEE ALSO
.Xr bcopy 3 , .Xr bcopy 3 ,
@ -69,8 +67,7 @@ returns the original value of
.Sh STANDARDS .Sh STANDARDS
The The
.Fn memcpy .Fn memcpy
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .
.Sh BUGS .Sh BUGS
In this implementation In this implementation


+ 3
- 5
src/lib/libc/string/memmove.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt MEMMOVE 3 .Dt MEMMOVE 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn memmove .Fn memmove
function
copies
function copies
.Fa len .Fa len
bytes from string bytes from string
.Fa src .Fa src
@ -70,6 +69,5 @@ function returns the original value of
.Sh STANDARDS .Sh STANDARDS
The The
.Fn memmove .Fn memmove
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 7
- 8
src/lib/libc/string/memset.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt MEMSET 3 .Dt MEMSET 3
@ -48,18 +48,18 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn memset .Fn memset
function
writes
function writes
.Fa len .Fa len
bytes of value bytes of value
.Fa c .Fa c
(converted to an unsigned char) to the string
(converted to an
.Li unsigned char )
to the string
.Fa b . .Fa b .
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn memset .Fn memset
function
returns the original value of
function returns the original value of
.Fa b . .Fa b .
.Sh SEE ALSO .Sh SEE ALSO
.Xr bzero 3 , .Xr bzero 3 ,
@ -67,6 +67,5 @@ returns the original value of
.Sh STANDARDS .Sh STANDARDS
The The
.Fn memset .Fn memset
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 2
- 3
src/lib/libc/string/strcasecmp.3 View File

@ -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 .\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -53,8 +53,7 @@ The
.Fn strcasecmp .Fn strcasecmp
and and
.Fn strncasecmp .Fn strncasecmp
functions
compare the null-terminated strings
functions compare the null-terminated strings
.Fa s1 .Fa s1
and and
.Fa s2 .Fa s2


+ 9
- 12
src/lib/libc/string/strcat.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd July 8, 1997
.Dt STRCAT 3 .Dt STRCAT 3
@ -53,8 +53,7 @@ The
.Fn strcat .Fn strcat
and and
.Fn strncat .Fn strncat
functions
append a copy of the null-terminated string
functions append a copy of the null-terminated string
.Fa append .Fa append
to the end of the null-terminated string to the end of the null-terminated string
.Fa s , .Fa s ,
@ -66,8 +65,7 @@ must have sufficient space to hold the result.
.Pp .Pp
The The
.Fn strncat .Fn strncat
function
appends not more than
function appends not more than
.Fa count .Fa count
characters where space for the terminating characters where space for the terminating
.Ql \e0 .Ql \e0
@ -78,8 +76,7 @@ The
.Fn strcat .Fn strcat
and and
.Fn strncat .Fn strncat
functions
return the pointer
functions return the pointer
.Fa s . .Fa s .
.Sh EXAMPLES .Sh EXAMPLES
The following appends The following appends
@ -109,9 +106,10 @@ The above will copy as many characters from
.Dq Li input .Dq Li input
to to
.Dq Li buf .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 .Xr strlcpy 3
and and
.Xr strlcat 3 .Xr strlcat 3
@ -133,6 +131,5 @@ The
.Fn strcat .Fn strcat
and and
.Fn strncat .Fn strncat
functions
conform to
functions conform to
.St -ansiC . .St -ansiC .

+ 2
- 3
src/lib/libc/string/strchr.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRCHR 3 .Dt STRCHR 3
@ -98,8 +98,7 @@ p = strchr(s, 'o');
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strchr .Fn strchr
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .
.Pp .Pp
The The


+ 3
- 5
src/lib/libc/string/strcmp.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRCMP 3 .Dt STRCMP 3
@ -53,8 +53,7 @@ The
.Fn strcmp .Fn strcmp
and and
.Fn strncmp .Fn strncmp
functions
lexicographically compare the null-terminated strings
functions lexicographically compare the null-terminated strings
.Fa s1 .Fa s1
and and
.Fa s2 . .Fa s2 .
@ -88,6 +87,5 @@ The
.Fn strcmp .Fn strcmp
and and
.Fn strncmp .Fn strncmp
functions
conform to
functions conform to
.St -ansiC . .St -ansiC .

+ 3
- 5
src/lib/libc/string/strcoll.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRCOLL 3 .Dt STRCOLL 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strcoll .Fn strcoll
function
lexicographically compares the null-terminated strings
function lexicographically compares the null-terminated strings
.Fa s1 .Fa s1
and and
.Fa s2 .Fa s2
@ -69,6 +68,5 @@ is greater than, equal to, or less than
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strcoll .Fn strcoll
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 8
- 9
src/lib/libc/string/strcpy.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRCPY 3 .Dt STRCPY 3
@ -53,8 +53,7 @@ The
.Fn strcpy .Fn strcpy
and and
.Fn strncpy .Fn strncpy
functions
copy the string
functions copy the string
.Fa src .Fa src
to to
.Fa dst .Fa dst
@ -87,8 +86,7 @@ The
.Fn strcpy .Fn strcpy
and and
.Fn strncpy .Fn strncpy
functions
return
functions return
.Fa dst . .Fa dst .
.Sh EXAMPLES .Sh EXAMPLES
The following sets The following sets
@ -120,7 +118,8 @@ The following copies as many characters from
.Va input .Va input
to to
.Va buf .Va buf
as will fit and null terminates the result. Because
as will fit and null terminates the result.
Because
.Fn strncpy .Fn strncpy
does does
.Em not .Em not
@ -134,7 +133,8 @@ buf[sizeof(buf) - 1] = '\e0';
.Pp .Pp
Note that Note that
.Xr strlcpy 3 .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 .Xr strlcpy 3
is simply: is simply:
.Bd -literal -offset indent .Bd -literal -offset indent
@ -151,6 +151,5 @@ The
.Fn strcpy .Fn strcpy
and and
.Fn strncpy .Fn strncpy
functions
conform to
functions conform to
.St -ansiC . .St -ansiC .

+ 5
- 9
src/lib/libc/string/strcspn.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRCSPN 3 .Dt STRCSPN 3
@ -48,23 +48,20 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strcspn .Fn strcspn
function
spans the initial part of the null-terminated string
function spans the initial part of the null-terminated string
.Fa s .Fa s
as long as the characters from as long as the characters from
.Fa s .Fa s
do not occur in string do not occur in string
.Fa charset .Fa charset
(it
spans the
(it spans the
.Em complement .Em complement
of of
.Fa charset ) . .Fa charset ) .
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn strcspn .Fn strcspn
function
returns the number of characters spanned.
function returns the number of characters spanned.
.Sh EXAMPLES .Sh EXAMPLES
The following call to The following call to
.Fn strcspn .Fn strcspn
@ -91,6 +88,5 @@ span = strcspn(s, charset);
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strcspn .Fn strcspn
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 3
- 6
src/lib/libc/string/strdup.3 View File

@ -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 .\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -46,13 +46,10 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strdup .Fn strdup
function
allocates sufficient memory for a copy
of the string
function allocates sufficient memory for a copy of the string
.Fa s , .Fa s ,
does the copy, and returns a pointer to it. 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 . .Xr free 3 .
.Pp .Pp
If insufficient memory is available, If insufficient memory is available,


+ 2
- 3
src/lib/libc/string/string.3 View File

@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd April 19, 1991
.Dt STRING 3 .Dt STRING 3
@ -157,6 +157,5 @@ The
.Fn strstr , .Fn strstr ,
and and
.Fn strtok .Fn strtok
functions
conform to
functions conform to
.St -ansiC . .St -ansiC .

+ 7
- 5
src/lib/libc/string/strlcpy.3 View File

@ -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> .\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
.\" All rights reserved. .\" All rights reserved.
@ -43,7 +43,8 @@ The
.Fn strlcpy .Fn strlcpy
and and
.Fn strlcat .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 to be safer, more consistent, and less error prone replacements for
.Xr strncpy 3 .Xr strncpy 3
and and
@ -55,7 +56,8 @@ and
take the full size of the buffer (not just the length) and guarantee to take the full size of the buffer (not just the length) and guarantee to
NUL-terminate the result (as long as NUL-terminate the result (as long as
.Fa size .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 . .Fa size .
.Pp .Pp
The The
@ -82,8 +84,8 @@ The
.Fn strlcpy .Fn strlcpy
and and
.Fn strlcat .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 .Fn strlcpy
that means the length of that means the length of
.Fa src . .Fa src .


+ 5
- 9
src/lib/libc/string/strlen.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRLEN 3 .Dt STRLEN 3
@ -48,22 +48,18 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strlen .Fn strlen
function
computes the length of the string
function computes the length of the string
.Fa s . .Fa s .
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn strlen .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. character.
.Sh SEE ALSO .Sh SEE ALSO
.Xr string 3 .Xr string 3
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strlen .Fn strlen
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 3
- 5
src/lib/libc/string/strmode.3 View File

@ -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 .\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -46,8 +46,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strmode .Fn strmode
function
converts a file
function converts a file
.Fa mode .Fa mode
(the type and permission information associated with an inode, see (the type and permission information associated with an inode, see
.Xr stat 2 ) .Xr stat 2 )
@ -150,8 +149,7 @@ it will be a space.
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn strmode .Fn strmode
function
always returns 0.
function always returns 0.
.Sh SEE ALSO .Sh SEE ALSO
.Xr chmod 1 , .Xr chmod 1 ,
.Xr find 1 , .Xr find 1 ,


+ 4
- 6
src/lib/libc/string/strpbrk.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRPBRK 3 .Dt STRPBRK 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strpbrk .Fn strpbrk
function
locates in the null-terminated string
function locates in the null-terminated string
.Fa s .Fa s
the first occurrence of any character in the string the first occurrence of any character in the string
.Fa charset .Fa charset
@ -57,7 +56,7 @@ and returns a pointer to this character.
If no characters from If no characters from
.Fa charset .Fa charset
occur anywhere in occur anywhere in
.Fa s
.Fa s ,
.Fn strpbrk .Fn strpbrk
returns returns
.Dv NULL . .Dv NULL .
@ -73,6 +72,5 @@ returns
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strpbrk .Fn strpbrk
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 5
- 4
src/lib/libc/string/strrchr.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRRCHR 3 .Dt STRRCHR 3
@ -55,7 +55,9 @@ function locates the last occurrence of the character
.Fa c .Fa c
in the string in the string
.Fa s . .Fa s .
The terminating NUL character is considered part of the string.
The terminating
.Tn NUL
character is considered part of the string.
If If
.Fa c .Fa c
is is
@ -98,8 +100,7 @@ p = strrchr(s, 'o');
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strrchr .Fn strrchr
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .
.Pp .Pp
The The


+ 2
- 3
src/lib/libc/string/strsep.3 View File

@ -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 .\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -97,8 +97,7 @@ for (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;)
.Sh HISTORY .Sh HISTORY
The The
.Fn strsep .Fn strsep
function
is intended as a replacement for the
function is intended as a replacement for the
.Fn strtok .Fn strtok
function. function.
While the While the


+ 4
- 7
src/lib/libc/string/strspn.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRSPN 3 .Dt STRSPN 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strspn .Fn strspn
function
spans the initial part of the null-terminated string
function spans the initial part of the null-terminated string
.Fa s .Fa s
as long as the characters from as long as the characters from
.Fa s .Fa s
@ -58,8 +57,7 @@ occur in string
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn strspn .Fn strspn
function
returns the number of characters spanned.
function returns the number of characters spanned.
.Sh EXAMPLES .Sh EXAMPLES
The following call to The following call to
.Fn strspn .Fn strspn
@ -86,6 +84,5 @@ span = strspn(s, charset);
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strspn .Fn strspn
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 3
- 5
src/lib/libc/string/strstr.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRSTR 3 .Dt STRSTR 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strstr .Fn strstr
function
locates the first occurrence of the null-terminated string
function locates the first occurrence of the null-terminated string
.Fa little .Fa little
in the null-terminated string in the null-terminated string
.Fa big . .Fa big .
@ -82,6 +81,5 @@ returns a pointer to the first character of the first occurrence of
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strstr .Fn strstr
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

+ 15
- 12
src/lib/libc/string/strtok.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRTOK 3 .Dt STRTOK 3
@ -55,8 +55,7 @@ This interface is obsoleted by
.Pp .Pp
The The
.Fn strtok .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 . .Fa str .
These tokens are separated in the string by at least one of the These tokens are separated in the string by at least one of the
characters in characters in
@ -81,9 +80,8 @@ The
.Fn strtok .Fn strtok
and and
.Fn strtok_r .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 .Tn ASCII NUL
character. character.
When no more tokens remain, a null pointer is returned. 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'; tokens[i] = '\e0';
.Ed .Ed
.Pp .Pp
That is, tokens[0] will point to
That is,
.Li tokens[0]
will point to
.Qq cat , .Qq cat ,
tokens[1] will point to
.Li tokens[1]
will point to
.Qq dog , .Qq dog ,
tokens[2] will point to
.Li tokens[2]
will point to
.Qq horse , .Qq horse ,
and tokens[3] will point to
and
.Li tokens[3]
will point to
.Qq cow . .Qq cow .
.Sh SEE ALSO .Sh SEE ALSO
.Xr memchr 3 , .Xr memchr 3 ,
@ -136,8 +140,7 @@ and tokens[3] will point to
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strtok .Fn strtok
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .
.Sh BUGS .Sh BUGS
The System V The System V


+ 3
- 5
src/lib/libc/string/strxfrm.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" 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 .Dd June 29, 1991
.Dt STRXFRM 3 .Dt STRXFRM 3
@ -48,8 +48,7 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn strxfrm .Fn strxfrm
function
does something horrible (see
function does something horrible (see
.Tn ANSI .Tn ANSI
standard). standard).
In this implementation it just copies. In this implementation it just copies.
@ -63,6 +62,5 @@ In this implementation it just copies.
.Sh STANDARDS .Sh STANDARDS
The The
.Fn strxfrm .Fn strxfrm
function
conforms to
function conforms to
.St -ansiC . .St -ansiC .

Loading…
Cancel
Save