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>2019-04-13 19:15:32 +0200
commit6fa4720fe935853338b362e5fce1a2486e16978a (patch)
tree6ec84745cd6133f852d5bf49f33c786d01919fbb /src
parent05d9109178906eb68ef6b488d115134c7bdcf179 (diff)
downloadserd-6fa4720fe935853338b362e5fce1a2486e16978a.tar.gz
serd-6fa4720fe935853338b362e5fce1a2486e16978a.tar.bz2
serd-6fa4720fe935853338b362e5fce1a2486e16978a.zip
Add blank node API
Diffstat (limited to 'src')
-rw-r--r--src/node.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index c06cb88d..a40ac937 100644
--- a/src/node.c
+++ b/src/node.c
@@ -160,6 +160,20 @@ 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;
+}
+
+SerdNode*
serd_node_copy(const SerdNode* node)
{
if (!node) {