X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Hooks.xs;h=0320d2abaa9b5e2a42f70c56f826d52a10981f80;hb=f609ee10b4b981c6c131936a39d13108d608a4fc;hp=b312223c08fff684b75445b2a1940a2731d85af7;hpb=be51951333b8f0da55af1243a039e74bb15dedcd;p=perl%2Fmodules%2Fre-engine-Hooks.git diff --git a/Hooks.xs b/Hooks.xs index b312223..0320d2a 100644 --- a/Hooks.xs +++ b/Hooks.xs @@ -143,8 +143,9 @@ EXTERN_C SV * reh_reg_qr_package(pTHX_ REGEXP * const); EXTERN_C void * reh_regdupe(pTHX_ REGEXP * const, CLONE_PARAMS *); EXTERN_C void * reh_re_dupe(pTHX_ REGEXP * const, CLONE_PARAMS *); #endif - -EXTERN_C const struct regexp_engine reh_regexp_engine; +#if REH_HAS_PERL(5, 17, 1) +EXTERN_C REGEXP *reh_op_compile(pTHX_ SV ** const patternp, int pat_count, OP *expr, const regexp_engine* eng, REGEXP *VOL old_re, bool *is_bare_re, U32 orig_rx_flags, U32 pm_flags); +#endif const struct regexp_engine reh_regexp_engine = { reh_regcomp, @@ -157,13 +158,16 @@ const struct regexp_engine reh_regexp_engine = { reh_reg_numbered_buff_length, reh_reg_named_buff, reh_reg_named_buff_iter, - reh_reg_qr_package, + reh_reg_qr_package #if defined(USE_ITHREADS) - reh_re_dupe + , reh_re_dupe +#endif +#if REH_HAS_PERL(5, 17, 1) + , reh_op_compile #endif }; -/* --- Private API --------------------------------------------------------- */ +/* --- Internal regexp structure -> hook list inside-out mapping ----------- */ typedef struct { size_t count; @@ -251,6 +255,8 @@ STATIC void reh_private_map_delete(pTHX_ void *ri) { return; } +/* --- Private API --------------------------------------------------------- */ + void reh_call_comp_begin_hook(pTHX_ regexp *rx) { SV *hint = reh_hint(); @@ -298,12 +304,12 @@ void reh_call_comp_begin_hook(pTHX_ regexp *rx) { } } -void reh_call_comp_hook(pTHX_ regexp *rx, regnode *node) { - REH_PRIVATE_MAP_FOREACH(cbs->comp(aTHX_ rx, node)); +void reh_call_comp_node_hook(pTHX_ regexp *rx, regnode *node) { + REH_PRIVATE_MAP_FOREACH(cbs->comp_node(aTHX_ rx, node)); } -void reh_call_exec_hook(pTHX_ regexp *rx, regnode *node, regmatch_info *reginfo, regmatch_state *st) { - REH_PRIVATE_MAP_FOREACH(cbs->exec(aTHX_ rx, node, reginfo, st)); +void reh_call_exec_node_hook(pTHX_ regexp *rx, regnode *node, regmatch_info *reginfo, regmatch_state *st) { + REH_PRIVATE_MAP_FOREACH(cbs->exec_node(aTHX_ rx, node, reginfo, st)); } void reh_re_free(pTHX_ REGEXP * const RX) {