FreeBSD ZFS
The Zettabyte File System
|
The ZFS code base is documented with Doxygen styled C comments.
To ensure consistency, please adhere to the following guidelines when writing ZFS code:
boolean_t enable
where the paramter's meaning is already well expressed by its type and/or name.\file
tag containing the filename.\file
so that it is properly aggregated by Doxygen.\param
tag for every parameter warranting additional documentation. Where it is not already clear from C context, the parameter's direction should be specified. The direction can be either [in]
for an input to the function, [out]
for an output, or [in,out]
for a bidirectional parameter.\return
tag, or multiple \retval
tags. \retval
tags are prefered where the return value has a few discrete possibilities.\invariant
s, if applicable.\note
s or \todo>
s, if applicable.\addtogroup tunables
block, or including an \ingroup tunables
directive in their documentation block. Here is an example of the above guidelines:
/** * \file example.c * Examples on proper doxygen usage. * * This file contains examples of how to properly use doxygen markup in the * ZFS module. Also, it can help you concatenate strings */ /** * Classroom Roster Element * * The classroom roster is a single linked list that stores all students' * information. This struct is one element in the list */ struct roster_elem { /** * A key to the student's last report card in the database. * * \note The database is volatile; the key will be invalid following a * reboot. Do not save the key to persistent storage. */ int report_card_key; char name[80]; /**< The student's name */ bool is_male; /**< True iff the student is a boy */ /** * pointer to next elem in list. * A null value signifies end of list */ struct roster_elem* next; }; /** * Concatenate two strings * * Copies the C-string pointed to by src to the end of the C-string pointed * to by dest. * * \warning Does not verify that dest has enough space available. This can * lead to buffer overflows. It is recomended to use strncat or * strlcat instead. * * \param[in,out] dest Pointer to the destination string * \param[in] src Pointer to the source string * * \return A pointer to the resulting string dest */ char * strcat(char *dest, const char *src) { return (0); }