unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] circleq.3: Fix CIRCLEQ_LOOP_*() return type
@ 2021-01-19 21:12 Alejandro Colomar via Libc-alpha
  2021-01-20  8:56 ` Michael Kerrisk (man-pages) via Libc-alpha
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar via Libc-alpha @ 2021-01-19 21:12 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/circleq.3 | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/man3/circleq.3 b/man3/circleq.3
index 6b6b9aa14..f21bbf903 100644
--- a/man3/circleq.3
+++ b/man3/circleq.3
@@ -75,9 +75,9 @@ CIRCLEQ_REMOVE
 .BI "struct TYPE *CIRCLEQ_LAST(CIRCLEQ_HEAD *" head );
 .BI "struct TYPE *CIRCLEQ_PREV(struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME );
 .BI "struct TYPE *CIRCLEQ_NEXT(struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME );
-.BI "void CIRCLEQ_LOOP_PREV(CIRCLEQ_HEAD *" head ,
+.BI "struct TYPE *CIRCLEQ_LOOP_PREV(CIRCLEQ_HEAD *" head ,
 .BI "                           struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME );
-.BI "void CIRCLEQ_LOOP_NEXT(CIRCLEQ_HEAD *" head ,
+.BI "struct TYPE *CIRCLEQ_LOOP_NEXT(CIRCLEQ_HEAD *" head ,
 .BI "                           struct TYPE *" elm ", CIRCLEQ_ENTRY " NAME );
 .PP
 .BI "CIRCLEQ_FOREACH(struct TYPE *" var ", CIRCLEQ_HEAD *" head ,
@@ -238,13 +238,23 @@ and zero if the queue contains at least one entry.
 .PP
 .BR CIRCLEQ_FIRST (),
 .BR CIRCLEQ_LAST (),
-.BR CIRCLEQ_PREV (),
+.BR CIRCLEQ_LOOP_PREV (),
 and
-.BR CIRCLEQ_NEXT ()
+.BR CIRCLEQ_LOOP_NEXT ()
 return a pointer to the first, last, previous, or next
 .I TYPE
 structure, respectively.
 .PP
+.BR CIRCLEQ_PREV (),
+and
+.BR CIRCLEQ_NEXT ()
+are similar to their
+.BR CIRCLEQ_LOOP_* ()
+counterparts,
+except that if the argument is the first or last element, respectively,
+they return
+.IR &head .
+.PP
 .BR CIRCLEQ_HEAD_INITIALIZER ()
 returns an initializer that can be assigned to the queue
 .IR head .
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-20  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 21:12 [PATCH] circleq.3: Fix CIRCLEQ_LOOP_*() return type Alejandro Colomar via Libc-alpha
2021-01-20  8:56 ` Michael Kerrisk (man-pages) via Libc-alpha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).