summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-05-12 13:47:38 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2022-05-12 13:47:43 +0200
commitfbed97a8ff8878e88cc60023fee5862a01965353 (patch)
treee0a8c3146e3de727fc39f62dd03a728169d2af2f
parentc18a5d2ebe59292031b453047f38765d61e36c73 (diff)
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-xbin/grepc86
1 files changed, 43 insertions, 43 deletions
diff --git a/bin/grepc b/bin/grepc
index e8c49c3..6b9e31c 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -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";
}