]> git.sesse.net Git - vlc/blobdiff - include/vlc_network.h
vlc_join is a cancellation point
[vlc] / include / vlc_network.h
index eb76c58f8e92bb4bb700ca9f5f19574e071ef9fa..5c4b1dcf780f119694c8b8556c5120777bdf4d3a 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#if !defined( __LIBVLC__ )
-  #error You are not libvlc or one of its plugins. You cannot include this file
-#endif
+#ifndef VLC_NETWORK_H
+# define VLC_NETWORK_H
 
-#ifndef __VLC_NETWORK_H
-# define __VLC_NETWORK_H
+/**
+ * \file
+ * This file defines interface to communicate with network plug-ins
+ */
 
 #if defined( WIN32 )
 #   if !defined(UNDER_CE)
@@ -40,7 +41,6 @@
 #   include <ws2tcpip.h>
 #   define ENETUNREACH WSAENETUNREACH
 #   define net_errno (WSAGetLastError())
-#   define AI_NUMERICSERV 0
 extern const char *net_strerror( int val );
 
 struct iovec
@@ -185,9 +185,11 @@ struct pollfd
     int events;
     int revents;
 };
-
-  VLC_EXPORT (int, poll, (struct pollfd *fds, unsigned nfds, int timeout));
+# define poll(a, b, c) vlc_poll(a, b, c)
 #endif
+struct pollfd;
+VLC_EXPORT (int, vlc_poll, (struct pollfd *fds, unsigned nfds, int timeout));
+
 
 #ifdef WIN32
 /* Microsoft: same semantic, same value, different name... go figure */
@@ -274,6 +276,10 @@ struct addrinfo
 #  define AI_NUMERICHOST 4
 # endif /* if !HAVE_STRUCT_ADDRINFO */
 
+#ifndef AI_NUMERICSERV
+# define AI_NUMERICSERV 0
+#endif
+
 VLC_EXPORT( const char *, vlc_gai_strerror, ( int ) );
 VLC_EXPORT( int, vlc_getnameinfo, ( const struct sockaddr *, int, char *, int, int *, int ) );
 VLC_EXPORT( int, vlc_getaddrinfo, ( vlc_object_t *, const char *, int, const struct addrinfo *, struct addrinfo ** ) );