void qemu_chr_add_handlers(CharDriverState *s,

                           IOCanReadHandler *fd_can_read,

                           IOReadHandler *fd_read,

                           IOEventHandler *fd_event,

                           void *opaque)

{

    if (!opaque) {

        /* chr driver being released. */

        s->assigned = 0;

    }

    s->chr_can_read = fd_can_read;

    s->chr_read = fd_read;

    s->chr_event = fd_event;

    s->handler_opaque = opaque;

    if (s->chr_update_read_handler)

        s->chr_update_read_handler(s);



    /* We're connecting to an already opened device, so let's make sure we

       also get the open event */

    if (s->opened) {

        qemu_chr_generic_open(s);

    }

}

void qemu_chr_add_handlers(CharDriverState *s,

                           IOCanReadHandler *fd_can_read,

                           IOReadHandler *fd_read,

                           IOEventHandler *fd_event,

                           void *opaque)

{

    if (!opaque) {

        

        s->assigned = 0;

    }

    s->chr_can_read = fd_can_read;

    s->chr_read = fd_read;

    s->chr_event = fd_event;

    s->handler_opaque = opaque;

    if (s->chr_update_read_handler)

        s->chr_update_read_handler(s);



    



    if (s->opened) {

        qemu_chr_generic_open(s);

    }

}

        s->assigned = 0;
void FUNC_0(CharDriverState *VAR_0,

                           IOCanReadHandler *VAR_1,

                           IOReadHandler *VAR_2,

                           IOEventHandler *VAR_3,

                           void *VAR_4)

{

    if (!VAR_4) {

        

        VAR_0->assigned = 0;

    }

    VAR_0->chr_can_read = VAR_1;

    VAR_0->chr_read = VAR_2;

    VAR_0->chr_event = VAR_3;

    VAR_0->handler_opaque = VAR_4;

    if (VAR_0->chr_update_read_handler)

        VAR_0->chr_update_read_handler(VAR_0);



    



    if (VAR_0->opened) {

        qemu_chr_generic_open(VAR_0);

    }

}

void FUNC_0(CharDriverState *VAR_0,
IOCanReadHandler *VAR_1,
IOReadHandler *VAR_2,
IOEventHandler *VAR_3,
void *VAR_4)
{ if (!VAR_4) { VAR_0->assigned = 0; } VAR_0->chr_can_read = VAR_1; VAR_0->chr_read = VAR_2; VAR_0->chr_event = VAR_3; VAR_0->handler_opaque = VAR_4; if (VAR_0->chr_update_read_handler)
VAR_0->chr_update_read_handler(VAR_0); if (VAR_0->opened) { qemu_chr_generic_open(VAR_0); } }