VLC 4.0.0-dev

HTTP read-only files. More...

Collaboration diagram for Files:

Macros

#define vlc_http_file_get_status   vlc_http_res_get_status
 
#define vlc_http_file_get_redirect   vlc_http_res_get_redirect
 
#define vlc_http_file_get_type   vlc_http_res_get_type
 
#define vlc_http_file_destroy   vlc_http_res_destroy
 

Functions

struct vlc_http_resourcevlc_http_file_create (struct vlc_http_mgr *mgr, const char *url, const char *ua, const char *ref)
 Creates an HTTP file. More...
 
uintmax_t vlc_http_file_get_size (struct vlc_http_resource *)
 Gets file size. More...
 
bool vlc_http_file_can_seek (struct vlc_http_resource *)
 Checks seeking support. More...
 
int vlc_http_file_seek (struct vlc_http_resource *, uintmax_t offset)
 Sets the read offset. More...
 
block_tvlc_http_file_read (struct vlc_http_resource *)
 Reads data. More...
 

Detailed Description

HTTP read-only files.

Macro Definition Documentation

◆ vlc_http_file_destroy

#define vlc_http_file_destroy   vlc_http_res_destroy

◆ vlc_http_file_get_redirect

#define vlc_http_file_get_redirect   vlc_http_res_get_redirect

◆ vlc_http_file_get_status

#define vlc_http_file_get_status   vlc_http_res_get_status

◆ vlc_http_file_get_type

#define vlc_http_file_get_type   vlc_http_res_get_type

Function Documentation

◆ vlc_http_file_can_seek()

bool vlc_http_file_can_seek ( struct vlc_http_resource res)

Checks seeking support.

Return values
trueif file supports seeking
falseif file does not support seeking

References vlc_http_resource::response, vlc_http_msg_can_seek(), and vlc_http_res_get_status().

Referenced by FileControl().

◆ vlc_http_file_create()

struct vlc_http_resource * vlc_http_file_create ( struct vlc_http_mgr mgr,
const char *  url,
const char *  ua,
const char *  ref 
)

Creates an HTTP file.

Allocates a structure for a remote HTTP-served read-only file.

Parameters
mgrHTTP connection manager
urlURL of the file to read
uauser agent string (or NULL to ignore)
refreferral URL (or NULL to ignore)
Returns
an HTTP resource object pointer, or NULL on error

References vlc_http_file::offset, vlc_http_file::resource, unlikely, vlc_http_file_callbacks, and vlc_http_res_init().

Referenced by Open().

◆ vlc_http_file_get_size()

uintmax_t vlc_http_file_get_size ( struct vlc_http_resource res)

Gets file size.

Determines the file size in bytes.

Returns
Bytes count or (uintmax_t)-1 if unknown.

References vlc_http_resource::response, vlc_http_msg_get_file_size(), vlc_http_msg_get_size(), and vlc_http_res_get_status().

Referenced by FileControl().

◆ vlc_http_file_read()

block_t * vlc_http_file_read ( struct vlc_http_resource res)

◆ vlc_http_file_seek()

int vlc_http_file_seek ( struct vlc_http_resource res,
uintmax_t  offset 
)

Sets the read offset.

Parameters
offsetbyte offset of next read
Return values
0if seek succeeded
-1if seek failed

References vlc_http_file::offset, vlc_http_resource::response, vlc_http_msg_destroy(), vlc_http_msg_get_status(), and vlc_http_res_open().

Referenced by FileSeek(), and vlc_http_file_read().