21#ifndef INPUT_MRL_HELPERS_H
22#define INPUT_MRL_HELPERS_H
62#define RFC3986_SUBDELIMS "!" "$" "&" "'" "(" ")" \
64#define RFC3986_ALPHA "abcdefghijklmnopqrstuvwxyz" \
65 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
66#define RFC3986_DIGIT "0123456789"
67#define RFC3986_UNRESERVED RFC3986_ALPHA RFC3986_DIGIT "-" "." "_" "~"
68#define RFC3986_PCHAR RFC3986_UNRESERVED RFC3986_SUBDELIMS ":" "@"
69#define RFC3986_FRAGMENT RFC3986_PCHAR "/" "?"
74 for(
char const*
p = payload; *
p; ++
p )
77 ( strchr(
"!?", *
p ) == NULL &&
81#undef RFC3986_FRAGMENT
83#undef RFC3986_UNRESERVEd
86#undef RFC3986_SUBDELIMS
116 char const** out_extra,
117 char const* payload )
119 char const* extra = NULL;
123 while( strncmp( payload,
"!/", 2 ) == 0 )
127 int len = strcspn( payload,
"!?" );
128 char* decoded =
strndup( payload, len );
143 if( *payload ==
'!' )
#define unlikely(p)
Predicted false condition.
Definition: vlc_common.h:257
#define VLC_EGENERIC
Unspecified error.
Definition: vlc_common.h:505
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:503
int vlc_memstream_open(struct vlc_memstream *ms)
Initializes a byte stream object.
Definition: memstream.c:105
int vlc_memstream_printf(struct vlc_memstream *ms, const char *fmt,...)
Appends a formatted string to a byte stream.
Definition: memstream.c:194
int vlc_memstream_close(struct vlc_memstream *ms)
Closes a byte stream object.
Definition: memstream.c:120
static int mrl_EscapeFragmentIdentifier(char **out, char const *payload)
Escape a fragment identifier for use within an MRL.
Definition: mrl_helpers.h:58
static int mrl_FragmentSplit(vlc_array_t *out_items, char const **out_extra, char const *payload)
Split an MRL-fragment into identifiers.
Definition: mrl_helpers.h:115
char * vlc_uri_decode(char *str)
Decodes an URI component in place.
Definition: url.c:74
Definition: vlc_arrays.h:257
In-memory stream object.
Definition: vlc_memstream.h:42
char * ptr
Buffer start address.
Definition: vlc_memstream.h:48
int error
Definition: vlc_memstream.h:46
This file defines functions, structures and macros for handling arrays in vlc.
static int vlc_array_append(vlc_array_t *ar, void *elem)
Definition: vlc_arrays.h:333
static void vlc_array_init(vlc_array_t *p_array)
Definition: vlc_arrays.h:262
static void vlc_array_clear(vlc_array_t *p_array)
Definition: vlc_arrays.h:268
#define vlc_array_item_at_index(ar, idx)
Definition: vlc_arrays.h:281
static size_t vlc_array_count(vlc_array_t *p_array)
Definition: vlc_arrays.h:275
This file is a collection of common definitions and types.
char * strndup(const char *, size_t)