aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.h
diff options
context:
space:
mode:
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);