More changes to doxygen/build_man.sh. Signed-off-by: Duncan Roe <duncan_roe@xxxxxxxxxxxxxxx> --- doxygen/build_man.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doxygen/build_man.sh b/doxygen/build_man.sh index 5c1a019..d3bd748 100755 --- a/doxygen/build_man.sh +++ b/doxygen/build_man.sh @@ -7,6 +7,7 @@ # Args: none or 2 being man7 page name & relative path of source with \mainpage declare -A renamed_page +no_macroRI=maybe main(){ set -e @@ -250,10 +251,18 @@ fix_name_line(){ mygrep "^\\.SH \"Function Documentation" $target head -n$linnum $target >$fileC + # Different versions of doxygen present macros and functions differently. + # Some versions have .RI lines for macros then functions. + # Some versions have .SS lines for macros instead of .RI. + # All versions (so far) have .SS lines for macros after all .RI lines. + # Look for #define in .RI lines and look for .SS lines if none found + # to cater for either scenario. + while : do mygrep2 ^\\.RI $fileC [ $linnum -ne 0 ] || break # Discard this entry + ! grep -E -q '#define' $fileG || no_macroRI= tail -n+$(($linnum + 1)) $fileC >$fileB cp $fileB $fileC @@ -262,9 +271,9 @@ fix_name_line(){ all_funcs="$all_funcs, $func" done - # macros (if any) come after functions + [ -z "$no_macroRI" ] || while : - do mygrep2 '^\.SS "#' $fileC + do mygrep2 '^\.SS "#define' $fileC [ $linnum -ne 0 ] || break tail -n+$(($linnum + 1)) $fileC >$fileB cp $fileB $fileC -- 2.35.8