START_EXTERN_C
-extern regexp* my_regcomp (pTHX_ char* exp, char* xend, PMOP* pm);
-extern regexp* my_re_compile(pTHX_ char *exp, char *xend, PMOP *pm);
+extern regexp* my_re_compile (pTHX_ char* exp, char* xend, PMOP* pm);
extern I32 my_regexec (pTHX_ regexp* prog, char* stringarg, char* strend,
char* strbeg, I32 minend, SV* screamer,
void* data, U32 flags);
END_EXTERN_C
const struct regexp_engine my_reg_engine = {
- my_regcomp,
- my_re_compile,
+ my_re_compile,
my_regexec,
my_re_intuit_start,
my_re_intuit_string,
#define Perl_regdump my_regdump
#define Perl_regprop my_regprop
#define Perl_re_intuit_start my_re_intuit_start
-#define Perl_pregcomp my_regcomp
#define Perl_re_compile my_re_compile
#define Perl_regfree_internal my_regfree
#define Perl_re_intuit_string my_re_intuit_string
extern const struct regexp_engine my_reg_engine;
#define RE_ENGINE_PTR &my_reg_engine
#endif
-
+
+#ifndef PERL_IN_XSUB_RE
regexp *
Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
{
dVAR;
- GET_RE_DEBUG_FLAGS_DECL;
- DEBUG_r(if (!PL_colorset) reginitcolors());
-#ifndef PERL_IN_XSUB_RE
- {
+ HV * const table = GvHV(PL_hintgv);
/* Dispatch a request to compile a regexp to correct
regexp engine. */
- HV * const table = GvHV(PL_hintgv);
if (table) {
SV **ptr= hv_fetchs(table, "regcomp", FALSE);
+ GET_RE_DEBUG_FLAGS_DECL;
if (ptr && SvIOK(*ptr) && SvIV(*ptr)) {
const regexp_engine *eng=INT2PTR(regexp_engine*,SvIV(*ptr));
DEBUG_COMPILE_r({
return CALLREGCOMP_ENG(eng, exp, xend, pm);
}
}
- }
-#endif
return Perl_re_compile(aTHX_ exp, xend, pm);
}
+#endif
regexp *
Perl_re_compile(pTHX_ char *exp, char *xend, PMOP *pm)
RExC_state_t copyRExC_state;
#endif
GET_RE_DEBUG_FLAGS_DECL;
+ DEBUG_r(if (!PL_colorset) reginitcolors());
+
if (exp == NULL)
FAIL("NULL regexp argument");
* special test to reverse the sign of BACK pointers since the offset is
* stored negative.]
*/
+typedef struct regexp_internal {
+ regexp_paren_ofs *swap; /* Swap copy of *startp / *endp */
+ U32 *offsets; /* offset annotations 20001228 MJD
+ data about mapping the program to the
+ string*/
+ regnode *regstclass; /* Optional startclass as identified or constructed
+ by the optimiser */
+ struct reg_data *data; /* Additional miscellaneous data used by the program.
+ Used to make it easier to clone and free arbitrary
+ data that the regops need. Often the ARG field of
+ a regop is an index into this structure */
+ regnode program[1]; /* Unwarranted chumminess with compiler. */
+} regexp_internal;
+
+#define RXi_SET(x,y) (x)->pprivate = (void*)(y)
+#define RXi_GET(x) ((regexp_internal *)((x)->pprivate))
+#define RXi_GET_DECL(r,ri) regexp_internal *ri = RXi_GET(r)
struct regnode_string {
U8 str_len;
EXTCONST regexp_engine PL_core_reg_engine;
#else /* DOINIT */
EXTCONST regexp_engine PL_core_reg_engine = {
- Perl_pregcomp,
Perl_re_compile,
Perl_regexec_flags,
Perl_re_intuit_start,
} regexp;
-typedef struct regexp_internal {
- regexp_paren_ofs *swap; /* Swap copy of *startp / *endp */
- U32 *offsets; /* offset annotations 20001228 MJD
- data about mapping the program to the
- string*/
- regnode *regstclass; /* Optional startclass as identified or constructed
- by the optimiser */
- struct reg_data *data; /* Additional miscellaneous data used by the program.
- Used to make it easier to clone and free arbitrary
- data that the regops need. Often the ARG field of
- a regop is an index into this structure */
- regnode program[1]; /* Unwarranted chumminess with compiler. */
-} regexp_internal;
-
-#define RXi_SET(x,y) (x)->pprivate = (void*)(y)
-#define RXi_GET(x) ((regexp_internal *)((x)->pprivate))
-#define RXi_GET_DECL(r,ri) regexp_internal *ri = RXi_GET(r)
-
typedef struct re_scream_pos_data_s
{
char **scream_olds; /* match pos */
typedef struct regexp_engine {
regexp* (*comp) (pTHX_ char* exp, char* xend, PMOP* pm);
- regexp* (*compile) (pTHX_ char *exp, char *xend, PMOP *pm);
I32 (*exec) (pTHX_ regexp* prog, char* stringarg, char* strend,
char* strbeg, I32 minend, SV* screamer,
void* data, U32 flags);