From cc61578f0f1417aba3c6d147d164bc644541372b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 4 Feb 2011 02:44:07 +0000 Subject: Replace use of raptor (for raptor_sequence) with glib. SLV2 now depends only on serd, sord, and glib. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2903 a436a847-0d15-0410-975c-d299462d15a1 --- src/plugins.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins.c') diff --git a/src/plugins.c b/src/plugins.c index 5a91ab4..a8c7e81 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -31,20 +31,20 @@ SLV2Plugins slv2_plugins_new() { - return raptor_new_sequence(NULL, NULL); + return g_ptr_array_new(); } void slv2_plugins_free(SLV2World world, SLV2Plugins list) { if (list && list != world->plugins) - raptor_free_sequence(list); + g_ptr_array_unref(list); } unsigned slv2_plugins_size(SLV2Plugins list) { - return (list ? raptor_sequence_size(list) : 0); + return (list ? ((GPtrArray*)list)->len : 0); } SLV2Plugin @@ -53,13 +53,13 @@ slv2_plugins_get_by_uri(SLV2Plugins list, SLV2Value uri) // good old fashioned binary search int lower = 0; - int upper = raptor_sequence_size(list) - 1; + int upper = ((GPtrArray*)list)->len - 1; int i; while (upper >= lower) { i = lower + ((upper - lower) / 2); - SLV2Plugin p = raptor_sequence_get_at(list, i); + SLV2Plugin p = g_ptr_array_index((GPtrArray*)list, i); const int cmp = strcmp(slv2_value_as_uri(slv2_plugin_get_uri(p)), slv2_value_as_uri(uri)); @@ -81,6 +81,6 @@ slv2_plugins_get_at(SLV2Plugins list, unsigned index) if (index > INT_MAX) return NULL; else - return (SLV2Plugin)raptor_sequence_get_at(list, (int)index); + return (SLV2Plugin)g_ptr_array_index((GPtrArray*)list, (int)index); } -- cgit v1.2.1