diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-12 13:47:38 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2025-10-29 21:28:59 +0100 |
| commit | 598594f90bda817d88cd27420dee5e8338814af4 (patch) | |
| tree | d75770e8b5893bf05e4c0f8d6ba8071c5c202815 | |
| parent | f5da2e048caff0b281d7e9f8db83d548893fbcd4 (diff) | |
| download | man-pages-598594f90bda817d88cd27420dee5e8338814af4.tar.gz | |
grepc: srcfix
Improve grouping so that adding flags for running the different
functions is simple.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
| -rwxr-xr-x | bin/grepc | 86 |
1 files changed, 43 insertions, 43 deletions
@@ -73,31 +73,6 @@ grepc_helper() } -grepc_macro_simple() -{ - grepc_helper \ - "#\s*define\s+$1\b[^(]" \ - '.' \ - '(?s)#\s*define\s+'"$1"'\b(?!\().*?[^\\]$'; -} - - -grepc_macro_func() -{ - grepc_helper \ - "#\s*define\s+$1\(" \ - '.' \ - '(?s)#\s*define\s+'"$1"'\(.*?[^\\]$'; -} - - -grepc_macro() -{ - grepc_macro_simple "$1"; - grepc_macro_func "$1"; -} - - grepc_enum_constant() { grepc_helper \ @@ -125,14 +100,7 @@ grepc_func_def() } -grepc_func() -{ - grepc_func_decl "$1"; - grepc_func_def "$1"; -} - - -grepc_linux_syscall_decl() +grepc_linux_func_syscall_decl() { grepc_helper \ "^asmlinkage\s+[\w\s]+\**sys_$1\s*\(" \ @@ -141,7 +109,7 @@ grepc_linux_syscall_decl() } -grepc_linux_syscall_def() +grepc_linux_func_syscall_def() { grepc_helper \ "SYSCALL_DEFINE.\($1\b" \ @@ -150,22 +118,56 @@ grepc_linux_syscall_def() } -grepc_linux() +grepc_linux_func() { - grepc_linux_syscall_decl "$1"; - grepc_linux_syscall_def "$1"; + grepc_linux_func_syscall_decl "$1"; + grepc_linux_func_syscall_def "$1"; } -grepc_glibc_math() +grepc_glibc_func_math() { grepc_func_def "M_DECL_FUNC \(__$1\)"; } -grepc_glibc() +grepc_glibc_func() +{ + grepc_glibc_func_math "$1"; +} + + +grepc_func() { - grepc_glibc_math "$1"; + grepc_func_decl "$1"; + grepc_func_def "$1"; + grepc_linux_func "$1"; + grepc_glibc_func "$1"; +} + + +grepc_macro_simple() +{ + grepc_helper \ + "#\s*define\s+$1\b[^(]" \ + '.' \ + '(?s)#\s*define\s+'"$1"'\b(?!\().*?[^\\]$'; +} + + +grepc_macro_func() +{ + grepc_helper \ + "#\s*define\s+$1\(" \ + '.' \ + '(?s)#\s*define\s+'"$1"'\(.*?[^\\]$'; +} + + +grepc_macro() +{ + grepc_macro_simple "$1"; + grepc_macro_func "$1"; } @@ -225,11 +227,9 @@ grepc_type() grepc_grepc() { - grepc_macro "$1"; grepc_enum_constant "$1"; grepc_func "$1"; - grepc_linux "$1"; - grepc_glibc "$1"; + grepc_macro "$1"; grepc_type "$1"; } |
