doxygen in c: grouping of defines

余生长醉 提交于 2019-12-24 02:23:37

问题


I'm documenting C code with doxygen. To make the documentation more readable I want to at least add code in every .c/.h file pair to one group using @defgroup and @ingroup. Inside these groups I want to group some defines together using @name blocks.

The result in the "file" pages looks closely to what I expected: Everything that's documented in the file is listed there and more or less nicely grouped. In the "module" pages on the other hand only functions and variables are listed and the defines before the first @name block are listed under "variables". All other defines and enums are missing. Removing the @name blocks lists all defines/typedefs/enums under "variables". No own sections for macros or enums and no further grouping on these pages.

How do I get all defines and enums in a group listed on the module/group page like on the file pages where the defines/functions etc. are documented?

I use doxygen 1.8.9.1 windows binarires.

My code looks similar to this: .h file:

/** @file
*   blabla
*   @author bla
*/
/// @ingroup 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 looks like this:

/** @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
}

/// @}

I let doxygen wizzard generate a doxyfile and also generated a DoxygenLayout.xml file. When playing arround with the layout file I found that the "defines" tags on the group pages are empty (they apparently do nothing) while the "defines" in the variables section are generated by a "membergroups" tag... Don't know what to make of this.

Any help is much appreciated. If you need the doxyfile or anything else let me know.


回答1:


Adding all members of a file to a group can be accomplished using the @addtogroup tag.

The same question is already answered here: Doxygen: Can file members inherit a module grouping if they are in a file that is grouped?



来源:https://stackoverflow.com/questions/27840411/doxygen-in-c-grouping-of-defines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!