/* --- Custom regexp engine ------------------------------------------------ */
-#define GET_SELF_FROM_PPRIVATE(pprivate) \
- re__engine__Plugin self; \
- SELF_FROM_PPRIVATE(self,pprivate);
-
/* re__engine__Plugin self; SELF_FROM_PPRIVATE(self,rx->pprivate) */
#define SELF_FROM_PPRIVATE(self, pprivate) \
if (sv_isobject(pprivate)) { \
char *strbeg, REP_ENG_EXEC_MINEND_TYPE minend,
SV *sv, void *data, U32 flags)
{
- dSP;
+ struct regexp *rx;
+ re__engine__Plugin self;
I32 matched;
- struct regexp *rx = rxREGEXP(RX);
- GET_SELF_FROM_PPRIVATE(rx->pprivate);
+ rx = rxREGEXP(RX);
+ SELF_FROM_PPRIVATE(self, rx->pprivate);
if (self->cb_exec) {
SV *ret;
+ dSP;
/* Store the current str for ->str */
SvREFCNT_dec(self->str);
Plugin_numbered_buff_FETCH(pTHX_ REGEXP * const RX, const I32 paren,
SV * const sv)
{
- dSP;
- I32 items;
+ struct regexp *rx;
+ re__engine__Plugin self;
SV *callback;
- struct regexp *rx = rxREGEXP(RX);
- GET_SELF_FROM_PPRIVATE(rx->pprivate);
+ rx = rxREGEXP(RX);
+ SELF_FROM_PPRIVATE(self, rx->pprivate);
callback = self->cb_num_capture_buff_FETCH;
if (callback) {
+ I32 items;
+ dSP;
+
ENTER;
SAVETMPS;
Plugin_numbered_buff_STORE(pTHX_ REGEXP * const RX, const I32 paren,
SV const * const value)
{
- dSP;
+ struct regexp *rx;
+ re__engine__Plugin self;
SV *callback;
- struct regexp *rx = rxREGEXP(RX);
- GET_SELF_FROM_PPRIVATE(rx->pprivate);
+ rx = rxREGEXP(RX);
+ SELF_FROM_PPRIVATE(self, rx->pprivate);
callback = self->cb_num_capture_buff_STORE;
if (callback) {
+ dSP;
+
ENTER;
SAVETMPS;
Plugin_numbered_buff_LENGTH(pTHX_ REGEXP * const RX, const SV * const sv,
const I32 paren)
{
- dSP;
+ struct regexp *rx;
+ re__engine__Plugin self;
SV *callback;
- struct regexp *rx = rxREGEXP(RX);
- GET_SELF_FROM_PPRIVATE(rx->pprivate);
+ rx = rxREGEXP(RX);
+ SELF_FROM_PPRIVATE(self, rx->pprivate);
callback = self->cb_num_capture_buff_LENGTH;
if (callback) {
IV ret;
+ dSP;
ENTER;
SAVETMPS;