summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-12-18 12:45:11 +0000
committerru <ru@FreeBSD.org>2002-12-18 12:45:11 +0000
commit8746d263e1451855025dc83dde5176cc9f1fbe3f (patch)
treeee7f7ba4650cadf44410ca9a44676c72c96739b7 /lib/libc/stdlib
parent160081aef68b0dc49b79d3b7702b75671d9c06ff (diff)
downloadFreeBSD-src-8746d263e1451855025dc83dde5176cc9f1fbe3f.zip
FreeBSD-src-8746d263e1451855025dc83dde5176cc9f1fbe3f.tar.gz
mdoc(7) police: "The .Fn function".
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/getopt_long.32
-rw-r--r--lib/libc/stdlib/lsearch.32
-rw-r--r--lib/libc/stdlib/malloc.34
-rw-r--r--lib/libc/stdlib/qsort.312
-rw-r--r--lib/libc/stdlib/rand.32
-rw-r--r--lib/libc/stdlib/realpath.32
-rw-r--r--lib/libc/stdlib/tsearch.320
7 files changed, 34 insertions, 10 deletions
diff --git a/lib/libc/stdlib/getopt_long.3 b/lib/libc/stdlib/getopt_long.3
index fa15076..9f46bff 100644
--- a/lib/libc/stdlib/getopt_long.3
+++ b/lib/libc/stdlib/getopt_long.3
@@ -59,7 +59,9 @@ The
.Fn getopt_long
function provides a superset of the functionality of
.Xr getopt 3 .
+The
.Fn getopt_long
+function
can be used in two ways.
In the first way, every long option understood
by the program has a corresponding short option, and the option
diff --git a/lib/libc/stdlib/lsearch.3 b/lib/libc/stdlib/lsearch.3
index 453d297..4eecb1e 100644
--- a/lib/libc/stdlib/lsearch.3
+++ b/lib/libc/stdlib/lsearch.3
@@ -64,9 +64,11 @@ into the position after the last element and increments the
integer pointed to by
.Fa nelp .
.Sh RETURN VALUES
+The
.Fn lsearch
and
.Fn lfind
+functions
return a pointer to the first element found.
If no element was found,
.Fn lsearch
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3
index 376b42d..6c11ea7 100644
--- a/lib/libc/stdlib/malloc.3
+++ b/lib/libc/stdlib/malloc.3
@@ -135,7 +135,9 @@ for the specified size.
.Pp
The
.Fn reallocf
-function call is identical to the realloc function call, except that it
+function is identical to the
+.Fn realloc
+function, except that it
will free the passed pointer when the requested memory cannot be allocated.
This is a
.Fx
diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
index a23301f..a734da2 100644
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -97,7 +97,9 @@ objects, the initial member of which is pointed to by
.Fa base .
The size of each object is specified by
.Fa size .
-.Fn Mergesort
+The
+.Fn mergesort
+function
behaves similarly, but
.Em requires
that
@@ -179,7 +181,9 @@ requires additional memory of size
.Fa nmemb *
.Fa size
bytes; it should be used only when space is not at a premium.
-.Fn Mergesort
+The
+.Fn mergesort
+function
is optimized for data with pre-existing order; its worst case
time is O N lg N; its best case is O N.
.Pp
@@ -218,9 +222,11 @@ argument to
is less than
.Dq "sizeof(void *) / 2" .
.It Bq Er ENOMEM
-.Fn Heapsort
+The
+.Fn heapsort
or
.Fn mergesort
+functions
were unable to allocate memory.
.El
.Sh COMPATIBILITY
diff --git a/lib/libc/stdlib/rand.3 b/lib/libc/stdlib/rand.3
index e7d3aaf..513a9f6 100644
--- a/lib/libc/stdlib/rand.3
+++ b/lib/libc/stdlib/rand.3
@@ -94,7 +94,9 @@ function initializes a seed using the
random number device which returns good random numbers,
suitable for cryptographic use.
.Pp
+The
.Fn rand_r
+function
provides the same functionality as
.Fn rand .
A pointer to the context value
diff --git a/lib/libc/stdlib/realpath.3 b/lib/libc/stdlib/realpath.3
index 9479a3c..2351c8f 100644
--- a/lib/libc/stdlib/realpath.3
+++ b/lib/libc/stdlib/realpath.3
@@ -124,5 +124,5 @@ when given a relative
.Sh HISTORY
The
.Fn realpath
-function call first appeared in
+function first appeared in
.Bx 4.4 .
diff --git a/lib/libc/stdlib/tsearch.3 b/lib/libc/stdlib/tsearch.3
index cfe39c2..ac6d841 100644
--- a/lib/libc/stdlib/tsearch.3
+++ b/lib/libc/stdlib/tsearch.3
@@ -55,7 +55,9 @@ from Knuth (6.2.2). The comparison function passed in by
the user has the same style of return values as
.Xr strcmp 3 .
.Pp
-.Fn Tfind
+The
+.Fn tfind
+function
searches for the datum matched by the argument
.Fa key
in the binary tree rooted at
@@ -63,7 +65,9 @@ in the binary tree rooted at
returning a pointer to the datum if it is found and NULL
if it is not.
.Pp
-.Fn Tsearch
+The
+.Fn tsearch
+function
is identical to
.Fn tfind
except that if no match is found,
@@ -72,7 +76,9 @@ is inserted into the tree and a pointer to it is returned. If
.Fa rootp
points to a NULL value a new binary search tree is created.
.Pp
-.Fn Tdelete
+The
+.Fn tdelete
+function
deletes a node from the specified binary search tree and returns
a pointer to the parent of the node to be deleted.
It takes the same arguments as
@@ -83,7 +89,9 @@ If the node to be deleted is the root of the binary search tree,
.Fa rootp
will be adjusted.
.Pp
-.Fn Twalk
+The
+.Fn twalk
+function
walks the binary search tree rooted in
.Fa root
and calls the function
@@ -105,10 +113,12 @@ The
function returns NULL if allocation of a new node fails (usually
due to a lack of free memory).
.Pp
-.Fn Tfind ,
+The
+.Fn tfind ,
.Fn tsearch ,
and
.Fn tdelete
+functions
return NULL if
.Fa rootp
is NULL or the datum cannot be found.
OpenPOWER on IntegriCloud