/*
 * call-seq:
 *  xc.medialib_entry_property_remove(id, key, *source) -> result
 *
 * Remove a custom field in the medialib associated with the entry _id_.
 * _source_ is an optional argument that describes where to write the
 * mediainfo. If _source_ is omitted, "client/<yourclient>" is used,
 * where <yourclient> is the name you specified in
 * _Xmms::Client.new(name)_.
 */
static VALUE
c_medialib_entry_property_remove (int argc, VALUE *argv, VALUE self)
{
        VALUE tmp, key, src = Qnil;
        RbXmmsClient *xmms = NULL;
        xmmsc_result_t *res;
        const char *ckey;
        uint32_t id;

        Data_Get_Struct (self, RbXmmsClient, xmms);

        CHECK_DELETED (xmms);

        rb_scan_args (argc, argv, "21", &tmp, &key, &src);

        id = check_uint32 (tmp);
        Check_Type (key, T_SYMBOL);

        ckey = rb_id2name (SYM2ID (key));

        if (NIL_P (src))
                res = xmmsc_medialib_entry_property_remove (xmms->real, id,
                                                            ckey);
        else
                res = xmmsc_medialib_entry_property_remove_with_source (
                        xmms->real, id,
                        StringValuePtr (src),
                        ckey);

        return TO_XMMS_CLIENT_RESULT (self, res);
}