#define refkids Perl_refkids
#define regdump Perl_regdump
#define regexec_flags Perl_regexec_flags
+#define reginitcolors Perl_reginitcolors
#define regnext Perl_regnext
#define regprop Perl_regprop
#define repeatcpy Perl_repeatcpy
#define reghopmaybe CPerlObj::Perl_reghopmaybe
#define reginclass CPerlObj::Perl_reginclass
#define reginclassutf8 CPerlObj::Perl_reginclassutf8
+#define reginitcolors CPerlObj::Perl_reginitcolors
#define reginsert CPerlObj::Perl_reginsert
#define regmatch CPerlObj::Perl_regmatch
#define regnext CPerlObj::Perl_regnext
push_scope
ref
refkids
+reginitcolors
regdump
regexec_flags
regnext
#define reginclass pPerl->Perl_reginclass
#undef reginclassutf8
#define reginclassutf8 pPerl->Perl_reginclassutf8
+#undef reginitcolors
+#define reginitcolors pPerl->Perl_reginitcolors
#undef reginsert
#define reginsert pPerl->Perl_reginsert
#undef regmatch
VIRTUAL void do_pmop_dump _((I32 level, PerlIO *file, PMOP *pm));
VIRTUAL void do_sv_dump _((I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim));
VIRTUAL void magic_dump _((MAGIC *mg));
+VIRTUAL void reginitcolors _((void));
# define Perl_pregfree my_regfree
# define Perl_regnext my_regnext
# define Perl_save_re_context my_save_re_context
+# define Perl_reginitcolors my_reginitcolors
#endif
/*SUPPRESS 112*/
return PL_regcomp_rx->data->count - n;
}
+void
+reginitcolors(void)
+{
+ dTHR;
+ int i = 0;
+ char *s = PerlEnv_getenv("PERL_RE_COLORS");
+
+ if (s) {
+ PL_colors[0] = s = savepv(s);
+ while (++i < 6) {
+ s = strchr(s, '\t');
+ if (s) {
+ *s = '\0';
+ PL_colors[i] = ++s;
+ }
+ else
+ PL_colors[i] = "";
+ }
+ } else {
+ while (i < 6)
+ PL_colors[i++] = "";
+ }
+ PL_colorset = 1;
+}
+
/*
- pregcomp - compile a regular expression into internal code
*
PL_regprecomp = savepvn(exp, xend - exp);
DEBUG_r(
- if (!PL_colorset) {
- int i = 0;
- char *s = PerlEnv_getenv("PERL_RE_COLORS");
-
- if (s) {
- PL_colors[0] = s = savepv(s);
- while (++i < 6) {
- s = strchr(s, '\t');
- if (s) {
- *s = '\0';
- PL_colors[i] = ++s;
- }
- else
- PL_colors[i] = "";
- }
- } else {
- while (i < 6)
- PL_colors[i++] = "";
- }
- PL_colorset = 1;
- }
- );
- DEBUG_r(PerlIO_printf(Perl_debug_log, "%sCompiling%s RE `%s%*s%s'\n",
- PL_colors[4],PL_colors[5],PL_colors[0],
- xend - exp, PL_regprecomp, PL_colors[1]));
+ if (!PL_colorset)
+ reginitcolors();
+ PerlIO_printf(Perl_debug_log, "%sCompiling%s RE `%s%*s%s'\n",
+ PL_colors[4],PL_colors[5],PL_colors[0],
+ xend - exp, PL_regprecomp, PL_colors[1]));
PL_regflags = pm->op_pmflags;
PL_regsawback = 0;
# define Perl_regprop my_regprop
/* *These* symbols are masked to allow static link. */
# define Perl_pregexec my_pregexec
+# define Perl_reginitcolors my_reginitcolors
#endif
/*SUPPRESS 112*/
}
DEBUG_r(
+ if (!PL_colorset)
+ reginitcolors();
PerlIO_printf(Perl_debug_log,
"%sMatching%s `%s%.60s%s%s' against `%s%.*s%s%s'\n",
PL_colors[4],PL_colors[5],PL_colors[0],