amagic_generation perlstring
walkoptree_slow walkoptree walkoptree_exec walksymtable
parents comppadlist sv_undef compile_stats timing_info
- begin_av init_av check_av end_av regex_padav);
+ begin_av init_av check_av end_av regex_padav dowarn
+ defstash curstash warnhook diehook inc_gv
+ );
sub OPf_KIDS ();
use strict;
@B::SVOP::ISA = 'B::OP';
@B::PADOP::ISA = 'B::OP';
@B::PVOP::ISA = 'B::OP';
-@B::CVOP::ISA = 'B::OP';
@B::LOOP::ISA = 'B::LISTOP';
@B::PMOP::ISA = 'B::LISTOP';
@B::COP::ISA = 'B::OP';
=head2 OP-RELATED CLASSES
C<B::OP>, C<B::UNOP>, C<B::BINOP>, C<B::LOGOP>, C<B::LISTOP>, C<B::PMOP>,
-C<B::SVOP>, C<B::PADOP>, C<B::PVOP>, C<B::CVOP>, C<B::LOOP>, C<B::COP>.
+C<B::SVOP>, C<B::PADOP>, C<B::PVOP>, C<B::LOOP>, C<B::COP>.
These classes correspond in the obvious way to the underlying C
structures of similar names. The inheritance hierarchy mimics the
B::OP
|
- +---------------+--------+--------+------+
- | | | | |
- B::UNOP B::SVOP B::PADOP B::CVOP B::COP
+ +---------------+--------+--------+
+ | | | |
+ B::UNOP B::SVOP B::PADOP B::COP
,' `-.
/ `--.
B::BINOP B::LOGOP
=item precomp
-=item pmoffet
+=item pmoffset
Only when perl was compiled with ithreads.
OPc_SVOP, /* 7 */
OPc_PADOP, /* 8 */
OPc_PVOP, /* 9 */
- OPc_CVOP, /* 10 */
- OPc_LOOP, /* 11 */
- OPc_COP /* 12 */
+ OPc_LOOP, /* 10 */
+ OPc_COP /* 11 */
} opclass;
static char *opclassnames[] = {
"B::SVOP",
"B::PADOP",
"B::PVOP",
- "B::CVOP",
"B::LOOP",
"B::COP"
};
+static size_t opsizes[] = {
+ 0,
+ sizeof(OP),
+ sizeof(UNOP),
+ sizeof(BINOP),
+ sizeof(LOGOP),
+ sizeof(LISTOP),
+ sizeof(PMOP),
+ sizeof(SVOP),
+ sizeof(PADOP),
+ sizeof(PVOP),
+ sizeof(LOOP),
+ sizeof(COP)
+};
+
#define MY_CXT_KEY "B::_guts" XS_VERSION
typedef struct {
#define B_main_cv() PL_main_cv
#define B_init_av() PL_initav
+#define B_inc_gv() PL_incgv
#define B_check_av() PL_checkav_save
#define B_begin_av() PL_beginav_save
#define B_end_av() PL_endav
#define B_main_root() PL_main_root
#define B_main_start() PL_main_start
#define B_amagic_generation() PL_amagic_generation
+#define B_defstash() PL_defstash
+#define B_curstash() PL_curstash
+#define B_dowarn() PL_dowarn
#define B_comppadlist() (PL_main_cv ? CvPADLIST(PL_main_cv) : CvPADLIST(PL_compcv))
#define B_sv_undef() &PL_sv_undef
#define B_sv_yes() &PL_sv_yes
B::AV
B_end_av()
+B::GV
+B_inc_gv()
+
#ifdef USE_ITHREADS
B::AV
B::SV
B_sv_no()
-MODULE = B PACKAGE = B
+B::HV
+B_curstash()
+
+B::HV
+B_defstash()
+U8
+B_dowarn()
+
+void
+B_warnhook()
+ CODE:
+ ST(0) = make_sv_object(aTHX_ sv_newmortal(), PL_warnhook);
+
+void
+B_diehook()
+ CODE:
+ ST(0) = make_sv_object(aTHX_ sv_newmortal(), PL_diehook);
+
+MODULE = B PACKAGE = B
void
walkoptree(opsv, method)
MODULE = B PACKAGE = B::OP PREFIX = OP_
+size_t
+OP_size(o)
+ B::OP o
+ CODE:
+ RETVAL = opsizes[cc_opclass(aTHX_ o)];
+ OUTPUT:
+ RETVAL
+
B::OP
OP_next(o)
B::OP o
#define PMOP_pmregexp(o) PM_GETRE(o)
#ifdef USE_ITHREADS
#define PMOP_pmoffset(o) o->op_pmoffset
+#define PMOP_pmstashpv(o) o->op_pmstashpv
+#else
+#define PMOP_pmstash(o) o->op_pmstash
#endif
#define PMOP_pmflags(o) o->op_pmflags
#define PMOP_pmpermflags(o) o->op_pmpermflags
PMOP_pmoffset(o)
B::PMOP o
+char*
+PMOP_pmstashpv(o)
+ B::PMOP o
+
+#else
+
+B::HV
+PMOP_pmstash(o)
+ B::PMOP o
+
#endif
U32
COP_io(o)
B::COP o
+MODULE = B PACKAGE = B::SV
+
+U32
+SvTYPE(sv)
+ B::SV sv
+
MODULE = B PACKAGE = B::SV PREFIX = Sv
U32
SvFLAGS(sv)
B::SV sv
+U32
+SvPOK(sv)
+ B::SV sv
+
+U32
+SvROK(sv)
+ B::SV sv
+
+U32
+SvMAGICAL(sv)
+ B::SV sv
+
MODULE = B PACKAGE = B::IV PREFIX = Sv
IV
sv_setpvn(ST(0), NULL, 0);
}
+void
+SvPVBM(sv)
+ B::PV sv
+ CODE:
+ ST(0) = sv_newmortal();
+ sv_setpvn(ST(0), SvPVX(sv),
+ SvCUR(sv) + (SvTYPE(sv) == SVt_PVBM ? 257 : 0));
+
+
STRLEN
SvLEN(sv)
B::PV sv
B::SV
MgOBJ(mg)
B::MAGIC mg
- CODE:
- if( mg->mg_type != 'r' ) {
- RETVAL = MgOBJ(mg);
- }
- else {
- croak( "OBJ is not meaningful on r-magic" );
- }
- OUTPUT:
- RETVAL
IV
MgREGEX(mg)
if (mg->mg_ptr){
if (mg->mg_len >= 0){
sv_setpvn(ST(0), mg->mg_ptr, mg->mg_len);
- } else {
- if (mg->mg_len == HEf_SVKEY)
- sv_setsv(ST(0),newRV((SV*)mg->mg_ptr));
+ } else if (mg->mg_len == HEf_SVKEY) {
+ ST(0) = make_sv_object(aTHX_
+ sv_newmortal(), (SV*)mg->mg_ptr);
}
}
OUTPUT:
RETVAL
+void*
+GvGP(gv)
+ B::GV gv
+
B::HV
GvSTASH(gv)
B::GV gv
MODULE = B PACKAGE = B::CV PREFIX = Cv
+U32
+CvCONST(cv)
+ B::CV cv
+
B::HV
CvSTASH(cv)
B::CV cv
B::CV cv
CODE:
ST(0) = CvCONST(cv) ?
- make_sv_object(aTHX_ sv_newmortal(),CvXSUBANY(cv).any_ptr) :
- sv_2mortal(newSViv(CvXSUBANY(cv).any_iv));
+ make_sv_object(aTHX_ sv_newmortal(),CvXSUBANY(cv).any_ptr) :
+ sv_2mortal(newSViv(CvXSUBANY(cv).any_iv));
MODULE = B PACKAGE = B::CV