From: Alejandro Colomar Date: Wed, 5 Nov 2025 22:24:19 +0000 (+0100) Subject: src/bin/grepc_c: -tut: Merge grepc_c_ut_su() and grepc_c_ut_td_su() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3a4882b2c95e5ccf4a6bdd9b6408fd138a36dd9;p=thirdparty%2Fman-pages.git src/bin/grepc_c: -tut: Merge grepc_c_ut_su() and grepc_c_ut_td_su() Signed-off-by: Alejandro Colomar --- diff --git a/src/bin/grepc_c b/src/bin/grepc_c index 24a15e80d..bd3adb606 100755 --- a/src/bin/grepc_c +++ b/src/bin/grepc_c @@ -29,7 +29,6 @@ t_umf='no'; t_umo='no'; t_ut_su='no'; t_ut_td_simple='no'; -t_ut_td_su='no'; grepc_err() @@ -63,8 +62,7 @@ while getopts "t:" opt; do u | um) t_umf='yes'; t_umo='yes'; ;;& u | ut) t_ut_su='yes'; - t_ut_td_simple='yes'; - t_ut_td_su='yes'; ;;& + t_ut_td_simple='yes'; ;;& [efmtu] | f[pdlg] | fl[pd] | fg[pd] | m[fo] | u[efmt]) t='yes'; ;; @@ -170,13 +168,10 @@ grepc_c_umf() { grepc_c_mf_decl_ '\w+' grepc_c_umo() { grepc_c_mo_decl_ '\w+' grepc_c_m_repl_ "$1"; echo; } -grepc_c_ut_su() { printf '%s' '(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\b([\w \t[\]]|::)*\w+'; +grepc_c_ut_su() { printf '%s' '(?s)^([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\b([\w \t[\]]|::)*'; grepc_c_u_body_ "$1"; echo '[^;]*;'; } grepc_c_ut_td_simple() { echo '(?s)^[ \t]*typedef\s+[^{};]*'"$1"'[^{};]+;'; } -grepc_c_ut_td_su() { printf '%s' '(?s)^[ \t]*typedef\s+(struct|union)\b([\w \t[\]]|::)*'; - grepc_c_u_body_ "$1"; - echo '[^;]*;'; } if test "$t_e" = yes; then grepc_c_e "$identifier"; fi; @@ -200,4 +195,3 @@ if test "$t_umf" = yes; then grepc_c_umf "$identifier"; fi; if test "$t_umo" = yes; then grepc_c_umo "$identifier"; fi; if test "$t_ut_su" = yes; then grepc_c_ut_su "$identifier"; fi; if test "$t_ut_td_simple" = yes; then grepc_c_ut_td_simple "$identifier"; fi; -if test "$t_ut_td_su" = yes; then grepc_c_ut_td_su "$identifier"; fi;