From 6fa4720fe935853338b362e5fce1a2486e16978a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Apr 2018 18:36:11 +0200 Subject: Add blank node API --- src/node.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index c06cb88d..a40ac937 100644 --- a/src/node.c +++ b/src/node.c @@ -159,6 +159,20 @@ serd_node_new_literal(const char* str, return node; } +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) { -- cgit v1.2.1