/*
 * call-seq:
 *  xc.io_on_need_out { |flag| }
 *
 * Sets the block that's called when the output socket state changes.
 */
static VALUE
c_io_on_need_out (VALUE self)
{
        RbXmmsClient *xmms = NULL;

        if (!rb_block_given_p ())
                return Qnil;

        Data_Get_Struct (self, RbXmmsClient, xmms);

        CHECK_DELETED (xmms);

        xmms->io_need_out_cb = rb_block_proc ();

        xmmsc_io_need_out_callback_set (xmms->real,
                                        on_io_need_out, (void *) self);

        return Qnil;
}