]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - Plugin.h
Remove trailing whitespace
[perl/modules/re-engine-Plugin.git] / Plugin.h
index 1f354d558632d4e15d062bda6edd1a2cf985be8b..aad712e62a421ac2660d2f4a7cbbb6369ae031e8 100644 (file)
--- a/Plugin.h
+++ b/Plugin.h
@@ -1,27 +1,31 @@
-
 #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)) {                             \
+    if (sv_isobject(pprivate)) {                             \
         SV * ref = SvRV((SV*)pprivate);                      \
-           IV tmp = SvIV((SV*)ref);                             \
-           self = INT2PTR(re__engine__Plugin,tmp);              \
+        IV tmp = SvIV((SV*)ref);                             \
+        self = INT2PTR(re__engine__Plugin,tmp);              \
     } else {                                                 \
         Perl_croak(aTHX_ "Not an object");                   \
     }
 
 START_EXTERN_C
 EXTERN_C const regexp_engine engine_plugin;
-EXTERN_C REGEXP * Plugin_comp(pTHX_ const SV const *, const U32);
+#if PERL_VERSION <= 10
+EXTERN_C REGEXP * Plugin_comp(pTHX_ const SV * const, const U32);
+#else
+EXTERN_C REGEXP * Plugin_comp(pTHX_ SV * const, U32);
+#endif
 EXTERN_C I32      Plugin_exec(pTHX_ REGEXP * const, char *, char *,
                               char *, I32, SV *, void *, U32);
 EXTERN_C char *   Plugin_intuit(pTHX_ REGEXP * const, SV *, char *,
                                 char *, U32, re_scream_pos_data *);
 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 *);
 EXTERN_C void     Plugin_numbered_buff_FETCH(pTHX_ REGEXP * const,
                                              const I32, SV * const);
 EXTERN_C void     Plugin_numbered_buff_STORE(pTHX_ REGEXP * const,
@@ -55,15 +59,15 @@ const regexp_engine engine_plugin = {
     Plugin_named_buff,
     Plugin_named_buff_iter,
     Plugin_package,
-#if defined(USE_ITHREADS)        
+#if defined(USE_ITHREADS)
     Plugin_dupe,
 #endif
 };
 
 typedef struct replug {
-    /* Pointer back to the containing REGEXP struct so that accessors
+    /* Pointer back to the containing regexp struct so that accessors
      * can modify nparens, gofs etc. */
-    REGEXP * rx;
+    struct regexp * rx;
 
     /* A copy of the pattern given to comp, for ->pattern */
     SV * pattern;
@@ -74,10 +78,8 @@ typedef struct replug {
     /* The ->stash */
     SV * stash;
 
-    /*
-     * Callbacks
-     */
-
+    /* Callbacks */
+    SV * cb_exec;
     SV * cb_free;
 
     /* ->num_captures */
@@ -85,3 +87,11 @@ typedef struct replug {
     SV * cb_num_capture_buff_STORE;
     SV * cb_num_capture_buff_LENGTH;
 } *re__engine__Plugin;
+
+#if PERL_VERSION >= 11
+# define rxREGEXP(RX)  (SvANY(RX))
+# define newREGEXP(RX) ((RX) = ((REGEXP*) newSV_type(SVt_REGEXP)))
+#else
+# define rxREGEXP(RX)  (RX)
+# define newREGEXP(RX) (Newxz((RX), 1, struct regexp))
+#endif