diff options
author | David Robillard <d@drobilla.net> | 2008-01-25 06:55:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-01-25 06:55:57 +0000 |
commit | 6f4460aee9962a49ae872eef42ba75a439ea6e59 (patch) | |
tree | dd08af14a835d0d6f77aa6a3c4c9047ceb4b307f /src/pluginui.c | |
parent | 361f21b9e1f59bd602d0e1ed8b80f726605995be (diff) | |
download | lilv-6f4460aee9962a49ae872eef42ba75a439ea6e59.tar.gz lilv-6f4460aee9962a49ae872eef42ba75a439ea6e59.tar.bz2 lilv-6f4460aee9962a49ae872eef42ba75a439ea6e59.zip |
Overhaul SLV2 API to return/take SLV2Value (instead of strings or primitives) wherever possible.
Make 'index' a fundemental property of ingen ports.
git-svn-id: http://svn.drobilla.net/lad/slv2@1113 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/pluginui.c')
-rw-r--r-- | src/pluginui.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/pluginui.c b/src/pluginui.c index 5de3dcb..9835e41 100644 --- a/src/pluginui.c +++ b/src/pluginui.c @@ -38,16 +38,16 @@ slv2_ui_new(SLV2World world, struct _SLV2UI* ui = malloc(sizeof(struct _SLV2UI)); ui->world = world; - ui->uri = librdf_new_uri_from_uri(uri); - ui->binary_uri = librdf_new_uri_from_uri(binary_uri); + ui->uri = slv2_value_new_librdf_uri(world, uri); + ui->binary_uri = slv2_value_new_librdf_uri(world, binary_uri); assert(ui->binary_uri); // FIXME: kludge - char* bundle = strdup((const char*)librdf_uri_as_string(ui->binary_uri)); + char* bundle = strdup(slv2_value_as_string(ui->binary_uri)); char* last_slash = strrchr(bundle, '/') + 1; *last_slash = '\0'; - ui->bundle_uri = librdf_new_uri(world->world, (const unsigned char*)bundle); + ui->bundle_uri = slv2_value_new_uri(world, bundle); free(bundle); ui->classes = slv2_values_new(); @@ -61,13 +61,13 @@ slv2_ui_new(SLV2World world, void slv2_ui_free(SLV2UI ui) { - librdf_free_uri(ui->uri); + slv2_value_free(ui->uri); ui->uri = NULL; - librdf_free_uri(ui->bundle_uri); + slv2_value_free(ui->bundle_uri); ui->bundle_uri = NULL; - librdf_free_uri(ui->binary_uri); + slv2_value_free(ui->binary_uri); ui->binary_uri = NULL; slv2_values_free(ui->classes); @@ -76,12 +76,12 @@ slv2_ui_free(SLV2UI ui) } -const char* +SLV2Value slv2_ui_get_uri(SLV2UI ui) { assert(ui); assert(ui->uri); - return (const char*)librdf_uri_as_string(ui->uri); + return ui->uri; } @@ -93,29 +93,26 @@ slv2_ui_get_classes(SLV2UI ui) bool -slv2_ui_is_a(SLV2UI ui, const char* type_uri) +slv2_ui_is_a(SLV2UI ui, SLV2Value ui_class_uri) { - SLV2Value type = slv2_value_new(ui->world, SLV2_VALUE_URI, type_uri); - bool ret = slv2_values_contains(ui->classes, type); - slv2_value_free(type); - return ret; + return slv2_values_contains(ui->classes, ui_class_uri); } -const char* +SLV2Value slv2_ui_get_bundle_uri(SLV2UI ui) { assert(ui); assert(ui->bundle_uri); - return (const char*)librdf_uri_as_string(ui->bundle_uri); + return ui->bundle_uri; } -const char* +SLV2Value slv2_ui_get_binary_uri(SLV2UI ui) { assert(ui); assert(ui->binary_uri); - return (const char*)librdf_uri_as_string(ui->binary_uri); + return ui->binary_uri; } |