aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-02-20 13:17:03 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commit53c28210b9e81ba33fddce89b2d61fb7c99445dc (patch)
tree524885916085088ee8d2744cbe3ff4ed217f149f /src/uri.c
parent19b9f627ba195cab7c7ebea9daca9ead6e4f5d9a (diff)
downloadserd-53c28210b9e81ba33fddce89b2d61fb7c99445dc.tar.gz
serd-53c28210b9e81ba33fddce89b2d61fb7c99445dc.tar.bz2
serd-53c28210b9e81ba33fddce89b2d61fb7c99445dc.zip
Rename SerdURI to SerdURIView
Diffstat (limited to 'src/uri.c')
-rw-r--r--src/uri.c40
1 files changed, 21 insertions, 19 deletions
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);
}