diff options
author | jasone <jasone@FreeBSD.org> | 2007-12-28 07:03:26 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2007-12-28 07:03:26 +0000 |
commit | 6a9a3f192972770da07da18a96d36dad51f89834 (patch) | |
tree | 2b05f280a76f20e8edc06ce608bcd6b2f7630d2e /share/man/man3 | |
parent | c9054ae803ccb0b5c30333ca4d58280dffdaf79c (diff) | |
download | FreeBSD-src-6a9a3f192972770da07da18a96d36dad51f89834.zip FreeBSD-src-6a9a3f192972770da07da18a96d36dad51f89834.tar.gz |
Implement RB_PREV() AND RB_FOREACH_REVERSE().
Diffstat (limited to 'share/man/man3')
-rw-r--r-- | share/man/man3/tree.3 | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/share/man/man3/tree.3 b/share/man/man3/tree.3 index 78ba4b0..aa53eb1 100644 --- a/share/man/man3/tree.3 +++ b/share/man/man3/tree.3 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2006 +.Dd December 27, 2007 .Dt TREE 3 .Os .Sh NAME @@ -61,6 +61,7 @@ .Nm RB_ROOT , .Nm RB_EMPTY , .Nm RB_NEXT , +.Nm RB_PREV , .Nm RB_MIN , .Nm RB_MAX , .Nm RB_FIND , @@ -69,6 +70,7 @@ .Nm RB_RIGHT , .Nm RB_PARENT , .Nm RB_FOREACH , +.Nm RB_FOREACH_REVERSE , .Nm RB_INIT , .Nm RB_INSERT , .Nm RB_REMOVE @@ -117,6 +119,8 @@ .Ft "struct TYPE *" .Fn RB_NEXT NAME "RB_HEAD *head" "struct TYPE *elm" .Ft "struct TYPE *" +.Fn RB_PREV NAME "RB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" .Fn RB_MIN NAME "RB_HEAD *head" .Ft "struct TYPE *" .Fn RB_MAX NAME "RB_HEAD *head" @@ -131,6 +135,7 @@ .Ft "struct TYPE *" .Fn RB_PARENT "struct TYPE *elm" "RB_ENTRY NAME" .Fn RB_FOREACH VARNAME NAME "RB_HEAD *head" +.Fn RB_FOREACH_REVERSE VARNAME NAME "RB_HEAD *head" .Ft void .Fn RB_INIT "RB_HEAD *head" .Ft "struct TYPE *" @@ -433,14 +438,17 @@ The .Fn RB_ROOT , .Fn RB_MIN , .Fn RB_MAX , +.Fn RB_NEXT , and -.Fn RB_NEXT +.Fn RB_PREV macros can be used to traverse the tree: .Pp .Dl "for (np = RB_MIN(NAME, &head); np != NULL; np = RB_NEXT(NAME, &head, np))" .Pp Or, for simplicity, one can use the .Fn RB_FOREACH +or +.Fn RB_FOREACH_REVERSE macro: .Bd -ragged -offset indent .Fn RB_FOREACH np NAME head |