besit
besit

Reputation: 131

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!

Upvotes: 13

Views: 7511

Answers (1)

Andreas Maier
Andreas Maier

Reputation: 3080

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

Upvotes: 15

Related Questions