1

Doxygen is able to document structs but it's not exporting any function declarations or macro definitions.

For instance these defined in headers are not exported.

/** Total instances */
#define TOTAL 10

/** Initializer */
void InitProduct(Product *product, const char *productName);

I'm using Doxygen GUI on Windows, appreciate a GUI reference.

AppDeveloper
  • 1,816
  • 7
  • 24
  • 49
  • 1
    Which version of doxygen? What are your settings in doxygen configuration file that are different from the default configuration settings. Did you have a look at `MACRO_EXPANSION` and te chapter about preprocessing (https://www.doxygen.nl/manual/preprocessing.html).? – albert May 17 '20 at 08:56
  • I'm using latest version, doxygen-1.8.18, I'm looking into preprocessing, what about function declarations in the header files? – AppDeveloper May 17 '20 at 08:59
  • First of all doxygen is not a compiler so there are some limitations. I'm not sure what you mean with "not exporting any function declarations or macro definitions.", can you elaborate on it and place your elaboration in the question)? – albert May 17 '20 at 09:03
  • let me try again please. For instance this function `InitProduct` is declared in the header file, and I wrote some docs comment above it but I don't see this function in the exported html documentation, is there a way to have it show up in the html output? – AppDeveloper May 17 '20 at 09:57
  • Without a complete example (small source files plus changes you made to your doxygen configuration settings) it is hard to tell. Have a go with `EXTRACT_ALL` or try `/** \file */` on top of your file(s). – albert May 17 '20 at 10:06

1 Answers1

1

Doxygen is fussy about what documentation it extracts when not EXTRACT_ALL.

Structures and classes are generally okay; functions and variables not so.

To get documentation extracted for functions and variables at the file-level scope, there needs to be a @file documentation element in that file:

/** @file frobulator.c
 *  Optionally describe the file...
 */

/** @brief My Frobulator.
 */
void frobulator () { ... }

This is for both headers and source files.

For functions and variables at namespace scope, the namespace also needs to be documented with @namespace or in situ. Unlike other elements, namespaces have no "single" point of declaration where documentation can be placed. I usually end up creating a separate .dox file to contain @namespace docs in C comment blocks.

simon.watts
  • 976
  • 10
  • 14