From 53c28210b9e81ba33fddce89b2d61fb7c99445dc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 20 Feb 2021 13:17:03 -0500 Subject: Rename SerdURI to SerdURIView --- src/uri.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'src/uri.c') diff --git a/src/uri.c b/src/uri.c index 18154329..def2b326 100644 --- a/src/uri.c +++ b/src/uri.c @@ -83,7 +83,7 @@ serd_uri_string_has_scheme(const char* utf8) } SerdStatus -serd_uri_parse(const char* const utf8, SerdURI* const out) +serd_uri_parse(const char* const utf8, SerdURIView* const out) { *out = SERD_URI_NULL; @@ -259,9 +259,9 @@ merge(SerdStringView* const base, SerdStringView* const path) /// See http://tools.ietf.org/html/rfc3986#section-5.2.2 void -serd_uri_resolve(const SerdURI* const r, - const SerdURI* const base, - SerdURI* const t) +serd_uri_resolve(const SerdURIView* const r, + const SerdURIView* const base, + SerdURIView* const t) { if (!base->scheme.len) { *t = *r; // Don't resolve against non-absolute URIs @@ -302,10 +302,10 @@ serd_uri_resolve(const SerdURI* const r, /** Write the path of `uri` starting at index `i` */ static size_t -write_path_tail(SerdSink sink, - void* const stream, - const SerdURI* const uri, - const size_t i) +write_path_tail(SerdSink sink, + void* const stream, + const SerdURIView* const uri, + const size_t i) { size_t len = 0; if (i < uri->path_base.len) { @@ -326,10 +326,10 @@ write_path_tail(SerdSink sink, /** Write the path of `uri` relative to the path of `base`. */ static size_t -write_rel_path(SerdSink sink, - void* const stream, - const SerdURI* const uri, - const SerdURI* const base) +write_rel_path(SerdSink sink, + void* const stream, + const SerdURIView* const uri, + const SerdURIView* const base) { const size_t path_len = uri_path_len(uri); const size_t base_len = uri_path_len(base); @@ -367,7 +367,7 @@ write_rel_path(SerdSink sink, } static uint8_t -serd_uri_path_starts_without_slash(const SerdURI* uri) +serd_uri_path_starts_without_slash(const SerdURIView* uri) { return ((uri->path_base.len || uri->path.len) && ((!uri->path_base.len || uri->path_base.buf[0] != '/') && @@ -376,11 +376,11 @@ serd_uri_path_starts_without_slash(const SerdURI* uri) /// See http://tools.ietf.org/html/rfc3986#section-5.3 size_t -serd_uri_serialise_relative(const SerdURI* const uri, - const SerdURI* const base, - const SerdURI* const root, - SerdSink sink, - void* const stream) +serd_uri_serialise_relative(const SerdURIView* const uri, + const SerdURIView* const base, + const SerdURIView* const root, + SerdSink sink, + void* const stream) { size_t len = 0; const bool relative = @@ -428,7 +428,9 @@ serd_uri_serialise_relative(const SerdURI* const uri, /// See http://tools.ietf.org/html/rfc3986#section-5.3 size_t -serd_uri_serialise(const SerdURI* const uri, SerdSink sink, void* const stream) +serd_uri_serialise(const SerdURIView* const uri, + SerdSink sink, + void* const stream) { return serd_uri_serialise_relative(uri, NULL, NULL, sink, stream); } -- cgit v1.2.1