Doxygen output for C

c, doxygen

Solution

If you create a layout file in addition to the normal config file:

doxygen -l layout.xml

You can edit that; this controls the basic format of the interface. If you want to remove the "Classes" tab, locate:

<tab type="classes" visible="yes" title="Types">
    [...]
</tab>

And remove it or change `visible` to "no".

C functions and datatypes are usually grouped together in files in a non-random way, so the "Files" tab alone may be sufficient for you. If not, use groups:

\ingroup foobar

Can be added to struct and function definitions, etc. You then need a

\defgroup foobar Description of foobar.

somewhere. This will then be used by

<tab type="modules" visible="yes" title="Modules" intro=""/>

From `layout.xml`, producing a possibly more intuitive interface than "Files" (e.g., struct documentation from a `.h` and function documentation from a `.c` are organized together if they are in the same group), akin to how "Classes" works with C++.

There's more about this stuff in the doxygen site.

Problem

I have used Doxygen for years with C++ code. I'd like to use it with some C code that I'm working on, but the output is less than optimal. The "Classes" tab in the top bar shows only the `struct` definitions, not the functions in the file. I have to click on the "Files" tab and then the name of the header file to view the functions it contains. Is there any way to modify the output of Doxygen so that it is more suitable to code written in C? Or at the very least, remove the "Classes" tab and provide only the "Files" view?

Original source