gpt4 book ai didi

c - Doxygen 不生成函数文档

转载 作者:太空狗 更新时间:2023-10-29 14:55:01 26 4
gpt4 key购买 nike

我是第一次尝试使用 doxygen。

我使用它来记录一些 C 库和结构。

我想使用正确的标签,但文档仅就定义宏而言是好的,但函数标签 (\fn) 被完全忽略了。我在下面附上了一个我标记的评论的例子:

`/*!    \file   cab.h`

\author dan
\date 20/12/2013
\brief cab

`*/
/*! \def NOT_SPECIFIED`

\brief Constant value that indicates the not specification of a parameter
` */`

`#define NOT_SPECIFIED 0`

/*! \fn cab_create
\brief allocates the memory space and resources for the CAB
\param c cab to create
\param dim_buf size of the data contained in each buffer
\param maximum number of buffer
\param protocol used to handle priority inversion
\param ceiling value of the ceiling,
\return 1 if it completes successfully, -1 otherwise
*/`
int cab_create(cab *c, int dim_buf, int max_buf, int protocol, int ceiling);

最佳答案

文档明确指出,仅当您的注释未紧接在函数声明之前时才需要 \fn

If your comment block is in front of the function declaration or definition this command can (and to avoid redundancy should) be omitted.

所以只需删除整个 \fn 行,它应该可以工作。

更新:

顺便说一下,\file shouldn't have a filename after it .

If the file name is omitted (i.e. the line after \file is left blank) then the documentation block that contains the \file command will belong to the file it is located in.

如果您指定了一个文件名,您将不得不在文件名更改时手动更新它(这将会发生),而且您可能会忘记这样做。不指定文件名更容易,并且始终是最新的。

关于c - Doxygen 不生成函数文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20842380/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com