C中Doxygen中的函数指针处理 [英] function pointer handling in Doxygen in C

查看:165
本文介绍了C中Doxygen中的函数指针处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的代码中,一个vtable包含多个函数指针。
Doxygen无法跟随它们。

In my code, a vtable containts several function pointer. Doxygen is unable to follow them.

我想强迫它识别可能的路径,以生成完整的调用图,因为现在这部分丢失。

I'd like to force it to recognize the possible paths, to produce a complete Call Graph, since now this part is missing.

示例:

typedef Bool(*SPECIAL_FUNC)(KEY key);

typedef struct{
  int a;
  int b;
  SPECIAL_FUNC;
}OBJ;

Bool add(KEY key); //code...
Bool sub(KEY key); //code...


推荐答案

虽然这可能不会影响doxygen中的调用图,您可以记录与结构相关的功能,并在 SPECIAL_FUNC 的文档中提供指向它们的链接。像这样的东西:

While this will likely not affect the call graph in doxygen, you can document the functions as related to the structure, and provide links to them in the documentation for SPECIAL_FUNC. Something like:

typedef Bool(*SPECIAL_FUNC)(KEY key);

/**
 * struct description
 */
typedef struct{
  int a;
  int b;

  /**
   * Function pointer to one of the following:
   * - add()
   * - sub()
   */
  SPECIAL_FUNC;
}OBJ;

/**
 * @relates OBJ
 * add function.
 */
Bool add(KEY key); //code...

/**
 * @relates OBJ
 * sub function.
 */
Bool sub(KEY key); //code...

与此一起, OBJ 将记录为一个类,添加 sub 将作为的相关成员出现OBJ ,以及 SPECIAL_FUNC 的文档将包含指向 add 和<$ c $的链接c> sub 。

With this, OBJ will be documented as a class, add and sub will appear as related members of OBJ, and the documentation for SPECIAL_FUNC will contain links to add and sub.

这篇关于C中Doxygen中的函数指针处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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