1 /* This file is part of the Sub::Op Perl module.
2 * See http://search.cpan.org/dist/Sub-Op/ */
4 #define PERL_NO_GET_CONTEXT
9 #define __PACKAGE__ "Sub::Op::LexicalSub"
10 #define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1)
14 STATIC HV *sols_map = NULL;
16 STATIC OP *sols_check(pTHX_ OP *o, void *ud_) {
17 char buf[sizeof(void*)*2+1];
20 (void) hv_store(sols_map, buf, sprintf(buf, "%"UVxf, PTR2UV(o)), cb, 0);
25 STATIC OP *sols_pp(pTHX) {
31 char buf[sizeof(void*)*2+1];
33 svp = hv_fetch(sols_map, buf, sprintf(buf, "%"UVxf, PTR2UV(PL_op)), 0);
42 return CALL_FPTR(PL_ppaddr[OP_ENTERSUB])(aTHX);
45 /* --- XS ------------------------------------------------------------------ */
47 MODULE = Sub::Op::LexicalSub PACKAGE = Sub::Op::LexicalSub
57 _init(SV *name, SV *cb)
64 if (SvTYPE(cb) >= SVt_PVCV) {
66 c.name = SvPV_const(name, c.namelen);
67 if (SvPOK(cb)) { /* Sub is prototyped */
68 c.proto = SvPV_const(cb, c.protolen);
71 c.ud = SvREFCNT_inc(cb);
73 sub_op_register(aTHX_ &c, 0);