diff options
author | David Robillard <d@drobilla.net> | 2011-03-09 18:11:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-03-09 18:11:40 +0000 |
commit | 027ca551e53800ab7a2cd8375d1cacb980803d75 (patch) | |
tree | 5dcd8281dcc4f83ddc07fc047656b57b3d12b74e /src/plugin.c | |
parent | 97304fcdaa125bf1bfec30fa0d92b619faa41ea2 (diff) | |
download | lilv-027ca551e53800ab7a2cd8375d1cacb980803d75.tar.gz lilv-027ca551e53800ab7a2cd8375d1cacb980803d75.tar.bz2 lilv-027ca551e53800ab7a2cd8375d1cacb980803d75.zip |
New collections and iterator API.
Deprecate slv2_*_get_at.
Remove slv2_world_get_plugins_by_filter.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3057 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r-- | src/plugin.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/plugin.c b/src/plugin.c index 4159cdf..e86b16a 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -131,7 +131,7 @@ slv2_plugin_get_unique(SLV2Plugin p, SLV2Node subject, SLV2Node predicate) sord_node_get_string(predicate)); return NULL; } - SLV2Value ret = slv2_value_duplicate(slv2_values_get_at(values, 0)); + SLV2Value ret = slv2_value_duplicate(slv2_values_get_first(values)); slv2_values_free(values); return ret; } @@ -143,7 +143,7 @@ slv2_plugin_get_one(SLV2Plugin p, SLV2Node subject, SLV2Node predicate) if (!values) { return NULL; } - SLV2Value ret = slv2_value_duplicate(slv2_values_get_at(values, 0)); + SLV2Value ret = slv2_value_duplicate(slv2_values_get_first(values)); slv2_values_free(values); return ret; } @@ -152,8 +152,8 @@ static void slv2_plugin_load(SLV2Plugin p) { // Parse all the plugin's data files into RDF model - for (unsigned i = 0; i < slv2_values_size(p->data_uris); ++i) { - SLV2Value data_uri_val = slv2_values_get_at(p->data_uris, i); + SLV2_FOREACH(i, p->data_uris) { + SLV2Value data_uri_val = slv2_values_get(p->data_uris, i); sord_read_file(p->world->model, sord_node_get_string(data_uri_val->val.uri_val), p->bundle_uri->val.uri_val, @@ -434,7 +434,7 @@ slv2_plugin_get_name(SLV2Plugin plugin) SLV2Value ret = NULL; if (results) { - SLV2Value val = slv2_values_get_at(results, 0); + SLV2Value val = slv2_values_get_first(results); if (slv2_value_is_string(val)) ret = slv2_value_duplicate(val); slv2_values_free(results); @@ -653,17 +653,16 @@ SLV2_API SLV2Values slv2_plugin_get_supported_features(SLV2Plugin p) { - SLV2Values optional = slv2_plugin_get_optional_features(p); - SLV2Values required = slv2_plugin_get_required_features(p); - SLV2Values result = slv2_values_new(); - unsigned n_optional = slv2_values_size(optional); - unsigned n_required = slv2_values_size(required); - for (unsigned i = 0 ; i < n_optional; ++i) + SLV2Values optional = slv2_plugin_get_optional_features(p); + SLV2Values required = slv2_plugin_get_required_features(p); + SLV2Values result = slv2_values_new(); + + SLV2_FOREACH(i, optional) slv2_array_append( - result, slv2_value_duplicate(slv2_values_get_at(optional, i))); - for (unsigned i = 0 ; i < n_required; ++i) + result, slv2_value_duplicate(slv2_values_get(optional, i))); + SLV2_FOREACH(i, required) slv2_array_append( - result, slv2_value_duplicate(slv2_values_get_at(required, i))); + result, slv2_value_duplicate(slv2_values_get(required, i))); slv2_values_free(optional); slv2_values_free(required); |