summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2006-01-11 15:48:36 +0000
committerjasone <jasone@FreeBSD.org>2006-01-11 15:48:36 +0000
commit3c55fbecc573cb9c1d0662104ce9485950b986ae (patch)
tree07dde63ea169823889a636e0466b6359dc5e7e66 /share
parentbb26b447587ea480273607b18f31bf7916e6a462 (diff)
downloadFreeBSD-src-3c55fbecc573cb9c1d0662104ce9485950b986ae.zip
FreeBSD-src-3c55fbecc573cb9c1d0662104ce9485950b986ae.tar.gz
Add the RB_NFIND() macro, which is useful for red-black tree searches
for which there may not be an exact match. Reviewed by: glebius, julian Approved by: markm (mentor)
Diffstat (limited to 'share')
-rw-r--r--share/man/man3/Makefile1
-rw-r--r--share/man/man3/tree.37
2 files changed, 7 insertions, 1 deletions
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile
index 878cd20..923c762 100644
--- a/share/man/man3/Makefile
+++ b/share/man/man3/Makefile
@@ -108,6 +108,7 @@ MLINKS+= timeradd.3 timerclear.3 \
MLINKS+= tree.3 RB_EMPTY.3 \
tree.3 RB_ENTRY.3 \
tree.3 RB_FIND.3 \
+ tree.3 RB_NFIND.3 \
tree.3 RB_FOREACH.3 \
tree.3 RB_GENERATE.3 \
tree.3 RB_HEAD.3 \
diff --git a/share/man/man3/tree.3 b/share/man/man3/tree.3
index c01aa8a..77ab368 100644
--- a/share/man/man3/tree.3
+++ b/share/man/man3/tree.3
@@ -62,6 +62,7 @@
.Nm RB_MIN ,
.Nm RB_MAX ,
.Nm RB_FIND ,
+.Nm RB_NFIND ,
.Nm RB_LEFT ,
.Nm RB_RIGHT ,
.Nm RB_PARENT ,
@@ -118,6 +119,8 @@
.Ft "struct TYPE *"
.Fn RB_FIND NAME "RB_HEAD *head" "struct TYPE *elm"
.Ft "struct TYPE *"
+.Fn RB_NFIND NAME "RB_HEAD *head" "struct TYPE *elm"
+.Ft "struct TYPE *"
.Fn RB_LEFT "struct TYPE *elm" "RB_ENTRY NAME"
.Ft "struct TYPE *"
.Fn RB_RIGHT "struct TYPE *elm" "RB_ENTRY NAME"
@@ -405,7 +408,9 @@ from the tree pointed by
.Pp
The
.Fn RB_FIND
-macro can be used to find a particular element in the tree.
+and
+.Fn RB_NFIND
+macros can be used to find a particular element in the tree.
.Bd -literal -offset indent
struct TYPE find, *res;
find.key = 30;
OpenPOWER on IntegriCloud