]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
grepc, grepc.1: -t...: Allow more granularity
authorAlejandro Colomar <alx.manpages@gmail.com>
Sat, 14 May 2022 23:40:56 +0000 (01:40 +0200)
committerAlejandro Colomar <alx@kernel.org>
Wed, 29 Oct 2025 20:29:03 +0000 (21:29 +0100)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
bin/grepc
share/man/man1/grepc.1

index 098093c27d0295d3cf3b922733a010cac17f31e7..ad4bccd0c2d372d097ee0f4efa5302d9451dfef4 100755 (executable)
--- a/bin/grepc
+++ b/bin/grepc
@@ -10,9 +10,18 @@ kflag='no';
 tflag='no';
 t_enum='no';
 t_func='no';
+t_func_proto='no';
+t_func_def='no';
+t_func_syscall='no';
+t_func_syscall_proto='no';
+t_func_syscall_def='no';
 t_macro='no';
 t_type='no';
 t_use='no';
+t_use_enum='yes';
+t_use_func='no';
+t_use_macro='no';
+t_use_type='no';
 
 
 grepc_usage()
@@ -47,6 +56,21 @@ grepc_parse_cmd()
                        f)
                                t_func='yes';
                                ;;
+                       fp)
+                               t_func_proto='yes';
+                               ;;
+                       fd)
+                               t_func_def='yes';
+                               ;;
+                       fs)
+                               t_func_syscall='yes';
+                               ;;
+                       fsp)
+                               t_func_syscall_proto='yes';
+                               ;;
+                       fsd)
+                               t_func_syscall_def='yes';
+                               ;;
                        m)
                                t_macro='yes';
                                ;;
@@ -56,6 +80,18 @@ grepc_parse_cmd()
                        u)
                                t_use='yes';
                                ;;
+                       ue)
+                               t_use_enum='yes';
+                               ;;
+                       uf)
+                               t_use_func='yes';
+                               ;;
+                       um)
+                               t_use_macro='yes';
+                               ;;
+                       ut)
+                               t_use_type='yes';
+                               ;;
                        *)
                                grepc_usage;
                                exit 1;
@@ -375,13 +411,29 @@ grepc_search()
 {
        if [ "$tflag" = 'no' ]; then
                grepc_search_default "$1";
-
        else
                if [ "$t_enum" = 'yes' ]; then
                        grepc_enum_constant "$1";
                fi;
                if [ "$t_func" = 'yes' ]; then
                        grepc_func "$1";
+               else
+                       if [ "$t_func_proto" = 'yes' ]; then
+                               grepc_func_proto "$1";
+                       fi;
+                       if [ "$t_func_def" = 'yes' ]; then
+                               grepc_func_def "$1";
+                       fi;
+                       if [ "$t_func_syscall" = 'yes' ]; then
+                               grepc_linux_func "$1";
+                       else
+                               if [ "$t_func_syscall_proto" = 'yes' ]; then
+                                       grepc_linux_func_syscall_proto "$1";
+                               fi;
+                               if [ "$t_func_syscall_def" = 'yes' ]; then
+                                       grepc_linux_func_syscall_def "$1";
+                               fi;
+                       fi;
                fi;
                if [ "$t_macro" = 'yes' ]; then
                        grepc_macro "$1";
@@ -391,6 +443,19 @@ grepc_search()
                fi;
                if [ "$t_use" = 'yes' ]; then
                        grepc_use "$1";
+               else
+                       if [ "$t_use_enum" = 'yes' ]; then
+                               grepc_use_enum "$1";
+                       fi;
+                       if [ "$t_use_func" = 'yes' ]; then
+                               grepc_use_func "$1";
+                       fi;
+                       if [ "$t_use_macro" = 'yes' ]; then
+                               grepc_use_macro "$1";
+                       fi;
+                       if [ "$t_use_type" = 'yes' ]; then
+                               grepc_use_type "$1";
+                       fi;
                fi;
        fi;
 }
index 25aaa13b3baadb2c8b382b62693fc4754e5aacb1..b23e5d9e59cc599cbe7726a99875dd1ffc4b9944 100644 (file)
@@ -44,6 +44,27 @@ enum constant definitions.
 .TP
 .B f
 Function prototypes and definitions.
+This can be further subdivided into:
+.RS
+.TP
+.B fp
+Function prototypes.
+.TP
+.B fd
+Function definitions.
+.TP
+.B fs
+Linux kernel system calls.
+This can be further subdivided into:
+.RS
+.TP
+.B fsp
+Linux kernel system call prototypes.
+.TP
+.B fsd
+Linux kernel system call definitions.
+.RE
+.RE
 .TP
 .B m
 Macro definitions.
@@ -55,11 +76,28 @@ Type definitions.
 Uses.
 Searches occurences of
 .BI \eb identifier \eb
-within enums (except as an enum constant),
+within enums,
 function bodies,
 macro replacements,
 and type definitions,
 and prints the whole enum, function, macro, and/or type definitions.
+.IP
+This can be further subdivided into:
+.RS
+.TP
+.B ue
+Uses within enum definitions (except as an enum constant).
+.TP
+.B uf
+Uses within function definition bodies.
+.TP
+.B um
+Uses within macro replacements.
+.TP
+.B ut
+Uses within type definitions
+(except enum; that is: typedef, struct, or union).
+.RE
 .SH OPTIONS
 .TP
 .B \-g