Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen: Documenting the parameters of a function pointer type (ANSI-C)

My code needs some function pointer types like

/**
 * \brief Callback function type "foo"
 */
typedef int (*foo)(int a, int b);

I would like to document the semantics of the function arguments, but a \param[in,out] next to the \brief statement does not seem to add extra documentation.

Is there a way to get doxygen add parameter documentation to function type-defs?

TIA for any help!

like image 428
besit Avatar asked Oct 24 '13 13:10

besit


1 Answers

It is not clear from your question what exactly you tried when you placed \param.

The following works for me (using doxygen 1.8.6):

/**
 * \brief Callback function type "foo"
 *
 * A longer description of foo.
 * \param a Description for a
 * \param b Description for b
 * \return Description for return value
 */
typedef int (*foo)(int a, int b);

In the output, it creates the brief and long descriptions, a Parameters section with parameters a and b, and a Returns section with the description of the return value.

Andy

like image 157
Andreas Maier Avatar answered Nov 15 '22 20:11

Andreas Maier