在Doxygen中使用相同的名称处理两个不同的功能 [英] Handling two different functions with the same name in Doxygen

查看:187
本文介绍了在Doxygen中使用相同的名称处理两个不同的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C项目,其中包含两个名称相同的函数,但每个都在不同的组/模块( @defgroup )中。



这些函数各自编译成不同的二进制文件,但是我需要紧密交叉引用文档,所以我需要参考( @ref )到彼此的模块中的这些功能(等等)。



当我做简单的 @ref name-of-the-function ,它始终链接到位于文件树中较早的文件中的文件。如何链接到另一个?

解决方案

据我所见: Doxygen的自动链接不支持具有相同名称的多个函数。



如果有多个具有相同名称的函数/方法,Doxygen将简单地链接它找到的第一个在这个问题。通话图也将不正确。这似乎适用于所有语言,而不仅仅是C语言。



这被多次报告为错误:





已知问题也描述了一个类似的问题:


使用\relates或\relatesalso命令,不可能在类A
中插入非成员函数f,如果A类已经一个
成员名字f和相同的参数列表。







有一些希望有人提出了一个修补程序来更好地处理具有相同名称的函数: 656694 - getDefs无法解析本地函数如果存在相同的全局名称,则名称


此修补程序实现以下两种策略来解决
重复的名称。首先是在当前文件中定义的名称,使用
的本地名称。其次尝试使用原型
定义匹配名称。


这将部分解决问题。不幸的是,票从2012年开始就没有活动...


I have a C project which contains two functions with the same name, but each is within a different group/module (@defgroup).

These functions each compile into a different binary, but I need the documentation to be closely cross-referenced, so I need to refer (@ref) to these functions (among other places) from each other's module.

When I do simple @ref name-of-the-function, it always links to the one which resides in file which is earlier in the file tree. How can I link to the other one?

解决方案

As far as I can see: Doxygen's autolinking does not support having multiple functions with the same name.

If there are multiple functions/methods with the same name, Doxygen will simply link the first one it finds, as described in the question. The call graphs will also be incorrect. This seems to apply to all languages, not just to C.

This has been reported as a bug multiple times:

The section "Known problems" in Doxygen's docs also describes a similar problem:

It is not possible to insert a non-member function f in a class A using the \relates or \relatesalso command, if class A already has a member with name f and the same argument list.


There is some hope; someone proposed a patch to better handle functions with the same name: 656694 - getDefs fails to resolve local function names if same global name exist.

This patch implements the following two strategies for resolving duplicated names. First, is the name is defined in current file, use the local name. Secondly try to match the names using the prototype definition.

This would partly solve the problem. Unfortunately, the ticket has seen no activity since 2012...

这篇关于在Doxygen中使用相同的名称处理两个不同的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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