Hi Alex, On Mon, 19 Oct 2020 at 17:29, Alejandro Colomar <colomar.6.4.3@xxxxxxxxx> wrote: > > Hi Michael, > > > I'm working on moving and fixing code from queue.3 to different pages. > > I'd like to send you patches against a separate branch, > if you would create one, to ask you some questions from time to time, > and maybe get suggestions. > > Or maybe you could look at my branch on github > (https://github.com/alejandro-colomar/man-pages/commits/queue > (I may force push changes there sometimes)) I created a remote to remote to track your work. But you'll need to ping me from time to tell me to take a look. Also, I think mail to this list to discuss directions (as you are now doing) is great. > (BTW, if you have a look there, > you can see how I'm moving&fixing the code from queue.3 > to the other pages and maybe suggest a different way). This looks okay in principle. > Or maybe I can just show you small pieces of code (no patches), > like in this email. > > Whatever works best for you. Both ;-) > What do you think about this SYNOPSIS for list.3?: > > [[ > .SH SYNOPSIS > .nf > .B #include <sys/queue.h> > .PP > .BI "int LIST_EMPTY(LIST_HEAD *" head ");" > .B " LIST_ENTRY(TYPE);" > .BI "LIST_ENTRY LIST_FIRST(LIST_HEAD *" head ");" > .BI " LIST_FOREACH(TYPE *" var ", LIST_HEAD *" head ", > LIST_ENTRY " NAME ");" > .\".BI " LIST_FOREACH_FROM(TYPE *" var ", LIST_HEAD *" head ", > LIST_ENTRY " NAME ");" > .\".BI " LIST_FOREACH_SAFE(TYPE *" var ", LIST_HEAD *" head ", > LIST_ENTRY " NAME ", TYPE *" temp_var ");" > .\".BI " LIST_FOREACH_FROM_SAFE(TYPE *" var ", LIST_HEAD *" > head ", LIST_ENTRY " NAME ", TYPE *" temp_var ");" > .B " LIST_HEAD(HEADNAME, TYPE);" > .BI "LIST_HEAD LIST_HEAD_INITIALIZER(LIST_HEAD " head ");" > .BI "void LIST_INIT(LIST_HEAD *" head ");" > .BI "void LIST_INSERT_AFTER(TYPE *" listelm ", TYPE *" elm ", > LIST_ENTRY " NAME ");" > .BI "void LIST_INSERT_BEFORE(TYPE *" listelm ", TYPE *" elm ", > LIST_ENTRY " NAME ");" > .BI "void LIST_INSERT_HEAD(LIST_HEAD *" head ", TYPE *" elm ", > LIST_ENTRY " NAME ");" > .BI "LIST_ENTRY LIST_NEXT(TYPE *" elm ", LIST_ENTRY " NAME ");" > .\".BI "LIST_ENTRY LIST_PREV(TYPE *" elm ", LIST_HEAD *" head ", TYPE, > LIST_ENTRY " NAME ");" > .BI "void LIST_REMOVE(TYPE *" elm ", LIST_ENTRY " NAME ");" > .\".BI "void IST_SWAP(LIST_HEAD *" head1 ", LIST_HEAD *" head2 ", > TYPE, LIST_ENTRY " NAME ");" > .fi > ]] > > Things to note: > - The (many) spaces are there because otherwise it's unreadable (at > least for me). But, I find the indentation confusing actually. When I see pieces such as int LIST_EMPTY(LIST_HEAD *head); LIST_ENTRY(TYPE); It visually looks to me as though the LIST_ENTRY piece is some extension of the LIST_EMPTY pest. I think it's best not to do horizontal indentation, but instead just use of vertical separation (.PP). We can perhaps revisit this later, to see if we can come up with something better. > Also, I kept the copyright from the University of California and added > myself: I consider this to be a modified redistribution but not a > derived product; maybe I'm wrong in that (I'm not a lawyer :)). This seems okay to me. Thanks. Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/