{
grepc_helper '\.[ch]$' \
"#\s*define\s+$1\b[^(]" \
- "." \
+ '.' \
"(?s)#\s*define\s+$1\b(?!\().*?[^\\\\]$";
}
{
grepc_helper '\.[ch]$' \
"#\s*define\s+$1\(" \
- "." \
+ '.' \
"(?s)#\s*define\s+$1\(.*?[^\\\\]$";
}
function grepc_enum_constant()
{
grepc_helper '\.[ch]$' \
- "^enum\s" \
+ '^enum\s' \
"^\s*$1\s*[,=]" \
"(?s)\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^\s*$1\s*[=,].*?^}.*?;";
}
{
grepc_helper '\.[ch]$' \
"\b$1\s*\(" \
- "." \
+ '.' \
"(?s)^[\w[]([\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**$1\s*\([\w\s\(,\)[\]*]+?(...)?\)[\w\s\(,\)[:\]]*;";
}
{
grepc_helper '\.[ch]$' \
"\b$1\s*\(" \
- "." \
+ '.' \
"(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**$1\s*\([\w\s\(,\)[\]*]+?(...)?\)\s*{.*?^}";
}
{
grepc_helper '\.[ch]$' \
"^asmlinkage\s+[\w\s]+\**sys_$1\s*\(" \
- "." \
+ '.' \
"(?s)^asmlinkage\s+[\w\s]+\**sys_$1\s*\(.*?\)";
}
{
grepc_helper '\.c$' \
"SYSCALL_DEFINE.\($1\b" \
- "." \
+ '.' \
"(?s)^\w*SYSCALL_DEFINE.\($1\b.*?^}";
}
{
grepc_helper '\.[ch]$' \
"\b(struct|union|enum)\s+$1\b" \
- "." \
+ '.' \
"(?s)^(?!^\s*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union|enum)\s+$1\b\s*[\w\s[\]]*{.*?^}.*?;";
}
function grepc_type_typedef_simple()
{
grepc_helper '\.[ch]$' \
- "^\s*typedef\s" \
+ '^\s*typedef\s' \
"\b$1;" \
"(?s)^\s*typedef\s+[^{};]+$1;";
}
function grepc_type_typedef_struct_union_enum()
{
grepc_helper '\.[ch]$' \
- "^\s*typedef\s+(struct|union|enum)\b[^;]*$" \
+ '^\s*typedef\s+(struct|union|enum)\b[^;]*$' \
"^(\s\s)?}\s*$1;" \
"(?s)^\s*typedef\s+(struct|union|enum)\s+(?:(?!^(\s\s)?}|^\s*typedef).)*^(\s\s)?}\s*$1;";
}