summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJason McIntyre <jmc@cvs.openbsd.org>2011-07-09 08:43:02 +0000
committerJason McIntyre <jmc@cvs.openbsd.org>2011-07-09 08:43:02 +0000
commit06fd3d5ad2dee1f88ff637ea7b192d641591f175 (patch)
treef7694748b8373168de921596af3855d3b2680df2 /share
parent447e4ea506b78b4294a293cc9f771f8b12a36fef (diff)
tweak previous;
Diffstat (limited to 'share')
-rw-r--r--share/man/man3/queue.361
-rw-r--r--share/man/man3/tree.319
2 files changed, 50 insertions, 30 deletions
diff --git a/share/man/man3/queue.3 b/share/man/man3/queue.3
index 415b78dc987..7ac90b85f01 100644
--- a/share/man/man3/queue.3
+++ b/share/man/man3/queue.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: queue.3,v 1.51 2011/07/09 00:20:36 pirofti Exp $
+.\" $OpenBSD: queue.3,v 1.52 2011/07/09 08:43:01 jmc Exp $
.\" $NetBSD: queue.3,v 1.4 1995/07/03 00:25:36 mycroft Exp $
.\"
.\" Copyright (c) 1993 The Regents of the University of California.
@@ -501,9 +501,11 @@ macro:
SLIST_FOREACH(np, head, NAME)
.Ed
.Pp
-The macro SLIST_FOREACH_SAFE traverses the list referenced by head in the
-forward direction, assigning each element in turn to var. However,
-unlike SLIST_FOREACH() here it is permitted to both remove var as well
+The macro SLIST_FOREACH_SAFE traverses the list referenced by head in a
+forward direction, assigning each element in turn to var.
+However, unlike
+.Fn SLIST_FOREACH
+it is permitted to remove var as well
as free it from within the loop safely without interfering with the traversal.
.Pp
The
@@ -649,9 +651,11 @@ macro:
LIST_FOREACH(np, head, NAME)
.Ed
.Pp
-The macro LIST_FOREACH_SAFE traverses the list referenced by head in the
-forward direction, assigning each element in turn to var. However,
-unlike LIST_FOREACH() here it is permitted to both remove var as well
+The macro LIST_FOREACH_SAFE traverses the list referenced by head in a
+forward direction, assigning each element in turn to var.
+However, unlike
+.Fn LIST_FOREACH
+it is permitted to remove var as well
as free it from within the loop safely without interfering with the traversal.
.Pp
The
@@ -776,9 +780,11 @@ is used for queue traversal:
SIMPLEQ_FOREACH(np, head, NAME)
.Ed
.Pp
-The macro SIMPLEQ_FOREACH_SAFE traverses the queue referenced by head in the
-forward direction, assigning each element in turn to var. However,
-unlike SIMPLEQ_FOREACH() here it is permitted to both remove var as well
+The macro SIMPLEQ_FOREACH_SAFE traverses the queue referenced by head in a
+forward direction, assigning each element in turn to var.
+However, unlike
+.Fn SIMPLEQ_FOREACH
+it is permitted to remove var as well
as free it from within the loop safely without interfering with the traversal.
.Pp
The
@@ -912,12 +918,17 @@ TAILQ_FOREACH(np, &head, NAME)
TAILQ_FOREACH_REVERSE(np, &head, HEADNAME, NAME)
.Ed
.Pp
-The macros TAILQ_FOREACH_SAFE and TAILQ_FOREACH_REVERSE_SAFE traverse the
-list referenced by head in the forward or reverse direction respectively,
-assigning each element in turn to var. However, unlike their unsafe
-counterparts, TAILQ_FOREACH and TAILQ_FOREACH_REVERSE permit to both
-remove var as well as free it from within the loop safely without interfering
-with the traversal.
+The macros
+.Fn TAILQ_FOREACH_SAFE
+and
+.Fn TAILQ_FOREACH_REVERSE_SAFE
+traverse the list referenced by head
+in a forward or reverse direction respectively,
+assigning each element in turn to var.
+However, unlike their unsafe counterparts,
+they permit both the removal of var
+as well as freeing it from within the loop safely
+without interfering with the traversal.
.Pp
The
.Fn TAILQ_FIRST ,
@@ -1074,12 +1085,17 @@ macro acts like
.Fn CIRCLEQ_FOREACH
but traverses the circular queue backwards.
.Pp
-The macros CIRCLEQ_FOREACH_SAFE and CIRCLEQ_FOREACH_REVERSE_SAFE traverse the
-list referenced by head in the forward or reverse direction respectively,
-assigning each element in turn to var. However, unlike their unsafe
-counterparts, CIRCLEQ_FOREACH and CIRCLEQ_FOREACH_REVERSE permit to both
-remove var as well as free it from within the loop safely without interfering
-with the traversal.
+The macros
+.Fn CIRCLEQ_FOREACH_SAFE
+and
+.Fn CIRCLEQ_FOREACH_REVERSE_SAFE
+traverse the list referenced by head
+in a forward or reverse direction respectively,
+assigning each element in turn to var.
+However, unlike their unsafe counterparts,
+they permit both the removal of var
+as well as freeing it from within the loop safely
+without interfering with the traversal.
.Pp
The
.Fn CIRCLEQ_EMPTY
@@ -1156,7 +1172,6 @@ from the list.
.Pp
In cases like these the data structure's FOREACH_SAFE macros should be used
instead.
-.Ed
.Sh HISTORY
The
.Nm queue
diff --git a/share/man/man3/tree.3 b/share/man/man3/tree.3
index 0ad5ecb71bf..bb9a5b2a062 100644
--- a/share/man/man3/tree.3
+++ b/share/man/man3/tree.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tree.3,v 1.22 2011/07/09 00:20:36 pirofti Exp $
+.\" $OpenBSD: tree.3,v 1.23 2011/07/09 08:43:01 jmc Exp $
.\"/*
.\" * Copyright 2002 Niels Provos <provos@citi.umich.edu>
.\" * All rights reserved.
@@ -460,12 +460,17 @@ macros:
RB_FOREACH(np, NAME, &head)
.Ed
.Pp
-The macros RB_FOREACH_SAFE and RB_FOREACH_REVERSE_SAFE traverse the
-tree referenced by head in the forward or reverse direction respectively,
-assigning each element in turn to np. However, unlike their unsafe
-counterparts, RB_FOREACH and RB_FOREACH_REVERSE permit to both
-remove np as well as free it from within the loop safely without interfering
-with the traversal.
+The macros
+.Fn RB_FOREACH_SAFE
+and
+.Fn RB_FOREACH_REVERSE_SAFE
+traverse the tree referenced by head
+in a forward or reverse direction respectively,
+assigning each element in turn to np.
+However, unlike their unsafe counterparts,
+they permit both the removal of np
+as well as freeing it from within the loop safely
+without interfering with the traversal.
.Pp
The
.Fn RB_EMPTY