From: Vincent Pit Date: Mon, 24 Sep 2012 10:53:14 +0000 (+0200) Subject: Normalize regexp function names X-Git-Tag: v0.03~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=14ef35c15932a15f49f50b1c407d9d805e759ae3;p=perl%2Fmodules%2Fre-engine-Hooks.git Normalize regexp function names --- diff --git a/Hooks.xs b/Hooks.xs index 6fb127e..d235880 100644 --- a/Hooks.xs +++ b/Hooks.xs @@ -117,16 +117,13 @@ void reh_register(pTHX_ const char *key, reh_config *cfg) { #endif #if PERL_VERSION <= 10 -EXTERN_C REGEXP *reh_regcomp(pTHX_ const SV * const, const U32); +EXTERN_C REGEXP *reh_re_compile(pTHX_ const SV * const, const U32); #else -EXTERN_C REGEXP *reh_regcomp(pTHX_ SV * const, U32); +EXTERN_C REGEXP *reh_re_compile(pTHX_ SV * const, U32); #endif -EXTERN_C I32 reh_regexec(pTHX_ REGEXP * const, char *, char *, - char *, I32, SV *, void *, U32); -EXTERN_C char * reh_re_intuit_start(pTHX_ REGEXP * const, SV *, char *, - char *, U32, re_scream_pos_data *); +EXTERN_C I32 reh_regexec_flags(pTHX_ REGEXP * const, char *, char *, char *, I32, SV *, void *, U32); +EXTERN_C char * reh_re_intuit_start(pTHX_ REGEXP * const, SV *, char *, char *, U32, re_scream_pos_data *); EXTERN_C SV * reh_re_intuit_string(pTHX_ REGEXP * const); -EXTERN_C void reh_regfree(pTHX_ REGEXP * const); EXTERN_C void reh_re_free(pTHX_ REGEXP * const); EXTERN_C void reh_reg_numbered_buff_fetch(pTHX_ REGEXP * const, const I32, SV * const); @@ -140,16 +137,15 @@ EXTERN_C SV * reh_reg_named_buff_iter(pTHX_ REGEXP * const, const SV * const, const U32); EXTERN_C SV * reh_reg_qr_package(pTHX_ REGEXP * const); #ifdef USE_ITHREADS -EXTERN_C void * reh_regdupe(pTHX_ REGEXP * const, CLONE_PARAMS *); EXTERN_C void * reh_re_dupe(pTHX_ REGEXP * const, CLONE_PARAMS *); #endif #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); +EXTERN_C REGEXP *reh_re_op_compile(pTHX_ SV ** const, int, OP *, const regexp_engine*, REGEXP *VOL, bool *, U32, U32); #endif const struct regexp_engine reh_regexp_engine = { - reh_regcomp, - reh_regexec, + reh_re_compile, + reh_regexec_flags, reh_re_intuit_start, reh_re_intuit_string, reh_re_free, @@ -163,7 +159,7 @@ const struct regexp_engine reh_regexp_engine = { , reh_re_dupe #endif #if REH_HAS_PERL(5, 17, 1) - , reh_op_compile + , reh_re_op_compile #endif }; @@ -312,21 +308,25 @@ void reh_call_exec_node_hook(pTHX_ regexp *rx, regnode *node, regmatch_info *reg REH_PRIVATE_MAP_FOREACH(cbs->exec_node(aTHX_ rx, node, reginfo, st)); } +EXTERN_C void reh_regfree_internal(pTHX_ REGEXP * const); + void reh_re_free(pTHX_ REGEXP * const RX) { regexp *rx = rxREGEXP(RX); reh_private_map_delete(rx->pprivate); - reh_regfree(aTHX_ RX); + reh_regfree_internal(aTHX_ RX); } #ifdef USE_ITHREADS +EXTERN_C void *reh_regdupe_internal(pTHX_ REGEXP * const, CLONE_PARAMS *); + void *reh_re_dupe(pTHX_ REGEXP * const RX, CLONE_PARAMS *param) { regexp *rx = rxREGEXP(RX); void *new_ri; - new_ri = reh_regdupe(aTHX_ RX, param); + new_ri = reh_regdupe_internal(aTHX_ RX, param); reh_private_map_copy(rx->pprivate, new_ri); diff --git a/re_top.h b/re_top.h index ff62070..58f7af7 100644 --- a/re_top.h +++ b/re_top.h @@ -1,19 +1,19 @@ /* We can't use PERL_{REVISION,VERSION,SUBVERSION} here because they are not * available yet at the time this file is included by reg{comp,exec}.c. */ -#define Perl_re_compile reh_regcomp -#define Perl_re_op_compile reh_op_compile -#define Perl_regexec_flags reh_regexec +#define Perl_re_compile reh_re_compile +#define Perl_regexec_flags reh_regexec_flags #define Perl_re_intuit_start reh_re_intuit_start #define Perl_re_intuit_string reh_re_intuit_string -#define Perl_regfree_internal reh_regfree +#define Perl_regfree_internal reh_regfree_internal #define Perl_reg_numbered_buff_fetch reh_reg_numbered_buff_fetch #define Perl_reg_numbered_buff_store reh_reg_numbered_buff_store #define Perl_reg_numbered_buff_length reh_reg_numbered_buff_length #define Perl_reg_named_buff reh_reg_named_buff #define Perl_reg_named_buff_iter reh_reg_named_buff_iter #define Perl_reg_qr_package reh_reg_qr_package -#define Perl_regdupe_internal reh_regdupe +#define Perl_regdupe_internal reh_regdupe_internal +#define Perl_re_op_compile reh_re_op_compile #define Perl_regnext reh_regnext #define Perl_pregcomp reh_pregcomp