[07/11] circleq.3: Copy and adapt code from queue.3
Commit Message
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
man3/circleq.3 | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
@@ -50,6 +50,8 @@
.Nm CIRCLEQ_PREV ,
.Nm CIRCLEQ_REMOVE
.SH SYNOPSIS
+.In sys/queue.h
+.\"
.Fn CIRCLEQ_EMPTY "CIRCLEQ_HEAD *head"
.Fn CIRCLEQ_ENTRY "TYPE"
.Fn CIRCLEQ_FIRST "CIRCLEQ_HEAD *head"
@@ -69,6 +71,18 @@
.Fn CIRCLEQ_PREV "TYPE *elm" "CIRCLEQ_ENTRY NAME"
.Fn CIRCLEQ_REMOVE "CIRCLEQ_HEAD *head" "TYPE *elm" "CIRCLEQ_ENTRY NAME"
.SH DESCRIPTION
+In the macro definitions,
+.Fa TYPE
+is the name of a user-defined structure,
+that must contain a field of type
+.Li CIRCLEQ_ENTRY ,
+named
+.Fa NAME .
+The argument
+.Fa HEADNAME
+is the name of a user-defined structure that must be declared
+using the macro
+.Li CIRCLEQ_HEAD .
.Ss Circular queues
A circular queue is headed by a structure defined by the
.Nm CIRCLEQ_HEAD
@@ -208,6 +222,10 @@ removes the element
from the circular queue.
.SH RETURN VALUE
.SH CONFORMING TO
+Not in POSIX.1, POSIX.1-2001 or POSIX.1-2008.
+Present on the BSDs
+(CIRCLEQ macros first appeared in
+.Bx 4.4 ).
.SH BUGS
.SH EXAMPLES
.Ss Circular queue example
@@ -227,9 +245,9 @@ CIRCLEQ_HEAD(circlehead, entry);
int
main(void)
{
- struct entry *n1, *n2, *n3, *np;
+ struct entry *n1, *n2, *n3, *np;
struct circlehead head; /* Queue head. */
- int i;
+ int i;
CIRCLEQ_INIT(&head); /* Initialize the queue. */