}
+grepc_use_enum()
+{
+ grepc_helper \
+ '\benum\b' \
+ "\b$1\b" \
+ "(?s)^([\w[]+[\w\s]*)?\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^\s*\w+[\w\s[\]=]*\b$1\b.*?^}.*?;";
+}
+
+
grepc_use_func_def()
{
grepc_helper \
}
+grepc_use_type_struct_union()
+{
+ grepc_helper \
+ "\b(struct|union)\b" \
+ "\b$1\b" \
+ "(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\s+\w+\s*[\w\s[\]]*{(?:(?!^}).)*?\b$1\b.*?^}.*?;";
+}
+
+
+grepc_use_type_typedef_simple()
+{
+ grepc_helper \
+ '^[ \t]*typedef\s' \
+ "\b$1\b" \
+ "(?s)^[ \t]*typedef\s+[^{};]*\b$1\b[^{};]+;";
+}
+
+
+grepc_use_type_typedef_struct_union()
+{
+ grepc_helper \
+ '^[ \t]*typedef\s+(struct|union)\b[^;]*$' \
+ "\b$1\b" \
+ "(?s)^[ \t]*typedef\s+(struct|union)\s+[\w\s[\]]*{(?:(?!^( )?}|^\s*typedef).)*\b$1\b(?:(?!^( )?}|^\s*typedef).)*^( )?}\s*\w+;";
+}
+
+
+grepc_use_type()
+{
+ grepc_use_type_struct_union "$1";
+ grepc_use_type_typedef_simple "$1";
+ grepc_use_type_typedef_struct_union "$1";
+}
+
+
grepc_use()
{
+ grepc_use_enum "$1";
grepc_use_func "$1";
grepc_use_macro "$1";
+ grepc_use_type "$1";
}
Uses.
Searches occurences of
.BI \eb identifier \eb
-within function bodies and macro replacements,
-and prints the whole functions and/or macros.
+within enums (except as an enum constant),
+function bodies,
+macro replacements,
+and type definitions,
+and prints the whole enum, function, macro, and/or type definitions.
.SH OPTIONS
.TP
.B \-g