21#ifndef INPUT_MRL_HELPERS_H
22#define INPUT_MRL_HELPERS_H
60#define RFC3986_SUBDELIMS "!" "$" "&" "'" "(" ")" \
62#define RFC3986_ALPHA "abcdefghijklmnopqrstuvwxyz" \
63 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
64#define RFC3986_DIGIT "0123456789"
65#define RFC3986_UNRESERVED RFC3986_ALPHA RFC3986_DIGIT "-" "." "_" "~"
66#define RFC3986_PCHAR RFC3986_UNRESERVED RFC3986_SUBDELIMS ":" "@"
67#define RFC3986_FRAGMENT RFC3986_PCHAR "/" "?"
72 for(
char const*
p = payload; *
p; ++
p )
75 ( strchr(
"!?", *
p ) == NULL &&
79#undef RFC3986_FRAGMENT
81#undef RFC3986_UNRESERVEd
84#undef RFC3986_SUBDELIMS
105 if( escaped == NULL )
169 char const* payload )
171 while( strncmp( payload,
"!/", 2 ) == 0 )
175 int len = strcspn( payload,
"!?" );
176 char* decoded =
strndup( payload, len );
189 while( strncmp( payload,
"!+", 2 ) == 0 )
193 int len = strcspn( payload,
"!?" );
194 char* decoded =
strndup( payload, len );
209 if( *payload ==
'!' )
215 mrli->
extra = payload;
#define unlikely(p)
Predicted false condition.
Definition vlc_common.h:246
#define VLC_MALLOC
Definition vlc_common.h:157
#define VLC_EGENERIC
Unspecified error.
Definition vlc_common.h:480
#define VLC_SUCCESS
No error.
Definition vlc_common.h:478
int vlc_memstream_open(struct vlc_memstream *ms)
Initializes a byte stream object.
Definition memstream.c:119
int vlc_memstream_printf(struct vlc_memstream *ms, const char *fmt,...)
Appends a formatted string to a byte stream.
Definition memstream.c:214
int vlc_memstream_putc(struct vlc_memstream *ms, int c)
Appends a single byte to a byte stream.
Definition memstream.c:171
int() vlc_memstream_puts(struct vlc_memstream *ms, const char *str)
Appends a nul-terminated string to a byte stream.
Definition memstream.c:176
int vlc_memstream_close(struct vlc_memstream *ms)
Closes a byte stream object.
Definition memstream.c:134
static void mrl_info_Clean(struct mrl_info *mrli)
Definition mrl_helpers.h:130
static void mrl_info_Init(struct mrl_info *mrli)
Definition mrl_helpers.h:141
static char * mrl_EscapeFragmentIdentifier(char const *payload)
Escape a fragment identifier for use within an MRL.
Definition mrl_helpers.h:56
static char * mrl_AppendAnchorFragment(const char *anchor, char const *payload)
Definition mrl_helpers.h:93
static int mrl_FragmentSplit(struct mrl_info *mrli, char const *payload)
Split an MRL-fragment into identifiers.
Definition mrl_helpers.h:168
char * vlc_uri_decode(char *str)
Decodes an URI component in place.
Definition url.c:74
Definition mrl_helpers.h:123
vlc_array_t volumes
Definition mrl_helpers.h:125
vlc_array_t identifiers
Definition mrl_helpers.h:124
char const * extra
Definition mrl_helpers.h:126
Definition vlc_arrays.h:259
In-memory stream object.
Definition vlc_memstream.h:42
char * ptr
Buffer start address.
Definition vlc_memstream.h:48
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:335
static void vlc_array_init(vlc_array_t *p_array)
Definition vlc_arrays.h:264
static void vlc_array_clear(vlc_array_t *p_array)
Definition vlc_arrays.h:270
#define vlc_array_item_at_index(ar, idx)
Definition vlc_arrays.h:283
static size_t vlc_array_count(const vlc_array_t *p_array)
Definition vlc_arrays.h:277
This file is a collection of common definitions and types.
char * strndup(const char *, size_t)