CVS commit: [netbsd-6] src/share/man/man3
Module Name:src Committed By: snj Date: Thu Jul 6 15:21:32 UTC 2017 Modified Files: src/share/man/man3 [netbsd-6]: bits.3 Log Message: Pull up following revision(s) (requested by riastradh in ticket #1420): share/man/man3/bits.3: revision 1.17 These have been able to handle uintmax-width masks since creation. To generate a diff of this commit: cvs rdiff -u -r1.12.6.1 -r1.12.6.2 src/share/man/man3/bits.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/bits.3 diff -u src/share/man/man3/bits.3:1.12.6.1 src/share/man/man3/bits.3:1.12.6.2 --- src/share/man/man3/bits.3:1.12.6.1 Thu Oct 25 17:09:43 2012 +++ src/share/man/man3/bits.3 Thu Jul 6 15:21:32 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: bits.3,v 1.12.6.1 2012/10/25 17:09:43 riz Exp $ +.\" $NetBSD: bits.3,v 1.12.6.2 2017/07/06 15:21:32 snj Exp $ .\" .\" Copyright (c) 2006, 2010 David Young. All rights reserved. .\" @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 17, 2012 +.Dd November 6, 2016 .Dt BITS 3 .Os .Sh NAME @@ -146,8 +146,3 @@ contributed the macro names .Fn SHIFTIN and .Fn SHIFTOUT . -.Sh BUGS -.Fn __BIT -and -.Fn __BITS -can only express 32-bit bitmasks.
CVS commit: [netbsd-6] src/share/man/man3
Module Name:src Committed By: msaitoh Date: Mon Oct 27 05:51:57 UTC 2014 Modified Files: src/share/man/man3 [netbsd-6]: rbtree.3 Log Message: Pull up following revision(s) (requested by riastradh in ticket #1136): share/man/man3/rbtree.3: revision 1.8 Fix documentation of rbtree(3) iteration. . Fix sense of rb_tree_iterate(rbt, NULL, ...). . Document RB_TREE_MIN/RB_TREE_MAX to avoid relying on that sense. . Document RB_TREE_FOREACH and RB_TREE_FOREACH_REVERSE to simplify iteration. Addresses PR lib/46034 and PR lib/47144. It would have been nice to make `x = NULL; while ((x = rb_tree_iterate(t, NULL, ...)) != NULL)' DTRT to traverse t, but it's too much late for that now. We probably ought to have an RB_TREE_FOREACH{,_REVERSE}_SAFE too. ok christos To generate a diff of this commit: cvs rdiff -u -r1.5.6.1 -r1.5.6.2 src/share/man/man3/rbtree.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/rbtree.3 diff -u src/share/man/man3/rbtree.3:1.5.6.1 src/share/man/man3/rbtree.3:1.5.6.2 --- src/share/man/man3/rbtree.3:1.5.6.1 Mon Sep 3 18:41:15 2012 +++ src/share/man/man3/rbtree.3 Mon Oct 27 05:51:57 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: rbtree.3,v 1.5.6.1 2012/09/03 18:41:15 riz Exp $ +.\" $NetBSD: rbtree.3,v 1.5.6.2 2014/10/27 05:51:57 msaitoh Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 19, 2012 +.Dd March 13, 2013 .Dt RBTREE 3 .Os .Sh NAME @@ -50,7 +50,13 @@ .Ft void * .Fn rb_tree_find_node_leq "rb_tree_t *rbt" "const void *key" .Ft void * -.Fn rb_tree_iterate "rb_tree_t *rbt" "void *rb" "const unsigned int direction" +.Fn rb_tree_iterate "rb_tree_t *rbt" "void *rb" "unsigned int direction" +.Ft void * +.Fn RB_TREE_MIN "rb_tree_t *rbt" +.Ft void * +.Fn RB_TREE_MAX "rb_tree_t *rbt" +.Fn RB_TREE_FOREACH "void *rb" "rb_tree_t *rbt" +.Fn RB_TREE_FOREACH_REVERSE "void *rb" "rb_tree_t *rbt" .Sh DESCRIPTION .Nm provides red-black trees. @@ -190,7 +196,7 @@ or, if .Fa rb is .Dv NULL , -return the last node in +return the first node in .Fa rbt or, if the tree is empty, return .Dv NULL . @@ -207,10 +213,44 @@ or, if .Fa rb is .Dv NULL , -return the first node in +return the last node in .Fa rbt or, if the tree is empty, return .Dv NULL . +.It Fn RB_TREE_MIN "rbt" +Return the first node in +.Fa rbt , +i.e. the node with the least key, or +.Dv NULL +if +.Fa rbt +is empty. +.It Fn RB_TREE_MAX "rbt" +Return the last node in +.Fa rbt , +i.e. the node with the greatest key, or +.Dv NULL +if +.Fa rbt +is empty. +.It Fn RB_TREE_FOREACH "rb" "rbt" +.Nm RB_TREE_FOREACH +is a macro to be used in the place of a +.Dv for +header preceding a statement to traverse the nodes in +.Fa rbt +from least to greatest, assigning +.Fa rb +to each node in turn and executing the statement. +.It Fn RB_TREE_FOREACH_REVERSE "rb" "rbt" +.Nm RB_TREE_FOREACH_REVERSE +is a macro to be used in the place of a +.Dv for +header preceding a statement to traverse the nodes in +.Fa rbt +from greatest to least, assigning +.Fa rb +to each node in turn and executing the statement. .El .Sh CODE REFERENCES The
CVS commit: [netbsd-6] src/share/man/man3
Module Name:src Committed By: msaitoh Date: Mon Sep 29 18:39:02 UTC 2014 Modified Files: src/share/man/man3 [netbsd-6]: attribute.3 Log Message: Pull up following revision(s) (requested by riastradh in ticket #1127): share/man/man3/attribute.3: revision 1.16 Fix note on __predict_true: predicts nonzero, not 1 specifically. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.11.4.1 src/share/man/man3/attribute.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/attribute.3 diff -u src/share/man/man3/attribute.3:1.11 src/share/man/man3/attribute.3:1.11.4.1 --- src/share/man/man3/attribute.3:1.11 Sun Sep 18 17:43:20 2011 +++ src/share/man/man3/attribute.3 Mon Sep 29 18:39:02 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: attribute.3,v 1.11 2011/09/18 17:43:20 jym Exp $ +.\" $NetBSD: attribute.3,v 1.11.4.1 2014/09/29 18:39:02 msaitoh Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -286,7 +286,7 @@ Semantically .Ic __predict_true expects that the integral expression .Fa exp -equals 1. +yields nonzero. .It Ic __predict_false The .Ic __predict_false
CVS commit: [netbsd-6] src/share/man/man3
Module Name:src Committed By: riz Date: Thu Oct 25 17:09:44 UTC 2012 Modified Files: src/share/man/man3 [netbsd-6]: bits.3 Log Message: share/man/man3/bits.3 1.13-1.14 Document the correct return value of __BIT() and __BITS(). [msaitoh, ticket #636] To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.12.6.1 src/share/man/man3/bits.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/bits.3 diff -u src/share/man/man3/bits.3:1.12 src/share/man/man3/bits.3:1.12.6.1 --- src/share/man/man3/bits.3:1.12 Sat Apr 30 19:34:10 2011 +++ src/share/man/man3/bits.3 Thu Oct 25 17:09:43 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: bits.3,v 1.12 2011/04/30 19:34:10 jym Exp $ +.\" $NetBSD: bits.3,v 1.12.6.1 2012/10/25 17:09:43 riz Exp $ .\" .\" Copyright (c) 2006, 2010 David Young. All rights reserved. .\" @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 8, 2011 +.Dd October 17, 2012 .Dt BITS 3 .Os .Sh NAME @@ -38,9 +38,9 @@ .Sh SYNOPSIS .In sys/param.h .In sys/cdefs.h -.Ft uint32_t +.Ft uintmax_t .Fn __BIT "n" -.Ft uint32_t +.Ft uintmax_t .Fn __BITS "m" "n" .Fn __SHIFTIN "v" "mask" .Fn __SHIFTOUT "v" "mask"
CVS commit: [netbsd-6] src/share/man/man3
Module Name:src Committed By: riz Date: Mon Sep 3 18:41:15 UTC 2012 Modified Files: src/share/man/man3 [netbsd-6]: rbtree.3 Log Message: Pull up following revision(s) (requested by dholland in ticket #526): share/man/man3/rbtree.3: revision 1.7 Add more function argument names to the man page, trying to address PR 46814 by Lloyd Parkes. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.6.1 src/share/man/man3/rbtree.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man3/rbtree.3 diff -u src/share/man/man3/rbtree.3:1.5 src/share/man/man3/rbtree.3:1.5.6.1 --- src/share/man/man3/rbtree.3:1.5 Mon Mar 28 13:46:14 2011 +++ src/share/man/man3/rbtree.3 Mon Sep 3 18:41:15 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: rbtree.3,v 1.5 2011/03/28 13:46:14 ahoka Exp $ +.\" $NetBSD: rbtree.3,v 1.5.6.1 2012/09/03 18:41:15 riz Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 17, 2011 +.Dd August 19, 2012 .Dt RBTREE 3 .Os .Sh NAME @@ -38,19 +38,19 @@ .Sh SYNOPSIS .In sys/rbtree.h .Ft void -.Fn rb_tree_init "rb_tree_t *" "const rb_tree_ops_t *" +.Fn rb_tree_init "rb_tree_t *rbt" "const rb_tree_ops_t *ops" .Ft void * -.Fn rb_tree_insert_node "rb_tree_t *" "void *" +.Fn rb_tree_insert_node "rb_tree_t *rbt" "void *rb" .Ft void -.Fn rb_tree_remove_node "rb_tree_t *" "void *" +.Fn rb_tree_remove_node "rb_tree_t *rbt" "void *rb" .Ft void * -.Fn rb_tree_find_node "rb_tree_t *" "const void *" +.Fn rb_tree_find_node "rb_tree_t *rbt" "const void *key" .Ft void * -.Fn rb_tree_find_node_geq "rb_tree_t *" "const void *" +.Fn rb_tree_find_node_geq "rb_tree_t *rbt" "const void *key" .Ft void * -.Fn rb_tree_find_node_leq "rb_tree_t *" "const void *" +.Fn rb_tree_find_node_leq "rb_tree_t *rbt" "const void *key" .Ft void * -.Fn rb_tree_iterate "rb_tree_t *" "void *" "const unsigned int" +.Fn rb_tree_iterate "rb_tree_t *rbt" "void *rb" "const unsigned int direction" .Sh DESCRIPTION .Nm provides red-black trees. @@ -74,20 +74,39 @@ The maximum height of a red-black tree i .It Vt rb_tree_t A red-black tree. .It Vt typedef signed int \ -(*const rbto_compare_nodes_fn)(void *, const void *, const void *); +(*const rbto_compare_nodes_fn)(void *context, const void *node1, const void *node2); The node-comparison operator. Defines an ordering on nodes. -Returns a negative value if the first node precedes the second node. -Returns a positive value if the first node follows the second node. -Returns 0 if the first node and the second are identical according -to the ordering. +Returns a negative value if the first node +.Ar node1 +precedes the second node +.Ar node2 . +Returns a positive value if the first node +.Ar node1 +follows the second node +.Ar node2 . +Returns 0 if the first node +.Ar node1 +and the second node +.Ar node2 +are identical according to the ordering. .It Vt typedef signed int \ -(*const rbto_compare_key_fn)(void *, const void *, const void *); +(*const rbto_compare_key_fn)(void *context, const void *node, const void *key); The node-key comparison operator. Defines the order of nodes and keys. -Returns a negative value if the node precedes the key. -Returns a positive value if the node follows the key. -Returns 0 if the node is identical to the key according to the ordering. +Returns a negative value if the node +.Ar node +precedes the key +.Ar key . +Returns a positive value if the node +.Ar node +follows the key +.Ar key . +Returns 0 if the node +.Ar node +is identical to the key +.Ar key +according to the ordering. .It Vt rb_tree_ops_t Defines the operator for comparing two nodes in the same tree, the operator for comparing a node in the tree with a key,