From be95afee123c169b083049c2f441d3860a12fea0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 20 Apr 2007 03:57:41 +0000 Subject: Clean up API, hide more methods that should not be exposed to user. Document performance of most methods. Clean up and clarify documentation. git-svn-id: http://svn.drobilla.net/lad/slv2@460 a436a847-0d15-0410-975c-d299462d15a1 --- src/plugininstance.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugininstance.c') diff --git a/src/plugininstance.c b/src/plugininstance.c index 6d957b6..013e33c 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -16,6 +16,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define _XOPEN_SOURCE 500 + #include #include #include @@ -65,7 +67,10 @@ slv2_plugin_instantiate(SLV2Plugin plugin, // Search for plugin by URI // FIXME: Kluge to get bundle path (containing directory of binary) - const char* const bundle_path = strrchr(plugin->binary_uri, '/') + 1; + char* bundle_path = strdup(plugin->binary_uri); + char* const bundle_path_end = strrchr(bundle_path, '/'); + if (bundle_path_end) + *(bundle_path_end+1) = '\0'; printf("Bundle path: %s\n", bundle_path); for (uint32_t i=0; 1; ++i) { @@ -95,6 +100,8 @@ slv2_plugin_instantiate(SLV2Plugin plugin, break; } } + + free(bundle_path); } assert(result); -- cgit v1.2.1