Reputation: 1359
I am using doxygen to comment my C code. I am making use of a foreign API (i.e. not my own) for which documentation is scarce so I intend to document some of that API within my own source files. I do have the header file for the foreign API but it is not practical to add my own comments to that file.
Foreign Header
struct foreignstruct
{
int a;
int b;
};
My Header
/** My structure comments... */
struct mystruct
{
/** Describe field here... */
int field;
};
/** @struct foreignstruct
* @brief This structure blah blah blah...
* @??? a Member 'a' contains...
* @??? b Member 'b' contains...
*/
What tag do I use in place of @???
to get the correct doxygen output (where 'correct' means generated output for mystruct
and foreignstruct
are the same)?
Upvotes: 20
Views: 56939
Reputation: 14859
Maybe one day doxygen will have a special @field tag for this, until that time, the following can be used:
/** @struct foreignstruct
* @brief This structure blah blah blah...
* @var foreignstruct::a
* Member 'a' contains...
* @var foreignstruct::b
* Member 'b' contains...
*/
Which is a short-hand notation for
/** @struct foreignstruct
* @brief This structure blah blah blah...
*/
/** @var foreignstruct::a
* Member 'a' contains...
*/
/** @var foreignstruct::b
* Member 'b' contains...
*/
Upvotes: 27