Defines | Functions

io.c File Reference

Include dependency graph for io.c:

Defines

#define INADDR_ANY   0x00000000
#define INADDR_NONE   0xFFFFFFFF

Functions

int rootwrap_bind (int family, int socktype, int protocol, const struct sockaddr *addr, size_t alen)
 Tries to obtain a bound TCP socket from the root process.
int net_Socket (vlc_object_t *p_this, int family, int socktype, int protocol)
int * net_Listen (vlc_object_t *p_this, const char *psz_host, int i_port, int type, int protocol)
ssize_t net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, void *restrict p_buf, size_t i_buflen, bool waitall)
ssize_t net_Write (vlc_object_t *p_this, int fd, const v_socket_t *p_vs, const void *restrict p_data, size_t i_data)
 Writes data to a file descriptor.
char * net_Gets (vlc_object_t *p_this, int fd, const v_socket_t *p_vs)
 Reads a line from a file descriptor.
ssize_t net_Printf (vlc_object_t *p_this, int fd, const v_socket_t *p_vs, const char *psz_fmt,...)
ssize_t net_vaPrintf (vlc_object_t *p_this, int fd, const v_socket_t *p_vs, const char *psz_fmt, va_list args)

Define Documentation

#define INADDR_ANY   0x00000000

Referenced by getaddrinfo().

#define INADDR_NONE   0xFFFFFFFF

Referenced by getaddrinfo().


Function Documentation

char* net_Gets ( vlc_object_t p_this,
int  fd,
const v_socket_t p_vs 
)

Reads a line from a file descriptor.

This function is not thread-safe; the same file descriptor I/O cannot be read by another thread at the same time (although it can be written to).

Returns:
nul-terminated heap-allocated string, or NULL on I/O error.

References net_Read, and xrealloc().

int* net_Listen ( vlc_object_t p_this,
const char *  psz_host,
int  i_port,
int  type,
int  protocol 
)
ssize_t net_Printf ( vlc_object_t p_this,
int  fd,
const v_socket_t p_vs,
const char *  psz_fmt,
  ... 
)

References net_vaPrintf, va_end(), and va_start().

ssize_t net_Read ( vlc_object_t *restrict  p_this,
int  fd,
const v_socket_t vs,
void *restrict  p_buf,
size_t  i_buflen,
bool  waitall 
)
int net_Socket ( vlc_object_t p_this,
int  family,
int  socktype,
int  protocol 
)
ssize_t net_vaPrintf ( vlc_object_t p_this,
int  fd,
const v_socket_t p_vs,
const char *  psz_fmt,
va_list  args 
)

References net_Write, and vasprintf().

ssize_t net_Write ( vlc_object_t p_this,
int  fd,
const v_socket_t p_vs,
const void *restrict  p_data,
size_t  i_data 
)

Writes data to a file descriptor.

This blocks until all data is written or an error occurs.

This function is a cancellation point if p_vs is NULL. This function is not cancellation-safe if p_vs is not NULL.

Returns:
the total number of bytes written, or -1 if an error occurs before any data is written.

References pollfd::fd, msg_Err, virtual_socket_t::p_sys, virtual_socket_t::pf_send, poll(), POLLERR, POLLHUP, POLLIN, POLLNVAL, POLLOUT, pollfd::revents, unlikely, vlc_object_waitpipe(), and vlc_testcancel().

int rootwrap_bind ( int  family,
int  socktype,
int  protocol,
const struct sockaddr *  addr,
size_t  alen 
)

Tries to obtain a bound TCP socket from the root process.

References getenv(), and recv_fd().

Referenced by net_Listen().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines