From dd63c46261f36de5c6dbd951ae1c535128f5cf8c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 12 Aug 2020 20:49:54 +0200 Subject: Make it possible to allocate nodes with CURIE datatypes --- src/node.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/node.c') diff --git a/src/node.c b/src/node.c index 8323e036..566e8839 100644 --- a/src/node.c +++ b/src/node.c @@ -238,6 +238,7 @@ serd_new_plain_literal_i(const SerdStringView str, SerdNode* serd_new_typed_literal_expanded(const SerdStringView str, const SerdNodeFlags flags, + const SerdNodeType datatype_type, const SerdStringView datatype_prefix, const SerdStringView datatype_suffix) { @@ -255,7 +256,7 @@ serd_new_typed_literal_expanded(const SerdStringView str, char* const datatype_buf = serd_node_buffer(datatype_node); datatype_node->n_bytes = datatype_uri_len; - datatype_node->type = SERD_URI; + datatype_node->type = datatype_type; memcpy(datatype_buf, datatype_prefix.buf, datatype_prefix.len); memcpy(datatype_buf + datatype_prefix.len, datatype_suffix.buf, @@ -300,14 +301,15 @@ serd_new_typed_literal_uri(const SerdStringView str, static SerdNode* serd_new_typed_literal_i(const SerdStringView str, SerdNodeFlags flags, - const SerdStringView datatype_uri) + SerdNodeType datatype_type, + const SerdStringView datatype) { assert(str.len); - assert(datatype_uri.len); - assert(strcmp(datatype_uri.buf, NS_RDF "langString")); + assert(datatype.len); + assert(strcmp(datatype.buf, NS_RDF "langString")); return serd_new_typed_literal_expanded( - str, flags, datatype_uri, SERD_EMPTY_STRING()); + str, flags, datatype_type, datatype, SERD_EMPTY_STRING()); } SerdNode* @@ -338,7 +340,7 @@ serd_new_typed_literal(const SerdStringView str, SerdNodeFlags flags = 0; serd_strlen(str.buf, &flags); - return serd_new_typed_literal_i(str, flags, datatype_uri); + return serd_new_typed_literal_i(str, flags, SERD_URI, datatype_uri); } SerdNode* -- cgit v1.2.1