From b2b4fa05b73c6eee51ee9db59726fc404198111a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Feb 2018 15:33:36 +0100 Subject: Make nodes opaque --- src/uri_utils.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/uri_utils.h') diff --git a/src/uri_utils.h b/src/uri_utils.h index 03d397d2..6b07ec48 100644 --- a/src/uri_utils.h +++ b/src/uri_utils.h @@ -50,7 +50,8 @@ uri_path_at(const SerdURIView* uri, size_t i) Return the index of the first differing character after the last root slash, or zero if `uri` is not under `root`. */ -static inline SERD_PURE_FUNC size_t +static inline SERD_PURE_FUNC +size_t uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) { if (!root || !root->scheme.len || @@ -80,14 +81,16 @@ uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) } /** Return true iff `uri` shares path components with `root` */ -static inline SERD_PURE_FUNC bool +static inline SERD_PURE_FUNC +bool uri_is_related(const SerdURIView* uri, const SerdURIView* root) { return uri_rooted_index(uri, root) > 0; } /** Return true iff `uri` is within the base of `root` */ -static inline SERD_PURE_FUNC bool +static inline SERD_PURE_FUNC +bool uri_is_under(const SerdURIView* uri, const SerdURIView* root) { const size_t index = uri_rooted_index(uri, root); -- cgit v1.2.1