summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 9fba6f4..88732d1 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -268,6 +268,17 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_p)
}
}
lilv_match_end(ports);
+
+ // Check sanity
+ for (uint32_t i = 0; i < p->num_ports; ++i) {
+ if (!p->ports[i]) {
+ LILV_ERRORF("Plugin <%s> is missing port %d/%d\n",
+ lilv_node_as_uri(p->plugin_uri), i, p->num_ports);
+ free(p->ports);
+ p->ports = NULL;
+ p->num_ports = 0;
+ }
+ }
}
}
@@ -645,6 +656,30 @@ lilv_plugin_get_required_features(const LilvPlugin* p)
}
LILV_API
+bool
+lilv_plugin_has_extension_data(const LilvPlugin* p,
+ const LilvNode* uri)
+{
+ if (!lilv_node_is_uri(uri)) {
+ LILV_ERRORF("Extension data `%s' is not a URI\n", uri->str_val);
+ return false;
+ }
+
+ SordIter* iter = lilv_world_query_internal(
+ p->world,
+ p->plugin_uri->val.uri_val,
+ p->world->lv2_extensionData_val->val.uri_val,
+ uri->val.uri_val);
+
+ if (iter) {
+ sord_iter_free(iter);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+LILV_API
LilvNodes*
lilv_plugin_get_extension_data(const LilvPlugin* p)
{