Doxygen: How do I link to a static variable?

时间:2015-10-29 15:49:34

标签: doxygen

I'm currently generating documentation for a pure C project.

In a file utilities.h file I have this:

/**
 * @defgroup LOG_LEVELS Different levels of log file granularity
 *
 * \addtogroup LOG_LEVELS
 *  @{
 * Each logging routine has a mandatory parameter defining the logging level
 * of the current logging function call. Only if that level is less or equal
 * to one of those predefined levels by the constants given here, that call
 * will actually be logged. These constants are also used to set the current
 * logging level in #currentLogPrio .
 **/
#define LOGPRIO_ALWAYS       0 /**< always log this, although no error */
#define LOGPRIO_FATAL        0 /**< fatal errors */
#define LOGPRIO_ALERT      100 /**< alerts */
#define LOGPRIO_CRITICAL   200 /**< critical, but not fatal errors */
#define LOGPRIO_ERROR      300 /**< normal errors */
#define LOGPRIO_WARNING    400 /**< warnings */
#define LOGPRIO_NOTICE     500 /**< notices */
#define LOGPRIO_INFO       600 /**< informational texts */
#define LOGPRIO_TRACE      700 /**< tracing */
#define LOGPRIO_DEBUG      800 /**< debugging information */
/** @} **/

In the associated utilities.c file the static variable currentLogPrio is defined:

/**
 * @var currentLogPrio
 * @brief Current setting of the logging level.
 *
 * Only if a logging routine was called with its log level parameter set to a
 * value less than or equal to the current logging priority the actual call of
 * a logging routine will be written to the log.
 **/
static logPrio_t currentLogPrio = LOGPRIO_ALWAYS;

Now, when I run doxygen on the complete project, I get the following warning:

...
Preprocessing utilities/logUtilities.c...
Parsing file utilities/logUtilities.c...
Preprocessing utilities/logUtilities.h...
Parsing file utilities/logUtilities.h...
...
Generating code for file utilities/logUtilities.c...
Generating code for file utilities/logUtilities.h...
...
Generating docs for file utilities/logUtilities.h...
Generating call graph for function logErrcode
Generating call graph for function logMsg_alert
Generating call graph for function logMsg_always
Generating caller graph for function logMsg_always
Generating call graph for function logMsg_critical
Generating call graph for function logMsg_debug
Generating caller graph for function logMsg_debug
Generating call graph for function logMsg_error
Generating caller graph for function logMsg_error
Generating call graph for function logMsg_fatal
Generating caller graph for function logMsg_fatal
utilities/logUtilities.h:136: warning: explicit link request to 'currentLogPrio' could not be resolved

Both files are part of the doxygen documentation as you can see from doxygens output and have the @file tag included. I also know that the @var tag for the static variable is not needed, but I get the same errors with or without this tag.

So, how can I link to that static variable?

Best regards and thanks in advance

0 个答案:

没有答案
相关问题