aboutsummaryrefslogtreecommitdiff
path: root/share/man
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2022-08-01 09:43:10 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2022-08-07 19:23:44 +0000
commit08349b18ea26d1e191333f9b3550cd95b09cfe34 (patch)
treeb26d2b4747b778528cd17ad021328b4b918ff318 /share/man
parent624e5dc0ecf6e3cbd1b380572c6cb752361ef5f0 (diff)
downloadsrc-08349b18ea26d1e191333f9b3550cd95b09cfe34.tar.gz
src-08349b18ea26d1e191333f9b3550cd95b09cfe34.zip
tree.3: explain RB_FIND() and RB_NFIND()
In collaboration with: dougm Reviewed by: alc Sponsored by: The FreeBSD Foundation (kib) MFC after: 3 days Differential revision: https://reviews.freebsd.org/D36001
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man3/tree.317
1 files changed, 16 insertions, 1 deletions
diff --git a/share/man/man3/tree.3 b/share/man/man3/tree.3
index 08d442db5e78..7e3727b2c365 100644
--- a/share/man/man3/tree.3
+++ b/share/man/man3/tree.3
@@ -523,10 +523,25 @@ The
and
.Fn RB_NFIND
macros can be used to find a particular element in the tree.
+.Pp
+The
+.Fn RB_FIND
+macro returns the element in the tree equal to the provided
+key, or
+.Dv NULL
+if there is no such element.
+.Pp
+The
+.Fn RB_NFIND
+macro returns the least element greater than or equal to the provided
+key, or
+.Dv NULL
+if there is no such element.
.Bd -literal -offset indent
-struct TYPE find, *res;
+struct TYPE find, *res, *resn;
find.key = 30;
res = RB_FIND(NAME, head, &find);
+resn = RB_NFIND(NAME, head, &find);
.Ed
.Pp
The