]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - Plugin.xs
Introduce ->callbacks to specify the 'exec' callback individually
[perl/modules/re-engine-Plugin.git] / Plugin.xs
index c5e9ebd465648482d86e78dfdc9721861af6c46e..3abd900c12e2a74beaa3d6795028307c44fe0160 100644 (file)
--- a/Plugin.xs
+++ b/Plugin.xs
@@ -768,10 +768,20 @@ PPCODE:
         }
     }
 
+void
+_exec(re::engine::Plugin self, ...)
+PPCODE:
+    if (items > 1) {
+        SvREFCNT_dec(self->cb_exec);
+        self->cb_exec = ST(1);
+        SvREFCNT_inc(self->cb_exec);
+    }
+
 void
 _num_capture_buff_FETCH(re::engine::Plugin self, ...)
 PPCODE:
     if (items > 1) {
+        SvREFCNT_dec(self->cb_num_capture_buff_FETCH);
         self->cb_num_capture_buff_FETCH = ST(1);
         SvREFCNT_inc(self->cb_num_capture_buff_FETCH);
     }
@@ -780,6 +790,7 @@ void
 _num_capture_buff_STORE(re::engine::Plugin self, ...)
 PPCODE:
     if (items > 1) {
+        SvREFCNT_dec(self->cb_num_capture_buff_STORE);
         self->cb_num_capture_buff_STORE = ST(1);
         SvREFCNT_inc(self->cb_num_capture_buff_STORE);
     }
@@ -788,6 +799,7 @@ void
 _num_capture_buff_LENGTH(re::engine::Plugin self, ...)
 PPCODE:
     if (items > 1) {
+        SvREFCNT_dec(self->cb_num_capture_buff_LENGTH);
         self->cb_num_capture_buff_LENGTH = ST(1);
         SvREFCNT_inc(self->cb_num_capture_buff_LENGTH);
     }