VLC
3.0.15
modules
access
http
file.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* file.h: HTTP read-only file
3
*****************************************************************************
4
* Copyright (C) 2015 RĂ©mi Denis-Courmont
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation; either version 2.1 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19
*****************************************************************************/
20
21
#include <stdint.h>
22
23
/**
24
* \defgroup http_file Files
25
* HTTP read-only files
26
* \ingroup http_res
27
* @{
28
*/
29
30
struct
vlc_http_mgr
;
31
struct
vlc_http_resource
;
32
struct
block_t
;
33
34
/**
35
* Creates an HTTP file.
36
*
37
* Allocates a structure for a remote HTTP-served read-only file.
38
*
39
* @param url URL of the file to read
40
* @param ua user agent string (or NULL to ignore)
41
* @param ref referral URL (or NULL to ignore)
42
*
43
* @return an HTTP resource object pointer, or NULL on error
44
*/
45
struct
vlc_http_resource
*
vlc_http_file_create
(
struct
vlc_http_mgr
*mgr,
46
const
char
*url,
const
char
*ua,
47
const
char
*ref);
48
49
/**
50
* Gets file size.
51
*
52
* Determines the file size in bytes.
53
*
54
* @return Bytes count or (uintmax_t)-1 if unknown.
55
*/
56
uintmax_t
vlc_http_file_get_size
(
struct
vlc_http_resource
*);
57
58
/**
59
* Checks seeking support.
60
*
61
* @retval true if file supports seeking
62
* @retval false if file does not support seeking
63
*/
64
bool
vlc_http_file_can_seek
(
struct
vlc_http_resource
*);
65
66
/**
67
* Sets the read offset.
68
*
69
* @param offset byte offset of next read
70
* @retval 0 if seek succeeded
71
* @retval -1 if seek failed
72
*/
73
int
vlc_http_file_seek
(
struct
vlc_http_resource
*, uintmax_t offset);
74
75
/**
76
* Reads data.
77
*
78
* Reads data from a file and update the file offset.
79
*/
80
struct
block_t
*
vlc_http_file_read
(
struct
vlc_http_resource
*);
81
82
#define vlc_http_file_get_status vlc_http_res_get_status
83
#define vlc_http_file_get_redirect vlc_http_res_get_redirect
84
#define vlc_http_file_get_type vlc_http_res_get_type
85
#define vlc_http_file_destroy vlc_http_res_destroy
86
87
/** @} */
vlc_http_file_can_seek
bool vlc_http_file_can_seek(struct vlc_http_resource *)
Checks seeking support.
Definition:
file.c:195
vlc_http_mgr
Definition:
connmgr.c:95
vlc_http_file_get_size
uintmax_t vlc_http_file_get_size(struct vlc_http_resource *)
Gets file size.
Definition:
file.c:177
vlc_http_file_read
struct block_t * vlc_http_file_read(struct vlc_http_resource *)
Reads data.
Definition:
file.c:231
vlc_http_resource
Definition:
resource.h:42
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.
Definition:
file.c:112
block_t
Definition:
vlc_block.h:111
vlc_http_file_seek
int vlc_http_file_seek(struct vlc_http_resource *, uintmax_t offset)
Sets the read offset.
Definition:
file.c:203
Generated by
1.8.16