Is it possible for doxygen to extract static functions only in a certain module?

Viewed 99

In my main.c there are many functions marked with static, but that would be nice to have documented for the next guy (or myself) since they are application critical/specific. However, extracting all static members is extreme, since most modules use the static keyword for functions specifically to hide these details. The only reason that static is being used in the main.c file is on the off chance that it is somehow included as a dependency into some other project, although it really isn't intended for such a purpose (it's an embedded application). This doesn't seem like such a radical use case and I frequently see heavy use of static functions in main.c even though it will likely never be included elsewhere.

Using doxygen, is there a way to extract static functions only in one module?

1 Answers

One thing you could try is set EXTRACT_STATIC = YES (surprisingly) and also set EXTRACT_LOCAL_CLASSES = NO in your doxyfile. Then, do not include a \file command at the top of any C file, except for the one C file that contains main(). But do include \file at the top of every H file that declares the global functions in your other C files.

You will find that any doxygen markup of those global functions will be included in the doxygen output, even if that mark-up is in the C files that no longer include a \file command. And, with luck, you will have your desired static functions in your main module documented too.

Related