Home > Back-end >  Document C macros when hiding files
Document C macros when hiding files

Time:12-29

I am documenting a C project using doxygen. In this project, there are some macros that are correctly documented in the code. In my doxyfile, I specify that I don't want a Files tab this way:

SHOW_FILES = NO

The problem is that when doing this, I have no way of seeing the macro documentation, since it seems to be only accessible through the Files tab:

Macros from Files tab

What I would like is to be able to consult the macro documentation without making file documentation available. Is there a way I could do this?

I browsed the special commands and the configuration options and saw nothing about this. I tried the @copydoc flag, but only the body of the documentation is copied, which is not what I need (I need to move the documentation altogether).


Update : here is one of the macro, with its documentation:

#ifndef NDEBUG
/*********************************************************************************************//**
 * @brief Standard assertion MACRO (with message attached)
 *
 * Asserts that `p_condition` is `true`. If you `#define` the `ABORT_ON_ERROR` flag, this
 * MACRO will also abort on a `false` condition. On assertion, a custom message defined by the
 * programmer will be printed out along with the assertion information.
 *
 * @param p_condition
 *      The condition to assert.
 * @param p_message
 *      The message to print.
 *
 *************************************************************************************************/
#define ASSERT_MSG(p_condition, p_message) cxinv::HandleAssert(cxinv::AssertLabel::ASSERTION, \
                                                               ( p_condition ),               \
                                                               #p_condition,                  \
                                                               __FILE__,                      \
                                                               __FUNCTION__,                  \
                                                               __LINE__,                      \
                                                               p_message                      \
                                                               )
#else
#define ASSERT_MSG(p_condition, p_message) ((void)0)
#endif // NDEBUG

CodePudding user response:

You can put your macros in a group. This will add a modules tab:

    /**
    * @defgroup macros  Add macro group title here
    */
    
    /*********************************************************************************************//**
     * @brief Standard assertion MACRO (with message attached)
     * @ingroup macros
     *
...(cut off, see the rest above)
  • Related