]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
- Add httpd_ServerIP() to obtain HTTP server's IP used with a given client
[vlc] / include / vlc_common.h
index 0f78a824e4a26a04e44b51869e45001170405df2..158122b282d98c316d5351f9a80dcd5a67bbb28b 100644 (file)
@@ -2,7 +2,7 @@
  * common.h: common definitions
  * Collection of useful common types and macros definitions
  *****************************************************************************
- * Copyright (C) 1998-2004 VideoLAN
+ * Copyright (C) 1998-2005 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
@@ -360,6 +360,9 @@ typedef struct pes_packet_t pes_packet_t;
 typedef struct network_socket_t network_socket_t;
 typedef struct virtual_socket_t v_socket_t;
 typedef struct iso639_lang_t iso639_lang_t;
+typedef struct sockaddr sockaddr;
+typedef struct addrinfo addrinfo;
+typedef struct vlc_acl_t vlc_acl_t;
 
 /* block */
 typedef struct block_t      block_t;
@@ -384,6 +387,9 @@ typedef struct tls_t tls_t;
 typedef struct tls_server_t tls_server_t;
 typedef struct tls_session_t tls_session_t;
 
+/* Hashing */
+typedef struct md5_s md5_t;
+
 /* XML */
 typedef struct xml_t xml_t;
 typedef struct xml_sys_t xml_sys_t;
@@ -530,7 +536,7 @@ static int64_t GCD( int64_t a, int64_t b )
 }
 
 /* Dynamic array handling: realloc array, move data, increment position */
-#if defined( _MSC_VER )
+#if defined( _MSC_VER ) && _MSC_VER < 1300
 #   define VLCCVP (void**) /* Work-around for broken compiler */
 #else
 #   define VLCCVP
@@ -907,12 +913,21 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 
 /* Format type specifiers for 64 bits numbers */
 #if defined(__CYGWIN32__) || (!defined(WIN32) && !defined(UNDER_CE))
-#   define I64Fd "%lld"
-#   define I64Fi "%lli"
-#   define I64Fo "%llo"
-#   define I64Fu "%llu"
-#   define I64Fx "%llx"
-#   define I64FX "%llX"
+#   if defined(__WORDSIZE) && __WORDSIZE == 64
+#       define I64Fd "%ld"
+#       define I64Fi "%li"
+#       define I64Fo "%lo"
+#       define I64Fu "%lu"
+#       define I64Fx "%lx"
+#       define I64FX "%lX"
+#   else
+#       define I64Fd "%lld"
+#       define I64Fi "%lli"
+#       define I64Fo "%llo"
+#       define I64Fu "%llu"
+#       define I64Fx "%llx"
+#       define I64FX "%llX"
+#   endif
 #else
 #   define I64Fd "%I64d"
 #   define I64Fi "%I64i"
@@ -924,8 +939,13 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 
 /* 64 bits integer constant suffix */
 #if defined( __MINGW32__ ) || (!defined(WIN32) && !defined(UNDER_CE))
-#   define I64C(x)         x##LL
-#   define UI64C(x)        x##ULL
+#   if defined(__WORDSIZE) && __WORDSIZE == 64
+#       define I64C(x)         x##L
+#       define UI64C(x)        x##UL
+#   else
+#       define I64C(x)         x##LL
+#       define UI64C(x)        x##ULL
+#   endif
 #else
 #   define I64C(x)         x##i64
 #   define UI64C(x)        x##ui64
@@ -993,7 +1013,7 @@ typedef __int64 off_t;
 #   include <tchar.h>
 #endif
 
-VLC_EXPORT( vlc_bool_t, vlc_reduce, ( int *, int *, int64_t, int64_t, int64_t ) );
+VLC_EXPORT( vlc_bool_t, vlc_ureduce, ( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t ) );
 VLC_EXPORT( char **, vlc_parse_cmdline, ( const char *, int * ) );
 
 /* vlc_wraptext (defined in src/extras/libc.c) */