queue.3: Comment out text for functions not in glibc

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-02-07 08:05:23 +01:00
parent c0f21a05f0
commit 6559169cac
1 changed files with 314 additions and 314 deletions

View File

@ -36,46 +36,46 @@
.Nm SLIST_ENTRY ,
.Nm SLIST_FIRST ,
.Nm SLIST_FOREACH ,
.Nm SLIST_FOREACH_FROM ,
.Nm SLIST_FOREACH_SAFE ,
.Nm SLIST_FOREACH_FROM_SAFE ,
.\" .Nm SLIST_FOREACH_FROM ,
.\" .Nm SLIST_FOREACH_SAFE ,
.\" .Nm SLIST_FOREACH_FROM_SAFE ,
.Nm SLIST_HEAD ,
.Nm SLIST_HEAD_INITIALIZER ,
.Nm SLIST_INIT ,
.Nm SLIST_INSERT_AFTER ,
.Nm SLIST_INSERT_HEAD ,
.Nm SLIST_NEXT ,
.Nm SLIST_REMOVE_AFTER ,
.\" .Nm SLIST_REMOVE_AFTER ,
.Nm SLIST_REMOVE_HEAD ,
.Nm SLIST_REMOVE ,
.Nm SLIST_SWAP ,
.\" .Nm SLIST_SWAP ,
.Nm STAILQ_CONCAT ,
.Nm STAILQ_EMPTY ,
.Nm STAILQ_ENTRY ,
.Nm STAILQ_FIRST ,
.Nm STAILQ_FOREACH ,
.Nm STAILQ_FOREACH_FROM ,
.Nm STAILQ_FOREACH_SAFE ,
.Nm STAILQ_FOREACH_FROM_SAFE ,
.\" .Nm STAILQ_FOREACH_FROM ,
.\" .Nm STAILQ_FOREACH_SAFE ,
.\" .Nm STAILQ_FOREACH_FROM_SAFE ,
.Nm STAILQ_HEAD ,
.Nm STAILQ_HEAD_INITIALIZER ,
.Nm STAILQ_INIT ,
.Nm STAILQ_INSERT_AFTER ,
.Nm STAILQ_INSERT_HEAD ,
.Nm STAILQ_INSERT_TAIL ,
.Nm STAILQ_LAST ,
.\" .Nm STAILQ_LAST ,
.Nm STAILQ_NEXT ,
.Nm STAILQ_REMOVE_AFTER ,
.\" .Nm STAILQ_REMOVE_AFTER ,
.Nm STAILQ_REMOVE_HEAD ,
.Nm STAILQ_REMOVE ,
.Nm STAILQ_SWAP ,
.\" .Nm STAILQ_SWAP ,
.Nm LIST_EMPTY ,
.Nm LIST_ENTRY ,
.Nm LIST_FIRST ,
.Nm LIST_FOREACH ,
.Nm LIST_FOREACH_FROM ,
.Nm LIST_FOREACH_SAFE ,
.Nm LIST_FOREACH_FROM_SAFE ,
.\" .Nm LIST_FOREACH_FROM ,
.\" .Nm LIST_FOREACH_SAFE ,
.\" .Nm LIST_FOREACH_FROM_SAFE ,
.Nm LIST_HEAD ,
.Nm LIST_HEAD_INITIALIZER ,
.Nm LIST_INIT ,
@ -83,21 +83,21 @@
.Nm LIST_INSERT_BEFORE ,
.Nm LIST_INSERT_HEAD ,
.Nm LIST_NEXT ,
.Nm LIST_PREV ,
.\" .Nm LIST_PREV ,
.Nm LIST_REMOVE ,
.Nm LIST_SWAP ,
.\" .Nm LIST_SWAP ,
.Nm TAILQ_CONCAT ,
.Nm TAILQ_EMPTY ,
.Nm TAILQ_ENTRY ,
.Nm TAILQ_FIRST ,
.Nm TAILQ_FOREACH ,
.Nm TAILQ_FOREACH_FROM ,
.Nm TAILQ_FOREACH_SAFE ,
.Nm TAILQ_FOREACH_FROM_SAFE ,
.\" .Nm TAILQ_FOREACH_FROM ,
.\" .Nm TAILQ_FOREACH_SAFE ,
.\" .Nm TAILQ_FOREACH_FROM_SAFE ,
.Nm TAILQ_FOREACH_REVERSE ,
.Nm TAILQ_FOREACH_REVERSE_FROM ,
.Nm TAILQ_FOREACH_REVERSE_SAFE ,
.Nm TAILQ_FOREACH_REVERSE_FROM_SAFE ,
.\" .Nm TAILQ_FOREACH_REVERSE_FROM ,
.\" .Nm TAILQ_FOREACH_REVERSE_SAFE ,
.\" .Nm TAILQ_FOREACH_REVERSE_FROM_SAFE ,
.Nm TAILQ_HEAD ,
.Nm TAILQ_HEAD_INITIALIZER ,
.Nm TAILQ_INIT ,
@ -119,48 +119,48 @@ lists and tail queues
.Fn SLIST_ENTRY "TYPE"
.Fn SLIST_FIRST "SLIST_HEAD *head"
.Fn SLIST_FOREACH "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
.Fn SLIST_FOREACH_FROM "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
.Fn SLIST_FOREACH_FROM_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
.\" .Fn SLIST_FOREACH_FROM "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME"
.\" .Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
.\" .Fn SLIST_FOREACH_FROM_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var"
.Fn SLIST_HEAD "HEADNAME" "TYPE"
.Fn SLIST_HEAD_INITIALIZER "SLIST_HEAD head"
.Fn SLIST_INIT "SLIST_HEAD *head"
.Fn SLIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_NEXT "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
.\" .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME"
.Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME"
.\" .Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME"
.\"
.Fn STAILQ_CONCAT "STAILQ_HEAD *head1" "STAILQ_HEAD *head2"
.Fn STAILQ_EMPTY "STAILQ_HEAD *head"
.Fn STAILQ_ENTRY "TYPE"
.Fn STAILQ_FIRST "STAILQ_HEAD *head"
.Fn STAILQ_FOREACH "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
.Fn STAILQ_FOREACH_FROM "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn STAILQ_FOREACH_FROM_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
.\" .Fn STAILQ_FOREACH_FROM "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
.\" .Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
.\" .Fn STAILQ_FOREACH_FROM_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn STAILQ_HEAD "HEADNAME" "TYPE"
.Fn STAILQ_HEAD_INITIALIZER "STAILQ_HEAD head"
.Fn STAILQ_INIT "STAILQ_HEAD *head"
.Fn STAILQ_INSERT_AFTER "STAILQ_HEAD *head" "TYPE *listelm" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_INSERT_HEAD "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE" "STAILQ_ENTRY NAME"
.\" .Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE" "STAILQ_ENTRY NAME"
.Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.\" .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME"
.Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME"
.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME"
.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME"
.\" .Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME"
.\"
.Fn LIST_EMPTY "LIST_HEAD *head"
.Fn LIST_ENTRY "TYPE"
.Fn LIST_FIRST "LIST_HEAD *head"
.Fn LIST_FOREACH "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
.Fn LIST_FOREACH_FROM "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
.Fn LIST_FOREACH_FROM_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
.\" .Fn LIST_FOREACH_FROM "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME"
.\" .Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
.\" .Fn LIST_FOREACH_FROM_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var"
.Fn LIST_HEAD "HEADNAME" "TYPE"
.Fn LIST_HEAD_INITIALIZER "LIST_HEAD head"
.Fn LIST_INIT "LIST_HEAD *head"
@ -168,7 +168,7 @@ lists and tail queues
.Fn LIST_INSERT_BEFORE "TYPE *listelm" "TYPE *elm" "LIST_ENTRY NAME"
.Fn LIST_INSERT_HEAD "LIST_HEAD *head" "TYPE *elm" "LIST_ENTRY NAME"
.Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME"
.Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
.\" .Fn LIST_PREV "TYPE *elm" "LIST_HEAD *head" "TYPE" "LIST_ENTRY NAME"
.Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME"
.\"
@ -177,13 +177,13 @@ lists and tail queues
.Fn TAILQ_ENTRY "TYPE"
.Fn TAILQ_FIRST "TAILQ_HEAD *head"
.Fn TAILQ_FOREACH "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
.Fn TAILQ_FOREACH_FROM "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_FOREACH_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.\" .Fn TAILQ_FOREACH_FROM "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME"
.\" .Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.\" .Fn TAILQ_FOREACH_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_FOREACH_REVERSE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
.Fn TAILQ_FOREACH_REVERSE_FROM "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_FOREACH_REVERSE_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.\" .Fn TAILQ_FOREACH_REVERSE_FROM "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME"
.\" .Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.\" .Fn TAILQ_FOREACH_REVERSE_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var"
.Fn TAILQ_HEAD "HEADNAME" "TYPE"
.Fn TAILQ_HEAD_INITIALIZER "TAILQ_HEAD head"
.Fn TAILQ_INIT "TAILQ_HEAD *head"
@ -379,46 +379,46 @@ traverses the list referenced by
in the forward direction, assigning each element in
turn to
.Fa var .
.Pp
The macro
.Nm SLIST_FOREACH_FROM
behaves identically to
.Nm SLIST_FOREACH
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found SLIST element and begins the loop at
.Fa var
instead of the first element in the SLIST referenced by
.Fa head .
.Pp
The macro
.Nm SLIST_FOREACH_SAFE
traverses the list referenced by
.Fa head
in the forward direction, assigning each element in
turn to
.Fa var .
However, unlike
.Fn SLIST_FOREACH
here it is permitted to both remove
.Fa var
as well as free it from within the loop safely without interfering with the
traversal.
.Pp
The macro
.Nm SLIST_FOREACH_FROM_SAFE
behaves identically to
.Nm SLIST_FOREACH_SAFE
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found SLIST element and begins the loop at
.Fa var
instead of the first element in the SLIST referenced by
.Fa head .
.\" .Pp
.\" The macro
.\" .Nm SLIST_FOREACH_FROM
.\" behaves identically to
.\" .Nm SLIST_FOREACH
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found SLIST element and begins the loop at
.\" .Fa var
.\" instead of the first element in the SLIST referenced by
.\" .Fa head .
.\" .Pp
.\" The macro
.\" .Nm SLIST_FOREACH_SAFE
.\" traverses the list referenced by
.\" .Fa head
.\" in the forward direction, assigning each element in
.\" turn to
.\" .Fa var .
.\" However, unlike
.\" .Fn SLIST_FOREACH
.\" here it is permitted to both remove
.\" .Fa var
.\" as well as free it from within the loop safely without interfering with the
.\" traversal.
.\" .Pp
.\" The macro
.\" .Nm SLIST_FOREACH_FROM_SAFE
.\" behaves identically to
.\" .Nm SLIST_FOREACH_SAFE
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found SLIST element and begins the loop at
.\" .Fa var
.\" instead of the first element in the SLIST referenced by
.\" .Fa head .
.Pp
The macro
.Nm SLIST_INIT
@ -441,15 +441,15 @@ after the element
The macro
.Nm SLIST_NEXT
returns the next element in the list.
.Pp
The macro
.Nm SLIST_REMOVE_AFTER
removes the element after
.Fa elm
from the list.
Unlike
.Fa SLIST_REMOVE ,
this macro does not traverse the entire list.
.\" .Pp
.\" The macro
.\" .Nm SLIST_REMOVE_AFTER
.\" removes the element after
.\" .Fa elm
.\" from the list.
.\" Unlike
.\" .Fa SLIST_REMOVE ,
.\" this macro does not traverse the entire list.
.Pp
The macro
.Nm SLIST_REMOVE_HEAD
@ -467,13 +467,13 @@ The macro
removes the element
.Fa elm
from the list.
.Pp
The macro
.Nm SLIST_SWAP
swaps the contents of
.Fa head1
and
.Fa head2 .
.\" .Pp
.\" The macro
.\" .Nm SLIST_SWAP
.\" swaps the contents of
.\" .Fa head1
.\" and
.\" .Fa head2 .
.Sh SINGLY-LINKED LIST EXAMPLE
.Bd -literal
SLIST_HEAD(slisthead, entry) head =
@ -502,13 +502,13 @@ free(n3);
/* Forward traversal. */
SLIST_FOREACH(np, &head, entries)
np-> ...
/* Safe forward traversal. */
SLIST_FOREACH_SAFE(np, &head, entries, np_temp) {
np->do_stuff();
...
SLIST_REMOVE(&head, np, entry, entries);
free(np);
}
.\" /* Safe forward traversal. */
.\"SLIST_FOREACH_SAFE(np, &head, entries, np_temp) {
.\" np->do_stuff();
.\" ...
.\" SLIST_REMOVE(&head, np, entry, entries);
.\" free(np);
.\"}
while (!SLIST_EMPTY(&head)) { /* List Deletion. */
n1 = SLIST_FIRST(&head);
@ -585,46 +585,46 @@ traverses the tail queue referenced by
in the forward direction, assigning each element
in turn to
.Fa var .
.Pp
The macro
.Nm STAILQ_FOREACH_FROM
behaves identically to
.Nm STAILQ_FOREACH
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found STAILQ element and begins the loop at
.Fa var
instead of the first element in the STAILQ referenced by
.Fa head .
.Pp
The macro
.Nm STAILQ_FOREACH_SAFE
traverses the tail queue referenced by
.Fa head
in the forward direction, assigning each element
in turn to
.Fa var .
However, unlike
.Fn STAILQ_FOREACH
here it is permitted to both remove
.Fa var
as well as free it from within the loop safely without interfering with the
traversal.
.Pp
The macro
.Nm STAILQ_FOREACH_FROM_SAFE
behaves identically to
.Nm STAILQ_FOREACH_SAFE
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found STAILQ element and begins the loop at
.Fa var
instead of the first element in the STAILQ referenced by
.Fa head .
.\" .Pp
.\" The macro
.\" .Nm STAILQ_FOREACH_FROM
.\" behaves identically to
.\" .Nm STAILQ_FOREACH
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found STAILQ element and begins the loop at
.\" .Fa var
.\" instead of the first element in the STAILQ referenced by
.\" .Fa head .
.\" .Pp
.\" The macro
.\" .Nm STAILQ_FOREACH_SAFE
.\" traverses the tail queue referenced by
.\" .Fa head
.\" in the forward direction, assigning each element
.\" in turn to
.\" .Fa var .
.\" However, unlike
.\" .Fn STAILQ_FOREACH
.\" here it is permitted to both remove
.\" .Fa var
.\" as well as free it from within the loop safely without interfering with the
.\" traversal.
.\" .Pp
.\" The macro
.\" .Nm STAILQ_FOREACH_FROM_SAFE
.\" behaves identically to
.\" .Nm STAILQ_FOREACH_SAFE
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found STAILQ element and begins the loop at
.\" .Fa var
.\" instead of the first element in the STAILQ referenced by
.\" .Fa head .
.Pp
The macro
.Nm STAILQ_INIT
@ -649,25 +649,25 @@ inserts the new element
.Fa elm
after the element
.Fa listelm .
.Pp
The macro
.Nm STAILQ_LAST
returns the last item on the tail queue.
If the tail queue is empty the return value is
.Dv NULL .
.\" .Pp
.\" The macro
.\" .Nm STAILQ_LAST
.\" returns the last item on the tail queue.
.\" If the tail queue is empty the return value is
.\" .Dv NULL .
.Pp
The macro
.Nm STAILQ_NEXT
returns the next item on the tail queue, or NULL this item is the last.
.Pp
The macro
.Nm STAILQ_REMOVE_AFTER
removes the element after
.Fa elm
from the tail queue.
Unlike
.Fa STAILQ_REMOVE ,
this macro does not traverse the entire tail queue.
.\" .Pp
.\" The macro
.\" .Nm STAILQ_REMOVE_AFTER
.\" removes the element after
.\" .Fa elm
.\" from the tail queue.
.\" Unlike
.\" .Fa STAILQ_REMOVE ,
.\" this macro does not traverse the entire tail queue.
.Pp
The macro
.Nm STAILQ_REMOVE_HEAD
@ -683,13 +683,13 @@ The macro
removes the element
.Fa elm
from the tail queue.
.Pp
The macro
.Nm STAILQ_SWAP
swaps the contents of
.Fa head1
and
.Fa head2 .
.\" .Pp
.\" The macro
.\" .Nm STAILQ_SWAP
.\" swaps the contents of
.\" .Fa head1
.\" and
.\" .Fa head2 .
.Sh SINGLY-LINKED TAIL QUEUE EXAMPLE
.Bd -literal
STAILQ_HEAD(stailhead, entry) head =
@ -721,13 +721,13 @@ free(n3);
/* Forward traversal. */
STAILQ_FOREACH(np, &head, entries)
np-> ...
/* Safe forward traversal. */
STAILQ_FOREACH_SAFE(np, &head, entries, np_temp) {
np->do_stuff();
...
STAILQ_REMOVE(&head, np, entry, entries);
free(np);
}
.\" /* Safe forward traversal. */
.\"STAILQ_FOREACH_SAFE(np, &head, entries, np_temp) {
.\" np->do_stuff();
.\" ...
.\" STAILQ_REMOVE(&head, np, entry, entries);
.\" free(np);
.\"}
/* TailQ Deletion. */
while (!STAILQ_EMPTY(&head)) {
n1 = STAILQ_FIRST(&head);
@ -801,45 +801,45 @@ traverses the list referenced by
.Fa head
in the forward direction, assigning each element in turn to
.Fa var .
.Pp
The macro
.Nm LIST_FOREACH_FROM
behaves identically to
.Nm LIST_FOREACH
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found LIST element and begins the loop at
.Fa var
instead of the first element in the LIST referenced by
.Fa head .
.Pp
The macro
.Nm LIST_FOREACH_SAFE
traverses the list referenced by
.Fa head
in the forward direction, assigning each element in turn to
.Fa var .
However, unlike
.Fn LIST_FOREACH
here it is permitted to both remove
.Fa var
as well as free it from within the loop safely without interfering with the
traversal.
.Pp
The macro
.Nm LIST_FOREACH_FROM_SAFE
behaves identically to
.Nm LIST_FOREACH_SAFE
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found LIST element and begins the loop at
.Fa var
instead of the first element in the LIST referenced by
.Fa head .
.\" .Pp
.\" The macro
.\" .Nm LIST_FOREACH_FROM
.\" behaves identically to
.\" .Nm LIST_FOREACH
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found LIST element and begins the loop at
.\" .Fa var
.\" instead of the first element in the LIST referenced by
.\" .Fa head .
.\" .Pp
.\" The macro
.\" .Nm LIST_FOREACH_SAFE
.\" traverses the list referenced by
.\" .Fa head
.\" in the forward direction, assigning each element in turn to
.\" .Fa var .
.\" However, unlike
.\" .Fn LIST_FOREACH
.\" here it is permitted to both remove
.\" .Fa var
.\" as well as free it from within the loop safely without interfering with the
.\" traversal.
.\" .Pp
.\" The macro
.\" .Nm LIST_FOREACH_FROM_SAFE
.\" behaves identically to
.\" .Nm LIST_FOREACH_SAFE
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found LIST element and begins the loop at
.\" .Fa var
.\" instead of the first element in the LIST referenced by
.\" .Fa head .
.Pp
The macro
.Nm LIST_INIT
@ -869,27 +869,27 @@ before the element
The macro
.Nm LIST_NEXT
returns the next element in the list, or NULL if this is the last.
.Pp
The macro
.Nm LIST_PREV
returns the previous element in the list, or NULL if this is the first.
List
.Fa head
must contain element
.Fa elm .
.\" .Pp
.\" The macro
.\" .Nm LIST_PREV
.\" returns the previous element in the list, or NULL if this is the first.
.\" List
.\" .Fa head
.\" must contain element
.\" .Fa elm .
.Pp
The macro
.Nm LIST_REMOVE
removes the element
.Fa elm
from the list.
.Pp
The macro
.Nm LIST_SWAP
swaps the contents of
.Fa head1
and
.Fa head2 .
.\" .Pp
.\" The macro
.\" .Nm LIST_SWAP
.\" swaps the contents of
.\" .Fa head1
.\" and
.\" .Fa head2 .
.Sh LIST EXAMPLE
.Bd -literal
LIST_HEAD(listhead, entry) head =
@ -918,14 +918,14 @@ free(n2);
LIST_FOREACH(np, &head, entries)
np-> ...
/* Safe forward traversal. */
LIST_FOREACH_SAFE(np, &head, entries, np_temp) {
np->do_stuff();
...
LIST_REMOVE(np, entries);
free(np);
}
.\" /* Safe forward traversal. */
.\" LIST_FOREACH_SAFE(np, &head, entries, np_temp) {
.\" np->do_stuff();
.\" ...
.\" LIST_REMOVE(np, entries);
.\" free(np);
.\" }
.\"
while (!LIST_EMPTY(&head)) { /* List Deletion. */
n1 = LIST_FIRST(&head);
LIST_REMOVE(n1, entries);
@ -1012,19 +1012,19 @@ in the forward direction, assigning each element in turn to
is set to
.Dv NULL
if the loop completes normally, or if there were no elements.
.Pp
The macro
.Nm TAILQ_FOREACH_FROM
behaves identically to
.Nm TAILQ_FOREACH
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found TAILQ element and begins the loop at
.Fa var
instead of the first element in the TAILQ referenced by
.Fa head .
.\" .Pp
.\" The macro
.\" .Nm TAILQ_FOREACH_FROM
.\" behaves identically to
.\" .Nm TAILQ_FOREACH
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found TAILQ element and begins the loop at
.\" .Fa var
.\" instead of the first element in the TAILQ referenced by
.\" .Fa head .
.Pp
The macro
.Nm TAILQ_FOREACH_REVERSE
@ -1032,63 +1032,63 @@ traverses the tail queue referenced by
.Fa head
in the reverse direction, assigning each element in turn to
.Fa var .
.Pp
The macro
.Nm TAILQ_FOREACH_REVERSE_FROM
behaves identically to
.Nm TAILQ_FOREACH_REVERSE
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found TAILQ element and begins the reverse loop at
.Fa var
instead of the last element in the TAILQ referenced by
.Fa head .
.Pp
The macros
.Nm TAILQ_FOREACH_SAFE
and
.Nm TAILQ_FOREACH_REVERSE_SAFE
traverse the list referenced by
.Fa head
in the forward or reverse direction respectively,
assigning each element in turn to
.Fa var .
However, unlike their unsafe counterparts,
.Nm TAILQ_FOREACH
and
.Nm TAILQ_FOREACH_REVERSE
permit to both remove
.Fa var
as well as free it from within the loop safely without interfering with the
traversal.
.Pp
The macro
.Nm TAILQ_FOREACH_FROM_SAFE
behaves identically to
.Nm TAILQ_FOREACH_SAFE
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found TAILQ element and begins the loop at
.Fa var
instead of the first element in the TAILQ referenced by
.Fa head .
.Pp
The macro
.Nm TAILQ_FOREACH_REVERSE_FROM_SAFE
behaves identically to
.Nm TAILQ_FOREACH_REVERSE_SAFE
when
.Fa var
is NULL, else it treats
.Fa var
as a previously found TAILQ element and begins the reverse loop at
.Fa var
instead of the last element in the TAILQ referenced by
.Fa head .
.\" .Pp
.\" The macro
.\" .Nm TAILQ_FOREACH_REVERSE_FROM
.\" behaves identically to
.\" .Nm TAILQ_FOREACH_REVERSE
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found TAILQ element and begins the reverse loop at
.\" .Fa var
.\" instead of the last element in the TAILQ referenced by
.\" .Fa head .
.\" .Pp
.\" The macros
.\" .Nm TAILQ_FOREACH_SAFE
.\" and
.\" .Nm TAILQ_FOREACH_REVERSE_SAFE
.\" traverse the list referenced by
.\" .Fa head
.\" in the forward or reverse direction respectively,
.\" assigning each element in turn to
.\" .Fa var .
.\" However, unlike their unsafe counterparts,
.\" .Nm TAILQ_FOREACH
.\" and
.\" .Nm TAILQ_FOREACH_REVERSE
.\" permit to both remove
.\" .Fa var
.\" as well as free it from within the loop safely without interfering with the
.\" traversal.
.\" .Pp
.\" The macro
.\" .Nm TAILQ_FOREACH_FROM_SAFE
.\" behaves identically to
.\" .Nm TAILQ_FOREACH_SAFE
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found TAILQ element and begins the loop at
.\" .Fa var
.\" instead of the first element in the TAILQ referenced by
.\" .Fa head .
.\" .Pp
.\" The macro
.\" .Nm TAILQ_FOREACH_REVERSE_FROM_SAFE
.\" behaves identically to
.\" .Nm TAILQ_FOREACH_REVERSE_SAFE
.\" when
.\" .Fa var
.\" is NULL, else it treats
.\" .Fa var
.\" as a previously found TAILQ element and begins the reverse loop at
.\" .Fa var
.\" instead of the last element in the TAILQ referenced by
.\" .Fa head .
.Pp
The macro
.Nm TAILQ_INIT
@ -1178,13 +1178,13 @@ free(n2);
/* Forward traversal. */
TAILQ_FOREACH(np, &head, entries)
np-> ...
/* Safe forward traversal. */
TAILQ_FOREACH_SAFE(np, &head, entries, np_temp) {
np->do_stuff();
...
TAILQ_REMOVE(&head, np, entries);
free(np);
}
.\" /* Safe forward traversal. */
.\" TAILQ_FOREACH_SAFE(np, &head, entries, np_temp) {
.\" np->do_stuff();
.\" ...
.\" TAILQ_REMOVE(&head, np, entries);
.\" free(np);
.\" }
/* Reverse traversal. */
TAILQ_FOREACH_REVERSE(np, &head, tailhead, entries)
np-> ...