aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-04-29 18:36:11 +0200
committerDavid Robillard <d@drobilla.net>2018-05-27 18:23:15 +0200
commit8d1dcc05f7072651c0056221d00d8f1bf3fb80a1 (patch)
tree4e06a8ed7440c3f8554ef15e96a605507c4cbb25 /src
parentb81b27fd762c3a3880070277a6d563a1c6913c1a (diff)
downloadserd-8d1dcc05f7072651c0056221d00d8f1bf3fb80a1.tar.gz
serd-8d1dcc05f7072651c0056221d00d8f1bf3fb80a1.tar.bz2
serd-8d1dcc05f7072651c0056221d00d8f1bf3fb80a1.zip
Add blank node API
Diffstat (limited to 'src')
-rw-r--r--src/node.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 742003fb..13af7ed6 100644
--- a/src/node.c
+++ b/src/node.c
@@ -160,6 +160,21 @@ serd_node_new_literal(const char* str,
}
SerdNode*
+serd_node_new_blank(const char* str)
+{
+ if (!str) {
+ return NULL;
+ }
+
+ const size_t n_bytes = strlen(str);
+ SerdNode* node = serd_node_malloc(n_bytes, 0, SERD_BLANK);
+ memcpy(serd_node_buffer(node), str, n_bytes);
+ node->n_bytes = n_bytes;
+ return node;
+}
+
+SERD_API
+SerdNode*
serd_node_copy(const SerdNode* node)
{
if (!node) {