/*
 * call-seq:
 *  Xmms::Client.new(name) -> xc
 *
 * Creates an Xmms::Client object.
 */
static VALUE
c_init (VALUE self, VALUE name)
{
        RbXmmsClient *xmms = NULL;

        Data_Get_Struct (self, RbXmmsClient, xmms);

        if (!(xmms->real = xmmsc_init (StringValuePtr (name)))) {
                rb_raise (rb_eNoMemError, "failed to allocate memory");
                return Qnil;
        }

        xmms->deleted = false;
        xmms->result_callbacks = rb_ary_new ();
        xmms->disconnect_cb = Qnil;
        xmms->io_need_out_cb = Qnil;

        return self;
}