summaryrefslogtreecommitdiffstats
path: root/src/port.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-07-31 04:15:58 +0000
committerDavid Robillard <d@drobilla.net>2014-07-31 04:15:58 +0000
commit99eca3f240998654e0adb3263dee93a19a4dc4b2 (patch)
tree5937f3a135dcd865cea06e6d37671fc6be50b85a /src/port.c
parent45f02a1390bbea3f7acbef5fdb4807a9f9331f3d (diff)
downloadlilv-99eca3f240998654e0adb3263dee93a19a4dc4b2.tar.gz
lilv-99eca3f240998654e0adb3263dee93a19a4dc4b2.tar.bz2
lilv-99eca3f240998654e0adb3263dee93a19a4dc4b2.zip
Minor code cleanups, slightly reduce LOC.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5416 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/port.c')
-rw-r--r--src/port.c77
1 files changed, 29 insertions, 48 deletions
diff --git a/src/port.c b/src/port.c
index 5d076fd..b1eccf6 100644
--- a/src/port.c
+++ b/src/port.c
@@ -50,8 +50,7 @@ lilv_port_free(const LilvPlugin* plugin, LilvPort* port)
}
}
-LILV_API
-bool
+LILV_API bool
lilv_port_is_a(const LilvPlugin* plugin,
const LilvPort* port,
const LilvNode* port_class)
@@ -63,21 +62,18 @@ lilv_port_is_a(const LilvPlugin* plugin,
return false;
}
-LILV_API
-bool
+LILV_API bool
lilv_port_has_property(const LilvPlugin* p,
const LilvPort* port,
const LilvNode* property)
{
- return lilv_world_ask_internal(
- p->world,
- port->node->node,
- p->world->uris.lv2_portProperty,
- lilv_node_as_node(property));
+ return lilv_world_ask_internal(p->world,
+ port->node->node,
+ p->world->uris.lv2_portProperty,
+ property->node);
}
-LILV_API
-bool
+LILV_API bool
lilv_port_supports_event(const LilvPlugin* p,
const LilvPort* port,
const LilvNode* event)
@@ -90,7 +86,7 @@ lilv_port_supports_event(const LilvPlugin* p,
if (lilv_world_ask_internal(p->world,
port->node->node,
sord_new_uri(p->world->world, *pred),
- lilv_node_as_node(event))) {
+ event->node)) {
return true;
}
}
@@ -102,23 +98,20 @@ lilv_port_get_value_by_node(const LilvPlugin* p,
const LilvPort* port,
const SordNode* predicate)
{
- return lilv_world_find_nodes_internal(
- p->world,
- port->node->node,
- predicate,
- NULL);
+ return lilv_world_find_nodes_internal(p->world,
+ port->node->node,
+ predicate,
+ NULL);
}
-LILV_API
-const LilvNode*
+LILV_API const LilvNode*
lilv_port_get_node(const LilvPlugin* plugin,
const LilvPort* port)
{
return port->node;
}
-LILV_API
-LilvNodes*
+LILV_API LilvNodes*
lilv_port_get_value(const LilvPlugin* p,
const LilvPort* port,
const LilvNode* predicate)
@@ -129,13 +122,10 @@ lilv_port_get_value(const LilvPlugin* p,
return NULL;
}
- return lilv_port_get_value_by_node(
- p, port,
- lilv_node_as_node(predicate));
+ return lilv_port_get_value_by_node(p, port, predicate->node);
}
-LILV_API
-LilvNode*
+LILV_API LilvNode*
lilv_port_get(const LilvPlugin* p,
const LilvPort* port,
const LilvNode* predicate)
@@ -149,24 +139,21 @@ lilv_port_get(const LilvPlugin* p,
return value;
}
-LILV_API
-uint32_t
+LILV_API uint32_t
lilv_port_get_index(const LilvPlugin* p,
const LilvPort* port)
{
return port->index;
}
-LILV_API
-const LilvNode*
+LILV_API const LilvNode*
lilv_port_get_symbol(const LilvPlugin* p,
const LilvPort* port)
{
return port->symbol;
}
-LILV_API
-LilvNode*
+LILV_API LilvNode*
lilv_port_get_name(const LilvPlugin* p,
const LilvPort* port)
{
@@ -188,16 +175,14 @@ lilv_port_get_name(const LilvPlugin* p,
return ret;
}
-LILV_API
-const LilvNodes*
+LILV_API const LilvNodes*
lilv_port_get_classes(const LilvPlugin* p,
const LilvPort* port)
{
return port->classes;
}
-LILV_API
-void
+LILV_API void
lilv_port_get_range(const LilvPlugin* p,
const LilvPort* port,
LilvNode** def,
@@ -230,8 +215,7 @@ lilv_port_get_range(const LilvPlugin* p,
}
}
-LILV_API
-LilvScalePoints*
+LILV_API LilvScalePoints*
lilv_port_get_scale_points(const LilvPlugin* p,
const LilvPort* port)
{
@@ -248,15 +232,13 @@ lilv_port_get_scale_points(const LilvPlugin* p,
FOREACH_MATCH(points) {
const SordNode* point = sord_iter_get_node(points, SORD_OBJECT);
- LilvNode* value = lilv_plugin_get_unique(
- p,
- point,
- p->world->uris.rdf_value);
+ LilvNode* value = lilv_plugin_get_unique(p,
+ point,
+ p->world->uris.rdf_value);
- LilvNode* label = lilv_plugin_get_unique(
- p,
- point,
- p->world->uris.rdfs_label);
+ LilvNode* label = lilv_plugin_get_unique(p,
+ point,
+ p->world->uris.rdfs_label);
if (value && label) {
zix_tree_insert(
@@ -269,8 +251,7 @@ lilv_port_get_scale_points(const LilvPlugin* p,
return ret;
}
-LILV_API
-LilvNodes*
+LILV_API LilvNodes*
lilv_port_get_properties(const LilvPlugin* p,
const LilvPort* port)
{