From 9242bbe164af2629b2746bbdebb80f5ced1f307d Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 7 Feb 2010 12:51:50 +0200 Subject: [PATCH] net: remove leading underscores --- include/vlc_network.h | 40 +++++++++++++++++++--------------------- src/libvlccore.sym | 14 +++++++------- src/network/io.c | 24 +++++++++++++----------- src/network/tcp.c | 7 ++++--- src/network/udp.c | 18 +++++++++--------- 5 files changed, 52 insertions(+), 51 deletions(-) diff --git a/include/vlc_network.h b/include/vlc_network.h index 1fba6bec32..29078adead 100644 --- a/include/vlc_network.h +++ b/include/vlc_network.h @@ -85,19 +85,18 @@ extern "C" { int net_Socket (vlc_object_t *obj, int family, int socktype, int proto); int net_SetupSocket (int fd); -#define net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e) -VLC_EXPORT( int, __net_Connect, (vlc_object_t *p_this, const char *psz_host, int i_port, int socktype, int protocol) ); +VLC_EXPORT( int, net_Connect, (vlc_object_t *p_this, const char *psz_host, int i_port, int socktype, int protocol) ); +#define net_Connect(a, b, c, d, e) net_Connect(VLC_OBJECT(a), b, c, d, e) VLC_EXPORT( int *, net_Listen, (vlc_object_t *p_this, const char *psz_host, int i_port, int protocol) ); #define net_ListenTCP(a, b, c) net_Listen(VLC_OBJECT(a), b, c, IPPROTO_TCP) -#define net_ConnectTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c) -static inline int __net_ConnectTCP (vlc_object_t *obj, const char *host, int port) +static inline int net_ConnectTCP (vlc_object_t *obj, const char *host, int port) { - return __net_Connect (obj, host, port, SOCK_STREAM, IPPROTO_TCP); + return net_Connect (obj, host, port, SOCK_STREAM, IPPROTO_TCP); } - +#define net_ConnectTCP(a, b, c) net_ConnectTCP(VLC_OBJECT(a), b, c) VLC_EXPORT( int, net_AcceptSingle, (vlc_object_t *obj, int lfd) ); @@ -105,16 +104,18 @@ VLC_EXPORT( int, net_Accept, ( vlc_object_t *, int * ) ); #define net_Accept(a, b) \ net_Accept(VLC_OBJECT(a), b) -#define net_ConnectDgram(a, b, c, d, e ) __net_ConnectDgram(VLC_OBJECT(a), b, c, d, e) -VLC_EXPORT( int, __net_ConnectDgram, ( vlc_object_t *p_this, const char *psz_host, int i_port, int hlim, int proto ) ); +VLC_EXPORT( int, net_ConnectDgram, ( vlc_object_t *p_this, const char *psz_host, int i_port, int hlim, int proto ) ); +#define net_ConnectDgram(a, b, c, d, e ) \ + net_ConnectDgram(VLC_OBJECT(a), b, c, d, e) static inline int net_ConnectUDP (vlc_object_t *obj, const char *host, int port, int hlim) { return net_ConnectDgram (obj, host, port, hlim, IPPROTO_UDP); } -#define net_OpenDgram( a, b, c, d, e, g, h ) __net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h) -VLC_EXPORT( int, __net_OpenDgram, ( vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server, int family, int proto ) ); +VLC_EXPORT( int, net_OpenDgram, ( vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server, int family, int proto ) ); +#define net_OpenDgram( a, b, c, d, e, g, h ) \ + net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h) static inline int net_ListenUDP1 (vlc_object_t *obj, const char *host, int port) { @@ -136,20 +137,17 @@ struct virtual_socket_t int (*pf_send) ( void *, const void *, int ); }; -#define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f) -VLC_EXPORT( ssize_t, __net_Read, ( vlc_object_t *p_this, int fd, const v_socket_t *, void *p_data, size_t i_data, bool b_retry ) ); - -#define net_Write(a,b,c,d,e) __net_Write(VLC_OBJECT(a),b,c,d,e) -VLC_EXPORT( ssize_t, __net_Write, ( vlc_object_t *p_this, int fd, const v_socket_t *, const void *p_data, size_t i_data ) ); +VLC_EXPORT( ssize_t, net_Read, ( vlc_object_t *p_this, int fd, const v_socket_t *, void *p_data, size_t i_data, bool b_retry ) ); +#define net_Read(a,b,c,d,e,f) net_Read(VLC_OBJECT(a),b,c,d,e,f) +VLC_EXPORT( ssize_t, net_Write, ( vlc_object_t *p_this, int fd, const v_socket_t *, const void *p_data, size_t i_data ) ); +#define net_Write(a,b,c,d,e) net_Write(VLC_OBJECT(a),b,c,d,e) +VLC_EXPORT( char *, net_Gets, ( vlc_object_t *p_this, int fd, const v_socket_t * ) ); +#define net_Gets(a,b,c) net_Gets(VLC_OBJECT(a),b,c) -#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, const v_socket_t * ) ); VLC_EXPORT( ssize_t, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ... ) LIBVLC_FORMAT( 4, 5 ) ); - -#define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e) -VLC_EXPORT( ssize_t, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) ); - +VLC_EXPORT( ssize_t, net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) ); +#define net_vaPrintf(a,b,c,d,e) net_vaPrintf(VLC_OBJECT(a),b,c,d,e) VLC_EXPORT (int, vlc_inet_pton, (int af, const char *src, void *dst) ); VLC_EXPORT (const char *, vlc_inet_ntop, (int af, const void *src, diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 4040b47a97..37002e19cc 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -263,17 +263,17 @@ mstrtime mwait net_Accept net_AcceptSingle -__net_Connect -__net_ConnectDgram -__net_Gets +net_Connect +net_ConnectDgram +net_Gets net_Listen net_ListenClose -__net_OpenDgram +net_OpenDgram net_Printf -__net_Read +net_Read net_SetCSCov -__net_vaPrintf -__net_Write +net_vaPrintf +net_Write NTPtime64 __osd_ButtonFind __osd_ButtonSelect diff --git a/src/network/io.c b/src/network/io.c index a1923c17d8..52877c0e49 100644 --- a/src/network/io.c +++ b/src/network/io.c @@ -271,9 +271,9 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, return sockv; } - +#undef net_Read /***************************************************************************** - * __net_Read: + * net_Read: ***************************************************************************** * Reads from a network socket. Cancellation point. * If waitall is true, then we repeat until we have read the right amount of @@ -281,8 +281,8 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, * object has been signaled. *****************************************************************************/ 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) +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) { size_t i_total = 0; struct pollfd ufd[2] = { @@ -408,10 +408,10 @@ silent: return -1; } - +#undef net_Write /* Write exact amount requested */ -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 ) +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 ) { size_t i_total = 0; struct pollfd ufd[2] = { @@ -484,6 +484,7 @@ error: return -1; } +#undef net_Gets /** * Reads a line from a file descriptor. * This function is not thread-safe; the same file descriptor cI/O annot be read @@ -491,7 +492,7 @@ error: * * @return nul-terminated heap-allocated string, or NULL on I/O error. */ -char *__net_Gets( vlc_object_t *p_this, int fd, const 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; @@ -543,8 +544,9 @@ ssize_t net_Printf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs, return i_ret; } -ssize_t __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs, - const char *psz_fmt, va_list args ) +#undef net_vaPrintf +ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs, + const char *psz_fmt, va_list args ) { char *psz; int i_ret; @@ -552,7 +554,7 @@ ssize_t __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs, int i_size = vasprintf( &psz, psz_fmt, args ); if( i_size == -1 ) return -1; - i_ret = __net_Write( p_this, fd, p_vs, psz, i_size ) < i_size + i_ret = net_Write( p_this, fd, p_vs, psz, i_size ) < i_size ? -1 : i_size; free( psz ); diff --git a/src/network/tcp.c b/src/network/tcp.c index cc4eb0aefd..eba5594957 100644 --- a/src/network/tcp.c +++ b/src/network/tcp.c @@ -65,14 +65,15 @@ static int SocksHandshakeTCP( vlc_object_t *, extern int net_Socket( vlc_object_t *p_this, int i_family, int i_socktype, int i_protocol ); +#undef net_Connect /***************************************************************************** - * __net_Connect: + * net_Connect: ***************************************************************************** * Open a network connection. * @return socket handler or -1 on error. *****************************************************************************/ -int __net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port, - int type, int proto ) +int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port, + int type, int proto ) { struct addrinfo hints, *res, *ptr; const char *psz_realhost; diff --git a/src/network/udp.c b/src/network/udp.c index 4366df23fb..4d8ac2ebdc 100644 --- a/src/network/udp.c +++ b/src/network/udp.c @@ -642,15 +642,15 @@ static int net_SetDSCP( int fd, uint8_t dscp ) return setsockopt( fd, level, cmd, &(int){ dscp }, sizeof (int)); } - +#undef net_ConnectDgram /***************************************************************************** - * __net_ConnectDgram: + * net_ConnectDgram: ***************************************************************************** * Open a datagram socket to send data to a defined destination, with an * optional hop limit. *****************************************************************************/ -int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port, - int i_hlim, int proto ) +int net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port, + int i_hlim, int proto ) { struct addrinfo hints, *res, *ptr; int i_val, i_handle = -1; @@ -744,15 +744,15 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port, return i_handle; } - +#undef net_OpenDgram /***************************************************************************** - * __net_OpenDgram: + * net_OpenDgram: ***************************************************************************** * OpenDgram a datagram socket and return a handle *****************************************************************************/ -int __net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind, - const char *psz_server, int i_server, - int family, int protocol ) +int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind, + const char *psz_server, int i_server, + int family, int protocol ) { if ((psz_server == NULL) || (psz_server[0] == '\0')) return net_ListenSingle (obj, psz_bind, i_bind, family, protocol); -- 2.39.2