]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/grepc_c: -tfld: Split regex
authorAlejandro Colomar <alx@kernel.org>
Wed, 5 Nov 2025 14:40:05 +0000 (15:40 +0100)
committerAlejandro Colomar <alx@kernel.org>
Thu, 6 Nov 2025 00:43:05 +0000 (01:43 +0100)
This will be reused for -tuf.

I copied '[\w\s,;[\]*\?:+-]*\)' from grepc_c_f_params_().

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

index 42f2f1c4e7719d9ad8711f18595fd63b9d5cc619..09d0c6fe691c853794055d8ab9abd112b085d77b 100755 (executable)
@@ -123,7 +123,10 @@ grepc_c_fgd_libio()     { grepc_c_fd "_IO_$1"; }
 grepc_c_fgp_libio()     { grepc_c_fp "_IO_$1"; }
 grepc_c_fgp()           { grepc_c_fgp_libio "$1"; }
 grepc_c_flp()           { grepc_c_fp "(?:compat_)?sys_$1"; }
-grepc_c_fld()           { echo '(?s)^(COMPAT_)?SYSCALL_DEFINE.\('"$1"'\b.*?^}'; }
+grepc_c_fld_decl_()     { printf '%s' '(?s)^(COMPAT_)?SYSCALL_DEFINE.\('"$1"'\b[\w\s,;[\]*\?:+-]*\)'; }
+grepc_c_fld()           { grepc_c_fld_decl_ "$1";
+                          grepc_c_f_body_;
+                          echo; }
 grepc_c_mf()            { echo '(?s)^[ \t]*#\s*define\s[\s\\]*'"$1"'\(.*?[^\\]$'; }
 grepc_c_mo()            { echo '(?s)^[ \t]*#\s*define\s[\s\\]*'"$1"'\b(?!\().*?(?<!\\)$'; }
 grepc_c_t_braced()      { echo '(?s)^([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union|enum)\b([\w \t[\]]|::)+\b'"$1"'\b[ \t]*\n*([ \t]*){.*?^\5}.*?;'; }