/*
 * call-seq:
 *  xc.on_disconnect { } -> self
 *
 * Sets the block that's executed when _xc_ is disconnected from the
 * XMMS2 daemon.
 */
static VALUE
c_on_disconnect (VALUE self)
{
        RbXmmsClient *xmms = NULL;

        if (!rb_block_given_p ())
                return Qnil;

        Data_Get_Struct (self, RbXmmsClient, xmms);

        CHECK_DELETED (xmms);

        xmms->disconnect_cb = rb_block_proc ();

        xmmsc_disconnect_callback_set (xmms->real,
                                       on_disconnect, (void *) self);

        return self;
}