summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-29 02:09:01 +0000
committerDavid Robillard <d@drobilla.net>2011-04-29 02:09:01 +0000
commit95ab9c9d236ecc524d98a6a08cd5bae9667265fb (patch)
tree7c22a10f056aab6c1e716059b2ce27cc6c625ad2 /src
parentb4cd6dd752c8da20e61abd3774bf9302724a773f (diff)
downloadlilv-95ab9c9d236ecc524d98a6a08cd5bae9667265fb.tar.gz
lilv-95ab9c9d236ecc524d98a6a08cd5bae9667265fb.tar.bz2
lilv-95ab9c9d236ecc524d98a6a08cd5bae9667265fb.zip
Terser names for value constructors.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3223 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/plugin.c2
-rw-r--r--src/pluginui.c2
-rw-r--r--src/value.c28
-rw-r--r--src/world.c6
4 files changed, 19 insertions, 19 deletions
diff --git a/src/plugin.c b/src/plugin.c
index b03205c..7ff47c5 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -449,7 +449,7 @@ lilv_plugin_get_value_by_qname(const LilvPlugin* p,
if (!pred_uri) {
return NULL;
}
- LilvValue* pred_value = lilv_value_new_uri(p->world, pred_uri);
+ LilvValue* pred_value = lilv_new_uri(p->world, pred_uri);
LilvValues* ret = lilv_plugin_get_value(p, pred_value);
lilv_value_free(pred_value);
diff --git a/src/pluginui.c b/src/pluginui.c
index b6fa60a..a2df5f2 100644
--- a/src/pluginui.c
+++ b/src/pluginui.c
@@ -41,7 +41,7 @@ lilv_ui_new(LilvWorld* world,
char* bundle = lilv_strdup(lilv_value_as_string(ui->binary_uri));
char* last_slash = strrchr(bundle, '/') + 1;
*last_slash = '\0';
- ui->bundle_uri = lilv_value_new_uri(world, bundle);
+ ui->bundle_uri = lilv_new_uri(world, bundle);
free(bundle);
ui->classes = lilv_values_new();
diff --git a/src/value.c b/src/value.c
index 3ede347..235a385 100644
--- a/src/value.c
+++ b/src/value.c
@@ -65,7 +65,7 @@ lilv_value_set_numerics_from_string(LilvValue* val)
* exact string value is known.
*/
LilvValue*
-lilv_value_new(LilvWorld* world, LilvValueType type, const char* str)
+lilv_new(LilvWorld* world, LilvValueType type, const char* str)
{
LilvValue* val = malloc(sizeof(struct LilvValueImpl));
val->world = world;
@@ -92,7 +92,7 @@ lilv_value_new(LilvWorld* world, LilvValueType type, const char* str)
/** Create a new LilvValue from @a node, or return NULL if impossible */
LilvValue*
-lilv_value_new_from_node(LilvWorld* world, const SordNode* node)
+lilv_new_from_node(LilvWorld* world, const SordNode* node)
{
LilvValue* result = NULL;
SordNode* datatype_uri = NULL;
@@ -120,7 +120,7 @@ lilv_value_new_from_node(LilvWorld* world, const SordNode* node)
else
LILV_ERRORF("Unknown datatype %s\n", sord_node_get_string(datatype_uri));
}
- result = lilv_value_new(world, type, (const char*)sord_node_get_string(node));
+ result = lilv_new(world, type, (const char*)sord_node_get_string(node));
switch (result->type) {
case LILV_VALUE_INT:
case LILV_VALUE_FLOAT:
@@ -132,7 +132,7 @@ lilv_value_new_from_node(LilvWorld* world, const SordNode* node)
break;
case SORD_BLANK:
type = LILV_VALUE_BLANK;
- result = lilv_value_new(world, type, (const char*)sord_node_get_string(node));
+ result = lilv_new(world, type, (const char*)sord_node_get_string(node));
break;
default:
assert(false);
@@ -143,45 +143,45 @@ lilv_value_new_from_node(LilvWorld* world, const SordNode* node)
LILV_API
LilvValue*
-lilv_value_new_uri(LilvWorld* world, const char* uri)
+lilv_new_uri(LilvWorld* world, const char* uri)
{
- return lilv_value_new(world, LILV_VALUE_URI, uri);
+ return lilv_new(world, LILV_VALUE_URI, uri);
}
LILV_API
LilvValue*
-lilv_value_new_string(LilvWorld* world, const char* str)
+lilv_new_string(LilvWorld* world, const char* str)
{
- return lilv_value_new(world, LILV_VALUE_STRING, str);
+ return lilv_new(world, LILV_VALUE_STRING, str);
}
LILV_API
LilvValue*
-lilv_value_new_int(LilvWorld* world, int val)
+lilv_new_int(LilvWorld* world, int val)
{
char str[32];
snprintf(str, sizeof(str), "%d", val);
- LilvValue* ret = lilv_value_new(world, LILV_VALUE_INT, str);
+ LilvValue* ret = lilv_new(world, LILV_VALUE_INT, str);
ret->val.int_val = val;
return ret;
}
LILV_API
LilvValue*
-lilv_value_new_float(LilvWorld* world, float val)
+lilv_new_float(LilvWorld* world, float val)
{
char str[32];
snprintf(str, sizeof(str), "%f", val);
- LilvValue* ret = lilv_value_new(world, LILV_VALUE_FLOAT, str);
+ LilvValue* ret = lilv_new(world, LILV_VALUE_FLOAT, str);
ret->val.float_val = val;
return ret;
}
LILV_API
LilvValue*
-lilv_value_new_bool(LilvWorld* world, bool val)
+lilv_new_bool(LilvWorld* world, bool val)
{
- LilvValue* ret = lilv_value_new(world, LILV_VALUE_BOOL, val ? "true" : "false");
+ LilvValue* ret = lilv_new(world, LILV_VALUE_BOOL, val ? "true" : "false");
ret->val.bool_val = val;
return ret;
}
diff --git a/src/world.c b/src/world.c
index 92f3ddc..e930964 100644
--- a/src/world.c
+++ b/src/world.c
@@ -60,7 +60,7 @@ lilv_world_new()
#define NS_DC (const uint8_t*)"http://dublincore.org/documents/dcmi-namespace/"
#define NEW_URI(uri) sord_new_uri(world->world, uri)
-#define NEW_URI_VAL(uri) lilv_value_new_uri(world, (const char*)(uri));
+#define NEW_URI_VAL(uri) lilv_new_uri(world, (const char*)(uri));
world->dc_replaces_node = NEW_URI(NS_DC "replaces");
world->dyn_manifest_node = NEW_URI(NS_DYNMAN "DynManifest");
@@ -325,7 +325,7 @@ lilv_world_add_plugin(LilvWorld* world,
// Add manifest as plugin data file (as if it were rdfs:seeAlso)
lilv_array_append(plugin->data_uris,
- lilv_value_new_uri(world, (const char*)manifest_uri->buf));
+ lilv_new_uri(world, (const char*)manifest_uri->buf));
// Set dynamic manifest library URI, if applicable
if (dyn_manifest_lib) {
@@ -569,7 +569,7 @@ lilv_world_load_directory(LilvWorld* world, const char* dir_path)
DIR* const bundle_dir = opendir(uri + file_scheme_len);
if (bundle_dir) {
closedir(bundle_dir);
- LilvValue* uri_val = lilv_value_new_uri(world, uri);
+ LilvValue* uri_val = lilv_new_uri(world, uri);
lilv_world_load_bundle(world, uri_val);
lilv_value_free(uri_val);
} else {