From: Alejandro Colomar Date: Fri, 23 Oct 2020 14:57:33 +0000 (+0200) Subject: circleq.3: Copy and adapt code from queue.3 X-Git-Tag: man-pages-5.09~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d1891f3b6c9305b2efcf33a2c40a9293ba37ea7;p=thirdparty%2Fman-pages.git circleq.3: Copy and adapt code from queue.3 Signed-off-by: Alejandro Colomar Signed-off-by: Michael Kerrisk --- diff --git a/man3/circleq.3 b/man3/circleq.3 index 2d683b441b..491e1ec913 100644 --- a/man3/circleq.3 +++ b/man3/circleq.3 @@ -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. */