c - 在 doxygen 中记录 C 类型定义

标签 c doxygen

按照doxygen手册中的例子,我构建了测试头test.h :

/**
 * @file test.h
 */

  /** @brief This is a struct 
   *  @var foo A foo.
   *  @var bar Also a Foo.
   *  @var baz (unused field)
   */
  typedef struct {
     int foo;
     int bar;
     char *baz;
  } whatsit;

当我使用默认 Doxyfile 时(使用“doxygen -g”生成),我看到警告:

...test.h:11: warning: Compound whatsit is not documented

...test.h:7: warning: documented symbol `foo A Foo` was not defined

...test.h:12: warning: Member foo (variable) of class whatsit is not documented

什么给了?手册给我的印象是您不需要 @struct 这样的标签当注释直接在定义之前时,并且在上面的 block 中记录成员变量是合法的,而不是在用 /*< ... 声明的同一行上句法。 (我绝对讨厌后一种风格……)

我怎样才能让它正确识别评论?

最佳答案

根据文档: 24.51\var(变量声明)

表示注释 block 包含变量或枚举值(全局或类成员)的文档。此命令等效于\fn、\property 和\typedef。

表示在\var 行中只应包含变量名。由于变量 foo 不存在但结构成员 whatsit::foo 您必须使用完整的限定名称。

结构的类似推理。

结果应该是这样的:

/**
 * @file test.h
 */

  /** @struct whatsit
   *  This is a struct
   *
   *  @var whatsit::foo
   *    A foo.
   *  @var whatsit::bar
   *    Also a Foo.
   *  @var whatsit::baz
   *    (unused field)
   */
  typedef struct {
     int foo;
     int bar;
     char *baz;
  } whatsit;

关于c - 在 doxygen 中记录 C 类型定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48859896/

相关文章:

c++ - 如何在 Doxygen 中拥有多个示例?

\includedoc 的 Doxygen 使用

c - 如何让 Doxygen 为 OpenVSource 代码生成调用图?PN

c - open() 不设置 O_CLOEXEcflags

c - 为什么 -std=c11 和 gcc 会隐藏 stdio.h 中的 popen ?

c - 如何使用 doxygen 打印我的函数文档字符串?

java - 在 doxygen 输出中隐藏公共(public)包

c - *(arr+i)[1] 和 **(arr+i) 表示的元素是如何确定的?

c - gdb - 通过预定义规则跳过某些文件的进一步步骤?

将 head 程序转换为 tail C