SLIST_REMOVAL number of arguments
Hi!
Kindly forgive me if I'm mistaken, but might there be an error in the man pages on the number of arguments in SLIST_REMOVE?
The SYNOPSIS in https://man7.org/linux/man-pages/man3/slist.3.html states that there are three arguments.
```
void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm,
SLIST_ENTRY NAME);
```However, the EXAMPLE and the source indicate that there should be four. Quoting the source:
```
#define SLIST_REMOVE(head, elm, type, field) do { \
```Should the SYNOPSIS be the following instead?
```
void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, TYPE,
SLIST_ENTRY NAME);
```Thank you.
Cheers,
Solomon
Alejandro Colomar
maintainerHi Solomon!
Quoted 9 lines · Solomon Tan
Kindly forgive me if I'm mistaken, but might there be an error in the man pages on the number of arguments in
SLIST_REMOVE?The SYNOPSIS in https://man7.org/linux/man-pages/man3/slist.3.html states that there are three arguments.
``` void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, SLIST_ENTRY NAME); ```
Quoted 5 lines
However, the EXAMPLE and the source indicate that there should be four. Quoting the source:
``` #define SLIST_REMOVE(head, elm, type, field) do { \ ```
alx@debian:~/src/gnu/glibc/master$ grepc SLIST_REMOVE .
./misc/sys/queue.h:#define SLIST_REMOVE(head, elm, type, field) do { \
if ((head)->slh_first == (elm)) { \
SLIST_REMOVE_HEAD((head), field); \
} \
else { \
struct type *curelm = (head)->slh_first; \
while(curelm->field.sle_next != (elm)) \
curelm = curelm->field.sle_next; \
curelm->field.sle_next = \
curelm->field.sle_next->field.sle_next; \
} \
} while (/*CONSTCOND*/0)Quoted 5 lines
Should the SYNOPSIS be the following instead?
``` void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, TYPE, SLIST_ENTRY NAME); ```
Yep, this seems a mistake I made in 2020. A fix should include the following tag:
Do you want to send a patch, or should I do it?
Have a lovely day!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es/>
Quoted 42 lines · Alejandro Colomar
Hi Solomon!
Quoted 9 lines · Solomon Tan
Kindly forgive me if I'm mistaken, but might there be an error in the man pages on the number of arguments in
SLIST_REMOVE?The SYNOPSIS in https://man7.org/linux/man-pages/man3/slist.3.html states that there are three arguments.
``` void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, SLIST_ENTRY NAME); ```Quoted 5 lines
However, the EXAMPLE and the source indicate that there should be four. Quoting the source:
``` #define SLIST_REMOVE(head, elm, type, field) do { \ ```alx@debian:~/src/gnu/glibc/master$ grepc SLIST_REMOVE . ./misc/sys/queue.h:#define SLIST_REMOVE(head, elm, type, field) do { \ if ((head)->slh_first == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ struct type *curelm = (head)->slh_first; \ while(curelm->field.sle_next != (elm)) \ curelm = curelm->field.sle_next; \ curelm->field.sle_next = \ curelm->field.sle_next->field.sle_next; \ } \ } while (/*CONSTCOND*/0)Quoted 5 lines
Should the SYNOPSIS be the following instead?
``` void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, TYPE, SLIST_ENTRY NAME); ```
Quoted 8 lines
Yep, this seems a mistake I made in 2020. A fix should include the following tag:
Fixes bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")Do you want to send a patch, or should I do it?
I would like to send a patch, please. :D I will do it in another email.
Quoted 6 lines
Have a lovely day!
AlexSignature · 1 line
<https://www.alejandro-colomar.es/>
Alejandro Colomar
maintainerHi Solomon,
Quoted 4 lines · Solomon Tan
Quoted 2 lines
Do you want to send a patch, or should I do it?
I would like to send a patch, please. :D I will do it in another email.
Great! Please send the patch with this header field, so that it's threaded under this conversation.
In-Reply-To: <[email protected]>
Cheers,
Alex
Signature · 1 line
<https://www.alejandro-colomar.es/>
PATCH 1/1 man/man3/slist.3: Add missing argument
In reply to Solomon TanSLIST_REMOVAL has four arguments. This commit adds in the missing argument.
--- man/man3/slist.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man/man3/slist.3 +1 -1
@@ -57,7 +57,7 @@ Standard C library .\" .BI "SLIST_FOREACH_FROM_SAFE(struct TYPE *" var ", SLIST_HEAD *" head , .\" .BI " SLIST_ENTRY " NAME ", struct TYPE *" temp_var ); .P -.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm , +.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm ", TYPE, .BI " SLIST_ENTRY " NAME ); .BI "void SLIST_REMOVE_HEAD(SLIST_HEAD *" head , .BI " SLIST_ENTRY " NAME );
Signature · 1 line
2.43.0
Alejandro Colomar
maintainerRe: [PATCH] man/man3/slist.3: Add missing argument
Hi Solomon,
Quoted 5 lines · Solomon T
SLIST_REMOVALhas four arguments. This commit adds in the missing argument.Fixes bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")Signed-off-by Solomon T <[email protected]>
Patch applied. Thanks!
Cheers,
Alex
Quoted 21 lines
--- man/man3/slist.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)man/man3/slist.3 +1
-1@@ -57,7 +57,7 @@ Standard C library .\" .BI "SLIST_FOREACH_FROM_SAFE(struct TYPE *" var ", SLIST_HEAD *" head , .\" .BI " SLIST_ENTRY " NAME ", struct TYPE *" temp_var ); .P -.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm , +.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm ", TYPE, .BI " SLIST_ENTRY " NAME ); .BI "void SLIST_REMOVE_HEAD(SLIST_HEAD *" head , .BI " SLIST_ENTRY " NAME );Signature · 1 line
2.43.0
Signature · 1 line
<https://www.alejandro-colomar.es/>