1 #define GET_SELF_FROM_PPRIVATE(pprivate) \
2 re__engine__Plugin self; \
3 SELF_FROM_PPRIVATE(self,pprivate);
5 /* re__engine__Plugin self; SELF_FROM_PPRIVATE(self,rx->pprivate) */
6 #define SELF_FROM_PPRIVATE(self, pprivate) \
7 if (sv_isobject(pprivate)) { \
8 SV * ref = SvRV((SV*)pprivate); \
9 IV tmp = SvIV((SV*)ref); \
10 self = INT2PTR(re__engine__Plugin,tmp); \
12 Perl_croak(aTHX_ "Not an object"); \
16 EXTERN_C const regexp_engine engine_plugin;
17 #if PERL_VERSION <= 10
18 EXTERN_C REGEXP * Plugin_comp(pTHX_ const SV * const, const U32);
20 EXTERN_C REGEXP * Plugin_comp(pTHX_ SV * const, U32);
22 EXTERN_C I32 Plugin_exec(pTHX_ REGEXP * const, char *, char *,
23 char *, I32, SV *, void *, U32);
24 EXTERN_C char * Plugin_intuit(pTHX_ REGEXP * const, SV *, char *,
25 char *, U32, re_scream_pos_data *);
26 EXTERN_C SV * Plugin_checkstr(pTHX_ REGEXP * const);
27 EXTERN_C void Plugin_free(pTHX_ REGEXP * const);
28 EXTERN_C void * Plugin_dupe(pTHX_ REGEXP * const, CLONE_PARAMS *);
29 EXTERN_C void Plugin_numbered_buff_FETCH(pTHX_ REGEXP * const,
30 const I32, SV * const);
31 EXTERN_C void Plugin_numbered_buff_STORE(pTHX_ REGEXP * const,
32 const I32, SV const * const);
33 EXTERN_C I32 Plugin_numbered_buff_LENGTH(pTHX_ REGEXP * const,
34 const SV * const, const I32);
35 EXTERN_C SV * Plugin_named_buff (pTHX_ REGEXP * const, SV * const,
36 SV * const, const U32);
37 EXTERN_C SV * Plugin_named_buff_iter (pTHX_ REGEXP * const, const SV * const,
39 EXTERN_C SV * Plugin_package(pTHX_ REGEXP * const);
41 EXTERN_C void * Plugin_dupe(pTHX_ REGEXP * const, CLONE_PARAMS *);
46 EXTERN_C const regexp_engine engine_plugin;
49 #define RE_ENGINE_PLUGIN (&engine_plugin)
50 const regexp_engine engine_plugin = {
56 Plugin_numbered_buff_FETCH,
57 Plugin_numbered_buff_STORE,
58 Plugin_numbered_buff_LENGTH,
60 Plugin_named_buff_iter,
62 #if defined(USE_ITHREADS)
67 typedef struct replug {
68 /* Pointer back to the containing regexp struct so that accessors
69 * can modify nparens, gofs etc. */
72 /* A copy of the pattern given to comp, for ->pattern */
75 /* A copy of the string being matched against, for ->str */
86 SV * cb_num_capture_buff_FETCH;
87 SV * cb_num_capture_buff_STORE;
88 SV * cb_num_capture_buff_LENGTH;
89 } *re__engine__Plugin;
91 #if PERL_VERSION >= 11
92 # define rxREGEXP(RX) (SvANY(RX))
93 # define newREGEXP(RX) ((RX) = ((REGEXP*) newSV_type(SVt_REGEXP)))
95 # define rxREGEXP(RX) (RX)
96 # define newREGEXP(RX) (Newxz((RX), 1, struct regexp))