diff options
author | David Robillard <d@drobilla.net> | 2018-02-04 15:33:36 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:24 -0500 |
commit | b2b4fa05b73c6eee51ee9db59726fc404198111a (patch) | |
tree | ce2c1b9f0d6e460dde8d439d684598a6ebe1e703 /src/uri_utils.h | |
parent | ecbc7584a09059ab5987dca95a998c88de8b479a (diff) | |
download | serd-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.h | 9 |
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); |