From 2066b51c243763677dfdbc6a9db8bccc10bbfe36 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 21 Apr 2007 21:21:49 +0000 Subject: Code cleanups. git-svn-id: http://svn.drobilla.net/lad/slv2@470 a436a847-0d15-0410-975c-d299462d15a1 --- src/Makefile.am | 2 +- src/plugin.c | 2 +- src/pluginclass.c | 2 +- src/pluginclasses.c | 2 +- src/plugininstance.c | 2 +- src/plugins.c | 2 +- src/port.c | 2 +- src/private_types.h | 127 --------------------------------------------------- src/query.c | 2 +- src/slv2_internal.h | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/world.c | 2 +- 11 files changed, 136 insertions(+), 136 deletions(-) delete mode 100644 src/private_types.h create mode 100644 src/slv2_internal.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 11f7aa8..cdc8793 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libslv2.la libslv2_la_LIBADD = @REDLAND_LIBS@ libslv2_la_SOURCES = \ - private_types.h \ + slv2_internal.h \ world.c \ pluginclass.c \ pluginclasses.c \ diff --git a/src/plugin.c b/src/plugin.c index 6d8dc87..a3f9177 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -26,7 +26,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" /* private */ diff --git a/src/pluginclass.c b/src/pluginclass.c index 80e96c4..8ffd66b 100644 --- a/src/pluginclass.c +++ b/src/pluginclass.c @@ -21,7 +21,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" SLV2PluginClass diff --git a/src/pluginclasses.c b/src/pluginclasses.c index 919201e..c7873fe 100644 --- a/src/pluginclasses.c +++ b/src/pluginclasses.c @@ -23,7 +23,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" SLV2PluginClasses diff --git a/src/plugininstance.c b/src/plugininstance.c index 013e33c..d989ef6 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -27,7 +27,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" SLV2Instance diff --git a/src/plugins.c b/src/plugins.c index 9d62398..57620e7 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -28,7 +28,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" SLV2Plugins diff --git a/src/port.c b/src/port.c index 97fb800..5d18c8a 100644 --- a/src/port.c +++ b/src/port.c @@ -25,7 +25,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" /* private */ diff --git a/src/private_types.h b/src/private_types.h deleted file mode 100644 index baf5100..0000000 --- a/src/private_types.h +++ /dev/null @@ -1,127 +0,0 @@ -/* SLV2 - * Copyright (C) 2007 Dave Robillard - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __SLV2_PRIVATE_TYPES_H__ -#define __SLV2_PRIVATE_TYPES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include - - -/** Reference to a port on some plugin. - */ -struct _Port { - uint32_t index; ///< LV2 index - char* symbol; ///< LV2 symbol - //char* node_id; ///< RDF Node ID -}; - - -SLV2Port slv2_port_new(uint32_t index, const char* symbol/*, const char* node_id*/); -SLV2Port slv2_port_duplicate(SLV2Port port); -void slv2_port_free(SLV2Port port); - - -/** Record of an installed/available plugin. - * - * A simple reference to a plugin somewhere on the system. This just holds - * paths of relevant files, the actual data therein isn't loaded into memory. - */ -struct _Plugin { - struct _World* world; - librdf_uri* plugin_uri; -// char* bundle_url; // Bundle directory plugin was loaded from - char* binary_uri; // lv2:binary - SLV2PluginClass plugin_class; - raptor_sequence* data_uris; // rdfs::seeAlso - raptor_sequence* ports; - librdf_storage* storage; - librdf_model* rdf; -}; - -SLV2Plugin slv2_plugin_new(SLV2World world, librdf_uri* uri, const char* binary_uri); -void slv2_plugin_load(SLV2Plugin p); -void slv2_plugin_free(SLV2Plugin plugin); - - -/** Create a new, empty plugin list. - * - * Returned object must be freed with slv2_plugins_free. - */ -SLV2Plugins -slv2_plugins_new(); - - -/** Pimpl portion of SLV2Instance */ -struct _InstanceImpl { - void* lib_handle; -}; - - -struct _PluginClass { - struct _World* world; - char* parent_uri; - char* uri; - char* label; -}; - -SLV2PluginClass slv2_plugin_class_new(SLV2World world, - const char* parent_uri, const char* uri, const char* label); -void slv2_plugin_class_free(SLV2PluginClass class); - -SLV2PluginClasses slv2_plugin_classes_new(); -void slv2_plugin_classes_free(); - -/** Model of LV2 (RDF) data loaded from bundles. - */ -struct _World { - librdf_world* world; - librdf_storage* storage; - librdf_model* model; - librdf_parser* parser; - SLV2PluginClasses plugin_classes; - SLV2Plugins plugins; -}; - -/** Load all bundles found in \a search_path. - * - * \param search_path A colon-delimited list of directories. These directories - * should contain LV2 bundle directories (ie the search path is a list of - * parent directories of bundles, not a list of bundle directories). - * - * If \a search_path is NULL, \a world will be unmodified. - * Use of this function is \b not recommended. Use \ref slv2_world_load_all. - */ -void -slv2_world_load_path(SLV2World world, - const char* search_path); - - -#ifdef __cplusplus -} -#endif - -#endif /* __SLV2_PRIVATE_TYPES_H__ */ - diff --git a/src/query.c b/src/query.c index a4d8e16..19eba56 100644 --- a/src/query.c +++ b/src/query.c @@ -24,7 +24,7 @@ #include #include #include -#include "private_types.h" +#include "slv2_internal.h" static const char* slv2_query_prefixes = diff --git a/src/slv2_internal.h b/src/slv2_internal.h new file mode 100644 index 0000000..baf5100 --- /dev/null +++ b/src/slv2_internal.h @@ -0,0 +1,127 @@ +/* SLV2 + * Copyright (C) 2007 Dave Robillard + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __SLV2_PRIVATE_TYPES_H__ +#define __SLV2_PRIVATE_TYPES_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include + + +/** Reference to a port on some plugin. + */ +struct _Port { + uint32_t index; ///< LV2 index + char* symbol; ///< LV2 symbol + //char* node_id; ///< RDF Node ID +}; + + +SLV2Port slv2_port_new(uint32_t index, const char* symbol/*, const char* node_id*/); +SLV2Port slv2_port_duplicate(SLV2Port port); +void slv2_port_free(SLV2Port port); + + +/** Record of an installed/available plugin. + * + * A simple reference to a plugin somewhere on the system. This just holds + * paths of relevant files, the actual data therein isn't loaded into memory. + */ +struct _Plugin { + struct _World* world; + librdf_uri* plugin_uri; +// char* bundle_url; // Bundle directory plugin was loaded from + char* binary_uri; // lv2:binary + SLV2PluginClass plugin_class; + raptor_sequence* data_uris; // rdfs::seeAlso + raptor_sequence* ports; + librdf_storage* storage; + librdf_model* rdf; +}; + +SLV2Plugin slv2_plugin_new(SLV2World world, librdf_uri* uri, const char* binary_uri); +void slv2_plugin_load(SLV2Plugin p); +void slv2_plugin_free(SLV2Plugin plugin); + + +/** Create a new, empty plugin list. + * + * Returned object must be freed with slv2_plugins_free. + */ +SLV2Plugins +slv2_plugins_new(); + + +/** Pimpl portion of SLV2Instance */ +struct _InstanceImpl { + void* lib_handle; +}; + + +struct _PluginClass { + struct _World* world; + char* parent_uri; + char* uri; + char* label; +}; + +SLV2PluginClass slv2_plugin_class_new(SLV2World world, + const char* parent_uri, const char* uri, const char* label); +void slv2_plugin_class_free(SLV2PluginClass class); + +SLV2PluginClasses slv2_plugin_classes_new(); +void slv2_plugin_classes_free(); + +/** Model of LV2 (RDF) data loaded from bundles. + */ +struct _World { + librdf_world* world; + librdf_storage* storage; + librdf_model* model; + librdf_parser* parser; + SLV2PluginClasses plugin_classes; + SLV2Plugins plugins; +}; + +/** Load all bundles found in \a search_path. + * + * \param search_path A colon-delimited list of directories. These directories + * should contain LV2 bundle directories (ie the search path is a list of + * parent directories of bundles, not a list of bundle directories). + * + * If \a search_path is NULL, \a world will be unmodified. + * Use of this function is \b not recommended. Use \ref slv2_world_load_all. + */ +void +slv2_world_load_path(SLV2World world, + const char* search_path); + + +#ifdef __cplusplus +} +#endif + +#endif /* __SLV2_PRIVATE_TYPES_H__ */ + diff --git a/src/world.c b/src/world.c index 90a604f..8178403 100644 --- a/src/world.c +++ b/src/world.c @@ -26,7 +26,7 @@ #include #include #include "config.h" -#include "private_types.h" +#include "slv2_internal.h" SLV2World -- cgit v1.2.1