【发布时间】:2023-03-10 11:05:01
【问题描述】:
我刚刚注意到 Doxygen 为 C 预处理器宏生成文档的方式很有趣。在Doxygen's manual(///、//!和/** */)中创建块cmets的三种样式中,只有前两种样式(///、//!)会在文件的宏列表中显示简要说明。
我的问题是:这是设计使然吗?我有控制这个的配置选项吗?我找不到任何信息表明 Javadoc 样式的行为应不同于 Qt 和 C++ 样式。
我尝试使用 MULTILINE_CPP_IS_BRIEF 配置选项,但没有任何效果。
test.c
/**
* @file test.c
* @brief A test
*/
#include <stdio.h>
/** This is a define that doesn't have a brief explanation on the macro list */
#define DEFINE_A 1
/// This is another define, it's brief explanation appears on the file's macro list
#define DEFINE_B 2
//! This is another define, it's brief explanation appears on the file's macro list
#define DEFINE_C 3
#define DEFINE_D 4 /**< This is a define that doesn't have a brief explanation on the file's macro list */
#define DEFINE_F 4 ///< This is another define, it's brief explanation appears on the file's macro list
#define DEFINE_G 4 //!< This is another define, it's brief explanation appears on the file's macro list
/**
* A simple test function
*
* @param[in] x An integer argument
* @return always zero
*/
int test_fcn( int x )
{
return x*x;
}
int main(void)
{
return test_fcn( 3 );
}
测试.h
/** @file */
/**My Preprocessor Macro.*/
#define TEST_DEFINE(x) (x*x)
/**
* @defgroup TEST_GROUP Test Group
*
* @{
*/
/** Test AAA documentation. */
#define TEST_AAA (1)
/** Test BBB documentation. */
#define TEST_BBB (2)
/** Test CCC documentation. */
#define TEST_CCC (3)
/** @} */
Doxyfile
PROJECT_NAME = "test"
OUTPUT_DIRECTORY = doc_out
INPUT = test.c test.h
#MULTILINE_CPP_IS_BRIEF = NO
MULTILINE_CPP_IS_BRIEF = YES
我在 Windows 7 64 位上使用 Doxygen 1.8.15。
谢谢!
【问题讨论】:
标签: macros c-preprocessor doxygen