与 Using Doxygen with C, do you comment the function prototype or the definition? Or both? 有关.
我认为正确的方法是使用\param、\return 和\brief 对 .h 函数原型(prototype)进行 doxygen,因为这隐藏了实现并仅将 API 公开给包含我的 .h 文件的函数;和 doxygen 的 .c 函数实现,有更多的\details。到目前为止,一切都很好。这也是关于 stackoverflow 的建议。
是否可以告诉 doxygen 合并 .c 和 .h 文档?因为 .c 实现可以是原型(prototype),我什至不需要 .h 函数原型(prototype),但我需要 doxygen 将 .h doxygen\param、\return 和\brief 拉到 .c 实现文档中HTML 和 latex 。现在,在不同的地方有两次功能是令人困惑和痛苦的。至少,我希望\param、\return 和\brief 与函数实现一起重新出现。
/我是
最佳答案
如果这是你的标题:
/**
* @brief Main function
*
* @param argc number of arguments
* @param argv array of arguments
*
* @return 0
*/
int main(int argc, char* argv[]);
这是你的来源:
/**
* @internal
*
* This is an internal implementation command.
*
* @endinternal
*/
int main(int argc, char* argv[])
{
return 0;
}
您的评论将合并到文档中。
在此示例中,必须在您的配置中启用 INTERNAL_DOCS
才能获得实现注释。
您将在头文件页面找到合并的文档。源文件页面只会显示执行命令。
关于c - doxygen --- 将 .c 和 .h doc 合并为相同的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24214227/