Commit cc6267ce authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

access: use void pointer for pf_read callback

This matches the stream_t.pf_read convention.
parent 3efea407
......@@ -87,7 +87,7 @@ struct access_t
/* pf_read/pf_block/pf_readdir is used to read data.
* XXX A access should set one and only one of them */
ssize_t (*pf_read) ( access_t *, uint8_t *, size_t ); /* Return -1 if no data yet, 0 if no more data, else real data read */
ssize_t (*pf_read) ( access_t *, void *, size_t ); /* Return -1 if no data yet, 0 if no more data, else real data read */
block_t *(*pf_block) ( access_t * ); /* Return a block of data in his 'natural' size, NULL if not yet data or eof */
int (*pf_readdir)( access_t *, input_item_node_t * );/* Fills the provided item_node, see doc/browsing.txt for details */
......@@ -181,7 +181,7 @@ static inline ssize_t vlc_access_Read(access_t *access, void *buf, size_t len)
{
if (access->pf_read == NULL)
return -1;
return access->pf_read(access, (unsigned char *)buf, len);
return access->pf_read(access, buf, len);
}
/**
......
......@@ -47,7 +47,7 @@ struct access_sys_t
bool b_seekable; /* Is our archive type seekable ? */
};
static ssize_t Read(access_t *p_access, uint8_t *p_data, size_t i_size)
static ssize_t Read(access_t *p_access, void *p_data, size_t i_size)
{
access_sys_t *p_sys = p_access->p_sys;
......
......@@ -54,7 +54,7 @@ vlc_module_end()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t Read(access_t *, uint8_t *, size_t);
static ssize_t Read(access_t *, void *, size_t);
static int Seek(access_t *, uint64_t);
static int Control(access_t *, int, va_list);
......@@ -111,7 +111,7 @@ static void Close(vlc_object_t *object)
}
/* */
static ssize_t Read(access_t *access, uint8_t *buffer, size_t size)
static ssize_t Read(access_t *access, void *buffer, size_t size)
{
access_sys_t *sys = access->p_sys;
input_attachment_t *a = sys->attachment;
......
......@@ -62,7 +62,7 @@ vlc_module_end()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t Read (access_t *, uint8_t *, size_t);
static ssize_t Read (access_t *, void *, size_t);
static int Seek (access_t *, uint64_t);
static int Control(access_t *, int, va_list);
static ssize_t Write(sout_access_out_t *, block_t *);
......@@ -303,7 +303,7 @@ void OutCloseAvio(vlc_object_t *object)
free(sys);
}
static ssize_t Read(access_t *access, uint8_t *data, size_t size)
static ssize_t Read(access_t *access, void *data, size_t size)
{
int r = avio_read(access->p_sys->context, data, size);
if (r <= 0) {
......
......@@ -78,7 +78,7 @@ error:
return a;
}
static ssize_t Read(access_t *access, uint8_t *buf, size_t len)
static ssize_t Read(access_t *access, void *buf, size_t len)
{
access_t *a = GetAccess(access);
if (a == NULL)
......
......@@ -90,7 +90,7 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Seek( access_t *, uint64_t );
static int Control( access_t *, int, va_list );
static int BrowserInit( access_t *p_access );
......@@ -458,7 +458,7 @@ static int Seek( access_t *p_access, uint64_t i_pos )
/*****************************************************************************
* Read:
*****************************************************************************/
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
int i_read;
......
......@@ -128,7 +128,7 @@ static bool IsRemote (const char *path)
# define posix_fadvise(fd, off, len, adv)
#endif
static ssize_t Read (access_t *, uint8_t *, size_t);
static ssize_t Read (access_t *, void *, size_t);
static int FileSeek (access_t *, uint64_t);
static int NoSeek (access_t *, uint64_t);
static int FileControl (access_t *, int, va_list);
......@@ -273,7 +273,7 @@ void FileClose (vlc_object_t * p_this)
}
static ssize_t Read (access_t *p_access, uint8_t *p_buffer, size_t i_len)
static ssize_t Read (access_t *p_access, void *p_buffer, size_t i_len)
{
access_sys_t *p_sys = p_access->p_sys;
int fd = p_sys->fd;
......
......@@ -109,7 +109,7 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Seek( access_t *, uint64_t );
static int Control( access_t *, int, va_list );
static int DirRead( access_t *, input_item_node_t * );
......@@ -845,7 +845,7 @@ static int OutSeek( sout_access_out_t *p_access, off_t i_pos )
/*****************************************************************************
* Read:
*****************************************************************************/
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
int i_read;
......
......@@ -143,7 +143,7 @@ struct access_sys_t
};
/* */
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Seek( access_t *, uint64_t );
static int Control( access_t *, int, va_list );
......@@ -448,7 +448,7 @@ static void Close( vlc_object_t *p_this )
/* Read data from the socket taking care of chunked transfer if needed */
static int ReadData( access_t *p_access, int *pi_read,
uint8_t *p_buffer, size_t i_len )
void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
if( p_sys->b_chunked )
......@@ -512,7 +512,7 @@ static int ReadData( access_t *p_access, int *pi_read,
* p_buffer. Return the actual number of bytes read
*****************************************************************************/
static int ReadICYMeta( access_t *p_access );
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
int i_read;
......
......@@ -37,7 +37,7 @@ struct access_sys_t
uint64_t size;
};
static ssize_t Read(access_t *access, uint8_t *buf, size_t len)
static ssize_t Read(access_t *access, void *buf, size_t len)
{
access_sys_t *sys = access->p_sys;
......
......@@ -68,7 +68,7 @@ vlc_module_end()
*****************************************************************************/
static int Seek( access_t *, uint64_t );
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Control( access_t *, int, va_list );
static int open_file( access_t *, const char * );
......@@ -174,7 +174,7 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* Read: standard read on a file descriptor.
*****************************************************************************/
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
ssize_t i_ret;
......
......@@ -198,7 +198,7 @@ nfs_read_finished_cb(access_t *p_access)
}
static ssize_t
FileRead(access_t *p_access, uint8_t *p_buf, size_t i_len)
FileRead(access_t *p_access, void *p_buf, size_t i_len)
{
access_sys_t *p_sys = p_access->p_sys;
......
......@@ -72,7 +72,7 @@ static int Seek(access_t *access, uint64_t position)
return sys->s ? stream_Seek(sys->s, offset) : VLC_EGENERIC;
}
static ssize_t Read(access_t *access, uint8_t *data, size_t size)
static ssize_t Read(access_t *access, void *data, size_t size)
{
access_sys_t *sys = access->p_sys;
......@@ -89,7 +89,7 @@ static ssize_t Read(access_t *access, uint8_t *data, size_t size)
total += r;
if( data )
data += r;
data = ((char *)data) + r;
sys->position += r;
if (sys->position >= chunk_end &&
Seek(access, sys->position))
......
......@@ -40,7 +40,7 @@ vlc_module_begin ()
add_shortcut ("sdp")
vlc_module_end()
static ssize_t Read (access_t *, uint8_t *, size_t);
static ssize_t Read (access_t *, void *, size_t);
static int Seek (access_t *, uint64_t);
static int Control (access_t *, int, va_list);
......@@ -83,7 +83,7 @@ static void Close (vlc_object_t *obj)
free (sys);
}
static ssize_t Read (access_t *access, uint8_t *buf, size_t len)
static ssize_t Read (access_t *access, void *buf, size_t len)
{
access_sys_t *sys = access->p_sys;
......
......@@ -76,7 +76,7 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Seek( access_t *, uint64_t );
static int Control( access_t *, int, va_list );
......@@ -384,14 +384,14 @@ static void Close( vlc_object_t* p_this )
}
static ssize_t Read( access_t *p_access, uint8_t *buf, size_t len )
static ssize_t Read( access_t *p_access, void *buf, size_t len )
{
access_sys_t *p_sys = p_access->p_sys;
if( p_access->info.b_eof )
return 0;
ssize_t val = libssh2_sftp_read( p_sys->file, (char *)buf, len );
ssize_t val = libssh2_sftp_read( p_sys->file, buf, len );
if( val < 0 )
{
p_access->info.b_eof = true;
......
......@@ -80,7 +80,7 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Seek( access_t *, uint64_t );
static int Control( access_t *, int, va_list );
#ifndef _WIN32
......@@ -320,7 +320,7 @@ static int Seek( access_t *p_access, uint64_t i_pos )
/*****************************************************************************
* Read:
*****************************************************************************/
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
int i_read;
......
......@@ -62,8 +62,7 @@ struct access_sys_t
int fd;
};
static ssize_t Read( access_t *, uint8_t *, size_t );
static ssize_t Read( access_t *, void *, size_t );
static int Control( access_t *, int, va_list );
/*****************************************************************************
......@@ -132,7 +131,7 @@ static void Close( vlc_object_t *p_this )
/*****************************************************************************
* Read: read on a file descriptor
*****************************************************************************/
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
int i_read;
......
......@@ -135,7 +135,7 @@ struct access_sys_t
#define FILE_COUNT (unsigned)p_sys->file_sizes.i_size
static int Control( access_t *, int, va_list );
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len );
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len );
static int Seek( access_t *p_access, uint64_t i_pos);
static void FindSeekpoint( access_t *p_access );
static bool ScanDirectory( access_t *p_access );
......@@ -337,7 +337,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
/*****************************************************************************
* Read and concatenate files
*****************************************************************************/
static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
......
......@@ -45,7 +45,7 @@ struct access_sys_t
};
static int AccessControl( access_t *p_access, int i_query, va_list args );
static ssize_t AccessRead( access_t *, uint8_t *, size_t );
static ssize_t AccessRead( access_t *, void *, size_t );
static int AccessSeek( access_t *, uint64_t );
static char *unescapeXml( const char *psz_text );
......@@ -266,7 +266,7 @@ static int AccessControl( access_t *p_access, int i_query, va_list args )
* Reads current opened file in zip. This does not open the file in zip.
* Return -1 if no data yet, 0 if no more data, else real data read
*****************************************************************************/
static ssize_t AccessRead( access_t *p_access, uint8_t *p_buffer, size_t sz )
static ssize_t AccessRead( access_t *p_access, void *p_buffer, size_t sz )
{
access_sys_t *p_sys = p_access->p_sys;
unzFile file = p_sys->zipFile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment