diff options
author | aaron <> | 1999-06-29 18:36:24 +0000 |
---|---|---|
committer | aaron <> | 1999-06-29 18:36:24 +0000 |
commit | 5771e6280ed94b6457e5db9facb5899254e4fb7f (patch) | |
tree | 95397a7ed19a0cddf5a2ebb73dee20cf20fe2c29 | |
parent | 403f5844d16c63a63b8ce33a354e4871cb93df4c (diff) | |
download | openbsd-5771e6280ed94b6457e5db9facb5899254e4fb7f.tar.gz openbsd-5771e6280ed94b6457e5db9facb5899254e4fb7f.tar.bz2 openbsd-5771e6280ed94b6457e5db9facb5899254e4fb7f.zip |
first round of repairs on stdlib
30 files changed, 182 insertions, 150 deletions
diff --git a/src/lib/libc/stdlib/a64l.3 b/src/lib/libc/stdlib/a64l.3 index 0607338cba..1074dbff2e 100644 --- a/src/lib/libc/stdlib/a64l.3 +++ b/src/lib/libc/stdlib/a64l.3 | |||
@@ -24,7 +24,7 @@ | |||
24 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | .\" | 26 | .\" |
27 | .\" $OpenBSD: a64l.3,v 1.3 1999/02/27 21:55:53 deraadt Exp $ | 27 | .\" $OpenBSD: a64l.3,v 1.4 1999/06/29 18:36:15 aaron Exp $ |
28 | .\" | 28 | .\" |
29 | .Dd August 17, 1997 | 29 | .Dd August 17, 1997 |
30 | .Dt A64L 3 | 30 | .Dt A64L 3 |
@@ -45,19 +45,36 @@ The | |||
45 | and | 45 | and |
46 | .Fn l64a | 46 | .Fn l64a |
47 | functions are used to maintain numbers stored in radix-64 | 47 | functions are used to maintain numbers stored in radix-64 |
48 | ASCII characters. This is a notation by which 32-bit integers | 48 | .Tn ASCII |
49 | characters. This is a notation by which 32-bit integers | ||
49 | can be represented by up to six characters; each character | 50 | can be represented by up to six characters; each character |
50 | represents a "digit" in a radix-64 notation. | 51 | represents a |
52 | .Dq digit | ||
53 | in a radix-64 notation. | ||
51 | .Pp | 54 | .Pp |
52 | The characters used to represent "digits" are '.' for 0, '/' for 1, | 55 | The characters used to represent digits are |
53 | '0' through '9' for 2-11, 'A' through 'Z' for 12-37, and 'a' through | 56 | .Ql \&. |
54 | 'z' for 38-63. | 57 | for 0, |
58 | .Ql / | ||
59 | for 1, | ||
60 | .Ql 0 | ||
61 | through | ||
62 | .Ql 9 | ||
63 | for 2-11, | ||
64 | .Ql A | ||
65 | through | ||
66 | .Ql Z | ||
67 | for 12-37, and | ||
68 | .Ql a | ||
69 | through | ||
70 | .Ql z | ||
71 | for 38-63. | ||
55 | .Pp | 72 | .Pp |
56 | The | 73 | The |
57 | .Fn a64l | 74 | .Fn a64l |
58 | function takes a pointer to a null-terminated radix-64 representation | 75 | function takes a pointer to a null-terminated radix-64 representation |
59 | and returns a corresponding 32-bit value. If the string pointed to by | 76 | and returns a corresponding 32-bit value. If the string pointed to by |
60 | .Ar s | 77 | .Fa s |
61 | contains more than six characters, | 78 | contains more than six characters, |
62 | .Fn a64l | 79 | .Fn a64l |
63 | will use the first six. | 80 | will use the first six. |
@@ -68,35 +85,39 @@ larger than 32 bits, the return value will be sign-extended. | |||
68 | .Pp | 85 | .Pp |
69 | .Fn l64a | 86 | .Fn l64a |
70 | takes a long integer argument | 87 | takes a long integer argument |
71 | .Ar l | 88 | .Fa l |
72 | and returns a pointer to the corresponding radix-64 representation. | 89 | and returns a pointer to the corresponding radix-64 representation. |
73 | .Sh RETURN VALUES | 90 | .Sh RETURN VALUES |
74 | On success, | 91 | On success, |
75 | .Fn a64l | 92 | .Fn a64l |
76 | returns a 32-bit representation of | 93 | returns a 32-bit representation of |
77 | .Ar s . | 94 | .Fa s . |
78 | If | 95 | If |
79 | .Ar s | 96 | .Fa s |
80 | is a NULL pointer or if it contains "digits" other than those described above, | 97 | is a null pointer or if it contains digits other than those described above. |
81 | .Fn a64l | 98 | .Fn a64l |
82 | returns -1L and sets the global variable errno to | 99 | returns \-1 and sets the global variable |
83 | .Va EINVAL . | 100 | .Va errno |
101 | to | ||
102 | .Er EINVAL . | ||
84 | .Pp | 103 | .Pp |
85 | On success, | 104 | On success, |
86 | .Fn l64a | 105 | .Fn l64a |
87 | returns a pointer to a string containing the radix-64 representation of | 106 | returns a pointer to a string containing the radix-64 representation of |
88 | .Ar l . | 107 | .Fa l . |
89 | If | 108 | If |
90 | .Ar l | 109 | .Fa l |
91 | is 0, | 110 | is 0, |
92 | .Fn l64a | 111 | .Fn l64a |
93 | returns a pointer to the empty string. | 112 | returns a pointer to the empty string. |
94 | If | 113 | If |
95 | .Ar l | 114 | .Fa l |
96 | is negative, | 115 | is negative, |
97 | .Fn l64a | 116 | .Fn l64a |
98 | returns a NULL pointer and sets the global variable errno to | 117 | returns a null pointer and sets the global variable |
99 | .Va EINVAL . | 118 | .Va errno |
119 | to | ||
120 | .Er EINVAL . | ||
100 | .Sh WARNINGS | 121 | .Sh WARNINGS |
101 | The value returned by | 122 | The value returned by |
102 | .Fn l64a | 123 | .Fn l64a |
@@ -115,7 +136,7 @@ If a long integer is larger than 32 bits, only the low-order | |||
115 | 32 bits are used. | 136 | 32 bits are used. |
116 | .Sh STANDARDS | 137 | .Sh STANDARDS |
117 | The | 138 | The |
118 | .Fn a64l | 139 | .Fn a64l |
119 | and | 140 | and |
120 | .Fn l64a | 141 | .Fn l64a |
121 | functions conform to | 142 | functions conform to |
diff --git a/src/lib/libc/stdlib/abort.3 b/src/lib/libc/stdlib/abort.3 index 92c9a354d0..a0dfba7e80 100644 --- a/src/lib/libc/stdlib/abort.3 +++ b/src/lib/libc/stdlib/abort.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: abort.3,v 1.4 1997/07/17 07:39:41 deraadt Exp $ | 36 | .\" $OpenBSD: abort.3,v 1.5 1999/06/29 18:36:17 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ABORT 3 | 39 | .Dt ABORT 3 |
@@ -56,7 +56,7 @@ is being caught and the signal handler does not return. | |||
56 | Any open streams are flushed and closed. | 56 | Any open streams are flushed and closed. |
57 | .Sh RETURN VALUES | 57 | .Sh RETURN VALUES |
58 | The | 58 | The |
59 | .Nm abort | 59 | .Fn abort |
60 | function | 60 | function |
61 | never returns. | 61 | never returns. |
62 | .Sh SEE ALSO | 62 | .Sh SEE ALSO |
diff --git a/src/lib/libc/stdlib/abs.3 b/src/lib/libc/stdlib/abs.3 index ca203c4e60..1e3675d7b5 100644 --- a/src/lib/libc/stdlib/abs.3 +++ b/src/lib/libc/stdlib/abs.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: abs.3,v 1.3 1999/05/16 19:55:12 alex Exp $ | 36 | .\" $OpenBSD: abs.3,v 1.4 1999/06/29 18:36:17 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ABS 3 | 39 | .Dt ABS 3 |
@@ -51,7 +51,7 @@ The | |||
51 | function | 51 | function |
52 | computes | 52 | computes |
53 | the absolute value of the integer | 53 | the absolute value of the integer |
54 | .Ar j . | 54 | .Fa j . |
55 | .Sh RETURN VALUES | 55 | .Sh RETURN VALUES |
56 | The | 56 | The |
57 | .Fn abs | 57 | .Fn abs |
diff --git a/src/lib/libc/stdlib/alloca.3 b/src/lib/libc/stdlib/alloca.3 index 2b64dcfc08..56d52ebe1b 100644 --- a/src/lib/libc/stdlib/alloca.3 +++ b/src/lib/libc/stdlib/alloca.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: alloca.3,v 1.6 1999/05/23 14:11:03 aaron Exp $ | 32 | .\" $OpenBSD: alloca.3,v 1.7 1999/06/29 18:36:18 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd May 2, 1991 | 34 | .Dd May 2, 1991 |
35 | .Dt ALLOCA 3 | 35 | .Dt ALLOCA 3 |
@@ -45,7 +45,7 @@ | |||
45 | The | 45 | The |
46 | .Fn alloca | 46 | .Fn alloca |
47 | function | 47 | function |
48 | allocates | 48 | allocates |
49 | .Fa size | 49 | .Fa size |
50 | bytes of space in the stack frame of the caller. | 50 | bytes of space in the stack frame of the caller. |
51 | This temporary space is automatically freed on | 51 | This temporary space is automatically freed on |
@@ -70,6 +70,6 @@ is machine dependent; its use is discouraged. | |||
70 | .\" .Fn alloca | 70 | .\" .Fn alloca |
71 | .\" function appeared in | 71 | .\" function appeared in |
72 | .\" .Bx ?? . | 72 | .\" .Bx ?? . |
73 | .\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd | 73 | .\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd |
74 | .\" The first man page (or link to a man page that I can find at the | 74 | .\" The first man page (or link to a man page that I can find at the |
75 | .\" moment is 4.3... | 75 | .\" moment is 4.3... |
diff --git a/src/lib/libc/stdlib/atexit.3 b/src/lib/libc/stdlib/atexit.3 index 0b10f010fa..cc37d08b00 100644 --- a/src/lib/libc/stdlib/atexit.3 +++ b/src/lib/libc/stdlib/atexit.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: atexit.3,v 1.2 1996/08/19 08:33:22 tholo Exp $ | 36 | .\" $OpenBSD: atexit.3,v 1.3 1999/06/29 18:36:18 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ATEXIT 3 | 39 | .Dt ATEXIT 3 |
@@ -50,11 +50,11 @@ The | |||
50 | .Fn atexit | 50 | .Fn atexit |
51 | function | 51 | function |
52 | registers the given | 52 | registers the given |
53 | .Ar function | 53 | .Fa function |
54 | to be called at program exit, whether via | 54 | to be called at program exit, whether via |
55 | .Xr exit 3 | 55 | .Xr exit 3 |
56 | or via return from the program's | 56 | or via return from the program's |
57 | .Em main . | 57 | .Fn main . |
58 | Functions so registered are called in reverse order; | 58 | Functions so registered are called in reverse order; |
59 | no arguments are passed. | 59 | no arguments are passed. |
60 | At least 32 functions can always be registered, | 60 | At least 32 functions can always be registered, |
diff --git a/src/lib/libc/stdlib/atof.3 b/src/lib/libc/stdlib/atof.3 index cc1b500b0f..0bd85dbe82 100644 --- a/src/lib/libc/stdlib/atof.3 +++ b/src/lib/libc/stdlib/atof.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: atof.3,v 1.2 1996/08/19 08:33:23 tholo Exp $ | 36 | .\" $OpenBSD: atof.3,v 1.3 1999/06/29 18:36:18 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ATOF 3 | 39 | .Dt ATOF 3 |
@@ -51,9 +51,9 @@ string to double | |||
51 | The | 51 | The |
52 | .Fn atof | 52 | .Fn atof |
53 | function converts the initial portion of the string pointed to by | 53 | function converts the initial portion of the string pointed to by |
54 | .Ar nptr | 54 | .Fa nptr |
55 | to | 55 | to |
56 | .Ar double | 56 | .Li double |
57 | representation. | 57 | representation. |
58 | .Pp | 58 | .Pp |
59 | It is equivalent to: | 59 | It is equivalent to: |
diff --git a/src/lib/libc/stdlib/atoi.3 b/src/lib/libc/stdlib/atoi.3 index 280a989e8e..fa7b84e95c 100644 --- a/src/lib/libc/stdlib/atoi.3 +++ b/src/lib/libc/stdlib/atoi.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: atoi.3,v 1.2 1996/08/10 04:51:31 tholo Exp $ | 36 | .\" $OpenBSD: atoi.3,v 1.3 1999/06/29 18:36:18 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 4, 1993 | 38 | .Dd June 4, 1993 |
39 | .Dt ATOI 3 | 39 | .Dt ATOI 3 |
@@ -51,9 +51,9 @@ string to integer | |||
51 | The | 51 | The |
52 | .Fn atoi | 52 | .Fn atoi |
53 | function converts the initial portion of the string pointed to by | 53 | function converts the initial portion of the string pointed to by |
54 | .Em nptr | 54 | .Fa nptr |
55 | to | 55 | to |
56 | .Em integer | 56 | .Li integer |
57 | representation. | 57 | representation. |
58 | .Pp | 58 | .Pp |
59 | It is equivalent to: | 59 | It is equivalent to: |
diff --git a/src/lib/libc/stdlib/atol.3 b/src/lib/libc/stdlib/atol.3 index 2b49bd1f2c..c7b4ff30da 100644 --- a/src/lib/libc/stdlib/atol.3 +++ b/src/lib/libc/stdlib/atol.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: atol.3,v 1.2 1996/08/19 08:33:25 tholo Exp $ | 36 | .\" $OpenBSD: atol.3,v 1.3 1999/06/29 18:36:19 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ATOL 3 | 39 | .Dt ATOL 3 |
@@ -51,9 +51,9 @@ string to long integer | |||
51 | The | 51 | The |
52 | .Fn atol | 52 | .Fn atol |
53 | function converts the initial portion of the string pointed to by | 53 | function converts the initial portion of the string pointed to by |
54 | .Ar nptr | 54 | .Fa nptr |
55 | to | 55 | to |
56 | .Em long integer | 56 | .Li long integer |
57 | representation. | 57 | representation. |
58 | .Pp | 58 | .Pp |
59 | It is equivalent to: | 59 | It is equivalent to: |
diff --git a/src/lib/libc/stdlib/bsearch.3 b/src/lib/libc/stdlib/bsearch.3 index 570a4227b4..63d4e6af69 100644 --- a/src/lib/libc/stdlib/bsearch.3 +++ b/src/lib/libc/stdlib/bsearch.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: bsearch.3,v 1.3 1997/06/13 23:41:35 deraadt Exp $ | 36 | .\" $OpenBSD: bsearch.3,v 1.4 1999/06/29 18:36:19 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd April 19, 1994 | 38 | .Dd April 19, 1994 |
39 | .Dt BSEARCH 3 | 39 | .Dt BSEARCH 3 |
@@ -50,12 +50,12 @@ The | |||
50 | .Fn bsearch | 50 | .Fn bsearch |
51 | function searches an array of | 51 | function searches an array of |
52 | .Fa nmemb | 52 | .Fa nmemb |
53 | objects, the initial member of which is | 53 | objects, the initial member of which is |
54 | pointed to by | 54 | pointed to by |
55 | .Fa base , | 55 | .Fa base , |
56 | for a member that matches the object pointed to by | 56 | for a member that matches the object pointed to by |
57 | .Fa key . | 57 | .Fa key . |
58 | The size of each member of the array is specified by | 58 | The size of each member of the array is specified by |
59 | .Fa size . | 59 | .Fa size . |
60 | .Pp | 60 | .Pp |
61 | The contents of the array should be in ascending sorted order according | 61 | The contents of the array should be in ascending sorted order according |
diff --git a/src/lib/libc/stdlib/calloc.3 b/src/lib/libc/stdlib/calloc.3 index 9bd7f1d8da..7b78521c4a 100644 --- a/src/lib/libc/stdlib/calloc.3 +++ b/src/lib/libc/stdlib/calloc.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: calloc.3,v 1.4 1999/05/16 19:55:13 alex Exp $ | 36 | .\" $OpenBSD: calloc.3,v 1.5 1999/06/29 18:36:19 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt CALLOC 3 | 39 | .Dt CALLOC 3 |
@@ -48,7 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn calloc | 50 | .Fn calloc |
51 | function allocates space for an array of | 51 | function allocates space for an array of |
52 | .Fa nmemb | 52 | .Fa nmemb |
53 | objects, each of whose size is | 53 | objects, each of whose size is |
54 | .Fa size . | 54 | .Fa size . |
diff --git a/src/lib/libc/stdlib/div.3 b/src/lib/libc/stdlib/div.3 index c766d37fab..5cc3b8757c 100644 --- a/src/lib/libc/stdlib/div.3 +++ b/src/lib/libc/stdlib/div.3 | |||
@@ -31,7 +31,7 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .\" $OpenBSD: div.3,v 1.3 1999/05/16 19:55:14 alex Exp $ | 34 | .\" $OpenBSD: div.3,v 1.4 1999/06/29 18:36:19 aaron Exp $ |
35 | .\" | 35 | .\" |
36 | .Dd April 19, 1991 | 36 | .Dd April 19, 1991 |
37 | .Dt DIV 3 | 37 | .Dt DIV 3 |
@@ -48,11 +48,11 @@ The | |||
48 | .Fn div | 48 | .Fn div |
49 | function | 49 | function |
50 | computes the value | 50 | computes the value |
51 | .Fa num/denom | 51 | .Fa num Ns No / Ns Fa denom |
52 | and returns the quotient and remainder in a structure named | 52 | and returns the quotient and remainder in a structure named |
53 | .Fa div_t | 53 | .Fa div_t |
54 | that contains two | 54 | that contains two |
55 | .Em int | 55 | .Li int |
56 | members named | 56 | members named |
57 | .Fa quot | 57 | .Fa quot |
58 | and | 58 | and |
diff --git a/src/lib/libc/stdlib/getenv.3 b/src/lib/libc/stdlib/getenv.3 index 79556f30e8..c7858b55b0 100644 --- a/src/lib/libc/stdlib/getenv.3 +++ b/src/lib/libc/stdlib/getenv.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: getenv.3,v 1.4 1999/05/25 13:06:46 aaron Exp $ | 36 | .\" $OpenBSD: getenv.3,v 1.5 1999/06/29 18:36:20 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd December 11, 1993 | 38 | .Dd December 11, 1993 |
39 | .Dt GETENV 3 | 39 | .Dt GETENV 3 |
@@ -60,10 +60,10 @@ host | |||
60 | .Em environment list . | 60 | .Em environment list . |
61 | For compatibility with differing environment conventions, | 61 | For compatibility with differing environment conventions, |
62 | the given arguments | 62 | the given arguments |
63 | .Ar name | 63 | .Fa name |
64 | and | 64 | and |
65 | .Ar value | 65 | .Fa value |
66 | may be appended and prepended, | 66 | may be appended and prepended, |
67 | respectively, | 67 | respectively, |
68 | with an equal sign | 68 | with an equal sign |
69 | .Dq Li \&= . | 69 | .Dq Li \&= . |
@@ -71,30 +71,30 @@ with an equal sign | |||
71 | The | 71 | The |
72 | .Fn getenv | 72 | .Fn getenv |
73 | function obtains the current value of the environment variable, | 73 | function obtains the current value of the environment variable, |
74 | .Ar name . | 74 | .Fa name . |
75 | If the variable | 75 | If the variable |
76 | .Ar name | 76 | .Fa name |
77 | is not in the current environment, | 77 | is not in the current environment, |
78 | a null pointer is returned. | 78 | a null pointer is returned. |
79 | .Pp | 79 | .Pp |
80 | The | 80 | The |
81 | .Fn setenv | 81 | .Fn setenv |
82 | function inserts or resets the environment variable | 82 | function inserts or resets the environment variable |
83 | .Ar name | 83 | .Fa name |
84 | in the current environment list. | 84 | in the current environment list. |
85 | If the variable | 85 | If the variable |
86 | .Ar name | 86 | .Fa name |
87 | does not exist in the list, | 87 | does not exist in the list, |
88 | it is inserted with the given | 88 | it is inserted with the given |
89 | .Ar value . | 89 | .Fa value . |
90 | If the variable does exist, the argument | 90 | If the variable does exist, the argument |
91 | .Ar overwrite | 91 | .Fa overwrite |
92 | is tested; if | 92 | is tested; if |
93 | .Ar overwrite is | 93 | .Fa overwrite |
94 | zero, the | 94 | is zero, |
95 | variable is not reset, otherwise it is reset | 95 | the variable is not reset, otherwise it is reset |
96 | to the given | 96 | to the given |
97 | .Ar value . | 97 | .Fa value . |
98 | .Pp | 98 | .Pp |
99 | The | 99 | The |
100 | .Fn putenv | 100 | .Fn putenv |
@@ -122,7 +122,7 @@ is set to indicate the error and a | |||
122 | .Pp | 122 | .Pp |
123 | If | 123 | If |
124 | .Fn getenv | 124 | .Fn getenv |
125 | is succesful, the string returned should be considered read-only. | 125 | is succesful, the string returned should be considered read-only. |
126 | .Sh ERRORS | 126 | .Sh ERRORS |
127 | .Bl -tag -width [ENOMEM] | 127 | .Bl -tag -width [ENOMEM] |
128 | .It Bq Er ENOMEM | 128 | .It Bq Er ENOMEM |
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3 index 57d2c3668b..3c8779d788 100644 --- a/src/lib/libc/stdlib/getopt.3 +++ b/src/lib/libc/stdlib/getopt.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: getopt.3,v 1.8 1999/05/27 13:09:09 aaron Exp $ | 32 | .\" $OpenBSD: getopt.3,v 1.9 1999/06/29 18:36:20 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd April 19, 1994 | 34 | .Dd April 19, 1994 |
35 | .Dt GETOPT 3 | 35 | .Dt GETOPT 3 |
@@ -132,22 +132,25 @@ When all options have been processed (i.e., up to the first non-option | |||
132 | argument), | 132 | argument), |
133 | .Fn getopt | 133 | .Fn getopt |
134 | returns \-1. | 134 | returns \-1. |
135 | .Sh SEE ALSO | ||
136 | .Xr getopt 1 , | ||
137 | .Xr getsubopt 3 | ||
135 | .Sh DIAGNOSTICS | 138 | .Sh DIAGNOSTICS |
136 | If the | 139 | If the |
137 | .Fn getopt | 140 | .Fn getopt |
138 | function encounters a character not found in the string | 141 | function encounters a character not found in the string |
139 | .Va optstring | 142 | .Va optstring |
140 | or detects | 143 | or detects |
141 | a missing option argument it writes an error message to | 144 | a missing option argument it writes an error message to |
142 | .Em stderr | 145 | .Em stderr |
143 | and returns | 146 | and returns |
144 | .Ql ? . | 147 | .Ql ? . |
145 | Setting | 148 | Setting |
146 | .Va opterr | 149 | .Va opterr |
147 | to a zero will disable these error messages. | 150 | to a zero will disable these error messages. |
148 | If | 151 | If |
149 | .Va optstring | 152 | .Va optstring |
150 | has a leading | 153 | has a leading |
151 | .Ql \&: | 154 | .Ql \&: |
152 | then a missing option argument causes a | 155 | then a missing option argument causes a |
153 | .Ql \&: | 156 | .Ql \&: |
@@ -202,17 +205,17 @@ function appeared | |||
202 | The | 205 | The |
203 | .Fn getopt | 206 | .Fn getopt |
204 | function was once specified to return | 207 | function was once specified to return |
205 | .Dv EOF | 208 | .Dv EOF |
206 | instead of \-1. | 209 | instead of \-1. |
207 | This was changed by | 210 | This was changed by |
208 | .St -p1003.2-92 | 211 | .St -p1003.2-92 |
209 | to decouple | 212 | to decouple |
210 | .Fn getopt | 213 | .Fn getopt |
211 | from | 214 | from |
212 | .Pa <stdio.h> . | 215 | .Pa <stdio.h> . |
213 | .Pp | 216 | .Pp |
214 | A single dash | 217 | A single dash |
215 | .Dq Li - | 218 | .Pq Ql - |
216 | may be specified as a character in | 219 | may be specified as a character in |
217 | .Fa optstring , | 220 | .Fa optstring , |
218 | however it should | 221 | however it should |
@@ -221,7 +224,7 @@ have an argument associated with it. | |||
221 | This allows | 224 | This allows |
222 | .Fn getopt | 225 | .Fn getopt |
223 | to be used with programs that expect | 226 | to be used with programs that expect |
224 | .Dq Li - | 227 | .Ql - |
225 | as an option flag. | 228 | as an option flag. |
226 | This practice is wrong, and should not be used in any current development. | 229 | This practice is wrong, and should not be used in any current development. |
227 | It is provided for backward compatibility | 230 | It is provided for backward compatibility |
diff --git a/src/lib/libc/stdlib/getsubopt.3 b/src/lib/libc/stdlib/getsubopt.3 index 8acc91bdd1..0ea48864c3 100644 --- a/src/lib/libc/stdlib/getsubopt.3 +++ b/src/lib/libc/stdlib/getsubopt.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: getsubopt.3,v 1.2 1998/06/15 17:55:07 mickey Exp $ | 1 | .\" $OpenBSD: getsubopt.3,v 1.3 1999/06/29 18:36:20 aaron Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991, 1993 | 3 | .\" Copyright (c) 1990, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. |
@@ -60,8 +60,7 @@ The argument | |||
60 | is a pointer to a pointer to the string. | 60 | is a pointer to a pointer to the string. |
61 | The argument | 61 | The argument |
62 | .Fa tokens | 62 | .Fa tokens |
63 | is a pointer to a | 63 | is a pointer to a null-terminated |
64 | .Dv NULL Ns -terminated | ||
65 | array of pointers to strings. | 64 | array of pointers to strings. |
66 | .Pp | 65 | .Pp |
67 | The | 66 | The |
diff --git a/src/lib/libc/stdlib/labs.3 b/src/lib/libc/stdlib/labs.3 index 2d9d6029db..de0b76ba1f 100644 --- a/src/lib/libc/stdlib/labs.3 +++ b/src/lib/libc/stdlib/labs.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: labs.3,v 1.3 1999/05/16 19:55:14 alex Exp $ | 36 | .\" $OpenBSD: labs.3,v 1.4 1999/06/29 18:36:20 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt LABS 3 | 39 | .Dt LABS 3 |
@@ -50,7 +50,7 @@ The | |||
50 | .Fn labs | 50 | .Fn labs |
51 | function | 51 | function |
52 | returns the absolute value of the long integer | 52 | returns the absolute value of the long integer |
53 | .Ar j . | 53 | .Fa j . |
54 | .Sh SEE ALSO | 54 | .Sh SEE ALSO |
55 | .Xr abs 3 , | 55 | .Xr abs 3 , |
56 | .Xr cabs 3 , | 56 | .Xr cabs 3 , |
diff --git a/src/lib/libc/stdlib/ldiv.3 b/src/lib/libc/stdlib/ldiv.3 index f5f22881b9..60b35dc98f 100644 --- a/src/lib/libc/stdlib/ldiv.3 +++ b/src/lib/libc/stdlib/ldiv.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: ldiv.3,v 1.3 1999/05/16 19:55:15 alex Exp $ | 36 | .\" $OpenBSD: ldiv.3,v 1.4 1999/06/29 18:36:21 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt LDIV 3 | 39 | .Dt LDIV 3 |
@@ -50,15 +50,15 @@ The | |||
50 | .Fn ldiv | 50 | .Fn ldiv |
51 | function | 51 | function |
52 | computes the value | 52 | computes the value |
53 | .Ar num/denom | 53 | .Fa num Ns No / Ns Fa denom |
54 | and returns the quotient and remainder in a structure named | 54 | and returns the quotient and remainder in a structure named |
55 | .Ar ldiv_t | 55 | .Li ldiv_t |
56 | that contains two | 56 | that contains two |
57 | .Em long integer | 57 | .Li long integer |
58 | members named | 58 | members named |
59 | .Ar quot | 59 | .Fa quot |
60 | and | 60 | and |
61 | .Ar rem . | 61 | .Fa rem . |
62 | .Sh SEE ALSO | 62 | .Sh SEE ALSO |
63 | .Xr div 3 , | 63 | .Xr div 3 , |
64 | .Xr math 3 , | 64 | .Xr math 3 , |
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index 023a58b832..e7c237c63a 100644 --- a/src/lib/libc/stdlib/malloc.3 +++ b/src/lib/libc/stdlib/malloc.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: malloc.3,v 1.14 1999/05/27 20:49:35 aaron Exp $ | 36 | .\" $OpenBSD: malloc.3,v 1.15 1999/06/29 18:36:21 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd August 27, 1996 | 38 | .Dd August 27, 1996 |
39 | .Dt MALLOC 3 | 39 | .Dt MALLOC 3 |
@@ -113,9 +113,9 @@ If | |||
113 | is a null pointer, the | 113 | is a null pointer, the |
114 | .Fn realloc | 114 | .Fn realloc |
115 | function behaves like the | 115 | function behaves like the |
116 | .Fn malloc | 116 | .Fn malloc |
117 | function for the specified size. | 117 | function for the specified size. |
118 | If the space cannot be allocated, the object | 118 | If the space cannot be allocated, the object |
119 | pointed to by | 119 | pointed to by |
120 | .Fa ptr | 120 | .Fa ptr |
121 | is unchanged. | 121 | is unchanged. |
@@ -137,7 +137,7 @@ if ((p = realloc(p, nsize)) == NULL) | |||
137 | .Pp | 137 | .Pp |
138 | In most cases, this will result in a leak of memory. | 138 | In most cases, this will result in a leak of memory. |
139 | As stated earlier, a return value of | 139 | As stated earlier, a return value of |
140 | .Fa NULL | 140 | .Dv NULL |
141 | indicates that the old object still remains allocated. | 141 | indicates that the old object still remains allocated. |
142 | Better code looks like this: | 142 | Better code looks like this: |
143 | .Bd -literal -offset indent | 143 | .Bd -literal -offset indent |
@@ -163,7 +163,7 @@ Flags are single letters, uppercase means on, lowercase means off. | |||
163 | ``abort'' malloc will coredump the process, rather than tolerate failure. | 163 | ``abort'' malloc will coredump the process, rather than tolerate failure. |
164 | This is a very handy debugging aid, since the core file will represent the | 164 | This is a very handy debugging aid, since the core file will represent the |
165 | time of failure, | 165 | time of failure, |
166 | rather than when the NULL pointer was accessed. | 166 | rather than when the null pointer was accessed. |
167 | .Pp | 167 | .Pp |
168 | .It D | 168 | .It D |
169 | ``dump'' malloc will dump statistics in a file called ``malloc.out'' at exit. | 169 | ``dump'' malloc will dump statistics in a file called ``malloc.out'' at exit. |
@@ -195,7 +195,7 @@ for all operations. | |||
195 | Consult the source for this one. | 195 | Consult the source for this one. |
196 | .Pp | 196 | .Pp |
197 | .It X | 197 | .It X |
198 | ``xmalloc'' | 198 | ``xmalloc'' |
199 | rather than return failure, | 199 | rather than return failure, |
200 | .Xr abort 3 | 200 | .Xr abort 3 |
201 | the program with a diagnostic message on stderr. | 201 | the program with a diagnostic message on stderr. |
@@ -244,15 +244,15 @@ The | |||
244 | function a pointer to the possibly moved allocated space; | 244 | function a pointer to the possibly moved allocated space; |
245 | otherwise a null pointer is returned. | 245 | otherwise a null pointer is returned. |
246 | .Sh MESSAGES | 246 | .Sh MESSAGES |
247 | If | 247 | If |
248 | .Fn malloc , | 248 | .Fn malloc , |
249 | .Fn free | 249 | .Fn free |
250 | or | 250 | or |
251 | .Fn realloc | 251 | .Fn realloc |
252 | detects an error or warning condition, | 252 | detects an error or warning condition, |
253 | a message will be printed to filedescriptor | 253 | a message will be printed to filedescriptor |
254 | 2 (not using stdio). | 254 | 2 (not using stdio). |
255 | Errors will always result in the process being | 255 | Errors will always result in the process being |
256 | .Xr abort 3 'ed. | 256 | .Xr abort 3 'ed. |
257 | If the ``A'' option has been specified, warnings will also | 257 | If the ``A'' option has been specified, warnings will also |
258 | .Xr abort 3 | 258 | .Xr abort 3 |
@@ -267,9 +267,10 @@ fishy in there. Consult sources and or wizards. | |||
267 | ``allocation failed'' | 267 | ``allocation failed'' |
268 | if the ``A'' option is specified it is an error for | 268 | if the ``A'' option is specified it is an error for |
269 | .Fn malloc | 269 | .Fn malloc |
270 | or | 270 | or |
271 | .Fn realloc | 271 | .Fn realloc |
272 | to return NULL. | 272 | to return |
273 | .Dv NULL . | ||
273 | .Pp | 274 | .Pp |
274 | ``mmap(2) failed, check limits.'' | 275 | ``mmap(2) failed, check limits.'' |
275 | This is a rather weird condition that is most likely to mean that | 276 | This is a rather weird condition that is most likely to mean that |
@@ -287,7 +288,7 @@ A pointer to a free chunk is attempted freed again. | |||
287 | The pointer doesn't make sense. It's above the area of memory that | 288 | The pointer doesn't make sense. It's above the area of memory that |
288 | malloc knows something about. | 289 | malloc knows something about. |
289 | This could be a pointer from some | 290 | This could be a pointer from some |
290 | .Xr mmap 2 'ed | 291 | .Xr mmap 2 'ed |
291 | memory. | 292 | memory. |
292 | .Pp | 293 | .Pp |
293 | ``junk pointer, too low to make sense.'' | 294 | ``junk pointer, too low to make sense.'' |
@@ -344,7 +345,7 @@ secondary. | |||
344 | .Pp | 345 | .Pp |
345 | The main difference from other malloc implementations are believed to be that | 346 | The main difference from other malloc implementations are believed to be that |
346 | the free pages are not accessed until allocated. | 347 | the free pages are not accessed until allocated. |
347 | Most malloc implementations will store a data structure containing a, | 348 | Most malloc implementations will store a data structure containing a, |
348 | possibly double-, linked list in the free chunks of memory, used to tie | 349 | possibly double-, linked list in the free chunks of memory, used to tie |
349 | all the free memory together. | 350 | all the free memory together. |
350 | That is a quite suboptimal thing to do. | 351 | That is a quite suboptimal thing to do. |
diff --git a/src/lib/libc/stdlib/qabs.3 b/src/lib/libc/stdlib/qabs.3 index cdfaa81bf9..0f7ccdc78f 100644 --- a/src/lib/libc/stdlib/qabs.3 +++ b/src/lib/libc/stdlib/qabs.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: qabs.3,v 1.3 1999/05/16 19:55:16 alex Exp $ | 36 | .\" $OpenBSD: qabs.3,v 1.4 1999/06/29 18:36:21 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt QABS 3 | 39 | .Dt QABS 3 |
@@ -50,7 +50,7 @@ The | |||
50 | .Fn qabs | 50 | .Fn qabs |
51 | function | 51 | function |
52 | returns the absolute value of the quad integer | 52 | returns the absolute value of the quad integer |
53 | .Ar j . | 53 | .Fa j . |
54 | .Sh SEE ALSO | 54 | .Sh SEE ALSO |
55 | .Xr abs 3 , | 55 | .Xr abs 3 , |
56 | .Xr cabs 3 , | 56 | .Xr cabs 3 , |
diff --git a/src/lib/libc/stdlib/qdiv.3 b/src/lib/libc/stdlib/qdiv.3 index 12aca0b1ea..127c581250 100644 --- a/src/lib/libc/stdlib/qdiv.3 +++ b/src/lib/libc/stdlib/qdiv.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: qdiv.3,v 1.2 1996/08/19 08:33:41 tholo Exp $ | 36 | .\" $OpenBSD: qdiv.3,v 1.3 1999/06/29 18:36:21 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt QDIV 3 | 39 | .Dt QDIV 3 |
@@ -50,15 +50,15 @@ The | |||
50 | .Fn qdiv | 50 | .Fn qdiv |
51 | function | 51 | function |
52 | computes the value | 52 | computes the value |
53 | .Ar num/denom | 53 | .Fa num Ns No / Ns Fa denom |
54 | and returns the quotient and remainder in a structure named | 54 | and returns the quotient and remainder in a structure named |
55 | .Ar qdiv_t | 55 | .Li qdiv_t |
56 | that contains two | 56 | that contains two |
57 | .Em quad integer | 57 | .Li quad integer |
58 | members named | 58 | members named |
59 | .Ar quot | 59 | .Fa quot |
60 | and | 60 | and |
61 | .Ar rem . | 61 | .Fa rem . |
62 | .Sh SEE ALSO | 62 | .Sh SEE ALSO |
63 | .Xr div 3 , | 63 | .Xr div 3 , |
64 | .Xr ldiv 3 , | 64 | .Xr ldiv 3 , |
diff --git a/src/lib/libc/stdlib/qsort.3 b/src/lib/libc/stdlib/qsort.3 index 0a71824450..8d665187bf 100644 --- a/src/lib/libc/stdlib/qsort.3 +++ b/src/lib/libc/stdlib/qsort.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: qsort.3,v 1.3 1999/02/27 21:56:00 deraadt Exp $ | 36 | .\" $OpenBSD: qsort.3,v 1.4 1999/06/29 18:36:22 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 4, 1993 | 38 | .Dd June 4, 1993 |
39 | .Dt QSORT 3 | 39 | .Dt QSORT 3 |
@@ -131,7 +131,7 @@ The function | |||
131 | .Fn mergesort | 131 | .Fn mergesort |
132 | requires additional memory of size | 132 | requires additional memory of size |
133 | .Fa nmemb * | 133 | .Fa nmemb * |
134 | .Fa size | 134 | .Fa size |
135 | bytes; it should be used only when space is not at a premium. | 135 | bytes; it should be used only when space is not at a premium. |
136 | .Fn mergesort | 136 | .Fn mergesort |
137 | is optimized for data with pre-existing order; its worst case | 137 | is optimized for data with pre-existing order; its worst case |
diff --git a/src/lib/libc/stdlib/radixsort.3 b/src/lib/libc/stdlib/radixsort.3 index 8b0ea89a0f..a1a4ee4eab 100644 --- a/src/lib/libc/stdlib/radixsort.3 +++ b/src/lib/libc/stdlib/radixsort.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: radixsort.3,v 1.4 1998/06/15 17:55:08 mickey Exp $ | 32 | .\" $OpenBSD: radixsort.3,v 1.5 1999/06/29 18:36:22 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd January 27, 1994 | 34 | .Dd January 27, 1994 |
35 | .Dt RADIXSORT 3 | 35 | .Dt RADIXSORT 3 |
@@ -62,8 +62,7 @@ is denoted by the user-specified value | |||
62 | Applications may specify a sort order by providing the | 62 | Applications may specify a sort order by providing the |
63 | .Fa table | 63 | .Fa table |
64 | argument. | 64 | argument. |
65 | If | 65 | If non-null, |
66 | .Pf non- Dv NULL , | ||
67 | .Fa table | 66 | .Fa table |
68 | must reference an array of | 67 | must reference an array of |
69 | .Dv UCHAR_MAX | 68 | .Dv UCHAR_MAX |
@@ -80,7 +79,9 @@ equally, for example, providing a table with the same weights | |||
80 | for A-Z as for a-z will result in a case-insensitive sort. | 79 | for A-Z as for a-z will result in a case-insensitive sort. |
81 | If | 80 | If |
82 | .Fa table | 81 | .Fa table |
83 | is NULL, the contents of the array are sorted in ascending order | 82 | is |
83 | .Dv NULL , | ||
84 | the contents of the array are sorted in ascending order | ||
84 | according to the | 85 | according to the |
85 | .Tn ASCII | 86 | .Tn ASCII |
86 | order of the byte strings they reference and | 87 | order of the byte strings they reference and |
@@ -106,7 +107,7 @@ particular, see D.E. Knuth's Algorithm R and section 5.2.5, exercise 10. | |||
106 | They take linear time relative to the number of bytes in the strings. | 107 | They take linear time relative to the number of bytes in the strings. |
107 | .Sh RETURN VALUES | 108 | .Sh RETURN VALUES |
108 | Upon successful completion 0 is returned. | 109 | Upon successful completion 0 is returned. |
109 | Otherwise, \-1 is returned and the global variable | 110 | Otherwise, \-1 is returned and the global variable |
110 | .Va errno | 111 | .Va errno |
111 | is set to indicate the error. | 112 | is set to indicate the error. |
112 | .Sh ERRORS | 113 | .Sh ERRORS |
diff --git a/src/lib/libc/stdlib/rand.3 b/src/lib/libc/stdlib/rand.3 index 28496ec12a..d5686e5f4c 100644 --- a/src/lib/libc/stdlib/rand.3 +++ b/src/lib/libc/stdlib/rand.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: rand.3,v 1.5 1998/11/20 11:18:50 d Exp $ | 36 | .\" $OpenBSD: rand.3,v 1.6 1999/06/29 18:36:22 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt RAND 3 | 39 | .Dt RAND 3 |
@@ -81,7 +81,7 @@ The | |||
81 | is a thread-safe version of | 81 | is a thread-safe version of |
82 | .Fn rand . | 82 | .Fn rand . |
83 | Storage for the seed must be provided through the | 83 | Storage for the seed must be provided through the |
84 | .Ar seed | 84 | .Fa seed |
85 | argument, and needs to have been initialized by the caller. | 85 | argument, and needs to have been initialized by the caller. |
86 | .Sh SEE ALSO | 86 | .Sh SEE ALSO |
87 | .Xr arc4random 3 , | 87 | .Xr arc4random 3 , |
diff --git a/src/lib/libc/stdlib/rand48.3 b/src/lib/libc/stdlib/rand48.3 index efd6477364..f1615027da 100644 --- a/src/lib/libc/stdlib/rand48.3 +++ b/src/lib/libc/stdlib/rand48.3 | |||
@@ -9,7 +9,7 @@ | |||
9 | .\" of any kind. I shall in no event be liable for anything that happens | 9 | .\" of any kind. I shall in no event be liable for anything that happens |
10 | .\" to anyone/anything when using this software. | 10 | .\" to anyone/anything when using this software. |
11 | .\" | 11 | .\" |
12 | .\" $OpenBSD: rand48.3,v 1.4 1999/03/11 01:35:01 pjanzen Exp $ | 12 | .\" $OpenBSD: rand48.3,v 1.5 1999/06/29 18:36:22 aaron Exp $ |
13 | .\" | 13 | .\" |
14 | .Dd October 8, 1993 | 14 | .Dd October 8, 1993 |
15 | .Dt RAND48 3 | 15 | .Dt RAND48 3 |
@@ -27,7 +27,7 @@ | |||
27 | .Nd pseudo random number generators and initialization routines | 27 | .Nd pseudo random number generators and initialization routines |
28 | .Sh SYNOPSIS | 28 | .Sh SYNOPSIS |
29 | .Fd #include <stdlib.h> | 29 | .Fd #include <stdlib.h> |
30 | .Ft double | 30 | .Ft double |
31 | .Fn drand48 void | 31 | .Fn drand48 void |
32 | .Ft double | 32 | .Ft double |
33 | .Fn erand48 "unsigned short xseed[3]" | 33 | .Fn erand48 "unsigned short xseed[3]" |
diff --git a/src/lib/libc/stdlib/random.3 b/src/lib/libc/stdlib/random.3 index 47cdfea9b3..e1ab9e44da 100644 --- a/src/lib/libc/stdlib/random.3 +++ b/src/lib/libc/stdlib/random.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: random.3,v 1.7 1999/05/23 14:11:03 aaron Exp $ | 32 | .\" $OpenBSD: random.3,v 1.8 1999/06/29 18:36:23 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd April 19, 1991 | 34 | .Dd April 19, 1991 |
35 | .Dt RANDOM 3 | 35 | .Dt RANDOM 3 |
@@ -42,7 +42,7 @@ | |||
42 | .Nd better random number generator; routines for changing generators | 42 | .Nd better random number generator; routines for changing generators |
43 | .Sh SYNOPSIS | 43 | .Sh SYNOPSIS |
44 | .Fd #include <stdlib.h> | 44 | .Fd #include <stdlib.h> |
45 | .Ft long | 45 | .Ft long |
46 | .Fn random void | 46 | .Fn random void |
47 | .Ft void | 47 | .Ft void |
48 | .Fn srandom "unsigned int seed" | 48 | .Fn srandom "unsigned int seed" |
@@ -96,7 +96,7 @@ however, | |||
96 | will by default produce a sequence of numbers that can be duplicated | 96 | will by default produce a sequence of numbers that can be duplicated |
97 | by calling | 97 | by calling |
98 | .Fn srandom | 98 | .Fn srandom |
99 | with | 99 | with |
100 | .Ql 1 | 100 | .Ql 1 |
101 | as the seed. | 101 | as the seed. |
102 | .Pp | 102 | .Pp |
@@ -167,16 +167,16 @@ messages are printed on the standard error output. | |||
167 | .Xr rand 3 | 167 | .Xr rand 3 |
168 | .Sh STANDARDS | 168 | .Sh STANDARDS |
169 | The | 169 | The |
170 | .Fn random , | 170 | .Fn random , |
171 | .Fn srandom , | 171 | .Fn srandom , |
172 | .Fn initstate , | 172 | .Fn initstate , |
173 | and | 173 | and |
174 | .Fn setstate | 174 | .Fn setstate |
175 | functions conform to | 175 | functions conform to |
176 | .St -xpg4.2 . | 176 | .St -xpg4.2 . |
177 | .Sh HISTORY | 177 | .Sh HISTORY |
178 | These | 178 | These |
179 | functions appeared in | 179 | functions appeared in |
180 | .Bx 4.2 . | 180 | .Bx 4.2 . |
181 | .Sh BUGS | 181 | .Sh BUGS |
182 | About 2/3 the speed of | 182 | About 2/3 the speed of |
diff --git a/src/lib/libc/stdlib/realpath.3 b/src/lib/libc/stdlib/realpath.3 index 7efccbf1b6..814c36ec13 100644 --- a/src/lib/libc/stdlib/realpath.3 +++ b/src/lib/libc/stdlib/realpath.3 | |||
@@ -32,7 +32,7 @@ | |||
32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
33 | .\" SUCH DAMAGE. | 33 | .\" SUCH DAMAGE. |
34 | .\" | 34 | .\" |
35 | .\" $OpenBSD: realpath.3,v 1.4 1999/05/28 01:57:36 aaron Exp $ | 35 | .\" $OpenBSD: realpath.3,v 1.5 1999/06/29 18:36:23 aaron Exp $ |
36 | .\" | 36 | .\" |
37 | .Dd February, 16, 1994 | 37 | .Dd February, 16, 1994 |
38 | .Dt REALPATH 3 | 38 | .Dt REALPATH 3 |
@@ -67,7 +67,7 @@ refer to a buffer capable of storing at least | |||
67 | .Dv MAXPATHLEN | 67 | .Dv MAXPATHLEN |
68 | characters. | 68 | characters. |
69 | .Pp | 69 | .Pp |
70 | The | 70 | The |
71 | .Fn realpath | 71 | .Fn realpath |
72 | function will resolve both absolute and relative paths | 72 | function will resolve both absolute and relative paths |
73 | and return the absolute pathname corresponding to | 73 | and return the absolute pathname corresponding to |
diff --git a/src/lib/libc/stdlib/strtod.3 b/src/lib/libc/stdlib/strtod.3 index 14981139c6..6bba73e89a 100644 --- a/src/lib/libc/stdlib/strtod.3 +++ b/src/lib/libc/stdlib/strtod.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: strtod.3,v 1.3 1999/05/27 20:49:35 aaron Exp $ | 36 | .\" $OpenBSD: strtod.3,v 1.4 1999/06/29 18:36:23 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt STRTOD 3 | 39 | .Dt STRTOD 3 |
@@ -50,11 +50,11 @@ string to double | |||
50 | .Sh DESCRIPTION | 50 | .Sh DESCRIPTION |
51 | The | 51 | The |
52 | .Fn strtod | 52 | .Fn strtod |
53 | function converts the initial portion of the string | 53 | function converts the initial portion of the string |
54 | pointed to by | 54 | pointed to by |
55 | .Fa nptr | 55 | .Fa nptr |
56 | to | 56 | to |
57 | .Em double | 57 | .Li double |
58 | representation. | 58 | representation. |
59 | .Pp | 59 | .Pp |
60 | The expected form of the string is an optional plus (``+'') or minus | 60 | The expected form of the string is an optional plus (``+'') or minus |
@@ -93,7 +93,7 @@ is stored in | |||
93 | If the correct value would cause underflow, zero is | 93 | If the correct value would cause underflow, zero is |
94 | returned and | 94 | returned and |
95 | .Dv ERANGE | 95 | .Dv ERANGE |
96 | is stored in | 96 | is stored in |
97 | .Va errno . | 97 | .Va errno . |
98 | .Sh ERRORS | 98 | .Sh ERRORS |
99 | .Bl -tag -width Er | 99 | .Bl -tag -width Er |
diff --git a/src/lib/libc/stdlib/strtol.3 b/src/lib/libc/stdlib/strtol.3 index b7d2cd1225..006ba904a5 100644 --- a/src/lib/libc/stdlib/strtol.3 +++ b/src/lib/libc/stdlib/strtol.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: strtol.3,v 1.3 1996/08/19 08:33:51 tholo Exp $ | 36 | .\" $OpenBSD: strtol.3,v 1.4 1999/06/29 18:36:23 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 25, 1992 | 38 | .Dd June 25, 1992 |
39 | .Dt STRTOL 3 | 39 | .Dt STRTOL 3 |
@@ -59,7 +59,7 @@ function | |||
59 | converts the string in | 59 | converts the string in |
60 | .Fa nptr | 60 | .Fa nptr |
61 | to a | 61 | to a |
62 | .Em long | 62 | .Li long |
63 | value. | 63 | value. |
64 | The | 64 | The |
65 | .Fn strtoq | 65 | .Fn strtoq |
@@ -67,7 +67,7 @@ function | |||
67 | converts the string in | 67 | converts the string in |
68 | .Fa nptr | 68 | .Fa nptr |
69 | to a | 69 | to a |
70 | .Em quad_t | 70 | .Li quad_t |
71 | value. | 71 | value. |
72 | The conversion is done according to the given | 72 | The conversion is done according to the given |
73 | .Fa base , | 73 | .Fa base , |
@@ -95,7 +95,7 @@ is taken as 10 (decimal) unless the next character is | |||
95 | in which case it is taken as 8 (octal). | 95 | in which case it is taken as 8 (octal). |
96 | .Pp | 96 | .Pp |
97 | The remainder of the string is converted to a | 97 | The remainder of the string is converted to a |
98 | .Em long | 98 | .Li long |
99 | value in the obvious manner, | 99 | value in the obvious manner, |
100 | stopping at the first character which is not a valid digit | 100 | stopping at the first character which is not a valid digit |
101 | in the given base. | 101 | in the given base. |
diff --git a/src/lib/libc/stdlib/strtoul.3 b/src/lib/libc/stdlib/strtoul.3 index b8234122a2..3b2a90adc3 100644 --- a/src/lib/libc/stdlib/strtoul.3 +++ b/src/lib/libc/stdlib/strtoul.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: strtoul.3,v 1.2 1996/08/19 08:33:52 tholo Exp $ | 36 | .\" $OpenBSD: strtoul.3,v 1.3 1999/06/29 18:36:24 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 25, 1992 | 38 | .Dd June 25, 1992 |
39 | .Dt STRTOUL 3 | 39 | .Dt STRTOUL 3 |
@@ -59,7 +59,7 @@ function | |||
59 | converts the string in | 59 | converts the string in |
60 | .Fa nptr | 60 | .Fa nptr |
61 | to an | 61 | to an |
62 | .Em unsigned long | 62 | .Li unsigned long |
63 | value. | 63 | value. |
64 | The | 64 | The |
65 | .Fn strtouq | 65 | .Fn strtouq |
@@ -67,7 +67,7 @@ function | |||
67 | converts the string in | 67 | converts the string in |
68 | .Fa nptr | 68 | .Fa nptr |
69 | to a | 69 | to a |
70 | .Em u_quad_t | 70 | .Li u_quad_t |
71 | value. | 71 | value. |
72 | The conversion is done according to the given | 72 | The conversion is done according to the given |
73 | .Fa base , | 73 | .Fa base , |
@@ -95,7 +95,7 @@ is taken as 10 (decimal) unless the next character is | |||
95 | in which case it is taken as 8 (octal). | 95 | in which case it is taken as 8 (octal). |
96 | .Pp | 96 | .Pp |
97 | The remainder of the string is converted to an | 97 | The remainder of the string is converted to an |
98 | .Em unsigned long | 98 | .Li unsigned long |
99 | value in the obvious manner, | 99 | value in the obvious manner, |
100 | stopping at the end of the string | 100 | stopping at the end of the string |
101 | or at the first character that does not produce a valid digit | 101 | or at the first character that does not produce a valid digit |
diff --git a/src/lib/libc/stdlib/system.3 b/src/lib/libc/stdlib/system.3 index 985adb07de..f2d2693677 100644 --- a/src/lib/libc/stdlib/system.3 +++ b/src/lib/libc/stdlib/system.3 | |||
@@ -33,7 +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 | .\" $OpenBSD: system.3,v 1.5 1996/12/11 23:09:53 tholo Exp $ | 36 | .\" $OpenBSD: system.3,v 1.6 1999/06/29 18:36:24 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt SYSTEM 3 | 39 | .Dt SYSTEM 3 |
@@ -70,18 +70,18 @@ pointer, | |||
70 | will return non-zero. | 70 | will return non-zero. |
71 | Otherwise, | 71 | Otherwise, |
72 | .Fn system | 72 | .Fn system |
73 | returns the termination status of the shell in the format specified by | 73 | returns the termination status of the shell in the format specified by |
74 | .Xr waitpid 2 . | 74 | .Xr waitpid 2 . |
75 | .Sh RETURN VALUES | 75 | .Sh RETURN VALUES |
76 | If a child process cannot be created, or the termination status of | 76 | If a child process cannot be created, or the termination status of |
77 | the shell cannot be obtained, | 77 | the shell cannot be obtained, |
78 | .Fn system | 78 | .Fn system |
79 | returns -1 and sets | 79 | returns \-1 and sets |
80 | .Va errno | 80 | .Va errno |
81 | to indicate the error. | 81 | to indicate the error. |
82 | If execution of the shell fails, | 82 | If execution of the shell fails, |
83 | .Fn system | 83 | .Fn system |
84 | returns the termination status for a program that terminates with a call of | 84 | returns the termination status for a program that terminates with a call of |
85 | .Fn exit 127 . | 85 | .Fn exit 127 . |
86 | .Sh SEE ALSO | 86 | .Sh SEE ALSO |
87 | .Xr sh 1 , | 87 | .Xr sh 1 , |
@@ -93,6 +93,6 @@ The | |||
93 | .Fn system | 93 | .Fn system |
94 | function | 94 | function |
95 | conforms to | 95 | conforms to |
96 | .St -ansiC | 96 | .St -ansiC |
97 | and | 97 | and |
98 | .St -p1003.2-92 . | 98 | .St -p1003.2-92 . |
diff --git a/src/lib/libc/stdlib/tsearch.3 b/src/lib/libc/stdlib/tsearch.3 index cb8b050e7b..8456457e27 100644 --- a/src/lib/libc/stdlib/tsearch.3 +++ b/src/lib/libc/stdlib/tsearch.3 | |||
@@ -23,7 +23,7 @@ | |||
23 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 23 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
24 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | .\" | 25 | .\" |
26 | .\" $OpenBSD: tsearch.3,v 1.4 1999/05/10 17:56:28 aaron Exp $ | 26 | .\" $OpenBSD: tsearch.3,v 1.5 1999/06/29 18:36:24 aaron Exp $ |
27 | .\" | 27 | .\" |
28 | .Dd June 15, 1997 | 28 | .Dd June 15, 1997 |
29 | .Dt TSEARCH 3 | 29 | .Dt TSEARCH 3 |
@@ -58,7 +58,8 @@ searches for the datum matched by the argument | |||
58 | .Fa key | 58 | .Fa key |
59 | in the binary tree rooted at | 59 | in the binary tree rooted at |
60 | .Fa rootp , | 60 | .Fa rootp , |
61 | returning a pointer to the datum if it is found and NULL | 61 | returning a pointer to the datum if it is found and |
62 | .Dv NULL | ||
62 | if it is not. | 63 | if it is not. |
63 | .Pp | 64 | .Pp |
64 | .Fn tsearch | 65 | .Fn tsearch |
@@ -68,7 +69,7 @@ except that if no match is found, | |||
68 | .Fa key | 69 | .Fa key |
69 | is inserted into the tree and a pointer to it is returned. If | 70 | is inserted into the tree and a pointer to it is returned. If |
70 | .Fa rootp | 71 | .Fa rootp |
71 | points to a NULL value a new binary search tree is created. | 72 | points to a null value a new binary search tree is created. |
72 | .Pp | 73 | .Pp |
73 | .Fn tdelete | 74 | .Fn tdelete |
74 | deletes a node from the specified binary search tree and returns | 75 | deletes a node from the specified binary search tree and returns |
@@ -89,7 +90,7 @@ and calls the function | |||
89 | on each node. | 90 | on each node. |
90 | .Fa action | 91 | .Fa action |
91 | is called with three arguments: a pointer to the current node, | 92 | is called with three arguments: a pointer to the current node, |
92 | a value from the enum | 93 | a value from the enum |
93 | .Sy "typedef enum { preorder, postorder, endorder, leaf } VISIT;" | 94 | .Sy "typedef enum { preorder, postorder, endorder, leaf } VISIT;" |
94 | specifying the traversal type, and a node level (where level | 95 | specifying the traversal type, and a node level (where level |
95 | zero is the root of the tree). | 96 | zero is the root of the tree). |
@@ -99,16 +100,22 @@ zero is the root of the tree). | |||
99 | .Sh RETURN VALUES | 100 | .Sh RETURN VALUES |
100 | The | 101 | The |
101 | .Fn tsearch | 102 | .Fn tsearch |
102 | function returns NULL if allocation of a new node fails (usually | 103 | function returns |
104 | .Dv NULL | ||
105 | if allocation of a new node fails (usually | ||
103 | due to a lack of free memory). | 106 | due to a lack of free memory). |
104 | .Pp | 107 | .Pp |
105 | .Fn tfind , | 108 | .Fn tfind , |
106 | .Fn tsearch , | 109 | .Fn tsearch , |
107 | and | 110 | and |
108 | .Fn tdelete | 111 | .Fn tdelete |
109 | return NULL if | 112 | return |
113 | .Dv NULL | ||
114 | if | ||
110 | .Fa rootp | 115 | .Fa rootp |
111 | is NULL or the datum cannot be found. | 116 | is |
117 | .Dv NULL | ||
118 | or the datum cannot be found. | ||
112 | .Pp | 119 | .Pp |
113 | The | 120 | The |
114 | .Fn twalk | 121 | .Fn twalk |