From 3cc1d3885007238256e70c100eec938fd94b7ee3 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 8 Jan 2023 00:10:39 +0100 Subject: Support parenthesized function names This creates some false positives, but with appropriate flags, those can be removed. Signed-off-by: Alejandro Colomar --- bin/grepc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/grepc b/bin/grepc index df15953..8e55e1a 100755 --- a/bin/grepc +++ b/bin/grepc @@ -206,7 +206,7 @@ grepc_func_proto() grepc_helper \ "\b$1\s*\(" \ '.' \ - '(?s)^[\w[]([\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**'"$1"'\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)([\w\s\(,\)[\]]|::)*;'; + '(?s)^[\w[]([\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)([\w\s\(,\)[\]]|::)*;'; } @@ -215,7 +215,7 @@ grepc_func_def() grepc_helper \ "\b$1\s*\(" \ '.' \ - '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**'"$1"'\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)[ \t]*\n([ \t]*){.*?^\4}'; + '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*\(([\w\s\(,\)[\]*]|::)+?(\.\.\.)?\)[ \t]*\n([ \t]*){.*?^\4}'; } -- cgit v1.2.3