VLC 4.0.0-dev
url.c File Reference
Include dependency graph for url.c:

Functions

char * vlc_uri_decode_duplicate (const char *str)
 Decodes an URI component. More...
 
static int_fast8_t hex_to_char (unsigned char c)
 
char * vlc_uri_decode (char *str)
 Decodes an URI component in place. More...
 
static bool isurialnum (int c)
 
static bool isurisafe (int c)
 
static bool isurisubdelim (int c)
 
static bool isurihex (int c)
 
static char * encode_URI_bytes (const char *str, size_t *restrict lenp)
 
char * vlc_uri_encode (const char *str)
 Encodes a URI component. More...
 
char * vlc_path2uri (const char *path, const char *scheme)
 Converts local path to URL. More...
 
char * vlc_uri2path (const char *url)
 Converts a URI to a local path. More...
 
static char * vlc_idna_to_ascii (const char *idn)
 Converts a UTF-8 nul-terminated IDN to nul-terminated ASCII domain name. More...
 
static char * vlc_iri2uri (const char *iri)
 
static bool vlc_uri_component_validate (const char *str, const char *extras)
 
static bool vlc_uri_host_validate (const char *str)
 
static bool vlc_uri_path_validate (const char *str)
 
static int vlc_UrlParseInner (vlc_url_t *restrict url, const char *str)
 
int vlc_UrlParse (vlc_url_t *url, const char *str)
 Parses an URI or IRI. More...
 
static char * vlc_uri_fixup_inner (const char *str, const char *extras)
 
int vlc_UrlParseFixup (vlc_url_t *url, const char *str)
 Parses an URI or IRI and fix up the path part. More...
 
void vlc_UrlClean (vlc_url_t *restrict url)
 
static char * vlc_uri_merge_paths (const char *base, const char *ref)
 Merge paths. More...
 
static char * vlc_uri_remove_dot_segments (char *str)
 Remove dot segments. More...
 
char * vlc_uri_compose (const vlc_url_t *uri)
 Composes an URI. More...
 
char * vlc_uri_resolve (const char *base, const char *ref)
 Resolves an URI reference. More...
 
static void vlc_uri_putc (struct vlc_memstream *s, int c, const char *extras)
 
char * vlc_uri_fixup (const char *str)
 Fixes up a URI string. More...
 

Variables

static const char urihex [] = "0123456789ABCDEF"
 

Function Documentation

◆ encode_URI_bytes()

static char * encode_URI_bytes ( const char *  str,
size_t *restrict  lenp 
)
static

References isurisafe(), likely, unlikely, and urihex.

Referenced by vlc_path2uri(), and vlc_uri_encode().

◆ hex_to_char()

static int_fast8_t hex_to_char ( unsigned char  c)
static

Referenced by vlc_uri_decode().

◆ isurialnum()

static bool isurialnum ( int  c)
static

◆ isurihex()

static bool isurihex ( int  c)
static

◆ isurisafe()

static bool isurisafe ( int  c)
static

◆ isurisubdelim()

static bool isurisubdelim ( int  c)
static

◆ vlc_idna_to_ascii()

static char * vlc_idna_to_ascii ( const char *  idn)
static

Converts a UTF-8 nul-terminated IDN to nul-terminated ASCII domain name.

Parameters
idnUTF-8 Internationalized Domain Name to convert
Returns
a heap-allocated string or NULL on error.

References vlc_memstream::error, p, strdup(), unlikely, and vlc_alloc().

Referenced by vlc_UrlParseInner().

◆ vlc_iri2uri()

static char * vlc_iri2uri ( const char *  iri)
static

References p, unlikely, and urihex.

Referenced by vlc_UrlParseInner().

◆ vlc_uri_component_validate()

static bool vlc_uri_component_validate ( const char *  str,
const char *  extras 
)
static

◆ vlc_uri_fixup_inner()

static char * vlc_uri_fixup_inner ( const char *  str,
const char *  extras 
)
static

◆ vlc_uri_host_validate()

static bool vlc_uri_host_validate ( const char *  str)
static

◆ vlc_uri_merge_paths()

static char * vlc_uri_merge_paths ( const char *  base,
const char *  ref 
)
static

Merge paths.

See IETF RFC3986 section 5.2.3 for details.

References asprintf(), and unlikely.

Referenced by vlc_uri_resolve().

◆ vlc_uri_path_validate()

static bool vlc_uri_path_validate ( const char *  str)
static

◆ vlc_uri_putc()

static void vlc_uri_putc ( struct vlc_memstream s,
int  c,
const char *  extras 
)
static

◆ vlc_uri_remove_dot_segments()

static char * vlc_uri_remove_dot_segments ( char *  str)
static

Remove dot segments.

See IETF RFC3986 section 5.2.4 for details.

References memrchr().

Referenced by vlc_uri_resolve().

◆ vlc_UrlClean()

◆ vlc_UrlParseInner()

static int vlc_UrlParseInner ( vlc_url_t *restrict  url,
const char *  str 
)
static

Variable Documentation

◆ urihex

const char urihex[] = "0123456789ABCDEF"
static

Referenced by encode_URI_bytes(), and vlc_iri2uri().