* Coding convention of function header comments
@ 2001-08-15 21:41 Hua Zhong
0 siblings, 0 replies; 2+ messages in thread
From: Hua Zhong @ 2001-08-15 21:41 UTC (permalink / raw)
To: Linux Kernel Mailing List
Hi:
Sorry maybe this is not the best place to ask, but recently I need to come
up with coding conventions regarding function header comments which explain
the usage of functions (meaning of parameters, etc). <linux/list.h> has sth
like this:
/**
* list_add - add a new entry
* @new: new entry to be added
* @head: list head to add it after
*
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
static __inline__ void list_add(struct list_head *new, struct list_head
*head)
{
__list_add(new, head, head->next);
}
Similar to Java. I want to ask that (1) is this a well-known convention or
was just invented (informally) by someone here (e.g., Linus?)? Where can I
find the documentation about this convention? (2) can anyone point me to the
URL of similar well-known coding conventions (except the Java one)?
Many thanks.
-Hua
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Coding convention of function header comments
[not found] <no.id>
@ 2001-08-15 22:00 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2001-08-15 22:00 UTC (permalink / raw)
To: Hua Zhong; +Cc: Linux Kernel Mailing List
> /**
> * list_add - add a new entry
> * @new: new entry to be added
> * @head: list head to add it after
> *
> * Insert a new entry after the specified head.
> * This is good for implementing stacks.
> */
> static __inline__ void list_add(struct list_head *new, struct list_head
> *head)
> {
> __list_add(new, head, head->next);
> }
>
> Similar to Java. I want to ask that (1) is this a well-known convention or
> was just invented (informally) by someone here (e.g., Linus?)? Where can I
> find the documentation about this convention? (2) can anyone point me to the
> URL of similar well-known coding conventions (except the Java one)?
Ok firstly - yes its a straight rip off of the java one. The history is
something like. Gnome needed a format for this, so Michael Zucchi (I
believe) wrote up a hideous perl hack. Miguel de Icaza couldn't get the
format right so it was extended with a free form body.
Its documented in Documentation/kernel-doc-nano-HOWTO.txt
We do need to improve it to mark up structures, and also to actually
finish the job.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-15 21:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-15 21:41 Coding convention of function header comments Hua Zhong
[not found] <no.id>
2001-08-15 22:00 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®