让 Doxygen 在 C 中记录枚举的问题

发布于 2024-08-10 10:37:19 字数 1058 浏览 3 评论 0原文

我对 Doxygen(Mac OS X Snow Leopard 上的 1.6.1)有一个相当奇怪的问题,因为无论我做什么,它似乎都没有记录我的枚举。我正在用 C 语言进行编程,并按照手册中的说明进行操作。这是我的代码:

/**
 * \enum dccp_pkt_type 
 * \brief specifies the available DCCP packet types
 */

enum dccp_pkt_type
{
    DCCP_REQUEST    = 0,    /**< DCCP Request Packet */
    DCCP_RESPONSE,          /**< DCCP Response Packet */
    DCCP_DATA,              /**< DCCP Data Packet */
    DCCP_ACK,               /**< DCCP Ack Packet */
    DCCP_DATAACK,           /**< DCCP Data Ack Packet */
    DCCP_CLOSEREQ,          /**< DCCP Close Request Packet */
    DCCP_CLOSE,             /**< DCCP Close Packet */
    DCCP_RESET,             /**< DCCP Reset Packet */
    DCCP_SYNC,              /**< DCCP Sync Packet */
    DCCP_SYNCACK,           /**< DCCP Sync Ack Packet */
    DCCP_RESERVED,          /**< DCCP Reserved Packet Type - Receivers MUST
                         ignore any packets with this type */
};

它应该根据 doxygen 手册生成正确记录的输出,但它什么也没生成。我很可能错过了一些简单的事情,如果有人能指出我正确的方向,我将不胜感激。

I have a rather odd problem with Doxygen (1.6.1 on Mac OS X Snow Leopard) in that it does not seem to document my enums no matter what I do. I am programming in C and have followed the instructions in the manual. Here is my code:

/**
 * \enum dccp_pkt_type 
 * \brief specifies the available DCCP packet types
 */

enum dccp_pkt_type
{
    DCCP_REQUEST    = 0,    /**< DCCP Request Packet */
    DCCP_RESPONSE,          /**< DCCP Response Packet */
    DCCP_DATA,              /**< DCCP Data Packet */
    DCCP_ACK,               /**< DCCP Ack Packet */
    DCCP_DATAACK,           /**< DCCP Data Ack Packet */
    DCCP_CLOSEREQ,          /**< DCCP Close Request Packet */
    DCCP_CLOSE,             /**< DCCP Close Packet */
    DCCP_RESET,             /**< DCCP Reset Packet */
    DCCP_SYNC,              /**< DCCP Sync Packet */
    DCCP_SYNCACK,           /**< DCCP Sync Ack Packet */
    DCCP_RESERVED,          /**< DCCP Reserved Packet Type - Receivers MUST
                         ignore any packets with this type */
};

It should according to the doxygen manual produce properly documentated output but instead it produces nothing. I am most likely missing something simple, if anyone could point me in the right direction I would be grateful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我还不会笑 2024-08-17 10:37:19

来自 Doxygen 手册

让我们重复一遍,因为它经常
被忽视:记录全局对象
(函数、typedef、枚举、宏、
等),您必须将文件记录在
它们是被定义的。在其他方面
也就是说,至少必须有一个

<代码>/*! \file */ 或 a

/** @file */ 此文件中的行。

From the Doxygen manual:

Let’s repeat that, because it is often
overlooked: to document global objects
(functions, typedefs, enum, macros,
etc), you must document the file in
which they are defined. In other
words, there must at least be a

/*! \file */ or a

/** @file */ line in this file.

烏雲後面有陽光 2024-08-17 10:37:19

我的经验与在 doxygen 1.8.9.1 中使用 EXTRACT_ALL=NOSHOW_INCLUDE_FILES=NO 的体验相同 - 即使 /*! 全局枚举类型也没有列出或链接。 \file */ 存在,并且全局enum 由记录的复合结构引用。

为了解决这个问题,我最终定义了一个枚举组:

<代码>/*!
\defgroup 枚举
公共枚举类型
*/

对于枚举类型,我使用 \ingroup Enumerations 将枚举包含在新组中。然后,Doxygen 能够从复合结构自动链接到枚举类型。

My experience is the same using EXTRACT_ALL=NO and SHOW_INCLUDE_FILES=NO with doxygen 1.8.9.1 - global enum types were not listed nor linked even though /*! \file */ is present and the global enum is referenced by a documented compound structure.

To work around this, I ended up defining an Enumerations group:

/*!
\defgroup Enumerations
Public enumeration types
*/

and for the enum types I used \ingroup Enumerations to include the enums in the new group. Doxygen then was able to autolink from the compound structures to the enum types.

玩物 2024-08-17 10:37:19

如果内存正常,则不会显示枚举文档,除非该文件也已记录。尝试添加 @file 部分。

If memory serves correctly, enum documentation doesn't show up unless the file is also documented. Try adding a @file section.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文