]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
circleq.3: Copy and adapt code from queue.3
authorAlejandro Colomar <colomar.6.4.3@gmail.com>
Fri, 23 Oct 2020 14:57:33 +0000 (16:57 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Fri, 23 Oct 2020 16:13:16 +0000 (18:13 +0200)
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/circleq.3

index 2d683b441be8c4b2178f4e50a5ab93f797e8af18..491e1ec913b7c6c782f0693cc11a47c2c573501c 100644 (file)
@@ -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"
 .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. */