如何记录函数的全局依赖关系? [英] How to documenting global dependencies for functions?

查看:64
本文介绍了如何记录函数的全局依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从第三方供应商那里获得了一些C代码(用于嵌入式平台),该代码使用了全局变量(用于速度和空间优化).我正在记录代码,转换为 Doxygen 格式.

I've got some C code from a 3rd party vendor (for an embedded platform) that uses global variables (for speed & space optimizations). I'm documenting the code, converting to Doxygen format.

如何在函数文档中为函数需要的有关全局变量和函数的注释?

Doxygen 具有用于注释参数和返回值的特殊命令,如下所述:

Doxygen has special commands for annotating parameters and return values as describe here: Doxygen Special Commands. I did not see any commands for global variables.

示例C代码:

    extern unsigned char data_buffer[]; //!< Global variable.

    /*! Returns the next available data byte.
     *  \return Next data byte.
     */
    unsigned char Get_Byte(void)
    {
      static unsigned int index = 0;
      return data_buffer[index++]; //!< Uses global variable.   
    }

在上面的代码中,我想添加Doxygen注释,该注释取决于该函数取决于全局变量 data_buffer .

In the above code, I would like to add Doxygen comments that the function depends on the global variable data_buffer.

推荐答案

您可以为此添加一个注释,然后使用 \ link 指令可将读者定向到全局变量的描述.

You can just add a note to that effect and use the \link directive to direct the reader to the description of the global variable.

这篇关于如何记录函数的全局依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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