Date: Wed, 10 Aug 2022 00:44:13 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: f2c6a00a2e46 - stable/13 - tree.3: explain RB_FIND() and RB_NFIND() Message-ID: <202208100044.27A0iD3b017407@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f2c6a00a2e4636a99f4e97c983b8dd1c132eae3e commit f2c6a00a2e4636a99f4e97c983b8dd1c132eae3e Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-08-01 09:43:10 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-08-10 00:44:03 +0000 tree.3: explain RB_FIND() and RB_NFIND() (cherry picked from commit 08349b18ea26d1e191333f9b3550cd95b09cfe34) --- share/man/man3/tree.3 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/share/man/man3/tree.3 b/share/man/man3/tree.3 index c68c71fff85b..c45ce3d3ceb6 100644 --- a/share/man/man3/tree.3 +++ b/share/man/man3/tree.3 @@ -520,10 +520,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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208100044.27A0iD3b017407>