summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-27 15:55:22 +0000
committerDavid Robillard <d@drobilla.net>2007-06-27 15:55:22 +0000
commit8d964fa7e72ebf076cd40a0b72caf778ce82fb85 (patch)
tree406bf1d58351c98dccf812d23d18e11b6e4e03d0
parentf323c56e8bf061741fa32e10c610e21aed622923 (diff)
downloadlilv-8d964fa7e72ebf076cd40a0b72caf778ce82fb85.tar.gz
lilv-8d964fa7e72ebf076cd40a0b72caf778ce82fb85.tar.bz2
lilv-8d964fa7e72ebf076cd40a0b72caf778ce82fb85.zip
Added slv2_value_duplicate.
git-svn-id: http://svn.drobilla.net/lad/slv2@545 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--slv2/value.h6
-rw-r--r--src/value.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/slv2/value.h b/slv2/value.h
index c61acf4..1470d36 100644
--- a/slv2/value.h
+++ b/slv2/value.h
@@ -37,6 +37,12 @@ void
slv2_value_free(SLV2Value val);
+/** Duplicate an SLV2Value.
+ */
+SLV2Value
+slv2_value_duplicate(SLV2Value val);
+
+
/** Return whether two values are equivalent.
*/
bool
diff --git a/src/value.c b/src/value.c
index 331c20c..f4dc673 100644
--- a/src/value.c
+++ b/src/value.c
@@ -50,6 +50,17 @@ slv2_value_new(SLV2ValueType type, const char* str)
}
+SLV2Value
+slv2_value_duplicate(SLV2Value val)
+{
+ SLV2Value result = (SLV2Value)malloc(sizeof(struct _SLV2Value));
+ result->str_val = strdup(val->str_val);
+ result->type = val->type;
+ result->val = val->val;
+ return result;
+}
+
+
void
slv2_value_free(SLV2Value val)
{