Document *_EMPTY().

This commit is contained in:
mycroft 2000-05-27 22:27:33 +00:00
parent 820e777524
commit 8d9497c3e3
2 changed files with 54 additions and 2 deletions

View File

@ -1,22 +1,26 @@
# $NetBSD: Makefile,v 1.18 2000/02/03 16:17:50 kleink Exp $
# $NetBSD: Makefile,v 1.19 2000/05/27 22:27:33 mycroft Exp $
# @(#)Makefile 8.2 (Berkeley) 12/13/93
MAN= assert.3 bitstring.3 dlfcn.3 end.3 intro.3 queue.3 stdarg.3
MLINKS+=end.3 edata.3 end.3 etext.3
MLINKS+=queue.3 list_empty.3
MLINKS+=queue.3 list_entry.3 queue.3 list_first.3 queue.3 list_head.3
MLINKS+=queue.3 list_head_initializer.3 queue.3 list_init.3
MLINKS+=queue.3 list_insert_after.3 queue.3 list_insert_before.3
MLINKS+=queue.3 list_insert_head.3 queue.3 list_next.3 queue.3 list_remove.3
MLINKS+=queue.3 simpleq_empty.3
MLINKS+=queue.3 simpleq_entry.3 queue.3 simpleq_first.3 queue.3 simpleq_head.3
MLINKS+=queue.3 simpleq_head_initializer.3 queue.3 simpleq_init.3
MLINKS+=queue.3 simpleq_insert_head.3 queue.3 simpleq_insert_tail.3
MLINKS+=queue.3 simpleq_insert_after.3 queue.3 simpleq_next.3
MLINKS+=queue.3 simpleq_remove_head.3
MLINKS+=queue.3 tailq_empty.3
MLINKS+=queue.3 tailq_entry.3 queue.3 tailq_first.3 queue.3 tailq_head.3
MLINKS+=queue.3 tailq_head_initializer.3 queue.3 tailq_init.3
MLINKS+=queue.3 tailq_insert_after.3 queue.3 tailq_insert_before.3
MLINKS+=queue.3 tailq_insert_head.3 queue.3 tailq_insert_tail.3
MLINKS+=queue.3 tailq_next.3 queue.3 tailq_remove.3
MLINKS+=queue.3 circleq_empty.3
MLINKS+=queue.3 circleq_entry.3 queue.3 circleq_first.3 queue.3 circleq_head.3
MLINKS+=queue.3 circleq_head_initializer.3 queue.3 circleq_init.3
MLINKS+=queue.3 circleq_insert_after.3 queue.3 circleq_insert_before.3

View File

@ -1,4 +1,4 @@
.\" $NetBSD: queue.3,v 1.11 1999/11/19 01:12:41 enami Exp $
.\" $NetBSD: queue.3,v 1.12 2000/05/27 22:27:34 mycroft Exp $
.\"
.\" Copyright (c) 1993 The Regents of the University of California.
.\" All rights reserved.
@ -45,6 +45,7 @@
.Nm LIST_INSERT_BEFORE ,
.Nm LIST_INSERT_HEAD ,
.Nm LIST_REMOVE ,
.Nm LIST_EMPTY ,
.Nm LIST_FIRST ,
.Nm LIST_NEXT ,
.Nm SIMPLEQ_ENTRY ,
@ -55,6 +56,7 @@
.Nm SIMPLEQ_INSERT_TAIL ,
.Nm SIMPLEQ_INSERT_AFTER ,
.Nm SIMPLEQ_REMOVE_HEAD ,
.Nm SIMPLEQ_EMPTY ,
.Nm SIMPLEQ_FIRST ,
.Nm SIMPLEQ_NEXT ,
.Nm TAILQ_ENTRY ,
@ -66,6 +68,7 @@
.Nm TAILQ_INSERT_HEAD ,
.Nm TAILQ_INSERT_TAIL ,
.Nm TAILQ_REMOVE ,
.Nm TAILQ_EMPTY ,
.Nm TAILQ_FIRST ,
.Nm TAILQ_NEXT ,
.Nm CIRCLEQ_ENTRY ,
@ -77,6 +80,7 @@
.Nm CIRCLEQ_INSERT_HEAD ,
.Nm CIRCLEQ_INSERT_TAIL ,
.Nm CIRCLEQ_REMOVE ,
.Nm CIRCLEQ_EMPTY ,
.Nm CIRCLEQ_FIRST ,
.Nm CIRCLEQ_LAST ,
.Nm CIRCLEQ_NEXT ,
@ -93,6 +97,8 @@
.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_REMOVE "TYPE *elm" "LIST_ENTRY NAME"
.Ft int
.Fn LIST_EMPTY "LIST_HEAD *head"
.Ft TYPE *
.Fn LIST_FIRST "LIST_HEAD *head"
.Ft TYPE *
@ -106,6 +112,8 @@
.Fn SIMPLEQ_INSERT_HEAD "SIMPLEQ_HEAD *head" "TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Fn SIMPLEQ_INSERT_TAIL "SIMPLEQ_HEAD *head" "TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Fn SIMPLEQ_REMOVE_HEAD "SIMPLEQ_HEAD *head" "TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Ft int
.Fn SIMPLEQ_EMPTY "SIMPLEQ_HEAD *head"
.Ft TYPE *
.Fn SIMPLEQ_FIRST "SIMPLEQ_HEAD *head"
.Ft TYPE *
@ -120,6 +128,8 @@
.Fn TAILQ_INSERT_HEAD "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_INSERT_TAIL "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
.Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME"
.Ft int
.Fn TAILQ_EMPTY "TAILQ_HEAD *head"
.Ft TYPE *
.Fn TAILQ_FIRST "TAILQ_HEAD *head"
.Ft TYPE *
@ -134,6 +144,8 @@
.Fn CIRCLEQ_INSERT_HEAD "CIRCLEQ_HEAD *head" "TYPE *elm" "CIRCLEQ_ENTRY NAME"
.Fn CIRCLEQ_INSERT_TAIL "CIRCLEQ_HEAD *head" "TYPE *elm" "CIRCLEQ_ENTRY NAME"
.Fn CIRCLEQ_REMOVE "CIRCLEQ_HEAD *head" "TYPE *elm" "CIRCLEQ_ENTRY NAME"
.Ft int
.Fn CIRCLEQ_EMPTY "CIRCLEQ_HEAD *head"
.Ft TYPE *
.Fn CIRCLEQ_FIRST "CIRCLEQ_HEAD *head"
.Ft TYPE *
@ -315,6 +327,12 @@ removes the element
from the list.
.Pp
The macro
.Nm LIST_EMPTY
return true if the list
.Fa head
has no elements.
.Pp
The macro
.Nm LIST_FIRST
returns the first elemement of the list
.Fa head .
@ -349,6 +367,9 @@ for (np = LIST_FIRST(&head); np != NULL; np = LIST_NEXT(np, entries))
/* Delete. */
while (LIST_FIRST(&head) != NULL)
LIST_REMOVE(LIST_FIRST(&head), entries);
/* Test for emptiness. */
if (LIST_EMPTY(&head))
printf("nothing to do\n");
.Ed
.Sh SIMPLE QUEUES
A simple queue is headed by a structure defined by the
@ -428,6 +449,12 @@ The macro
removes the first element from the simple queue.
.Pp
The macro
.Nm SIMPLEQ_EMPTY
return true if the simple queue
.Fa head
has no elements.
.Pp
The macro
.Nm SIMPLEQ_FIRST
returns the first elemement of the simple queue
.Fa head .
@ -462,6 +489,9 @@ for (np = SIMPLEQ_FIRST(&head); np != NULL; np = SIMPLEQ_NEXT(np, entries))
/* Delete. */
while (SIMPLEQ_FIRST(&head) != NULL)
SIMPLEQ_REMOVE_HEAD(&head, SIMPLEQ_FIRST(&head), entries);
/* Test for emptiness. */
if (SIMPLEQ_EMPTY(&head))
printf("nothing to do\n");
.Ed
.Sh TAIL QUEUES
A tail queue is headed by a structure defined by the
@ -550,6 +580,12 @@ removes the element
from the tail queue.
.Pp
The macro
.Nm TAILQ_EMPTY
return true if the tail queue
.Fa head
has no elements.
.Pp
The macro
.Nm TAILQ_FIRST
returns the first elemement of the tail queue
.Fa head .
@ -587,6 +623,9 @@ for (np = TAILQ_FIRST(&head); np != NULL; np = TAILQ_NEXT(np, entries))
/* Delete. */
while (TAILQ_FIRST(&head) != NULL)
TAILQ_REMOVE(&head, TAILQ_FIRST(&head), entries);
/* Test for emptiness. */
if (TAILQ_EMPTY(&head))
printf("nothing to do\n");
.Ed
.Sh CIRCULAR QUEUES
A circular queue is headed by a structure defined by the
@ -675,6 +714,12 @@ removes the element
from the circular queue.
.Pp
The macro
.Nm CIRCLEQ_EMPTY
return true if the circular queue
.Fa head
has no elements.
.Pp
The macro
.Nm CIRCLEQ_FIRST
returns the first elemement of the circular queue
.Fa head .
@ -727,6 +772,9 @@ for (np = CIRCLEQ_LAST(&head); np != (void *)&head;
/* Delete. */
while (CIRCLEQ_HEAD(&head) != (void *)&head)
CIRCLEQ_REMOVE(&head, CIRCLEQ_HEAD(&head), entries);
/* Test for emptiness. */
if (CIRCLEQ_EMPTY(&head))
printf("nothing to do\n");
.Ed
.Sh HISTORY
The