This file defines functions for manipulating URL in vlc. More...

Go to the source code of this file.
Data Structures | |
| struct | vlc_url_t |
Defines | |
| #define | I(i, a, b) ( (a) <= (i) && (i) <= (b) ) |
Functions | |
| VLC_API char * | decode_URI_duplicate (const char *psz) |
| Decode encoded URI component. | |
| VLC_API char * | decode_URI (char *psz) |
| Decode an encoded URI component in place. | |
| VLC_API char * | encode_URI_component (const char *psz) |
| Encodes a URI component (RFC3986 §2). | |
| VLC_API char * | make_URI (const char *path, const char *scheme) |
| Convert a file path to a URI. | |
| VLC_API char * | make_path (const char *url) |
| Tries to convert a URI to a local (UTF-8-encoded) file path. | |
| static void | vlc_UrlParse (vlc_url_t *url, const char *psz_url, char option) |
| static void | vlc_UrlClean (vlc_url_t *url) |
| static int | vlc_UrlIsNotEncoded (const char *psz_url) |
| Check whether a given string is not a valid URL and must hence be encoded. | |
This file defines functions for manipulating URL in vlc.
| #define I | ( | i, | ||
| a, | ||||
| b | ||||
| ) | ( (a) <= (i) && (i) <= (b) ) |
| VLC_API char* decode_URI | ( | char * | psz | ) |
Decode an encoded URI component in place.
This function does NOT decode entire URIs. It decodes components (e.g. host name, directory, file name). Decoded URIs do not exist in the real world (see RFC3986 §2.4). Complete URIs are always "encoded" (or they are syntaxically invalid).
Note that URI encoding is different from Javascript escaping. Especially, white spaces and Unicode non-ASCII code points are encoded differently.
Referenced by decode_URI_duplicate(), input_item_SetURI(), make_path(), and vlc_UrlParse().
| VLC_API char* decode_URI_duplicate | ( | const char * | psz | ) |
Decode encoded URI component.
See also decode_URI().
References decode_URI(), and strdup().
Referenced by test_decode().
| VLC_API char* encode_URI_component | ( | const char * | psz_uri | ) |
Encodes a URI component (RFC3986 §2).
| psz_uri | nul-terminated UTF-8 representation of the component. Obviously, you can't pass a URI containing a nul character, but you don't want to do that, do you? |
References encode_URI_bytes().
| VLC_API char* make_path | ( | const char * | url | ) |
Tries to convert a URI to a local (UTF-8-encoded) file path.
| url | URI to convert |
References asprintf(), decode_URI(), strdup(), strncasecmp(), strndup(), and unlikely.
Referenced by get_path(), input_item_WriteMeta(), and subtitles_Detect().
| VLC_API char* make_URI | ( | const char * | path, | |
| const char * | scheme | |||
| ) |
Convert a file path to a URI.
If already a URI, return a copy of the string.
| path | path to convert (or URI to copy) | |
| scheme | URI scheme to use (default is auto: "file", "fd" or "smb") |
References asprintf(), DIR_SEP, DIR_SEP_CHAR, encode_URI_bytes(), make_URI(), SMB_SCHEME, strdup(), and vlc_getcwd().
Referenced by Control(), GetFilenames(), libvlc_InternalInit(), LoadSlaves(), make_URI(), make_URI_def(), playlist_FindArtInCache(), playlist_Import(), playlist_MLLoad(), playlist_SaveArt(), SubtitleAdd(), vlm_ControlMediaInstanceStart(), vlm_OnMediaUpdate(), and WMCOPYWNDPROC().
| static void vlc_UrlClean | ( | vlc_url_t * | url | ) | [inline, static] |
References vlc_url_t::i_port, vlc_url_t::psz_buffer, vlc_url_t::psz_host, vlc_url_t::psz_option, vlc_url_t::psz_password, vlc_url_t::psz_path, vlc_url_t::psz_protocol, and vlc_url_t::psz_username.
Referenced by httpd_HostCreate(), and input_item_SetURI().
| static int vlc_UrlIsNotEncoded | ( | const char * | psz_url | ) | [inline, static] |
Check whether a given string is not a valid URL and must hence be encoded.
| static void vlc_UrlParse | ( | vlc_url_t * | url, | |
| const char * | psz_url, | |||
| char | option | |||
| ) | [inline, static] |
References decode_URI(), I, vlc_url_t::i_port, vlc_url_t::psz_buffer, vlc_url_t::psz_host, vlc_url_t::psz_option, vlc_url_t::psz_password, vlc_url_t::psz_path, vlc_url_t::psz_protocol, vlc_url_t::psz_username, and strdup().
Referenced by httpd_HostCreate(), and input_item_SetURI().
1.7.1