C和doxygen - 删除可变文档的重复 [英] C and doxygen - removing duplicates of variable documentation

查看:242
本文介绍了C和doxygen - 删除可变文档的重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用doxygen记录我的C代码。为了更好的可读性,我使用 defgroup addtogroup (请参阅 doxygen c:分组定义)。
文件页面看起来不错,但是在组/模块页面上,所有变量文档都翻了一番。在头文件中声明(带有extern)的每个变量都有2个条目,并在.c文件(摘要和描述部分)中定义。功能和其他一切只列出一次...



如何摆脱组/模块页面上的douplicate变量文档?



我的源文件如下所示:
.h文件:

  / ** @文件
* blabla
* @author bla
* /
/// @addtogroup MY_GRP
/// @ {
#define SOMEDEF1 1
/// @name Special defs
/// @ {
#define SOMEDEF2 2
/// @}
enum someenum {
foo,
bar
};

extern int some_variables;

extern void some_proc(int baz);

/// @}

.c文件:

  / ** @file 
* blabla
* @author bla
* /
/ ** @defgroup MY_GRP一个测试组。
*描述
* /
/// @ {
#includemy.h

///重要变量。
int some_variable;

/ **重要proc
*说明
* @param baz需要这个
* /
void some_proc(int baz){
// code
}

/// @}


解决方案

无法真正解决问题,但找到了一个工作环境:
我使用 INPUT_FILTER 选项与 grep -Eveextern(cygwin),用extern函数或变量声明整理所有行。
由于我只记录了实际的函数实现和变量定义,所以前面带有extern的所有内容都没有文档,并且可以删除doxygen。
这也确实删除了doxygen输出中变量的所有重复项。


I'm documenting my C code with doxygen. For better readability I group documentation of every .c/.h file pair (sometimes also more files) with defgroup and addtogroup (see doxygen in c: grouping of defines). The file pages look fine, but on the group/module pages all variable documentation is doubled. There are 2 entries for every variable that's declared (with extern) in the header file and defined in the .c file (in the summary as well as in the description part). Functions and everything else is listed just once...

How do I get rid of the douplicate variable documentation on group/module pages?

My source files look like this: .h file:

/** @file
*   blabla
*   @author bla
*/
/// @addtogroup MY_GRP
/// @{
#define SOMEDEF1 1
/// @name Special defs
/// @{
#define SOMEDEF2 2
/// @}
enum someenum {
    foo,
    bar
};

extern int some_variables;

extern void some_proc(int baz);

/// @}

.c file:

/** @file
 *  blabla
 *  @author bla
 */
/** @defgroup MY_GRP A test group.
  * Description
  */
/// @{
#include "my.h"

/// Important variable.
int some_variable;

/** Important proc
 *  Description
 *  @param baz need this
 */
void some_proc(int baz) {
// code
}

/// @}

解决方案

Could not really solve the problem but found me a workarround: I use the INPUT_FILTER option with grep -Eve "extern" (cygwin) to sort out all lines with "extern" functions or variable declarations. Since I only document actual function implementations and variable definitions everything with "extern" in front of it has no documentation anyways and can be removed for doxygen. This indeed also removes all duplicate entries for variables in the doxygen output.

这篇关于C和doxygen - 删除可变文档的重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆