aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-12 13:28:47 +0200
committerDavid Robillard <d@drobilla.net>2021-03-08 23:34:52 -0500
commit677d85c7f3df3563e990f41964f6ae7d560567a0 (patch)
tree9b5113cb7c2b2cc7ae8a07ab5a21e5a55d579559 /src/node.h
parent15485f61df8cbd922907db39fcc864abb002eea3 (diff)
downloadserd-677d85c7f3df3563e990f41964f6ae7d560567a0.tar.gz
serd-677d85c7f3df3563e990f41964f6ae7d560567a0.tar.bz2
serd-677d85c7f3df3563e990f41964f6ae7d560567a0.zip
Add model
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/node.h b/src/node.h
index 51faaca6..5206b109 100644
--- a/src/node.h
+++ b/src/node.h
@@ -20,6 +20,7 @@
#include "exess/exess.h"
#include "serd/serd.h"
+#include <stdbool.h>
#include <stddef.h>
struct SerdNodeImpl {
@@ -40,6 +41,20 @@ serd_node_buffer_c(const SerdNode* SERD_NONNULL node)
return (const char*)(node + 1);
}
+static inline int
+serd_node_wildcard_compare(const SerdNode* SERD_NULLABLE a,
+ const SerdNode* SERD_NULLABLE b)
+{
+ return (!a || !b) ? 0 : serd_node_compare(a, b);
+}
+
+static inline bool
+serd_node_pattern_match(const SerdNode* SERD_NULLABLE a,
+ const SerdNode* SERD_NULLABLE b)
+{
+ return !a || !b || serd_node_equals(a, b);
+}
+
SerdNode* SERD_ALLOCATED
serd_node_malloc(size_t n_bytes, SerdNodeFlags flags, SerdNodeType type);