summaryrefslogtreecommitdiffstats
path: root/slv2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-03-05 20:11:04 +0000
committerDavid Robillard <d@drobilla.net>2010-03-05 20:11:04 +0000
commit4d2cf9582ba6c5e9cdb29b07427934b2f1e0ef02 (patch)
tree0fe2c738a54718ae1c5dc3d5a905308b58fe69d0 /slv2
parentd8437709d6f69b4952993a6794313edb38361a53 (diff)
downloadlilv-4d2cf9582ba6c5e9cdb29b07427934b2f1e0ef02.tar.gz
lilv-4d2cf9582ba6c5e9cdb29b07427934b2f1e0ef02.tar.bz2
lilv-4d2cf9582ba6c5e9cdb29b07427934b2f1e0ef02.zip
Hide symbols by default and explicitly export API (clean ABI).
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2530 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'slv2')
-rw-r--r--slv2/collections.h12
-rw-r--r--slv2/plugin.h28
-rw-r--r--slv2/pluginclass.h9
-rw-r--r--slv2/plugininstance.h4
-rw-r--r--slv2/pluginui.h5
-rw-r--r--slv2/pluginuiinstance.h5
-rw-r--r--slv2/port.h12
-rw-r--r--slv2/query.h8
-rw-r--r--slv2/scalepoint.h2
-rw-r--r--slv2/types.h18
-rw-r--r--slv2/util.h2
-rw-r--r--slv2/value.h27
-rw-r--r--slv2/world.h9
13 files changed, 133 insertions, 8 deletions
diff --git a/slv2/collections.h b/slv2/collections.h
index f81a60d..d15ef5e 100644
--- a/slv2/collections.h
+++ b/slv2/collections.h
@@ -43,6 +43,7 @@ extern "C" {
*
* Time = O(1)
*/ \
+SLV2_API \
void \
prefix ## _free(CollType collection); \
\
@@ -51,6 +52,7 @@ prefix ## _free(CollType collection); \
*
* Time = O(1)
*/ \
+SLV2_API \
unsigned \
prefix ## _size(CollType collection); \
\
@@ -66,6 +68,7 @@ prefix ## _size(CollType collection); \
*
* \return NULL if \a index out of range.
*/ \
+SLV2_API \
ElemType \
prefix ## _get_at(CollType collection, \
unsigned index);
@@ -85,6 +88,7 @@ SLV2_COLLECTION(SLV2UIs, SLV2UI, slv2_uis)
* (plugins are owned by the world). \a plugins is invalid after this call.
* Time = O(1)
*/
+SLV2_API
void
slv2_plugins_free(SLV2World world,
SLV2Plugins plugins);
@@ -93,6 +97,7 @@ slv2_plugins_free(SLV2World world,
/** Get the number of plugins in the collection.
* Time = O(1)
*/
+SLV2_API
unsigned
slv2_plugins_size(SLV2Plugins plugins);
@@ -106,6 +111,7 @@ slv2_plugins_size(SLV2Plugins plugins);
*
* \return NULL if plugin with \a url not found in \a plugins.
*/
+SLV2_API
SLV2Plugin
slv2_plugins_get_by_uri(SLV2Plugins plugins,
SLV2Value uri);
@@ -122,6 +128,7 @@ slv2_plugins_get_by_uri(SLV2Plugins plugins,
*
* \return NULL if \a index out of range.
*/
+SLV2_API
SLV2Plugin
slv2_plugins_get_at(SLV2Plugins plugins,
unsigned index);
@@ -139,6 +146,7 @@ slv2_plugins_get_at(SLV2Plugins plugins,
*
* \return NULL if plugin with \a url not found in \a classes.
*/
+SLV2_API
SLV2PluginClass
slv2_plugin_classes_get_by_uri(SLV2PluginClasses classes,
SLV2Value uri);
@@ -149,6 +157,7 @@ slv2_plugin_classes_get_by_uri(SLV2PluginClasses classes,
/** Allocate a new, empty SLV2ScalePoints
*/
+SLV2_API
SLV2ScalePoints
slv2_scale_points_new();
@@ -158,6 +167,7 @@ slv2_scale_points_new();
/** Allocate a new, empty SLV2Values
*/
+SLV2_API
SLV2Values
slv2_values_new();
@@ -166,6 +176,7 @@ slv2_values_new();
*
* Time = O(n)
*/
+SLV2_API
bool
slv2_values_contains(SLV2Values values, SLV2Value value);
@@ -182,6 +193,7 @@ slv2_values_contains(SLV2Values values, SLV2Value value);
*
* \return NULL if plugin with \a url not found in \a list.
*/
+SLV2_API
SLV2UI
slv2_uis_get_by_uri(SLV2UIs list,
SLV2Value uri);
diff --git a/slv2/plugin.h b/slv2/plugin.h
index 5af80e8..a64e518 100644
--- a/slv2/plugin.h
+++ b/slv2/plugin.h
@@ -56,6 +56,7 @@ extern "C" {
*
* Time = Query
*/
+SLV2_API
bool
slv2_plugin_verify(SLV2Plugin plugin);
@@ -76,6 +77,7 @@ slv2_plugin_verify(SLV2Plugin plugin);
*
* Time = O(1)
*/
+SLV2_API
SLV2Value
slv2_plugin_get_uri(SLV2Plugin plugin);
@@ -95,6 +97,7 @@ slv2_plugin_get_uri(SLV2Plugin plugin);
*
* Time = O(1)
*/
+SLV2_API
SLV2Value
slv2_plugin_get_bundle_uri(SLV2Plugin plugin);
@@ -111,6 +114,7 @@ slv2_plugin_get_bundle_uri(SLV2Plugin plugin);
*
* Time = O(1)
*/
+SLV2_API
SLV2Values
slv2_plugin_get_data_uris(SLV2Plugin plugin);
@@ -124,6 +128,7 @@ slv2_plugin_get_data_uris(SLV2Plugin plugin);
*
* Time = O(1)
*/
+SLV2_API
SLV2Value
slv2_plugin_get_library_uri(SLV2Plugin plugin);
@@ -137,12 +142,14 @@ slv2_plugin_get_library_uri(SLV2Plugin plugin);
*
* Time = Query
*/
+SLV2_API
SLV2Value
slv2_plugin_get_name(SLV2Plugin plugin);
/** Get the class this plugin belongs to (ie Filters).
*/
+SLV2_API
SLV2PluginClass
slv2_plugin_get_class(SLV2Plugin plugin);
@@ -163,6 +170,7 @@ slv2_plugin_get_class(SLV2Plugin plugin);
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_plugin_get_value(SLV2Plugin p,
SLV2Value predicate);
@@ -174,6 +182,7 @@ slv2_plugin_get_value(SLV2Plugin p,
* string parameter for a predicate instead of an SLV2Value, which may be
* more convenient.
*/
+SLV2_API
SLV2Values
slv2_plugin_get_value_by_qname(SLV2Plugin p,
const char* predicate);
@@ -186,6 +195,7 @@ slv2_plugin_get_value_by_qname(SLV2Plugin p,
* more convenient. It returns the value translated to the current language
* if possible.
*/
+SLV2_API
SLV2Values
slv2_plugin_get_value_by_qname_i18n(SLV2Plugin p,
const char* predicate);
@@ -210,6 +220,7 @@ slv2_plugin_get_value_by_qname_i18n(SLV2Plugin p,
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_plugin_get_value_for_subject(SLV2Plugin p,
SLV2Value subject_uri,
@@ -223,6 +234,7 @@ slv2_plugin_get_value_for_subject(SLV2Plugin p,
*
* Time = Query
*/
+SLV2_API
bool
slv2_plugin_has_feature(SLV2Plugin p,
SLV2Value feature_uri);
@@ -240,6 +252,7 @@ slv2_plugin_has_feature(SLV2Plugin p,
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_plugin_get_supported_features(SLV2Plugin p);
@@ -257,6 +270,7 @@ slv2_plugin_get_supported_features(SLV2Plugin p);
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_plugin_get_required_features(SLV2Plugin p);
@@ -271,6 +285,7 @@ slv2_plugin_get_required_features(SLV2Plugin p);
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_plugin_get_optional_features(SLV2Plugin p);
@@ -279,6 +294,7 @@ slv2_plugin_get_optional_features(SLV2Plugin p);
*
* Time = O(1)
*/
+SLV2_API
uint32_t
slv2_plugin_get_num_ports(SLV2Plugin p);
@@ -297,6 +313,7 @@ slv2_plugin_get_num_ports(SLV2Plugin p);
* all float ports on a plugin, and may be significantly faster than
* repeated calls to slv2_port_get_range.
*/
+SLV2_API
void
slv2_plugin_get_port_ranges_float(SLV2Plugin p,
float* min_values,
@@ -311,6 +328,7 @@ slv2_plugin_get_port_ranges_float(SLV2Plugin p,
*
* Time = O(1)
*/
+SLV2_API
uint32_t
slv2_plugin_get_num_ports_of_class(SLV2Plugin p,
SLV2Value class_1, ...);
@@ -322,6 +340,7 @@ slv2_plugin_get_num_ports_of_class(SLV2Plugin p,
*
* Time = Query
*/
+SLV2_API
bool
slv2_plugin_has_latency(SLV2Plugin p);
@@ -337,6 +356,7 @@ slv2_plugin_has_latency(SLV2Plugin p);
*
* Time = Query
*/
+SLV2_API
uint32_t
slv2_plugin_get_latency_port_index(SLV2Plugin p);
@@ -351,6 +371,7 @@ slv2_plugin_get_latency_port_index(SLV2Plugin p);
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_plugin_query_variable(SLV2Plugin plugin,
const char* sparql_str,
@@ -367,6 +388,7 @@ slv2_plugin_query_variable(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
unsigned
slv2_plugin_query_count(SLV2Plugin plugin,
const char* sparql_str);
@@ -379,6 +401,7 @@ slv2_plugin_query_count(SLV2Plugin plugin,
*
* Time = O(1)
*/
+SLV2_API
SLV2Port
slv2_plugin_get_port_by_index(SLV2Plugin plugin,
uint32_t index);
@@ -393,6 +416,7 @@ slv2_plugin_get_port_by_index(SLV2Plugin plugin,
*
* Time = O(n)
*/
+SLV2_API
SLV2Port
slv2_plugin_get_port_by_symbol(SLV2Plugin plugin,
SLV2Value symbol);
@@ -410,6 +434,7 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
SLV2UIs
slv2_plugin_get_uis(SLV2Plugin plugin);
@@ -421,6 +446,7 @@ slv2_plugin_get_uis(SLV2Plugin plugin);
*
* Time = Query
*/
+SLV2_API
SLV2Value
slv2_plugin_get_author_name(SLV2Plugin plugin);
@@ -432,6 +458,7 @@ slv2_plugin_get_author_name(SLV2Plugin plugin);
*
* Time = Query
*/
+SLV2_API
SLV2Value
slv2_plugin_get_author_email(SLV2Plugin plugin);
@@ -443,6 +470,7 @@ slv2_plugin_get_author_email(SLV2Plugin plugin);
*
* Time = Query
*/
+SLV2_API
SLV2Value
slv2_plugin_get_author_homepage(SLV2Plugin plugin);
diff --git a/slv2/pluginclass.h b/slv2/pluginclass.h
index 0c14235..37682be 100644
--- a/slv2/pluginclass.h
+++ b/slv2/pluginclass.h
@@ -37,7 +37,9 @@ extern "C" {
*
* Time = O(1)
*/
-SLV2Value slv2_plugin_class_get_parent_uri(SLV2PluginClass plugin_class);
+SLV2_API
+SLV2Value
+slv2_plugin_class_get_parent_uri(SLV2PluginClass plugin_class);
/** Get the URI of this plugin class.
@@ -46,7 +48,9 @@ SLV2Value slv2_plugin_class_get_parent_uri(SLV2PluginClass plugin_class);
*
* Time = O(1)
*/
-SLV2Value slv2_plugin_class_get_uri(SLV2PluginClass plugin_class);
+SLV2_API
+SLV2Value
+slv2_plugin_class_get_uri(SLV2PluginClass plugin_class);
/** Get the label of this plugin class, ie "Oscillators".
@@ -55,6 +59,7 @@ SLV2Value slv2_plugin_class_get_uri(SLV2PluginClass plugin_class);
*
* Time = O(1)
*/
+SLV2_API
SLV2Value slv2_plugin_class_get_label(SLV2PluginClass plugin_class);
diff --git a/slv2/plugininstance.h b/slv2/plugininstance.h
index 7ef78ab..f46306d 100644
--- a/slv2/plugininstance.h
+++ b/slv2/plugininstance.h
@@ -74,6 +74,7 @@ typedef struct _Instance {
*
* \return NULL if instantiation failed.
*/
+SLV2_API
SLV2Instance
slv2_plugin_instantiate(SLV2Plugin plugin,
double sample_rate,
@@ -84,10 +85,11 @@ slv2_plugin_instantiate(SLV2Plugin plugin,
*
* \a instance is invalid after this call.
*/
+SLV2_API
void
slv2_instance_free(SLV2Instance instance);
-#ifndef LIBSLV2_SOURCE
+#ifndef SLV2_INTERNAL
/** Get the URI of the plugin which \a instance is an instance of.
*
diff --git a/slv2/pluginui.h b/slv2/pluginui.h
index 0436fb6..246bd4f 100644
--- a/slv2/pluginui.h
+++ b/slv2/pluginui.h
@@ -35,6 +35,7 @@ extern "C" {
*
* Time = O(1)
*/
+SLV2_API
SLV2Value
slv2_ui_get_uri(SLV2UI ui);
@@ -46,6 +47,7 @@ slv2_ui_get_uri(SLV2UI ui);
*
* Time = O(1)
*/
+SLV2_API
SLV2Values
slv2_ui_get_classes(SLV2UI ui);
@@ -57,6 +59,7 @@ slv2_ui_get_classes(SLV2UI ui);
*
* Time = O(1)
*/
+SLV2_API
bool
slv2_ui_is_a(SLV2UI ui, SLV2Value class_uri);
@@ -68,6 +71,7 @@ slv2_ui_is_a(SLV2UI ui, SLV2Value class_uri);
*
* Time = O(1)
*/
+SLV2_API
SLV2Value
slv2_ui_get_bundle_uri(SLV2UI ui);
@@ -79,6 +83,7 @@ slv2_ui_get_bundle_uri(SLV2UI ui);
*
* Time = O(1)
*/
+SLV2_API
SLV2Value
slv2_ui_get_binary_uri(SLV2UI ui);
diff --git a/slv2/pluginuiinstance.h b/slv2/pluginuiinstance.h
index f2c16e2..caaa68d 100644
--- a/slv2/pluginuiinstance.h
+++ b/slv2/pluginuiinstance.h
@@ -59,6 +59,7 @@ typedef struct _SLV2UIInstance {
*
* \return NULL if instantiation failed.
*/
+SLV2_API
SLV2UIInstance
slv2_ui_instantiate(SLV2Plugin plugin,
SLV2UI ui,
@@ -75,12 +76,14 @@ slv2_ui_instantiate(SLV2Plugin plugin,
*
* \a instance is invalid after this call.
*/
+SLV2_API
void
slv2_ui_instance_free(SLV2UIInstance instance);
/** Get the widget for the UI instance.
*/
+SLV2_API
LV2UI_Widget
slv2_ui_instance_get_widget(SLV2UIInstance instance);
@@ -92,6 +95,7 @@ slv2_ui_instance_get_widget(SLV2UIInstance instance);
*
* The returned descriptor is shared and must not be deleted.
*/
+SLV2_API
const LV2UI_Descriptor*
slv2_ui_instance_get_descriptor(SLV2UIInstance instance);
@@ -103,6 +107,7 @@ slv2_ui_instance_get_descriptor(SLV2UIInstance instance);
*
* The returned handle is shared and must not be deleted.
*/
+SLV2_API
LV2UI_Handle
slv2_ui_instance_get_handle(SLV2UIInstance instance);
diff --git a/slv2/port.h b/slv2/port.h
index 7a461cc..d069001 100644
--- a/slv2/port.h
+++ b/slv2/port.h
@@ -37,6 +37,7 @@ extern "C" {
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_port_get_value(SLV2Plugin plugin,
SLV2Port port,
@@ -47,6 +48,7 @@ slv2_port_get_value(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_port_get_value_by_qname(SLV2Plugin plugin,
SLV2Port port,
@@ -57,6 +59,7 @@ slv2_port_get_value_by_qname(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_port_get_value_by_qname_i18n(SLV2Plugin plugin,
SLV2Port port,
@@ -67,6 +70,7 @@ slv2_port_get_value_by_qname_i18n(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
SLV2Values
slv2_port_get_properties(SLV2Plugin plugin,
SLV2Port port);
@@ -76,6 +80,7 @@ slv2_port_get_properties(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
bool
slv2_port_has_property(SLV2Plugin p,
SLV2Port port,
@@ -86,6 +91,7 @@ slv2_port_has_property(SLV2Plugin p,
*
* Time = Query
*/
+SLV2_API
bool
slv2_port_supports_event(SLV2Plugin p,
SLV2Port port,
@@ -99,6 +105,7 @@ slv2_port_supports_event(SLV2Plugin p,
*
* Time = Query
*/
+SLV2_API
SLV2Value
slv2_port_get_symbol(SLV2Plugin plugin,
SLV2Port port);
@@ -111,6 +118,7 @@ slv2_port_get_symbol(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
SLV2Value
slv2_port_get_name(SLV2Plugin plugin,
SLV2Port port);
@@ -126,6 +134,7 @@ slv2_port_get_name(SLV2Plugin plugin,
*
* Time = O(1)
*/
+SLV2_API
SLV2Values
slv2_port_get_classes(SLV2Plugin plugin,
SLV2Port port);
@@ -142,6 +151,7 @@ slv2_port_get_classes(SLV2Plugin plugin,
* Time = O(n) (n pointer comparisons where n is the number of classes of
* this port, so this method is suitable for realtime use on any sane port).
*/
+SLV2_API
bool
slv2_port_is_a(SLV2Plugin plugin,
SLV2Port port,
@@ -157,6 +167,7 @@ slv2_port_is_a(SLV2Plugin plugin,
*
* Time = Query
*/
+SLV2_API
void
slv2_port_get_range(SLV2Plugin plugin,
SLV2Port port,
@@ -173,6 +184,7 @@ slv2_port_get_range(SLV2Plugin plugin,
* Returned value may be NULL if @a port has no scale points, otherwise it
* must be freed by caller with slv2_scale_points_free.
*/
+SLV2_API
SLV2ScalePoints
slv2_port_get_scale_points(SLV2Plugin plugin,
SLV2Port port);
diff --git a/slv2/query.h b/slv2/query.h
index 61b266b..619b902 100644
--- a/slv2/query.h
+++ b/slv2/query.h
@@ -30,6 +30,7 @@ extern "C" {
/** Query a plugin with an arbitrary SPARQL string.
*/
+SLV2_API
SLV2Results
slv2_plugin_query_sparql(SLV2Plugin plugin,
const char* sparql_str);
@@ -37,6 +38,7 @@ slv2_plugin_query_sparql(SLV2Plugin plugin,
/** Free query results.
*/
+SLV2_API
void
slv2_results_free(SLV2Results results);
@@ -46,12 +48,14 @@ slv2_results_free(SLV2Results results);
* iterate to the end of \a results and rewinding is impossible).
* Instead, use slv2_results_next and slv2_results_finished repeatedly.
*/
+SLV2_API
unsigned
slv2_results_size(SLV2Results results);
/** Return true iff the end of \a results has been reached.
*/
+SLV2_API
bool
slv2_results_finished(SLV2Results results);
@@ -61,6 +65,7 @@ slv2_results_finished(SLV2Results results);
* Returned value must be freed by caller with slv2_value_free.
* \return NULL if binding value can not be expressed as an SLV2Value.
*/
+SLV2_API
SLV2Value
slv2_results_get_binding_value(SLV2Results results, unsigned index);
@@ -70,6 +75,7 @@ slv2_results_get_binding_value(SLV2Results results, unsigned index);
* Returned value must be freed by caller with slv2_value_free.
* \return NULL if binding value can not be expressed as an SLV2Value.
*/
+SLV2_API
SLV2Value
slv2_results_get_binding_value_by_name(SLV2Results results, const char* name);
@@ -78,12 +84,14 @@ slv2_results_get_binding_value_by_name(SLV2Results results, const char* name);
* Returned value is shared and must not be freed by caller.
* Indices correspond to selected variables in the query in order of appearance.
*/
+SLV2_API
const char*
slv2_results_get_binding_name(SLV2Results results, unsigned index);
/** Increment \a results to the next match.
*/
+SLV2_API
void
slv2_results_next(SLV2Results results);
diff --git a/slv2/scalepoint.h b/slv2/scalepoint.h
index 311b014..d371ea1 100644
--- a/slv2/scalepoint.h
+++ b/slv2/scalepoint.h
@@ -34,6 +34,7 @@ extern "C" {
*
* Returned value is owned by \a point and must not be freed.
*/
+SLV2_API
SLV2Value
slv2_scale_point_get_label(SLV2ScalePoint point);
@@ -42,6 +43,7 @@ slv2_scale_point_get_label(SLV2ScalePoint point);
*
* Returned value is owned by \a point and must not be freed.
*/
+SLV2_API
SLV2Value
slv2_scale_point_get_value(SLV2ScalePoint point);
diff --git a/slv2/types.h b/slv2/types.h
index 2cf01fd..f0f6d58 100644
--- a/slv2/types.h
+++ b/slv2/types.h
@@ -26,6 +26,24 @@ extern "C" {
#include <stdint.h>
#include <stdbool.h>
+#if defined _WIN32 || defined __CYGWIN__
+ #define SLV2_LIB_IMPORT __declspec(dllimport)
+ #define SLV2_LIB_EXPORT __declspec(dllexport)
+#else
+ #define SLV2_LIB_IMPORT __attribute__ ((visibility("default")))
+ #define SLV2_LIB_EXPORT __attribute__ ((visibility("default")))
+#endif
+
+#ifdef SLV2_SHARED // Building a shared library
+ #ifdef SLV2_INTERNAL // Building SLV2 (not using it)
+ #define SLV2_API SLV2_LIB_EXPORT
+ #else
+ #define SLV2_API SLV2_LIB_IMPORT
+ #endif
+#else // Building a static library
+ #define SLV2_API
+#endif // SLV2_DLL
+
#define SLV2_NAMESPACE_LV2 "http://lv2plug.in/ns/lv2core#"
#define SLV2_PORT_CLASS_PORT "http://lv2plug.in/ns/lv2core#Port"
#define SLV2_PORT_CLASS_INPUT "http://lv2plug.in/ns/lv2core#InputPort"
diff --git a/slv2/util.h b/slv2/util.h
index f1ef2d4..0a53b82 100644
--- a/slv2/util.h
+++ b/slv2/util.h
@@ -24,6 +24,7 @@ extern "C" {
#endif
#include <stdarg.h>
+#include "slv2/types.h"
/** \defgroup slv2_util Utility functions
@@ -37,6 +38,7 @@ extern "C" {
* Return value is shared and must not be deleted by caller.
* \return \a uri converted to a path, or NULL on failure (URI is not local).
*/
+SLV2_API
const char* slv2_uri_to_path(const char* uri);
diff --git a/slv2/value.h b/slv2/value.h
index 4a32c1a..4a71cad 100644
--- a/slv2/value.h
+++ b/slv2/value.h
@@ -35,6 +35,7 @@ extern "C" {
*
* Returned value must be freed by caller with slv2_value_free.
*/
+SLV2_API
SLV2Value
slv2_value_new_uri(SLV2World world, const char* uri);
@@ -43,6 +44,7 @@ slv2_value_new_uri(SLV2World world, const char* uri);
*
* Returned value must be freed by caller with slv2_value_free.
*/
+SLV2_API
SLV2Value
slv2_value_new_string(SLV2World world, const char* str);
@@ -51,6 +53,7 @@ slv2_value_new_string(SLV2World world, const char* str);
*
* Returned value must be freed by caller with slv2_value_free.
*/
+SLV2_API
SLV2Value
slv2_value_new_int(SLV2World world, int val);
@@ -59,38 +62,43 @@ slv2_value_new_int(SLV2World world, int val);
*
* Returned value must be freed by caller with slv2_value_free.
*/
+SLV2_API
SLV2Value
slv2_value_new_float(SLV2World world, float val);
/** Free an SLV2Value.
*/
+SLV2_API
void
slv2_value_free(SLV2Value val);
/** Duplicate an SLV2Value.
*/
+SLV2_API
SLV2Value
slv2_value_duplicate(SLV2Value val);
/** Return whether two values are equivalent.
*/
+SLV2_API
bool
slv2_value_equals(SLV2Value value, SLV2Value other);
/** Return this value as a Turtle/SPARQL token.
* Examples:
- * <http://example.org/foo>
- * doap:name
- * "this is a string"
- * 1.0
- * 1
+ * <http://example.org/foo>
+ * doap:name
+ * "this is a string"
+ * 1.0
+ * 1
*
* Returned string is newly allocated and must be freed by caller.
*/
+SLV2_API
char*
slv2_value_get_turtle_token(SLV2Value value);
@@ -99,6 +107,7 @@ slv2_value_get_turtle_token(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
bool
slv2_value_is_uri(SLV2Value value);
@@ -110,6 +119,7 @@ slv2_value_is_uri(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
const char*
slv2_value_as_uri(SLV2Value value);
@@ -144,6 +154,7 @@ slv2_value_as_qname(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
bool
slv2_value_is_literal(SLV2Value value);
@@ -154,6 +165,7 @@ slv2_value_is_literal(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
bool
slv2_value_is_string(SLV2Value value);
@@ -162,6 +174,7 @@ slv2_value_is_string(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
const char*
slv2_value_as_string(SLV2Value value);
@@ -170,6 +183,7 @@ slv2_value_as_string(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
bool
slv2_value_is_float(SLV2Value value);
@@ -181,6 +195,7 @@ slv2_value_is_float(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
float
slv2_value_as_float(SLV2Value value);
@@ -189,6 +204,7 @@ slv2_value_as_float(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
bool
slv2_value_is_int(SLV2Value value);
@@ -199,6 +215,7 @@ slv2_value_is_int(SLV2Value value);
*
* Time = O(1)
*/
+SLV2_API
int
slv2_value_as_int(SLV2Value value);
diff --git a/slv2/world.h b/slv2/world.h
index 9d2dd77..bb84868 100644
--- a/slv2/world.h
+++ b/slv2/world.h
@@ -50,12 +50,14 @@ extern "C" {
*
* If initialization fails, NULL is returned.
*/
+SLV2_API
SLV2World
slv2_world_new();
/** Initialize a new, empty world, using an existing Redland context.
*/
+SLV2_API
SLV2World
slv2_world_new_using_rdf_world(librdf_world* world);
@@ -66,6 +68,7 @@ slv2_world_new_using_rdf_world(librdf_world* world);
* plugins, etc. Do not destroy the world until you are finished with all
* objects that came from it.
*/
+SLV2_API
void
slv2_world_free(SLV2World world);
@@ -83,6 +86,7 @@ slv2_world_free(SLV2World world);
*
* Time = Query
*/
+SLV2_API
void
slv2_world_load_all(SLV2World world);
@@ -105,6 +109,7 @@ slv2_world_load_all(SLV2World world);
*
* Time = Query
*/
+SLV2_API
void
slv2_world_load_bundle(SLV2World world,
SLV2Value bundle_uri);
@@ -114,6 +119,7 @@ slv2_world_load_bundle(SLV2World world,
*
* Time = O(1)
*/
+SLV2_API
SLV2PluginClass
slv2_world_get_plugin_class(SLV2World world);
@@ -124,6 +130,7 @@ slv2_world_get_plugin_class(SLV2World world);
*
* Time = O(1)
*/
+SLV2_API
SLV2PluginClasses
slv2_world_get_plugin_classes(SLV2World world);
@@ -141,6 +148,7 @@ slv2_world_get_plugin_classes(SLV2World world);
*
* Time = O(1)
*/
+SLV2_API
SLV2Plugins
slv2_world_get_all_plugins(SLV2World world);
@@ -156,6 +164,7 @@ slv2_world_get_all_plugins(SLV2World world);
*
* Time = O(n * Time(include))
*/
+SLV2_API
SLV2Plugins
slv2_world_get_plugins_by_filter(SLV2World world,
bool (*include)(SLV2Plugin));