doc: filter some constructs that confuse doxygen

This commit is contained in:
Pauli Virtanen 2024-01-28 12:44:26 +02:00 committed by Wim Taymans
parent c25c7f7bd8
commit cdb6c5a316

View file

@ -11,9 +11,7 @@ FILENAME="$1"
# Add \ingroup commands for the file, for each \addgroup in it
BASEFILE=$(echo "$FILENAME" | sed -e 's@.*src/pipewire/@pipewire/@; s@.*spa/include/spa/@spa/@; s@.*src/test/@test/@;')
# shellcheck disable=SC2028 # \file is not an escape sequence
echo "/** \file"
echo "\`$BASEFILE\`"
printf "/** \\\\file\n\`%s\`\n" "$BASEFILE"
sed -n -e '/.*\\addtogroup [a-zA-Z0-9_].*/ { s/.*addtogroup /\\ingroup /; p; }' < "$FILENAME" | sort | uniq
echo " */"
@ -25,9 +23,15 @@ echo " */"
# 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.
# Strip SPA_FORMAT_ARG_FUNC(1) etc. things that confuse doxygen
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@;' \
-e 's@^[ ]*SPA_FORMAT_ARG_FUNC([0-9, ]*)@@;' \
-e 's@[ ]*SPA_PRINTF_FUNC([0-9, ]*);@;@;' \
-e 's@^[ ]*SPA_WARN_UNUSED_RESULT@ @;' \
-e 's@ SPA_SENTINEL;@;@;' \
-e 's@ SPA_UNUSED,@,@;' \
< "$FILENAME"