1*0Sstevel@tonic-gate #include <EXTERN.h>
2*0Sstevel@tonic-gate #include <perl.h>
3*0Sstevel@tonic-gate #include <XSUB.h>
4*0Sstevel@tonic-gate
5*0Sstevel@tonic-gate int
my_runops(pTHX)6*0Sstevel@tonic-gate my_runops(pTHX)
7*0Sstevel@tonic-gate {
8*0Sstevel@tonic-gate HV* regexp_hv = get_hv( "B::C::REGEXP", 0 );
9*0Sstevel@tonic-gate SV* key = newSViv( 0 );
10*0Sstevel@tonic-gate
11*0Sstevel@tonic-gate do {
12*0Sstevel@tonic-gate PERL_ASYNC_CHECK();
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gate if( PL_op->op_type == OP_QR ) {
15*0Sstevel@tonic-gate PMOP* op;
16*0Sstevel@tonic-gate REGEXP* rx = PM_GETRE( (PMOP*)PL_op );
17*0Sstevel@tonic-gate SV* rv = newSViv( 0 );
18*0Sstevel@tonic-gate
19*0Sstevel@tonic-gate New( 671, op, 1, PMOP );
20*0Sstevel@tonic-gate Copy( PL_op, op, 1, PMOP );
21*0Sstevel@tonic-gate /* we need just the flags */
22*0Sstevel@tonic-gate op->op_next = NULL;
23*0Sstevel@tonic-gate op->op_sibling = NULL;
24*0Sstevel@tonic-gate op->op_first = NULL;
25*0Sstevel@tonic-gate op->op_last = NULL;
26*0Sstevel@tonic-gate op->op_pmreplroot = NULL;
27*0Sstevel@tonic-gate op->op_pmreplstart = NULL;
28*0Sstevel@tonic-gate op->op_pmnext = NULL;
29*0Sstevel@tonic-gate #ifdef USE_ITHREADS
30*0Sstevel@tonic-gate op->op_pmoffset = 0;
31*0Sstevel@tonic-gate #else
32*0Sstevel@tonic-gate op->op_pmregexp = 0;
33*0Sstevel@tonic-gate #endif
34*0Sstevel@tonic-gate
35*0Sstevel@tonic-gate sv_setiv( key, PTR2IV( rx ) );
36*0Sstevel@tonic-gate sv_setref_iv( rv, "B::PMOP", PTR2IV( op ) );
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate hv_store_ent( regexp_hv, key, rv, 0 );
39*0Sstevel@tonic-gate }
40*0Sstevel@tonic-gate } while ((PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX)));
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gate SvREFCNT_dec( key );
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gate TAINT_NOT;
45*0Sstevel@tonic-gate return 0;
46*0Sstevel@tonic-gate }
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gate MODULE=B__C PACKAGE=B::C
49*0Sstevel@tonic-gate
50*0Sstevel@tonic-gate PROTOTYPES: DISABLE
51*0Sstevel@tonic-gate
52*0Sstevel@tonic-gate BOOT:
53*0Sstevel@tonic-gate PL_runops = my_runops;
54