]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Support parenthesized function names
authorAlejandro Colomar <alx@kernel.org>
Sat, 7 Jan 2023 23:10:39 +0000 (00:10 +0100)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:09 +0000 (21:29 +0100)
This creates some false positives, but with appropriate flags, those can
be removed.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
bin/grepc

index df15953e897c5e715db11fc796907eaf5822db43..8e55e1a807db68182e011415c974b192b43dbad9 100755 (executable)
--- 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}';
 }