From 95ab9c9d236ecc524d98a6a08cd5bae9667265fb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 29 Apr 2011 02:09:01 +0000 Subject: Terser names for value constructors. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3223 a436a847-0d15-0410-975c-d299462d15a1 --- src/value.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/value.c') 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; } -- cgit v1.2.1