diff options
author | David Robillard <d@drobilla.net> | 2023-02-26 12:39:18 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | 70277ccdb3035db83d81d942777c12a60c4aded3 (patch) | |
tree | 401d570c44167148cb282d1013ec1eaf4abe6283 /src/uri_utils.h | |
parent | febb30141356df83a56026bbb14099e3cb2c82fc (diff) | |
download | serd-70277ccdb3035db83d81d942777c12a60c4aded3.tar.gz serd-70277ccdb3035db83d81d942777c12a60c4aded3.tar.bz2 serd-70277ccdb3035db83d81d942777c12a60c4aded3.zip |
Rename string view fields
Diffstat (limited to 'src/uri_utils.h')
-rw-r--r-- | src/uri_utils.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/uri_utils.h b/src/uri_utils.h index 3974b5ce..ebc32b78 100644 --- a/src/uri_utils.h +++ b/src/uri_utils.h @@ -19,23 +19,23 @@ typedef struct { static inline bool slice_equals(const SerdStringView* a, const SerdStringView* b) { - return a->len == b->len && !strncmp(a->buf, b->buf, a->len); + return a->length == b->length && !strncmp(a->data, b->data, a->length); } static inline size_t uri_path_len(const SerdURIView* uri) { - return uri->path_base.len + uri->path.len; + return uri->path_base.length + uri->path.length; } static inline char uri_path_at(const SerdURIView* uri, size_t i) { - if (i < uri->path_base.len) { - return uri->path_base.buf[i]; + if (i < uri->path_base.length) { + return uri->path_base.data[i]; } - return uri->path.buf[i - uri->path_base.len]; + return uri->path.data[i - uri->path_base.length]; } /** @@ -51,7 +51,7 @@ uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) { SlashIndexes indexes = {SIZE_MAX, SIZE_MAX}; - if (!root || !root->scheme.len || + if (!root || !root->scheme.length || !slice_equals(&root->scheme, &uri->scheme) || !slice_equals(&root->authority, &uri->authority)) { return indexes; |