static void modify_event_perl(PLCBA_t *async,
                              PLCBA_c_event *cevent,
                              PLCBA_evaction_t action,
                              short flags)
{
    SV **tmpsv;

    tmpsv = av_fetch(cevent->pl_event, PLCBA_EVIDX_FD, 1);
    if (SvIOK(*tmpsv)) {
        if (SvIV(*tmpsv) != cevent->fd) {
            /*file descriptor mismatch!*/
            av_delete(cevent->pl_event, PLCBA_EVIDX_DUPFH, G_DISCARD);
        }

    } else {
        sv_setiv(*tmpsv, cevent->fd);
    }
    
    plcb_call_sv_with_args_noret(async->cv_evmod,
                                 1,
                                 3,
                                 newRV_inc( (SV*)(cevent->pl_event)),
                                 newSViv(action),
                                 newSViv(flags));
    
    /*set the current flags*/
    if (action != PLCBA_EVACTION_SUSPEND && action != PLCBA_EVACTION_RESUME) {
        sv_setiv( *(av_fetch(cevent->pl_event, PLCBA_EVIDX_WATCHFLAGS, 1)),
                 flags);
    }
    
    /*set the current state*/
    sv_setiv( *(av_fetch(cevent->pl_event, PLCBA_EVIDX_STATEFLAGS, 1)),
             cevent->state);
}
Ejemplo n.º 2
0
void *swiftperl_av_delete(void *vp, int key) {
    return (void *)av_delete((AV *)vp, key, 0);
}
Ejemplo n.º 3
0
void p5_av_delete(PerlInterpreter *my_perl, AV *av, I32 key) {
    PERL_SET_CONTEXT(my_perl);
    av_delete(av, key, G_DISCARD);
}