From 287df0407c9660ac60ca8e124a0fab61061b022d Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 5 Nov 2023 16:26:02 +0100 Subject: bin/grepc: srcfix (Remove grepc_patterns()) Signed-off-by: Alejandro Colomar --- bin/grepc | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/bin/grepc b/bin/grepc index d06b0fb..469b69d 100755 --- a/bin/grepc +++ b/bin/grepc @@ -149,39 +149,38 @@ grepc_ut_td_simple() { echo '(?s)^[ \t]*typedef\s+[^{};]*'"$1"'[^{};]+;'; } grepc_ut_td_su() { echo '(?s)^[ \t]*typedef\s+(struct|union)\b([\w \t[\]]|::)*\n*([ \t]*){(?:(?!^\3?}|^\s*typedef).)*'"$1"'(?:(?!^\3?}|^\s*typedef).)*^\3}\s*\w+;'; } -grepc_patterns() -{ - test $t_e = yes && grepc_e "$1"; - test $t_fp = yes && grepc_fp "$1"; - test $t_fd = yes && grepc_fd "$1"; - test $t_flp = yes && grepc_flp "$1"; - test $t_fld = yes && grepc_fld "$1"; - test $t_fgp = yes && grepc_fgp "$1"; - test $t_fgd_libm = yes && grepc_fgd_libm "$1"; - test $t_fgd_libio = yes && grepc_fgd_libio "$1"; - test $t_mf = yes && grepc_mf "$1"; - test $t_mo = yes && grepc_mo "$1"; - test $t_t_braced = yes && grepc_t_braced "$1"; - test $t_t_td_simple = yes && grepc_t_td_simple "$1"; - test $t_t_td_braced = yes && grepc_t_td_braced "$1"; - test $t_t_td_func = yes && grepc_t_td_func "$1"; - test $t_ue = yes && grepc_ue "$1"; - test $t_uf_def = yes && grepc_uf_def "$1"; - test $t_uf_linux_def = yes && grepc_uf_linux_def "$1"; - test $t_um = yes && grepc_um "$1"; - test $t_ut_su = yes && grepc_ut_su "$1"; - test $t_ut_td_simple = yes && grepc_ut_td_simple "$1"; - test $t_ut_td_su = yes && grepc_ut_td_su "$1"; -} +patterns="$(mktemp -t grepc.patterns.XXXXXX)"; + + +( + test $t_e = yes && grepc_e "$identifier"; + test $t_fp = yes && grepc_fp "$identifier"; + test $t_fd = yes && grepc_fd "$identifier"; + test $t_flp = yes && grepc_flp "$identifier"; + test $t_fld = yes && grepc_fld "$identifier"; + test $t_fgp = yes && grepc_fgp "$identifier"; + test $t_fgd_libm = yes && grepc_fgd_libm "$identifier"; + test $t_fgd_libio = yes && grepc_fgd_libio "$identifier"; + test $t_mf = yes && grepc_mf "$identifier"; + test $t_mo = yes && grepc_mo "$identifier"; + test $t_t_braced = yes && grepc_t_braced "$identifier"; + test $t_t_td_simple = yes && grepc_t_td_simple "$identifier"; + test $t_t_td_braced = yes && grepc_t_td_braced "$identifier"; + test $t_t_td_func = yes && grepc_t_td_func "$identifier"; + test $t_ue = yes && grepc_ue "$identifier"; + test $t_uf_def = yes && grepc_uf_def "$identifier"; + test $t_uf_linux_def = yes && grepc_uf_linux_def "$identifier"; + test $t_um = yes && grepc_um "$identifier"; + test $t_ut_su = yes && grepc_ut_su "$identifier"; + test $t_ut_td_simple = yes && grepc_ut_td_simple "$identifier"; + test $t_ut_td_su = yes && grepc_ut_td_su "$identifier"; +) >"$patterns"; grepc_search() { - local patterns="$(mktemp -t grepc.patterns.XXXXXX)"; local opts=''; - grepc_patterns "$identifier" >"$patterns"; - opts="$opts $A"; opts="$opts $B"; opts="$opts $C"; -- cgit v1.2.3