aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-02-04 15:33:36 +0100
committerDavid Robillard <d@drobilla.net>2021-03-07 15:32:24 -0500
commitb2b4fa05b73c6eee51ee9db59726fc404198111a (patch)
treece2c1b9f0d6e460dde8d439d684598a6ebe1e703 /src/uri_utils.h
parentecbc7584a09059ab5987dca95a998c88de8b479a (diff)
downloadserd-b2b4fa05b73c6eee51ee9db59726fc404198111a.tar.gz
serd-b2b4fa05b73c6eee51ee9db59726fc404198111a.tar.bz2
serd-b2b4fa05b73c6eee51ee9db59726fc404198111a.zip
Make nodes opaque
Diffstat (limited to 'src/uri_utils.h')
-rw-r--r--src/uri_utils.h9
1 files changed, 6 insertions, 3 deletions
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);