3

Currently my C-code function declaration is documented as follows

/** Some fubar function
 *@param[in]    val1    the first input variable
 *@param[in]    val2    the second input variable
 */
void foo (int val1, int val2);

But say the parameters can only except numbers within a certain range, e.g., 0-500

Is it possible to document this other than as part of the parameter description? Maybe so that it shows up separately in the produced documentation?

E.g. in the latex-produced pdf a table would be produced with a cell for the parameter type (int) the direction (in) and the name (var1/var2). There is some way of having another table cell with 0-500?

1 Answer 1

2

Your best bet may be a table in the detail section. Doxygen supports HTML commands inside the documentation, and the table generated in the PDF looks decent.

/**
 * @brief Some fubar function
 * @param[in]    val1    the first input variable
 * @param[in]    val2    the second input variable
 *
 * <TABLE>
 * <TR><TD>Type</TD><TD>Direction</TD><TD>Name</TD><TD>Value Range</TD></TR>
 * <TR><TD>int</TD><TD>in</TD><TD>val1</TD><TD>0-500</TD></TR>
 * <TR><TD>int</TD><TD>in</TD><TD>val2</TD><TD>1-1000</TD></TR>
 * </TABLE>
 */
 void foo(int val1, int val2) {}

The issue is that it looks very redundant to me. Perhaps limiting the table to parameter name and expected value would look better.

See Doxygen Manual: HTML Commands for the set of HTML supported by doxygen.

Sign up to request clarification or add additional context in comments.

1 Comment

Even better: Doxygen includes Markdown Extra's table syntax. Much nicer on the eyes in the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.