Пример #1
0
static VALUE
c_attrs_aset (VALUE self, VALUE key, VALUE value)
{
	RbCollection *coll = NULL;
	VALUE tmp;

	StringValue (key);
	StringValue (value);

	tmp = rb_iv_get (self, "collection");
	Data_Get_Struct (tmp, RbCollection, coll);

	xmmsc_coll_attribute_set (coll->real, StringValuePtr (key),
	                          StringValuePtr (value));

	return Qnil;
}
Пример #2
0
void configure_collection (xmmsc_result_t *res, cli_infos_t *infos,
                           gchar *ns, gchar *name,
                           gchar *attrname, gchar *attrvalue)
{
	xmmsv_coll_t *coll;
	xmmsv_t *val;

	val = xmmsc_result_get_value (res);

	if (xmmsv_get_coll (val, &coll)) {
		xmmsc_coll_attribute_set (coll, attrname, attrvalue);
		coll_save (infos, coll, ns, name, TRUE);
	} else {
		g_printf (_("Invalid collection!\n"));
		cli_infos_loop_resume (infos);
	}

	xmmsc_result_unref (res);
}