grepc_c_f_decl_() { grepc_c_f_return_;
printf '%s' '\(?'"$1"'\)?';
grepc_c_f_params_; }
-grepc_c_body_() { printf '%s' '[ \t]*\n*(?<space>[ \t]*){(?:(?!^\k<space>?}).)*'"$1"'.*?^\k<space>}'; }
+grepc_c_body_() { printf '%s' '[ \t]*\n*(?<space>[ \t]*){.*?^\k<space>}'; }
+grepc_c_u_body_() { printf '%s' '[ \t]*\n*(?<space>[ \t]*){(?:(?!^\k<space>?}).)*'"$1"'.*?^\k<space>}'; }
grepc_c_fld_decl_() { printf '%s' '(?s)^(COMPAT_)?SYSCALL_DEFINE.\('"$1"'\b[\w\s,;[\]*\?:+-]*\)'; }
grepc_c_m_decl_() { printf '%s' '(?s)^[ \t]*#\s*define\s[\s\\]*'"$1"'\b'; }
grepc_c_mf_decl_() { grepc_c_m_decl_ "$1";
grepc_c_e() { grepc_c_e_decl_;
- grepc_c_body_ '^[ \t]*'"$1"'\b\s*[=,]';
+ grepc_c_u_body_ '^[ \t]*'"$1"'\b\s*[=,]';
echo '[^;]*;'; }
grepc_c_fp() { grepc_c_f_decl_ "$1";
echo '(?:[\w\s\(,\)[\]]|::)*;'; }
grepc_c_fd() { grepc_c_f_decl_ "$1";
- grepc_c_body_ '';
+ grepc_c_body_;
echo; }
grepc_c_fgd_libm() { grepc_c_fd "M_DECL_FUNC \(__$1\)"; }
grepc_c_fgd_libio() { grepc_c_fd "_IO_$1"; }
grepc_c_fgp() { grepc_c_fgp_libio "$1"; }
grepc_c_flp() { grepc_c_fp "(?:compat_)?sys_$1"; }
grepc_c_fld() { grepc_c_fld_decl_ "$1";
- grepc_c_body_ '';
+ grepc_c_body_;
echo; }
grepc_c_mf() { grepc_c_mf_decl_ "$1";
grepc_c_m_repl_ '';
grepc_c_m_repl_ '';
echo; }
grepc_c_t_braced() { printf '%s' '(?s)^([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union|enum)\b([\w \t[\]]|::)+\b'"$1"'\b';
- grepc_c_body_ '';
+ grepc_c_body_;
echo '[^;]*;'; }
grepc_c_t_td_simple() { echo '(?s)^[ \t]*typedef\s+[^{};]+\b'"$1"';'; }
grepc_c_t_td_braced() { printf '%s' '(?s)^[ \t]*typedef\s+(struct|union|enum)\b(?:(?!\W'"$1"'\W)([\w \t[\]]|::))*';
- grepc_c_body_ '';
+ grepc_c_body_;
echo '\s*'"$1"'(\[[\w\(,\)]\])*;'; }
grepc_c_t_td_func() { echo '(?s)^[ \t]*typedef\s+[^{};]+\(\**'"$1"'\)\s*\([^{};]+;'; }
grepc_c_ue() { grepc_c_e_decl_;
- grepc_c_body_ "$1";
+ grepc_c_u_body_ "$1";
echo '[^;]*;'; }
grepc_c_uf_def() { grepc_c_f_decl_ '\w+';
- grepc_c_body_ "$1";
+ grepc_c_u_body_ "$1";
echo; }
grepc_c_uf_linux_def() { grepc_c_fld_decl_ '\w+';
- grepc_c_body_ "$1";
+ grepc_c_u_body_ "$1";
echo; }
grepc_c_umf() { grepc_c_mf_decl_ '\w+'
grepc_c_m_repl_ "$1";
grepc_c_m_repl_ "$1";
echo; }
grepc_c_ut_su() { printf '%s' '(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\b([\w \t[\]]|::)*\w+';
- grepc_c_body_ "$1";
+ grepc_c_u_body_ "$1";
echo '[^;]*;'; }
grepc_c_ut_td_simple() { echo '(?s)^[ \t]*typedef\s+[^{};]*'"$1"'[^{};]+;'; }
grepc_c_ut_td_su() { printf '%s' '(?s)^[ \t]*typedef\s+(struct|union)\b([\w \t[\]]|::)*';
- grepc_c_body_ "$1";
+ grepc_c_u_body_ "$1";
echo '[^;]*;'; }