};
#define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( int, __net_Read, ( vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry ) );
+VLC_EXPORT( int, __net_Read, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry ) );
#define net_ReadNonBlock(a,b,c,d,e,f) __net_ReadNonBlock(VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( int, __net_ReadNonBlock, ( vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait ) );
+VLC_EXPORT( int, __net_ReadNonBlock, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait ) );
#define net_Select(a,b,c,d,e,f,g) __net_Select(VLC_OBJECT(a),b,c,d,e,f,g)
-VLC_EXPORT( int, __net_Select, ( vlc_object_t *p_this, int *pi_fd, v_socket_t **, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait ) );
+VLC_EXPORT( int, __net_Select, ( vlc_object_t *p_this, const int *pi_fd, const v_socket_t *const *, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait ) );
#define net_Write(a,b,c,d,e) __net_Write(VLC_OBJECT(a),b,c,d,e)
-VLC_EXPORT( int, __net_Write, ( vlc_object_t *p_this, int fd, v_socket_t *, const uint8_t *p_data, int i_data ) );
+VLC_EXPORT( int, __net_Write, ( vlc_object_t *p_this, int fd, const v_socket_t *, const uint8_t *p_data, int i_data ) );
#define net_Gets(a,b,c) __net_Gets(VLC_OBJECT(a),b,c)
-VLC_EXPORT( char *, __net_Gets, ( vlc_object_t *p_this, int fd, v_socket_t * ) );
+VLC_EXPORT( char *, __net_Gets, ( vlc_object_t *p_this, int fd, const v_socket_t * ) );
-VLC_EXPORT( int, net_Printf, ( vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, ... ) );
+VLC_EXPORT( int, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ... ) );
#define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
-VLC_EXPORT( int, __net_vaPrintf, ( vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, va_list args ) );
+VLC_EXPORT( int, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) );
#if !HAVE_INET_PTON
int (*__net_Accept_inner) (vlc_object_t *, int *, mtime_t);
int (*__net_OpenUDP_inner) (vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server);
void (*net_Close_inner) (int fd);
- int (*__net_Read_inner) (vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry);
- int (*__net_ReadNonBlock_inner) (vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait);
- int (*__net_Select_inner) (vlc_object_t *p_this, int *pi_fd, v_socket_t **, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait);
- int (*__net_Write_inner) (vlc_object_t *p_this, int fd, v_socket_t *, const uint8_t *p_data, int i_data);
- char * (*__net_Gets_inner) (vlc_object_t *p_this, int fd, v_socket_t *);
- int (*net_Printf_inner) (vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, ...);
- int (*__net_vaPrintf_inner) (vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, va_list args);
+ int (*__net_Read_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry);
+ int (*__net_ReadNonBlock_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait);
+ int (*__net_Select_inner) (vlc_object_t *p_this, const int *pi_fd, const v_socket_t *const *, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait);
+ int (*__net_Write_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, const uint8_t *p_data, int i_data);
+ char * (*__net_Gets_inner) (vlc_object_t *p_this, int fd, const v_socket_t *);
+ int (*net_Printf_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ...);
+ int (*__net_vaPrintf_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args);
int (*vout_ShowTextRelative_inner) (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t);
int (*vout_ShowTextAbsolute_inner) (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t);
void (*__vout_OSDMessage_inner) (vlc_object_t *, int, char *, ...);
static int
net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
- v_socket_t *const *restrict vsv,
+ const v_socket_t *const *restrict vsv,
uint8_t *restrict buf, size_t buflen,
int wait_ms, vlc_bool_t waitall )
{
* data
*****************************************************************************/
int __net_Read( vlc_object_t *restrict p_this, int fd,
- v_socket_t *restrict p_vs,
+ const v_socket_t *restrict p_vs,
uint8_t *restrict p_data, int i_data, vlc_bool_t b_retry )
{
- return net_ReadInner (p_this, 1, &(int){ fd }, &(v_socket_t *){ p_vs },
+ return net_ReadInner (p_this, 1, &(int){ fd },
+ &(const v_socket_t *){ p_vs },
p_data, i_data, -1, b_retry);
}
* Read from a network socket, non blocking mode (with timeout)
*****************************************************************************/
int __net_ReadNonBlock( vlc_object_t *restrict p_this, int fd,
- v_socket_t *restrict p_vs,
+ const v_socket_t *restrict p_vs,
uint8_t *restrict p_data, int i_data, mtime_t i_wait)
{
- return net_ReadInner (p_this, 1, &(int){ fd }, &(v_socket_t *){ p_vs },
+ return net_ReadInner (p_this, 1, &(int){ fd },
+ &(const v_socket_t *){ p_vs },
p_data, i_data, i_wait / 1000, VLC_FALSE);
}
* Read from several sockets (with timeout). Takes data from the first socket
* that has some.
*****************************************************************************/
-int __net_Select( vlc_object_t *restrict p_this, int *restrict pi_fd,
- v_socket_t **restrict pp_vs,
+int __net_Select( vlc_object_t *restrict p_this, const int *restrict pi_fd,
+ const v_socket_t *const *restrict pp_vs,
int i_fd, uint8_t *restrict p_data, int i_data,
mtime_t i_wait )
{
/* Write exact amount requested */
-int __net_Write( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
+int __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const uint8_t *p_data, int i_data )
{
struct timeval timeout;
return i_total;
}
-char *__net_Gets( vlc_object_t *p_this, int fd, v_socket_t *p_vs )
+char *__net_Gets( vlc_object_t *p_this, int fd, const v_socket_t *p_vs )
{
char *psz_line = NULL, *ptr = NULL;
size_t i_line = 0, i_max = 0;
return psz_line;
}
-int net_Printf( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
+int net_Printf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const char *psz_fmt, ... )
{
int i_ret;
return i_ret;
}
-int __net_vaPrintf( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
+int __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const char *psz_fmt, va_list args )
{
char *psz;