From: Florian Ragwitz Date: Wed, 22 Oct 2008 18:29:36 +0000 (+0000) Subject: Merge branch 'hook_op_check' X-Git-Tag: 0.005000~54 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=18aa1122598b682f0af6bcd24f182861b9531b57;p=p5sagit%2FDevel-Declare.git Merge branch 'hook_op_check' * hook_op_check: Update for latest B::Hooks::OP::Check API. Use B::Hooks::OP::Check to register PL_check callbacks. Create branch hook_op_check --- 18aa1122598b682f0af6bcd24f182861b9531b57 diff --cc Declare.xs index ae5b164,537ff80..af640e9 --- a/Declare.xs +++ b/Declare.xs @@@ -192,42 -193,28 +193,38 @@@ int dd_toke_skipspace(pTHX_ int offset /* replacement PL_check rv2cv entry */ - STATIC OP *(*dd_old_ck_rv2cv)(pTHX_ OP *op); - - STATIC OP *dd_ck_rv2cv(pTHX_ OP *o) { + STATIC OP *dd_ck_rv2cv(pTHX_ OP *o, void *user_data) { OP* kid; int dd_flags; - char* cb_args[6]; - o = dd_old_ck_rv2cv(aTHX_ o); /* let the original do its job */ - if (in_declare) { - cb_args[0] = NULL; -#ifdef DD_DEBUG - printf("Deconstructing declare\n"); - printf("PL_bufptr: %s\n", PL_bufptr); - printf("bufend at: %i\n", PL_bufend - PL_bufptr); - printf("linestr: %s\n", SvPVX(PL_linestr)); - printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr)); -#endif - call_argv("Devel::Declare::done_declare", G_VOID|G_DISCARD, cb_args); -#ifdef DD_DEBUG - printf("PL_bufptr: %s\n", PL_bufptr); - printf("bufend at: %i\n", PL_bufend - PL_bufptr); - printf("linestr: %s\n", SvPVX(PL_linestr)); - printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr)); - printf("actual len: %i\n", strlen(PL_bufptr)); -#endif + if (dd_debug) { + printf("Deconstructing declare\n"); + printf("PL_bufptr: %s\n", PL_bufptr); + printf("bufend at: %i\n", PL_bufend - PL_bufptr); + printf("linestr: %s\n", SvPVX(PL_linestr)); + printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr)); + } + + dSP; + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + + call_pv("Devel::Declare::done_declare", G_VOID|G_DISCARD); + + FREETMPS; + LEAVE; + + if (dd_debug) { + printf("PL_bufptr: %s\n", PL_bufptr); + printf("bufend at: %i\n", PL_bufend - PL_bufptr); + printf("linestr: %s\n", SvPVX(PL_linestr)); + printf("linestr len: %i\n", PL_bufend - SvPVX(PL_linestr)); + printf("actual len: %i\n", strlen(PL_bufptr)); + } return o; } @@@ -299,14 -286,11 +293,10 @@@ static I32 dd_filter_realloc(pTHX_ int return count; } - STATIC OP *(*dd_old_ck_const)(pTHX_ OP*op); - - STATIC OP *dd_ck_const(pTHX_ OP *o) { + STATIC OP *dd_ck_const(pTHX_ OP *o, void *user_data) { int dd_flags; - char* s; char* name; - o = dd_old_ck_const(aTHX_ o); /* let the original do its job */ - /* if this is set, we just grabbed a delimited string or something, not a bareword, so NO TOUCHY */