#define BSET_pv_free(pv) Safefree(pv.xpv_pv)
#define BSET_pregcomp(o, arg) \
((PMOP*)o)->op_pmregexp = arg ? \
- pregcomp(arg, arg + pv.xpv_cur, ((PMOP*)o)) : 0
+ CALLREGCOMP(arg, arg + pv.xpv_cur, ((PMOP*)o)) : 0
#define BSET_newsv(sv, arg) sv = NEWSV(666,0); SvUPGRADE(sv, arg)
#define BSET_newop(o, arg) o = (OP*)safemalloc(optype_size[arg])
#define BSET_newopn(o, arg) STMT_START { \
#define pp_i_negate Perl_pp_i_negate
#define pp_i_subtract Perl_pp_i_subtract
#define pp_index Perl_pp_index
-#define pp_indread Perl_pp_indread
#define pp_int Perl_pp_int
#define pp_interp Perl_pp_interp
#define pp_ioctl Perl_pp_ioctl
sub MY::postamble {
return <<'EOF';
re_comp.c: ../../regcomp.c
- -$(RM) $@
+ -$(RM_F) $@
$(CP) ../../regcomp.c $@
re_exec.c: ../../regexec.c
- -$(RM) $@
+ -$(RM_F) $@
$(CP) ../../regexec.c $@
EOF
pp_i_negate
pp_i_subtract
pp_index
-pp_indread
pp_int
pp_interp
pp_ioctl
PERLVAR(Iregcc, CURCUR *) /* from regexec.c */
-PERLVARI(Iregcompp, regcomp_t, &pregcomp) /* Pointer to RE compiler */
-PERLVARI(Iregexecp, regexec_t, ®exec_flags) /* Pointer to RE executer */
-
+PERLVARI(Iregcompp, regcomp_t, FUNC_NAME_TO_PTR(pregcomp))
+ /* Pointer to RE compiler */
+PERLVARI(Iregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags))
+ /* Pointer to RE executer */
PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */
PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */
p = SvPV(pat, plen);
pm->op_pmflags |= PMf_SKIPWHITE;
}
- pm->op_pmregexp = (*regcompp)(p, p + plen, pm);
+ pm->op_pmregexp = CALLREGCOMP(p, p + plen, pm);
if (strEQ("\\s+", pm->op_pmregexp->precomp))
pm->op_pmflags |= PMf_WHITE;
op_free(expr);
open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
for (@ops) {
+ next if /^i_(pre|post)(inc|dec)$/;
print PP "PPDEF(pp_$_)\n";
}
#define _PERL_OBJECT_THIS ,this
#define PERL_OBJECT_THIS_ this,
#define CALLRUNOPS (this->*runops)
+#define CALLREGCOMP (this->*regcompp)
+#define CALLREGEXEC (this->*regexecp)
#else /* !PERL_OBJECT */
#define _PERL_OBJECT_THIS
#define PERL_OBJECT_THIS_
#define CALLRUNOPS runops
+#define CALLREGCOMP (*regcompp)
+#define CALLREGEXEC (*regexecp)
#endif /* PERL_OBJECT */
#define RsRECORD(sv) (SvROK(sv) && (SvIV(SvRV(sv)) > 0))
/* Enable variables which are pointers to functions */
+#ifdef PERL_OBJECT
+typedef regexp*(CPerlObj::*regcomp_t) _((char* exp, char* xend, PMOP* pm));
+typedef I32 (CPerlObj::*regexec_t) _((regexp* prog, char* stringarg,
+ char* strend, char* strbeg,
+ I32 minend, SV* screamer, void* data,
+ U32 flags));
+#else
typedef regexp*(*regcomp_t) _((char* exp, char* xend, PMOP* pm));
typedef I32 (*regexec_t) _((regexp* prog, char* stringarg, char* strend, char*
strbeg, I32 minend, SV* screamer, void* data,
U32 flags));
+EXT regexp* pregcomp _((char* exp, char* xend, PMOP* pm));
+EXT I32 regexec_flags _((regexp* prog, char* stringarg, char* strend,
+ char* strbeg, I32 minend, SV* screamer,
+ void* data, U32 flags));
+#endif
+
/* Set up PERLVAR macros for populating structs */
#define PERLVAR(var,type) type var;
#define PERLVARI(var,type,init) type var;
else {
maxiters += (strend - s) * rx->nparens;
while (s < strend && --limit &&
- (*regexecp)(rx, s, strend, orig, 1, Nullsv, NULL, 0))
+ CALLREGEXEC(rx, s, strend, orig, 1, Nullsv, NULL, 0))
{
TAINT_IF(RX_MATCH_TAINTED(rx));
if (rx->subbase
}
pm->op_pmflags = pm->op_pmpermflags; /* reset case sensitivity */
- pm->op_pmregexp = (*regcompp)(t, t + len, pm);
+ pm->op_pmregexp = CALLREGCOMP(t, t + len, pm);
}
}
sv_catsv(dstr, POPs);
/* Are we done */
- if (cx->sb_once || !(*regexecp)(rx, s, cx->sb_strend, orig,
+ if (cx->sb_once || !CALLREGEXEC(rx, s, cx->sb_strend, orig,
s == m, Nullsv, NULL,
cx->sb_safebase ? 0 : REXEC_COPY_STR))
{
rx->float_substr = Nullsv;
}
}
- if ((*regexecp)(rx, s, strend, truebase, minmatch,
+ if (CALLREGEXEC(rx, s, strend, truebase, minmatch,
screamer, NULL, safebase))
{
curpm = pm;
/* can do inplace substitution? */
if (c && clen <= rx->minlen && (once || !(safebase & REXEC_COPY_STR))
&& !(rx->reganch & ROPT_LOOKBEHIND_SEEN)) {
- if (!(*regexecp)(rx, s, strend, orig, 0, screamer, NULL, safebase)) {
+ if (!CALLREGEXEC(rx, s, strend, orig, 0, screamer, NULL, safebase)) {
SPAGAIN;
PUSHs(&sv_no);
LEAVE_SCOPE(oldsave);
d += clen;
}
s = rx->endp[0];
- } while ((*regexecp)(rx, s, strend, orig, s == m,
+ } while (CALLREGEXEC(rx, s, strend, orig, s == m,
Nullsv, NULL, 0)); /* don't match same null twice */
if (s != d) {
i = strend - s;
RETURN;
}
- if ((*regexecp)(rx, s, strend, orig, 0, screamer, NULL, safebase)) {
+ if (CALLREGEXEC(rx, s, strend, orig, 0, screamer, NULL, safebase)) {
if (force_on_match) {
force_on_match = 0;
s = SvPV_force(TARG, len);
sv_catpvn(dstr, c, clen);
if (once)
break;
- } while ((*regexecp)(rx, s, strend, orig, s == m, Nullsv, NULL, safebase));
+ } while (CALLREGEXEC(rx, s, strend, orig, s == m, Nullsv, NULL, safebase));
sv_catpvn(dstr, s, strend - s);
(void)SvOOK_off(TARG);
PPDEF(pp_study)
PPDEF(pp_pos)
PPDEF(pp_preinc)
-PPDEF(pp_i_preinc)
PPDEF(pp_predec)
-PPDEF(pp_i_predec)
PPDEF(pp_postinc)
-PPDEF(pp_i_postinc)
PPDEF(pp_postdec)
-PPDEF(pp_i_postdec)
PPDEF(pp_pow)
PPDEF(pp_multiply)
PPDEF(pp_i_multiply)
return result;
}
+#if 0 /* XXX never used! */
PP(pp_indread)
{
last_in_gv = gv_fetchpv(SvPVx(GvSV((GV*)(*stack_sp--)), na), TRUE,SVt_PVIO);
return do_readline();
}
+#endif
PP(pp_rcatline)
{
VIRTUAL OP* prepend_elem _((I32 optype, OP* head, OP* tail));
VIRTUAL void push_return _((OP* o));
VIRTUAL void push_scope _((void));
-VIRTUAL regexp* pregcomp _((char* exp, char* xend, PMOP* pm));
VIRTUAL OP* ref _((OP* o, I32 type));
VIRTUAL OP* refkids _((OP* o, I32 type));
VIRTUAL void regdump _((regexp* r));
VIRTUAL I32 pregexec _((regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, U32 nosave));
-VIRTUAL I32 regexec_flags _((regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags));
VIRTUAL void pregfree _((struct regexp* r));
VIRTUAL regnode* regnext _((regnode* p));
VIRTUAL void regprop _((SV* sv, regnode* o));
int runops_standard _((void));
int runops_debug _((void));
+
+regexp* pregcomp _((char* exp, char* xend, PMOP* pm));
+I32 regexec_flags _((regexp* prog, char* stringarg, char* strend,
+ char* strbeg, I32 minend, SV* screamer,
+ void* data, U32 flags));
+
void check_uni _((void));
void force_next _((I32 type));
char *force_version _((char *start));
PERL95_OBJ = $(PERL95_OBJ) DynaLoadmt$(o)
!ENDIF
-DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B
+DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
ATTRS = $(EXTDIR)\attrs\attrs
THREAD = $(EXTDIR)\Thread\Thread
B = $(EXTDIR)\B\B
+RE = $(EXTDIR)\RE\RE
ERRNO = $(EXTDIR)\Errno\Errno
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
B_DLL = $(AUTODIR)\B\B.dll
+RE_DLL = $(AUTODIR)\re\re.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
$(POSIX).c \
$(ATTRS).c \
$(THREAD).c \
+ $(RE).c \
$(B).c
EXTENSION_DLL = \
!IF "$(OBJECT)" == ""
EXTENSION_DLL = \
$(EXTENSION_DLL)\
- $(THREAD_DLL)
+ $(THREAD_DLL) \
+ $(RE_DLL)
!ENDIF
POD2HTML = $(PODDIR)\pod2html
if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(XCOPY) *.h $(COREDIR)\*.*
+ $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
$(RCOPY) include $(COREDIR)\*.*
$(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
|| $(MAKE) $(MAKEFLAGS) $(CONFIGPM)
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
+$(RE_DLL): $(PERLEXE) $(RE).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
$(B_DLL): $(PERLEXE) $(B).xs
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
-del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
-del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
- -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm
+ -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
-rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
Perl_statusvalue_vms
Perl_archpat_auto
Perl_block_type
-Perl_bostr
Perl_additem
Perl_cast_ulong
Perl_check_uni
Perl_checkcomma
Perl_chsize
Perl_ck_aelem
-Perl_colors
-Perl_colorset
Perl_cryptseen
Perl_cx_dump
Perl_DBcv
Perl_dump_pm
Perl_dump_sub
Perl_expectterm
-Perl_extralen
Perl_fetch_gv
Perl_fetch_io
Perl_force_ident
Perl_q
Perl_rcsid
Perl_reall_srchlen
-Perl_reg_eval_set
-Perl_reg_flags
-Perl_reg_start_tmp
-Perl_reg_start_tmpl
-Perl_regbol
-Perl_regcc
-Perl_regcode
-Perl_regdata
-Perl_regdummy
-Perl_regdump
-Perl_regfold
-Perl_regendp
-Perl_regeol
-Perl_regflags
-Perl_regindent
-Perl_reginput
-Perl_reglastparen
-Perl_regmyendp
-Perl_regmyp_size
-Perl_regmystartp
-Perl_regnarrate
-Perl_regnaughty
-Perl_regnpar
-Perl_regcomp_parse
-Perl_regprecomp
-Perl_regprev
-Perl_regprogram
-Perl_regprop
-Perl_regsawback
-Perl_regseen
-Perl_regsize
-Perl_regstartp
-Perl_regtill
-Perl_regxend
-Perl_regcomp_rx
Perl_same_dirent
Perl_saw_return
Perl_scan_const
Perl_scan_subst
Perl_scan_trans
Perl_scan_word
-Perl_seen_zerolen
Perl_setenv_getix
Perl_skipspace
Perl_sort_mutex
PERL95_OBJ += DynaLoadmt$(o)
.ENDIF
-DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B
+DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
ATTRS = $(EXTDIR)\attrs\attrs
THREAD = $(EXTDIR)\Thread\Thread
B = $(EXTDIR)\B\B
+RE = $(EXTDIR)\re\re
ERRNO = $(EXTDIR)\Errno\Errno
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
B_DLL = $(AUTODIR)\B\B.dll
+RE_DLL = $(AUTODIR)\re\re.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
$(POSIX).c \
$(ATTRS).c \
$(THREAD).c \
+ $(RE).c \
$(B).c
EXTENSION_DLL = \
EXTENSION_PM = \
$(ERRNO_PM)
+# re.dll doesn't build with PERL_OBJECT yet
.IF "$(OBJECT)" == ""
EXTENSION_DLL += \
- $(THREAD_DLL)
+ $(THREAD_DLL) \
+ $(RE_DLL)
.ENDIF
POD2HTML = $(PODDIR)\pod2html
if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(XCOPY) *.h $(COREDIR)\*.*
+ $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
$(RCOPY) include $(COREDIR)\*.*
$(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
|| $(MAKE) $(MAKEMACROS) $(CONFIGPM)
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
+$(RE_DLL): $(PERLEXE) $(RE).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
$(B_DLL): $(PERLEXE) $(B).xs
cd $(EXTDIR)\$(*B) && \
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
-del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
-del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
- -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm
+ -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
-rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B