* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.99 2004/01/08 10:27:06 fenrir Exp $
+ * $Id: vlc_common.h,v 1.104 2004/01/24 20:40:46 fenrir Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
typedef struct playlist_group_t playlist_group_t;
typedef struct item_info_t item_info_t;
typedef struct item_info_category_t item_info_category_t;
+typedef struct playlist_export_t playlist_export_t;
/* Modules */
typedef struct module_bank_t module_bank_t;
#define TAB_APPEND( count, tab, p ) \
if( (count) > 0 ) \
{ \
- (*(void **)(&tab)) = \
- realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
+ (void *)(tab) = realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
} \
else \
{ \
- (*(void **)(&tab)) = malloc( sizeof( void ** ) ); \
+ (void *)(tab) = malloc( sizeof( void ** ) ); \
} \
((void**)(tab))[count] = (void*)(p); \
(count)++
* MSB, and should be used for both network communications and files. Note that
* byte orders other than little and big endians are not supported, but only
* the VAX seems to have such exotic properties. */
-static inline uint16_t U16_AT( void * _p )
+static inline uint16_t U16_AT( void const * _p )
{
uint8_t * p = (uint8_t *)_p;
return ( ((uint16_t)p[0] << 8) | p[1] );
}
-static inline uint32_t U32_AT( void * _p )
+static inline uint32_t U32_AT( void const * _p )
{
uint8_t * p = (uint8_t *)_p;
return ( ((uint32_t)p[0] << 24) | ((uint32_t)p[1] << 16)
| ((uint32_t)p[2] << 8) | p[3] );
}
-static inline uint64_t U64_AT( void * _p )
+static inline uint64_t U64_AT( void const * _p )
{
uint8_t * p = (uint8_t *)_p;
return ( ((uint64_t)p[0] << 56) | ((uint64_t)p[1] << 48)
| ((uint64_t)p[6] << 8) | p[7] );
}
-static inline uint16_t GetWLE( void * _p )
+static inline uint16_t GetWLE( void const * _p )
{
uint8_t * p = (uint8_t *)_p;
return ( ((uint16_t)p[1] << 8) | p[0] );
}
-static inline uint32_t GetDWLE( void * _p )
+static inline uint32_t GetDWLE( void const * _p )
{
uint8_t * p = (uint8_t *)_p;
return ( ((uint32_t)p[3] << 24) | ((uint32_t)p[2] << 16)
| ((uint32_t)p[1] << 8) | p[0] );
}
-static inline uint64_t GetQWLE( void * _p )
+static inline uint64_t GetQWLE( void const * _p )
{
uint8_t * p = (uint8_t *)_p;
return ( ((uint64_t)p[7] << 56) | ((uint64_t)p[6] << 48)
#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
# define vasprintf vlc_vasprintf
- VLC_EXPORT( char *, vlc_vasprintf, ( const char *s ) );
+ VLC_EXPORT( int, vlc_vasprintf, (char **, const char *, va_list ) );
#elif !defined(__PLUGIN__)
# define vlc_vasprintf NULL
#endif
+#if !defined(HAVE_ASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
+# define asprintf vlc_asprintf
+ VLC_EXPORT( int, vlc_asprintf, (char **, const char *, ... ) );
+#elif !defined(__PLUGIN__)
+# define vlc_asprintf NULL
+#endif
+
#ifndef HAVE_STRNDUP
# if defined(STRNDUP_IN_GNOME_H) && \
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)||\