From 577ff8d97411f7cbd6b923a76a936dc81e7e18cc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Feb 2011 00:54:04 +0000 Subject: Consistent names for node accessors. git-svn-id: http://svn.drobilla.net/sord/trunk@32 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sord.h | 12 ++++++++---- src/sord.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sord/sord.h b/sord/sord.h index 90c3bf6..a2fbefe 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -162,20 +162,24 @@ SORD_API const uint8_t* sord_node_get_string(SordNode node); +/** Return the string value of a node, and set @a len to its length. */ SORD_API const uint8_t* sord_node_get_string_counted(SordNode node, size_t* len); -/** Get the language of a literal node. */ +/** Return the language of a literal node (or NULL). */ SORD_API const char* -sord_literal_get_lang(SordNode node); +sord_node_get_language(SordNode node); -/** Get the datatype URI of a literal node. */ +/** Return the datatype URI of a literal node (or NULL). */ SORD_API SordNode -sord_literal_get_datatype(SordNode node); +sord_node_get_datatype(SordNode node); +/** Return true iff @a a is equal to @a b. + * Note this is much faster than comparing the node's strings. + */ SORD_API bool sord_node_equals(const SordNode a, const SordNode b); diff --git a/src/sord.c b/src/sord.c index ee5ed1b..1596086 100644 --- a/src/sord.c +++ b/src/sord.c @@ -792,13 +792,13 @@ sord_node_get_string_counted(SordNode ref, size_t* n_bytes) } const char* -sord_literal_get_lang(SordNode ref) +sord_node_get_language(SordNode ref) { return ref->lang; } SordNode -sord_literal_get_datatype(SordNode ref) +sord_node_get_datatype(SordNode ref) { return ref->datatype; } -- cgit v1.2.1