LMMS
Loading...
Searching...
No Matches
uri.c File Reference
#include "serd_internal.h"
#include <stdlib.h>
#include <string.h>

Functions

SERD_API const uint8_tserd_uri_to_path (const uint8_t *uri)
SERD_API uint8_tserd_file_uri_parse (const uint8_t *uri, uint8_t **hostname)
SERD_API bool serd_uri_string_has_scheme (const uint8_t *utf8)
SERD_API SerdStatus serd_uri_parse (const uint8_t *utf8, SerdURI *uri)
static const uint8_tremove_dot_segments (const uint8_t *path, size_t len, size_t *up)
static void merge (SerdChunk *base, SerdChunk *path)
 Merge base and path in-place.
SERD_API void serd_uri_resolve (const SerdURI *r, const SerdURI *base, SerdURI *t)
 See http://tools.ietf.org/html/rfc3986#section-5.2.2.
static size_t write_path_tail (SerdSink sink, void *stream, const SerdURI *uri, size_t i)
static size_t write_rel_path (SerdSink sink, void *stream, const SerdURI *uri, const SerdURI *base)
SERD_API size_t serd_uri_serialise_relative (const SerdURI *uri, const SerdURI *base, const SerdURI *root, SerdSink sink, void *stream)
 See http://tools.ietf.org/html/rfc3986#section-5.3.
SERD_API size_t serd_uri_serialise (const SerdURI *uri, SerdSink sink, void *stream)
 See http://tools.ietf.org/html/rfc3986#section-5.3.

Function Documentation

◆ merge()

void merge ( SerdChunk * base,
SerdChunk * path )
static

Merge base and path in-place.

◆ remove_dot_segments()

const uint8_t * remove_dot_segments ( const uint8_t * path,
size_t len,
size_t * up )
static

Remove leading dot components from path. See http://tools.ietf.org/html/rfc3986#section-5.2.3

Parameters
upSet to the number of up-references (e.g. "../") trimmed
Returns
A pointer to the new start of @path

◆ write_path_tail()

size_t write_path_tail ( SerdSink sink,
void * stream,
const SerdURI * uri,
size_t i )
static

Write the path of uri starting at index i

◆ write_rel_path()

size_t write_rel_path ( SerdSink sink,
void * stream,
const SerdURI * uri,
const SerdURI * base )
static

Write the path of uri relative to the path of base.