doc: further Doxygen tweaks

Make Doxygen see also macros defined inside struct declarations,
and to include also opaque structs.

Keep members in the order they are in the .h file, since Doxygen's
case-insensitive sort by name jumbles things.
This commit is contained in:
Pauli Virtanen 2021-10-06 20:55:04 +03:00 committed by Wim Taymans
parent caced1f226
commit 7123fadc37
2 changed files with 9 additions and 0 deletions

View file

@ -51,6 +51,7 @@ PREDEFINED = PA_C_DECL_BEGIN= \
HTML_EXTRA_STYLESHEET = @cssfiles@
MAX_INITIALIZER_LINES = 1
SORT_MEMBER_DOCS = NO
CALL_GRAPH = NO
CALLER_GRAPH = NO

View file

@ -19,6 +19,14 @@ echo " */"
# Add \sa and \copydoc for (struct *methods) callback macros.
# #define pw_core_add_listener(...) pw_core_method(c,add_listener,...) -> add \sa and \copydoc
# #define spa_system_read(...) spa_system_method_r(c,read,...) -> add \sa and \copydoc
#
# Also:
# Ensure all macros are included (also those defined inside a struct),
# by adding /** \ingroup XXX */ before each definition.
# Also ensure all opaque structs get included.
sed -e 's@^\(#define .*[[:space:]]\)\(.*_method\)\((.,[[:space:]]*\)\([a-z_]\+\)\(.*)[[:space:]]*\)$@\1\2\3\4\5 /**< \\copydoc \2s.\4\n\n\\sa \2s.\4 */@;' \
-e 's@^\(#define .*[[:space:]]\)\(.*_method\)\(_[rvs](.,[[:space:]]*\)\([a-z_]\+\)\(.*)[[:space:]]*\)$@\1\2\3\4\5 /**< \\copydoc \2s.\4\n\n\\sa \2s.\4 */@;' \
-e '/\\addtogroup/ { h; s@.*\\addtogroup \(.*\).*@/** \\ingroup \1 */@; x; }' \
-e '/#define \(PW\|SPA\)_[A-Z].*[^\\][ ]*$/ { x; p; x; }' \
-e 's@^\([ ]*struct \)\([a-zA-Z0-9_]*\)\(;.*\)$@/** \\struct \2 */\n\1\2\3@;' \
< "$FILENAME"