summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-03 01:16:42 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-03 01:18:17 +0100
commit690c3c37560ce15091f9e67b82db226a9d951d3d (patch)
tree2d27b6f8911f5346414d6dadb72d64bd4a961388
parent2445b6ccbec571bca5ec759e508fd2a8113e481f (diff)
bin/grepc, grepc.1: -tmf, -tmo: Add options to find only function-like macros, or other macros
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-xbin/grepc26
-rw-r--r--share/man/man1/grepc.18
2 files changed, 24 insertions, 10 deletions
diff --git a/bin/grepc b/bin/grepc
index b987352..7c03000 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -17,8 +17,8 @@ t_fsd='no';
t_fgp='no';
t_fgd_libm='no';
t_fgd_libio='no';
-t_m_func='no';
-t_m_obj='no';
+t_mf='no';
+t_mo='no';
t_t_braced='no';
t_t_td_simple='no';
t_t_td_braced='no';
@@ -106,8 +106,14 @@ grepc_parse_cmd()
t_fgd_libio='yes';
;;
m)
- t_m_func='yes';
- t_m_obj='yes';
+ t_mf='yes';
+ t_mo='yes';
+ ;;
+ mf)
+ t_mf='yes';
+ ;;
+ mo)
+ t_mo='yes';
;;
t)
t_t_braced='yes';
@@ -172,8 +178,8 @@ grepc_parse_cmd()
t_fgp='yes';
t_fgd_libm='yes';
t_fgd_libio='yes';
- t_m_func='yes';
- t_m_obj='yes';
+ t_mf='yes';
+ t_mo='yes';
t_t_braced='yes';
t_t_td_simple='yes';
t_t_td_braced='yes';
@@ -283,7 +289,7 @@ grepc_fsd()
}
-grepc_m_func()
+grepc_mf()
{
grepc_helper \
"#\s*define\s+$1\(" \
@@ -292,7 +298,7 @@ grepc_m_func()
}
-grepc_m_object()
+grepc_mo()
{
grepc_helper \
"#\s*define\s+$1\b(?!\()" \
@@ -413,8 +419,8 @@ grepc_search()
test "$t_fgp" = 'yes' && grepc_fgp "$1";
test "$t_fgd_libm" = 'yes' && grepc_fgd_libm "$1";
test "$t_fgd_libio" = 'yes' && grepc_fgd_libio "$1";
- test "$t_m_func" = 'yes' && grepc_m_func "$1";
- test "$t_m_obj" = 'yes' && grepc_m_object "$1";
+ test "$t_mf" = 'yes' && grepc_mf "$1";
+ test "$t_mo" = 'yes' && grepc_mo "$1";
test "$t_t_braced" = 'yes' && grepc_t_braced "$1";
test "$t_t_td_simple" = 'yes' && grepc_t_td_simple "$1";
test "$t_t_td_braced" = 'yes' && grepc_t_td_braced "$1";
diff --git a/share/man/man1/grepc.1 b/share/man/man1/grepc.1
index 453b85d..3fd46b6 100644
--- a/share/man/man1/grepc.1
+++ b/share/man/man1/grepc.1
@@ -80,6 +80,14 @@ Glibc definitions.
.TP
.B m
Macro definitions.
+.RS
+.TP
+.B mf
+Function-like macro definitions.
+.TP
+.B mo
+Other macro definitions.
+.RE
.TP
.B t
Type definitions.