Amb

 view release on metacpan or  search on metacpan

Amb.xs  view on Meta::CPAN

    CV *cur_cv;

    if (cx->cx_type != CXt_SUB)
        croak("cx_type is %d not CXt_SUB\n", cx->cx_type);

    cur_cv = cx->blk_sub.cv;
    if (!cur_cv)
        croak("Context has no CV!\n");

    RETVAL = (SV*) newRV_inc( (SV*) cur_cv );
  OUTPUT:
    RETVAL


SV*
caller_op(context)
SV* context;
  CODE:
    /* stolen from Devel::Caller */
    PERL_CONTEXT *cx = INT2PTR(PERL_CONTEXT*, SvIV(context));
    OP *op = (OP*)cx->blk_oldcop;
    SV *rv = newSV(0);
    sv_setref_iv(rv, "B::COP", PTR2IV(op));
    RETVAL = rv;
  OUTPUT:
    RETVAL



( run in 0.352 second using v1.01-cache-2.11-cpan-4e96b696675 )