On this page
在 Apache 2.4 中编写代码
Apache 2.4 使用Doxygen来记录代码中的 API 和全局变量。这将解释如何使用 Doxygen 进行记录的基础知识。
Brief Description
要启动文档块,请使用/**
要结束文档块,请使用*/
在块的中间,可以使用多个标签:
Description of this functions purpose @param parameter_name description @return description @deffunc signature of the function
并非总是需要deffunc
。 DoxyGen 中没有完整的解析器,因此任何在返回类型声明中使用宏的原型对于 scandoc 而言都过于复杂。这些功能需要deffunc
。一个例子(使用而不是>):
/** * return the final element of the pathname * @param pathname The path to get the final element of * @return the final element of the path * @tip Examples: * <pre> * "/foo/bar/gum" -> "gum" * "/foo/bar/gum/" -> "" * "gum" -> "gum" * "wi\\n32\\stuff" -> "stuff" * </pre> * @deffunc const char * ap_filename_of_pathname(const char *pathname) */
在头文件的顶部,始终包括:
/** * @package Name of library header */
Doxygen 为每个程序包使用一个新的 HTML 文件。 HTML 文件的名称为\ {} .html,因此请尽量简洁。
有关可能性的进一步讨论,请参考Doxygen 网站。