summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-31 16:39:31 +0000
committerDavid Robillard <d@drobilla.net>2008-01-31 16:39:31 +0000
commit40dfef23e8094c8e83df4efc262392253672046a (patch)
tree1e90fb0343bf8d667bc748bcac1901344ef0d0c9 /src/plugin.c
parent55b699d9a9b08ba8086f30f29348bf4c87231c12 (diff)
downloadlilv-40dfef23e8094c8e83df4efc262392253672046a.tar.gz
lilv-40dfef23e8094c8e83df4efc262392253672046a.tar.bz2
lilv-40dfef23e8094c8e83df4efc262392253672046a.zip
Slightly more gracefully fail on broken rasqal ORDER BY, or plugins with missing ports.
git-svn-id: http://svn.drobilla.net/lad/slv2@1120 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 3d8b7da..ed90490 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -205,12 +205,24 @@ slv2_plugin_load(SLV2Plugin p)
raptor_sequence_push(p->ports, this_port);
++num_ports;
++last_index;
- } else {
+
+ // More information about a port we already created
+ } else if (this_index < num_ports) {
this_port = slv2_plugin_get_port_by_index(p, this_index);
+
+ // Got a port index out of whack, plugin or rasqal is broken
+ } else {
+ fprintf(stderr, "ERROR: Found port %d immediately after port %d\n",
+ this_index, num_ports-1);
+ fprintf(stderr, "Either the plugin %s or your version of rasqal is broken.\n",
+ slv2_value_as_uri(p->plugin_uri));
+ fprintf(stderr, "Please report (with rasqal version): http://dev.drobilla.net/newticket?component=SLV2\n");
}
- raptor_sequence_push(this_port->classes, slv2_value_new_librdf_uri(p->world,
- librdf_node_get_uri(type_node)));
+ if (this_port) {
+ raptor_sequence_push(this_port->classes,
+ slv2_value_new_librdf_uri(p->world, librdf_node_get_uri(type_node)));
+ }
librdf_free_node(type_node);
librdf_free_node(symbol_node);
@@ -219,7 +231,7 @@ slv2_plugin_load(SLV2Plugin p)
librdf_query_results_next(results);
}
- raptor_sequence_sort(p->ports, slv2_port_compare_by_index);
+ //raptor_sequence_sort(p->ports, slv2_port_compare_by_index);
librdf_free_query_results(results);
librdf_free_query(q);