summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-02 19:38:43 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-03 01:08:32 +0100
commit9afd98d11b1cdf3501ef927b8b9a7efb78fa6f19 (patch)
treeba4709315378293450087c4614e17020b105417f
parent486efd8a64c4d0412687ac91bea6f5903bf60c39 (diff)
bin/grepc: Simplify (remove grepc_use_type())
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-xbin/grepc34
1 files changed, 18 insertions, 16 deletions
diff --git a/bin/grepc b/bin/grepc
index 1fc1ce5..2c83624 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -26,7 +26,9 @@ t_type_td_func='no';
t_use_enum='no';
t_use_func='no';
t_use_macro='no';
-t_use_type='no';
+t_use_type_su='no';
+t_use_type_td_simple='no';
+t_use_type_td_su='no';
grepc_err()
@@ -116,7 +118,9 @@ grepc_parse_cmd()
t_use_enum='yes';
t_use_func='yes';
t_use_macro='yes';
- t_use_type='yes';
+ t_use_type_su='yes';
+ t_use_type_td_simple='yes';
+ t_use_type_td_su='yes';
;;
ue)
t_use_enum='yes';
@@ -128,7 +132,9 @@ grepc_parse_cmd()
t_use_macro='yes';
;;
ut)
- t_use_type='yes';
+ t_use_type_su='yes';
+ t_use_type_td_simple='yes';
+ t_use_type_td_su='yes';
;;
*)
grepc_err "-$opt: $OPTARG: Unknown argument.";
@@ -374,7 +380,7 @@ grepc_use_macro()
}
-grepc_use_type_struct_union()
+grepc_use_type_su()
{
grepc_helper_use \
"\b(struct|union)\b" \
@@ -383,7 +389,7 @@ grepc_use_type_struct_union()
}
-grepc_use_type_typedef_simple()
+grepc_use_type_td_simple()
{
grepc_helper_use \
'^[ \t]*typedef\s' \
@@ -392,7 +398,7 @@ grepc_use_type_typedef_simple()
}
-grepc_use_type_typedef_struct_union()
+grepc_use_type_td_su()
{
grepc_helper_use \
'^[ \t]*typedef\s+(struct|union)\b[^;]*$' \
@@ -401,14 +407,6 @@ grepc_use_type_typedef_struct_union()
}
-grepc_use_type()
-{
- grepc_use_type_struct_union "$1";
- grepc_use_type_typedef_simple "$1";
- grepc_use_type_typedef_struct_union "$1";
-}
-
-
grepc_search()
{
test "$t_enum" = 'yes' \
@@ -445,8 +443,12 @@ grepc_search()
&& grepc_use_func "$1";
test "$t_use_macro" = 'yes' \
&& grepc_use_macro "$1";
- test "$t_use_type" = 'yes' \
- && grepc_use_type "$1";
+ test "$t_use_type_su" = 'yes' \
+ && grepc_use_type_su "$1";
+ test "$t_use_type_td_simple" = 'yes' \
+ && grepc_use_type_td_simple "$1";
+ test "$t_use_type_td_su" = 'yes' \
+ && grepc_use_type_td_su "$1";
}