- return PTR2IV(NULL);
-}
-#endif /* REP_WORKAROUND_REQUIRE_PROPAGATION */
-
-STATIC SV *rep_tag(pTHX_ SV *comp, SV *exec) {
-#define rep_tag(C, E) rep_tag(aTHX_ (C), (E))
- rep_hint_t *h;
- dMY_CXT;
-
- h = PerlMemShared_malloc(sizeof *h);
- h->comp = rep_validate_callback(comp);
- h->exec = rep_validate_callback(exec);
-#if REP_WORKAROUND_REQUIRE_PROPAGATION
- h->cxreq = rep_require_tag();
-#endif /* REP_WORKAROUND_REQUIRE_PROPAGATION */
-
-#if REP_THREADSAFE
- /* We only need for the key to be an unique tag for looking up the value later.
- * Allocated memory provides convenient unique identifiers, so that's why we
- * use the hint as the key itself. */
- ptable_store(MY_CXT.tbl, h, h);
-#endif /* REP_THREADSAFE */
-
- return newSViv(PTR2IV(h));
-}
+#if XSH_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 XSH_HAS_PERL(5, 11, 0)
+EXTERN_C REGEXP * Plugin_comp(pTHX_ SV * const, U32);
+#else
+EXTERN_C REGEXP * Plugin_comp(pTHX_ const SV * const, const U32);
+#endif
+EXTERN_C I32 Plugin_exec(pTHX_ REGEXP * const, char *, char *,
+ char *, REP_ENG_EXEC_MINEND_TYPE, SV *, void *, U32);
+#if XSH_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 *);
+EXTERN_C void Plugin_numbered_buff_FETCH(pTHX_ REGEXP * const,
+ const I32, SV * const);
+EXTERN_C void Plugin_numbered_buff_STORE(pTHX_ REGEXP * const,
+ const I32, SV const * const);
+EXTERN_C I32 Plugin_numbered_buff_LENGTH(pTHX_ REGEXP * const,
+ const SV * const, const I32);
+EXTERN_C SV * Plugin_named_buff(pTHX_ REGEXP * const, SV * const,
+ SV * const, const U32);
+EXTERN_C SV * Plugin_named_buff_iter(pTHX_ REGEXP * const, const SV * const,
+ const U32);
+EXTERN_C SV * Plugin_package(pTHX_ REGEXP * const);
+#ifdef USE_ITHREADS
+EXTERN_C void * Plugin_dupe(pTHX_ REGEXP * const, CLONE_PARAMS *);
+#endif