From nobody Sun Aug 07 19:24:53 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M18RV2XL2z4YmHb; Sun, 7 Aug 2022 19:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M18RV0Lmxz470J; Sun, 7 Aug 2022 19:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659900294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CR3WcJOS4c8md83HZublGR43meCqyiEMfyFtgrIn2yQ=; b=oczKWV9uBVwenMP0SMKBl592BZcm08fUyig6XJu4dRvfZepXmTlIPoEIK1468Ml4s5HK54 UjohdOyjMon2FmoJOm6C0S+Os4p4IDon0VihUMdJ0cQ8OQOZOOsbZokx8tjCg/cmSIjYRZ ZA3dIEcVgJfw6haN1QtDrbNWw2MsQP7gBlgc4LbMtI6TUvmQTi3F699O/pwrYSUAufyXAw h8uPZofFtcoNT0ZhXPDq/WH/CMkhs+IZgv9EaIxhFDzJJhY1Zy4N6Fr2db73KwxOeWyCmA ER6m8/Ltcgmbp76xpWa7Divs7XlDwddianiRRKe0Y6uKUCNUYoMi4NXqis13FQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M18RT6ZwTzPC2; Sun, 7 Aug 2022 19:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 277JOrTh068425; Sun, 7 Aug 2022 19:24:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 277JOr3T068424; Sun, 7 Aug 2022 19:24:53 GMT (envelope-from git) Date: Sun, 7 Aug 2022 19:24:53 GMT Message-Id: <202208071924.277JOr3T068424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 08349b18ea26 - main - tree.3: explain RB_FIND() and RB_NFIND() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08349b18ea26d1e191333f9b3550cd95b09cfe34 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659900294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CR3WcJOS4c8md83HZublGR43meCqyiEMfyFtgrIn2yQ=; b=OHsmfV5KgHpAd7mOb86BqFu1WK+fjgFzDhGcBl7aQ2NFetyU9PeFovqub2lCflqsaVO2IH orGx3o0clhyWlq8lgj4MXYntZDjgUrwIabx/gIiRU+Vjxysqac7lXIvzYaEjrdAZbrZRsA E4nurY7MkZcpPm0aeIyQ2DDTZiH/Pbu8djI7RWkWw2iNfPc2t1UfR9xn/8JXKUIp7wB6l4 PYgtqnPzSALx5+Wu+vWmwPjh7TSEiC0wNZEHMTLO2o+PlXN4x3zb4Lr7aw85BvI5dC/I2Q xNiCzG84HnI40Cdatxe6TE2k6k5bB8WCH1fcy95xweRYKFhzoS8zebX9lDEY+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659900294; a=rsa-sha256; cv=none; b=mRCz3JSqLvdxEqo1DcYWjZcsOUzEuhKAFP33FthoLL7cRYTRa4e+K5Wwoauf6GqWFR0EUm urVQIWG2DNqDslJ2Jh7ZZJONtQvT3eLWOanAoxAjTxiSto8R2a7uwa1XF4fv/sE9vlLkNK zveJyNrBR0ZmAO8Qo1gD7I4WnNtBoKRIEWwd5CU5ROXVCGPovYRmleSRTiYC1Q/TreG9Os o8Wh1WbhlAHMpuHuIp5+p7W7utNaOh51M1AJ4LvwGWdcpu6pKsueWLUUucL5DTaYLFsMwt 8luXq3KXh3k5v8LPZSu991qHtUipR6pzQBhWw/jZ08MuIb3FTDjaj7FxuKxpwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=08349b18ea26d1e191333f9b3550cd95b09cfe34 commit 08349b18ea26d1e191333f9b3550cd95b09cfe34 Author: Konstantin Belousov AuthorDate: 2022-08-01 09:43:10 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-07 19:23:44 +0000 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 --- 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 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