]> git.sesse.net Git - vlc/blobdiff - include/network.h
Re-use the old OBJC workaround and distribute autoconf260.m4
[vlc] / include / network.h
index dd2c32a3638a71ebc085598307f9372c9629e86b..f49dd60a4e279a9d05e873f949653ba6d6676aca 100644 (file)
@@ -38,6 +38,8 @@
 #   include <winsock2.h>
 #   include <ws2tcpip.h>
 #   define ENETUNREACH WSAENETUNREACH
+#   define net_errno (WSAGetLastError())
+extern const char *net_strerror( int val );
 #else
 #   if HAVE_SYS_SOCKET_H
 #      include <sys/socket.h>
@@ -51,6 +53,8 @@
 #      include <net/netdb.h>
 #   endif
 #   include <netdb.h>
+#   define net_errno errno
+#   define net_strerror strerror
 #endif
 
 # ifdef __cplusplus
@@ -98,6 +102,7 @@ VLC_EXPORT( int, __net_OpenUDP, ( vlc_object_t *p_this, const char *psz_bind, in
 VLC_EXPORT( void, net_Close, ( int fd ) );
 VLC_EXPORT( void, net_ListenClose, ( int *fd ) );
 
+VLC_EXPORT( int, net_SetDSCP, ( int fd, uint8_t dscp ) );
 
 /* Functions to read from or write to the networking layer */
 struct virtual_socket_t
@@ -108,24 +113,24 @@ struct virtual_socket_t
 };
 
 #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
@@ -247,7 +252,7 @@ static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, const c
                          &hints, &res );
     if( i )
     {
-        msg_Err( p_object, "Invalid node for net_AddressIsMulticast: %s : %s",
+        msg_Err( p_object, "invalid address for net_AddressIsMulticast: %s : %s",
                  psz_addr, vlc_gai_strerror( i ) );
         return VLC_FALSE;
     }