]> git.sesse.net Git - vlc/blobdiff - include/vlc_network.h
Qt: Save/Convert dialog should not show any streaming features.
[vlc] / include / vlc_network.h
index 77cb6f0d8b228868084837b072bbfc7c92cd11f8..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)
@@ -59,8 +60,6 @@ struct msghdr
     int           msg_flags;
 };
 
-VLC_EXPORT( ssize_t, vlc_sendmsg, ( int, struct msghdr *, int ) );
-VLC_EXPORT( ssize_t, vlc_recvmsg, ( int, struct msghdr *, int ) );
 #define sendmsg vlc_sendmsg
 #define recvmsg vlc_recvmsg
 
@@ -81,6 +80,9 @@ VLC_EXPORT( ssize_t, vlc_recvmsg, ( int, struct msghdr *, int ) );
 #   define net_errno errno
 #endif
 
+VLC_EXPORT( ssize_t, vlc_sendmsg, ( int, struct msghdr *, int ) );
+VLC_EXPORT( ssize_t, vlc_recvmsg, ( int, struct msghdr *, int ) );
+
 # ifdef __cplusplus
 extern "C" {
 # endif
@@ -154,19 +156,18 @@ VLC_EXPORT( ssize_t, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_
 VLC_EXPORT( ssize_t, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) );
 
 
+/* Don't go to an extra call layer if we have the symbol */
 #ifndef HAVE_INET_PTON
-/* only in core, so no need for C++ extern "C" */
-    VLC_EXPORT (int, inet_pton, (int af, const char *src, void *dst) );
+#define inet_pton vlc_inet_pton
 #endif
-
 #ifndef HAVE_INET_NTOP
-#ifdef WIN32
-/* only in core, so no need for C++ extern "C" */
-    VLC_EXPORT (const char *, inet_ntop, (int af, const void *src,
-                                          char *dst, socklen_t cnt) );
-#endif
+#define inet_ntop vlc_inet_ntop
 #endif
 
+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,
+                                          char *dst, socklen_t cnt) );
+
 #ifndef HAVE_POLL
 enum
 {
@@ -184,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 */
@@ -273,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 ** ) );