Skip to content
rustyrussell edited this page Sep 28, 2011 · 1 revision

Documentation for CCAN modules uses kerneldoc stylized comments because they are simple.

The comment in _info is the description for the entire module, which is published on the web pages. Comments in the header files are parsed by ccanlint for sanity checking, and also for extraction and testing of any example sections.

/**
 * list_add - add an entry at the start of a linked list.`
 * @h: the list_head to add the node to`
 * @n: the list_node to add to the list.
 *
 * The list_node does not need to be initialized; it will be overwritten.
 * Example:
 *      list_add(&parent->children, &child->list);
 *      parent->num_children++;
 */
static inline void list_add(struct list_head *h, struct list_node *n)
{
...