diff options
author | David Robillard <d@drobilla.net> | 2021-02-20 13:17:03 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:23 -0500 |
commit | 5ea69340e389163cfea54c16a466672b9b7284b8 (patch) | |
tree | e8240a625b3b23990658266d1113b0f86a41b38e /src/uri_utils.h | |
parent | b4dee10576e9916c0c8d80033bc429dc38a70c1c (diff) | |
download | serd-5ea69340e389163cfea54c16a466672b9b7284b8.tar.gz serd-5ea69340e389163cfea54c16a466672b9b7284b8.tar.bz2 serd-5ea69340e389163cfea54c16a466672b9b7284b8.zip |
Rename SerdURI to SerdURIView
Diffstat (limited to 'src/uri_utils.h')
-rw-r--r-- | src/uri_utils.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/uri_utils.h b/src/uri_utils.h index 735555c4..03d397d2 100644 --- a/src/uri_utils.h +++ b/src/uri_utils.h @@ -31,13 +31,13 @@ slice_equals(const SerdStringView* a, const SerdStringView* b) } static inline size_t -uri_path_len(const SerdURI* uri) +uri_path_len(const SerdURIView* uri) { return uri->path_base.len + uri->path.len; } static inline char -uri_path_at(const SerdURI* uri, size_t i) +uri_path_at(const SerdURIView* uri, size_t i) { if (i < uri->path_base.len) { return uri->path_base.buf[i]; @@ -51,7 +51,7 @@ uri_path_at(const SerdURI* uri, size_t i) or zero if `uri` is not under `root`. */ static inline SERD_PURE_FUNC size_t -uri_rooted_index(const SerdURI* uri, const SerdURI* root) +uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) { if (!root || !root->scheme.len || !slice_equals(&root->scheme, &uri->scheme) || @@ -81,14 +81,14 @@ uri_rooted_index(const SerdURI* uri, const SerdURI* root) /** Return true iff `uri` shares path components with `root` */ static inline SERD_PURE_FUNC bool -uri_is_related(const SerdURI* uri, const SerdURI* root) +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 -uri_is_under(const SerdURI* uri, const SerdURI* root) +uri_is_under(const SerdURIView* uri, const SerdURIView* root) { const size_t index = uri_rooted_index(uri, root); return index > 0 && uri->path.len > index; |