t_func='no';
t_macro='no';
t_type='no';
+t_use='no';
grepc_usage()
t)
t_type='yes';
;;
+ u)
+ t_use='yes';
+ ;;
*)
grepc_usage;
exit 1;
}
+grepc_use_func_def()
+{
+ grepc_helper \
+ "\b$1\b" \
+ '.' \
+ "(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\w+\s*\([\w\s\(,\)[\]*]+?(...)?\)\s*{(?:(?!^}).)*\b$1\b.*?^}";
+}
+
+
+grepc_linux_use_func_syscall_def()
+{
+ grepc_helper \
+ "SYSCALL_DEFINE.\(" \
+ "\b$1\b" \
+ "(?s)^(COMPAT_)?SYSCALL_DEFINE.\(\w+\b(?:(?!^}).)*\b$1\b.?^}";
+}
+
+
+grepc_linux_use_func()
+{
+ grepc_linux_use_func_syscall_def "$1";
+}
+
+
+grepc_use_func()
+{
+ grepc_use_func_def "$1";
+ grepc_linux_use_func "$1";
+}
+
+
+grepc_use_macro()
+{
+ grepc_helper \
+ "\b$1\b" \
+ 'define' \
+ '(?s)^[ \t]*#\s*define\s+\w+\b(\([^\)]*\))?(?:(?![^\\]$).)*'"$1"'.*?[^\\]$';
+}
+
+
+grepc_use()
+{
+ grepc_use_func "$1";
+ grepc_use_macro "$1";
+}
+
+
grepc_search_default()
{
grepc_enum_constant "$1";
grepc_func "$1";
grepc_macro "$1";
grepc_type "$1";
+ grepc_use "$1";
}
if [ "$t_type" = 'yes' ]; then
grepc_type "$1";
fi;
+ if [ "$t_use" = 'yes' ]; then
+ grepc_use "$1";
+ fi;
fi;
}
.TP
.B t
Type definitions.
+.TP
+.B u
+Uses.
+Searches occurences of
+.BI \eb identifier \eb
+within function bodies and macro replacements,
+and prints the whole functions and/or macros.
.SH OPTIONS
.TP
.B \-g
This option can be passed multiple times
to search for various types of code.
Default:
-.BR "e f m t" .
+.BR "e f m t u" .
.TP
.BI \-x " extension"
Restrict the search to files ending with