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) {
32 char buf[sizeof(void*)*2+1];
34 svp = hv_fetch(sols_map, buf, sprintf(buf, "%"UVxf, PTR2UV(PL_op)), 0);
45 items = call_sv(cb, G_ARRAY);
48 for (i = 0; i < items; ++i)
58 /* --- XS ------------------------------------------------------------------ */
60 MODULE = Sub::Op::LexicalSub PACKAGE = Sub::Op::LexicalSub
70 _init(SV *name, SV *cb)
77 if (SvTYPE(cb) >= SVt_PVCV) {
78 c.name = SvPV_const(name, c.len);
80 c.ud = SvREFCNT_inc(cb);
82 sub_op_register(aTHX_ &c);