From: Vincent Pit Date: Wed, 1 Oct 2014 23:39:46 +0000 (+0200) Subject: Teach the regexp engine about the new entries in the API X-Git-Tag: v0.10~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fre-engine-Plugin.git;a=commitdiff_plain;h=ca88f6dfd59f4794f58f0aea9c14629f5199b814 Teach the regexp engine about the new entries in the API --- diff --git a/Plugin.xs b/Plugin.xs index 2b0fe04..b4db0bd 100644 --- a/Plugin.xs +++ b/Plugin.xs @@ -308,6 +308,12 @@ STATIC const rep_hint_t *rep_hint(pTHX) { Perl_croak(aTHX_ "Not an object"); \ } +#if REP_HAS_PERL(5, 19, 4) +# define REP_ENG_EXEC_MINEND_TYPE SSize_t +#else +# define REP_ENG_EXEC_MINEND_TYPE I32 +#endif + START_EXTERN_C EXTERN_C const regexp_engine engine_plugin; #if REP_HAS_PERL(5, 11, 0) @@ -316,9 +322,14 @@ EXTERN_C REGEXP * Plugin_comp(pTHX_ SV * const, U32); EXTERN_C REGEXP * Plugin_comp(pTHX_ const SV * const, const U32); #endif EXTERN_C I32 Plugin_exec(pTHX_ REGEXP * const, char *, char *, - char *, I32, SV *, void *, U32); + char *, REP_ENG_EXEC_MINEND_TYPE, SV *, void *, U32); +#if REP_HAS_PERL(5, 19, 1) +EXTERN_C char * Plugin_intuit(pTHX_ REGEXP * const, SV *, const char * const, + char *, char *, U32, re_scream_pos_data *); +#else EXTERN_C char * Plugin_intuit(pTHX_ REGEXP * const, SV *, char *, char *, U32, re_scream_pos_data *); +#endif EXTERN_C SV * Plugin_checkstr(pTHX_ REGEXP * const); EXTERN_C void Plugin_free(pTHX_ REGEXP * const); EXTERN_C void * Plugin_dupe(pTHX_ REGEXP * const, CLONE_PARAMS *); @@ -352,9 +363,12 @@ const regexp_engine engine_plugin = { Plugin_numbered_buff_LENGTH, Plugin_named_buff, Plugin_named_buff_iter, - Plugin_package, + Plugin_package #if defined(USE_ITHREADS) - Plugin_dupe, + , Plugin_dupe +#endif +#if REP_HAS_PERL(5, 17, 0) + , 0 #endif }; @@ -492,7 +506,8 @@ Plugin_comp(pTHX_ const SV * const pattern, const U32 flags) I32 Plugin_exec(pTHX_ REGEXP * const RX, char *stringarg, char *strend, - char *strbeg, I32 minend, SV *sv, void *data, U32 flags) + char *strbeg, REP_ENG_EXEC_MINEND_TYPE minend, + SV *sv, void *data, U32 flags) { dSP; I32 matched; @@ -536,11 +551,19 @@ Plugin_exec(pTHX_ REGEXP * const RX, char *stringarg, char *strend, } char * +#if REP_HAS_PERL(5, 19, 1) +Plugin_intuit(pTHX_ REGEXP * const RX, SV *sv, const char * const strbeg, + char *strpos, char *strend, U32 flags, re_scream_pos_data *data) +#else Plugin_intuit(pTHX_ REGEXP * const RX, SV *sv, char *strpos, - char *strend, U32 flags, re_scream_pos_data *data) + char *strend, U32 flags, re_scream_pos_data *data) +#endif { PERL_UNUSED_ARG(RX); PERL_UNUSED_ARG(sv); +#if REP_HAS_PERL(5, 19, 1) + PERL_UNUSED_ARG(strbeg); +#endif PERL_UNUSED_ARG(strpos); PERL_UNUSED_ARG(strend); PERL_UNUSED_ARG(flags);