Exemplo n.º 1
0
void
blizkost_call_in(BLIZKOST_NEXUS, SV *what, U32 mode, PMC *positp, PMC *namedp,
        PMC **retp) {
    dBNPERL; dBNINTERP;
    int num_returns, i;

    {
        /* Set up the stack. */
        dSP;
        ENTER;
        SAVETMPS;
        PUSHMARK(SP);

        PUTBACK;
        blizkost_slurpy_to_stack(nexus, positp, namedp);

        /* Invoke the methods. */
        num_returns = call_sv(what, mode);
        SPAGAIN;

        /* Build the results PMC array. */
        *retp = pmc_new(interp, enum_class_ResizablePMCArray);
        for (i = 0; i < num_returns; i++) {
            SV *result_sv = POPs;
            PMC *result_pmc = blizkost_wrap_sv(nexus, result_sv);
            VTABLE_unshift_pmc(interp, *retp, result_pmc);
        }
        PUTBACK;
        FREETMPS;
        LEAVE;
    }
}
Exemplo n.º 2
0
Arquivo: pcc.c Projeto: mpeters/parrot
static void
Parrot_pcc_add_invocant(PARROT_INTERP, ARGIN(PMC *call_obj), ARGIN(PMC *pmc))
{
    ASSERT_ARGS(Parrot_pcc_add_invocant)
    PMC *arg_flags;
    GETATTR_CallContext_arg_flags(interp, call_obj, arg_flags);

    VTABLE_unshift_integer(interp, arg_flags,
          PARROT_ARG_PMC | PARROT_ARG_INVOCANT);
          VTABLE_unshift_pmc(interp, call_obj, pmc);
}