aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-26 11:54:21 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commitfe0b6d5d4d78cb31e1bf2381198890d070e46ed1 (patch)
tree98fdfcb34ee19b766a1ca0d724472522148d9c03 /src/node.c
parent413b4d1f58bdf1d6aed785ae9b076c7b7b9a7350 (diff)
downloadserd-fe0b6d5d4d78cb31e1bf2381198890d070e46ed1.tar.gz
serd-fe0b6d5d4d78cb31e1bf2381198890d070e46ed1.tar.bz2
serd-fe0b6d5d4d78cb31e1bf2381198890d070e46ed1.zip
Add serd_new_boolean()
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node.c b/src/node.c
index 08893fc7..199fbc5e 100644
--- a/src/node.c
+++ b/src/node.c
@@ -45,6 +45,7 @@ typedef struct StaticNode {
{sizeof(NS_XSD #name) - 1, 0, SERD_URI}, NS_XSD #name};
DEFINE_XSD_NODE(base64Binary)
+DEFINE_XSD_NODE(boolean)
DEFINE_XSD_NODE(decimal)
DEFINE_XSD_NODE(integer)
@@ -458,6 +459,13 @@ serd_digits(const double abs)
}
SerdNode*
+serd_new_boolean(bool b)
+{
+ return serd_new_typed_literal(b ? serd_string("true") : serd_string("false"),
+ serd_node_string_view(&serd_xsd_boolean.node));
+}
+
+SerdNode*
serd_new_decimal(const double d,
const unsigned frac_digits,
const SerdNode* const datatype)