aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-07-22 19:15:24 -0400
committerDavid Robillard <d@drobilla.net>2022-01-14 19:37:51 -0500
commit4584e03fce0d702160f8fde910bb3f24647d4036 (patch)
tree754373f973506f2afeb56d76ab45f688348c6579 /src
parentca3a7049506cd1ba91326a36fc02a7319657728c (diff)
downloadserd-4584e03fce0d702160f8fde910bb3f24647d4036.tar.gz
serd-4584e03fce0d702160f8fde910bb3f24647d4036.tar.bz2
serd-4584e03fce0d702160f8fde910bb3f24647d4036.zip
Rename serd_new_simple_node() to serd_new_token()
Things get confusing without a term for this concept (which is roughly "nodes that are not annoying to construct"), so "token" it is.
Diffstat (limited to 'src')
-rw-r--r--src/node.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/node.c b/src/node.c
index 9468325b..088ab058 100644
--- a/src/node.c
+++ b/src/node.c
@@ -167,12 +167,8 @@ result(const SerdStatus status, const size_t count)
}
SerdNode*
-serd_new_simple_node(const SerdNodeType type, const SerdStringView str)
+serd_new_token(const SerdNodeType type, const SerdStringView str)
{
- if (type != SERD_BLANK && type != SERD_URI && type != SERD_VARIABLE) {
- return NULL;
- }
-
SerdNodeFlags flags = 0u;
const size_t length = str.buf ? str.len : 0u;
SerdNode* node = serd_node_malloc(length, flags, type);
@@ -288,7 +284,7 @@ serd_new_literal(const SerdStringView string,
SerdNode*
serd_new_blank(const SerdStringView str)
{
- return serd_new_simple_node(SERD_BLANK, str);
+ return serd_new_token(SERD_BLANK, str);
}
ExessResult
@@ -463,7 +459,7 @@ serd_node_compare(const SerdNode* const a, const SerdNode* const b)
SerdNode*
serd_new_uri(const SerdStringView str)
{
- return serd_new_simple_node(SERD_URI, str);
+ return serd_new_token(SERD_URI, str);
}
SerdNode*