From d1ba721d37af61f2b529faaa16bd20ba1e161b06 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 20 Dec 2018 13:02:24 -0500 Subject: Add serd_node_compare() --- include/serd/node.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/serd') diff --git a/include/serd/node.h b/include/serd/node.h index 50108f57..95638c68 100644 --- a/include/serd/node.h +++ b/include/serd/node.h @@ -409,6 +409,19 @@ SERD_PURE_API bool serd_node_equals(const SerdNode* SERD_NULLABLE a, const SerdNode* SERD_NULLABLE b); +/** + Compare two nodes. + + Returns less than, equal to, or greater than zero if `a` is less than, equal + to, or greater than `b`, respectively. + + Nodes are ordered first by type, then by string, then by language or + datatype, if present. +*/ +SERD_PURE_API int +serd_node_compare(const SerdNode* SERD_NONNULL a, + const SerdNode* SERD_NONNULL b); + /** @} @} -- cgit v1.2.1