]> git.sesse.net Git - vlc/blobdiff - include/network.h
* added x264 and live to the linux target
[vlc] / include / network.h
index cf176df4a710de57e2c8851a1d416b44a3411f74..81626f453320c94cce884fedf93b617e378bd7a0 100644 (file)
@@ -47,6 +47,9 @@
 #   include <netdb.h>
 #endif
 
+# ifdef __cplusplus
+extern "C" {
+# endif
 
 /*****************************************************************************
  * network_socket_t: structure passed to a network plug-in to define the
@@ -222,7 +225,7 @@ static inline int isurlsafe( int c )
          * (even if they are not URL-safe), nor URL-safe characters.
          * We still encode some of them because of Microsoft's crap browser.
          */
-        || ( strchr( "/:.[]-_.", c ) != NULL );
+        || ( strchr( "-_.", c ) != NULL );
 }
 
 /*****************************************************************************
@@ -368,7 +371,7 @@ VLC_EXPORT( int, __net_ReadNonBlock, ( vlc_object_t *p_this, int fd, v_socket_t
 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 ) );
 
 #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 *, uint8_t *p_data, int i_data ) );
+VLC_EXPORT( int, __net_Write, ( vlc_object_t *p_this, int fd, 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 * ) );
@@ -399,7 +402,9 @@ int inet_pton(int af, const char *src, void *dst);
 # define net_StopSend( fd ) (void)shutdown( fd, SD_SEND )
 # define net_StopRecv( fd ) (void)shutdown( fd, SD_RECEIVE )
 #else
-# warning FIXME: implement shutdown on your platform!
+# ifndef SYS_BEOS /* R5 just doesn't have a working shutdown() */
+#  warning FIXME: implement shutdown on your platform!
+# endif
 # define net_StopSend( fd ) (void)0
 # define net_StopRecv( fd ) (void)0
 #endif
@@ -515,13 +520,13 @@ static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, const c
                    && ( ntohl( v4->sin_addr.s_addr ) <= 0xefffffff );
 #endif
     }
+#if defined( WIN32 ) || defined( HAVE_GETADDRINFO )
     else if( res->ai_family == AF_INET6 )
     {
-#if defined( WIN32 ) || defined( HAVE_GETADDRINFO )
         struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)res->ai_addr;
         b_multicast = IN6_IS_ADDR_MULTICAST( &v6->sin6_addr );
-#endif
     }
+#endif
     
     vlc_freeaddrinfo( res );
     return b_multicast;
@@ -549,4 +554,8 @@ static inline int net_GetPeerAddress( int fd, char *address, int *port )
         ? VLC_EGENERIC : 0;
 }
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif