From fd735236cca8af5364f98e5587b2984b3d798378 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 2 Jan 2022 21:09:00 -0500 Subject: Expose serd_nodes_token() --- include/serd/serd.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/serd') diff --git a/include/serd/serd.h b/include/serd/serd.h index c09494bc..7a280b64 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -1409,6 +1409,27 @@ const SerdNode* SERD_ALLOCATED serd_nodes_intern(SerdNodes* SERD_NONNULL nodes, const SerdNode* SERD_NULLABLE node); +/** + Make a simple "token" node. + + "Token" is just a shorthand used in this API to refer to a node that is not + a typed or tagged literal, that is, a node that is just one string. This + can be used to make URIs, blank nodes, variables, and simple string + literals. + + Note that string literals constructed with this function will have no flags + set, and so will be written as "short" literals (not triple-quoted). To + construct long literals, use the more advanced serd_nodes_literal() with the + #SERD_IS_LONG flag. + + A new node will be added if an equivalent node is not already in the set. +*/ +SERD_API +const SerdNode* SERD_ALLOCATED +serd_nodes_token(SerdNodes* SERD_NONNULL nodes, + SerdNodeType type, + SerdStringView string); + /** Make a string node. -- cgit v1.2.1