summaryrefslogtreecommitdiffstats
path: root/src/pluginclass.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-12-13 05:47:50 +0000
committerDavid Robillard <d@drobilla.net>2008-12-13 05:47:50 +0000
commit90885da36afd20388a6eeeb58efcd844398bc531 (patch)
treea5cce42b5bae93d1c910a8a12af3d927bd8d114e /src/pluginclass.c
parentbaa2354cf47b093117206fd1fc1bae45e46b03c3 (diff)
downloadlilv-90885da36afd20388a6eeeb58efcd844398bc531.tar.gz
lilv-90885da36afd20388a6eeeb58efcd844398bc531.tar.bz2
lilv-90885da36afd20388a6eeeb58efcd844398bc531.zip
Handle librdf failures (NULL values) and crazily typed values etc. more gracefully.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1860 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/pluginclass.c')
-rw-r--r--src/pluginclass.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/pluginclass.c b/src/pluginclass.c
index b3323a0..0ac9d05 100644
--- a/src/pluginclass.c
+++ b/src/pluginclass.c
@@ -30,15 +30,12 @@
SLV2PluginClass
slv2_plugin_class_new(SLV2World world, librdf_uri* parent_uri, librdf_uri* uri, const char* label)
{
- SLV2PluginClass plugin_class = (SLV2PluginClass)malloc(sizeof(struct _SLV2PluginClass));
- plugin_class->world = world;
- if (parent_uri)
- plugin_class->parent_uri = slv2_value_new_librdf_uri(world, parent_uri);
- else
- plugin_class->parent_uri = NULL;
- plugin_class->uri = slv2_value_new_librdf_uri(world, uri);
- plugin_class->label = slv2_value_new(world, SLV2_VALUE_STRING, label);
- return plugin_class;
+ SLV2PluginClass pc = (SLV2PluginClass)malloc(sizeof(struct _SLV2PluginClass));
+ pc->world = world;
+ pc->parent_uri = (parent_uri ? slv2_value_new_librdf_uri(world, parent_uri) : NULL);
+ pc->uri = slv2_value_new_librdf_uri(world, uri);
+ pc->label = slv2_value_new(world, SLV2_VALUE_STRING, label);
+ return pc;
}