Commit 6f258887 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Replace VLC_EXPORT macro with a simple prefix, VLC_API

This should help Doxygen parse VLC headers, and generally makes headers
easier to read. LibVLC already uses a similar approach.
parent 9a46b63e
...@@ -151,7 +151,7 @@ static inline void access_InitFields( access_t *p_a ) ...@@ -151,7 +151,7 @@ static inline void access_InitFields( access_t *p_a )
* This function will return the parent input of this access. * This function will return the parent input of this access.
* It is retained. It can return NULL. * It is retained. It can return NULL.
*/ */
VLC_EXPORT( input_thread_t *, access_GetParentInput, ( access_t *p_access ) LIBVLC_USED ); VLC_API input_thread_t * access_GetParentInput( access_t *p_access ) LIBVLC_USED;
#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \ #define ACCESS_SET_CALLBACKS( read, block, control, seek ) \
p_access->pf_read = read; \ p_access->pf_read = read; \
......
...@@ -26,15 +26,15 @@ ...@@ -26,15 +26,15 @@
# define VLC_ACL_H # define VLC_ACL_H
VLC_EXPORT( int, ACL_Check, ( vlc_acl_t *p_acl, const char *psz_ip ) ); VLC_API int ACL_Check( vlc_acl_t *p_acl, const char *psz_ip );
VLC_EXPORT( vlc_acl_t *, ACL_Create, ( vlc_object_t *p_this, bool b_allow ) LIBVLC_USED LIBVLC_MALLOC ); VLC_API vlc_acl_t * ACL_Create( vlc_object_t *p_this, bool b_allow ) LIBVLC_USED LIBVLC_MALLOC;
#define ACL_Create(a, b) ACL_Create(VLC_OBJECT(a), b) #define ACL_Create(a, b) ACL_Create(VLC_OBJECT(a), b)
VLC_EXPORT( vlc_acl_t *, ACL_Duplicate, ( vlc_object_t *p_this, const vlc_acl_t *p_acl ) LIBVLC_USED LIBVLC_MALLOC ); VLC_API vlc_acl_t * ACL_Duplicate( vlc_object_t *p_this, const vlc_acl_t *p_acl ) LIBVLC_USED LIBVLC_MALLOC;
#define ACL_Duplicate(a,b) ACL_Duplicate(VLC_OBJECT(a),b) #define ACL_Duplicate(a,b) ACL_Duplicate(VLC_OBJECT(a),b)
VLC_EXPORT( void, ACL_Destroy, ( vlc_acl_t *p_acl ) ); VLC_API void ACL_Destroy( vlc_acl_t *p_acl );
#define ACL_AddHost(a,b,c) ACL_AddNet(a,b,-1,c) #define ACL_AddHost(a,b,c) ACL_AddNet(a,b,-1,c)
VLC_EXPORT( int, ACL_AddNet, ( vlc_acl_t *p_acl, const char *psz_ip, int i_len, bool b_allow ) ); VLC_API int ACL_AddNet( vlc_acl_t *p_acl, const char *psz_ip, int i_len, bool b_allow );
VLC_EXPORT( int, ACL_LoadFile, ( vlc_acl_t *p_acl, const char *path ) ); VLC_API int ACL_LoadFile( vlc_acl_t *p_acl, const char *path );
#endif #endif
...@@ -256,7 +256,7 @@ static const uint32_t pi_vlc_chan_order_wg4[] = ...@@ -256,7 +256,7 @@ static const uint32_t pi_vlc_chan_order_wg4[] =
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, bool ) LIBVLC_USED ); VLC_API aout_buffer_t * aout_OutputNextBuffer( aout_instance_t *, mtime_t, bool ) LIBVLC_USED;
/** /**
* This function computes the reordering needed to go from pi_chan_order_in to * This function computes the reordering needed to go from pi_chan_order_in to
...@@ -264,8 +264,8 @@ VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t ...@@ -264,8 +264,8 @@ VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t
* If pi_chan_order_in or pi_chan_order_out is NULL, it will assume that vlc * If pi_chan_order_in or pi_chan_order_out is NULL, it will assume that vlc
* internal (WG4) order is requested. * internal (WG4) order is requested.
*/ */
VLC_EXPORT( int, aout_CheckChannelReorder, ( const uint32_t *pi_chan_order_in, const uint32_t *pi_chan_order_out, uint32_t i_channel_mask, int i_channels, int *pi_chan_table ) ); VLC_API int aout_CheckChannelReorder( const uint32_t *pi_chan_order_in, const uint32_t *pi_chan_order_out, uint32_t i_channel_mask, int i_channels, int *pi_chan_table );
VLC_EXPORT( void, aout_ChannelReorder, ( uint8_t *, int, int, const int *, int ) ); VLC_API void aout_ChannelReorder( uint8_t *, int, int, const int *, int );
/** /**
* This fonction will compute the extraction parameter into pi_selection to go * This fonction will compute the extraction parameter into pi_selection to go
...@@ -283,7 +283,7 @@ VLC_EXPORT( void, aout_ChannelReorder, ( uint8_t *, int, int, const int *, int ) ...@@ -283,7 +283,7 @@ VLC_EXPORT( void, aout_ChannelReorder, ( uint8_t *, int, int, const int *, int )
* by VLC. In this case the channel type pi_order_src[] must be set to 0. * by VLC. In this case the channel type pi_order_src[] must be set to 0.
* XXX It must also be used if multiple channels have the same type. * XXX It must also be used if multiple channels have the same type.
*/ */
VLC_EXPORT( bool, aout_CheckChannelExtraction, ( int *pi_selection, uint32_t *pi_layout, int *pi_channels, const uint32_t pi_order_dst[AOUT_CHAN_MAX], const uint32_t *pi_order_src, int i_channels ) ); VLC_API bool aout_CheckChannelExtraction( int *pi_selection, uint32_t *pi_layout, int *pi_channels, const uint32_t pi_order_dst[AOUT_CHAN_MAX], const uint32_t *pi_order_src, int i_channels );
/** /**
* Do the actual channels extraction using the parameters created by * Do the actual channels extraction using the parameters created by
...@@ -292,7 +292,7 @@ VLC_EXPORT( bool, aout_CheckChannelExtraction, ( int *pi_selection, uint32_t *pi ...@@ -292,7 +292,7 @@ VLC_EXPORT( bool, aout_CheckChannelExtraction, ( int *pi_selection, uint32_t *pi
* XXX this function does not work in place (p_dst and p_src must not overlap). * XXX this function does not work in place (p_dst and p_src must not overlap).
* XXX Only 8, 16, 24, 32, 64 bits per sample are supported. * XXX Only 8, 16, 24, 32, 64 bits per sample are supported.
*/ */
VLC_EXPORT( void, aout_ChannelExtract, ( void *p_dst, int i_dst_channels, const void *p_src, int i_src_channels, int i_sample_count, const int *pi_selection, int i_bits_per_sample ) ); VLC_API void aout_ChannelExtract( void *p_dst, int i_dst_channels, const void *p_src, int i_src_channels, int i_sample_count, const int *pi_selection, int i_bits_per_sample );
/* */ /* */
static inline unsigned aout_FormatNbChannels(const audio_sample_format_t *fmt) static inline unsigned aout_FormatNbChannels(const audio_sample_format_t *fmt)
...@@ -300,37 +300,37 @@ static inline unsigned aout_FormatNbChannels(const audio_sample_format_t *fmt) ...@@ -300,37 +300,37 @@ static inline unsigned aout_FormatNbChannels(const audio_sample_format_t *fmt)
return popcount(fmt->i_physical_channels & AOUT_CHAN_PHYSMASK); return popcount(fmt->i_physical_channels & AOUT_CHAN_PHYSMASK);
} }
VLC_EXPORT( unsigned int, aout_BitsPerSample, ( vlc_fourcc_t i_format ) LIBVLC_USED ); VLC_API unsigned int aout_BitsPerSample( vlc_fourcc_t i_format ) LIBVLC_USED;
VLC_EXPORT( void, aout_FormatPrepare, ( audio_sample_format_t * p_format ) ); VLC_API void aout_FormatPrepare( audio_sample_format_t * p_format );
VLC_EXPORT( void, aout_FormatPrint, ( aout_instance_t * p_aout, const char * psz_text, const audio_sample_format_t * p_format ) ); VLC_API void aout_FormatPrint( aout_instance_t * p_aout, const char * psz_text, const audio_sample_format_t * p_format );
VLC_EXPORT( const char *, aout_FormatPrintChannels, ( const audio_sample_format_t * ) LIBVLC_USED ); VLC_API const char * aout_FormatPrintChannels( const audio_sample_format_t * ) LIBVLC_USED;
VLC_EXPORT( mtime_t, aout_FifoFirstDate, ( aout_instance_t *, aout_fifo_t * ) LIBVLC_USED ); VLC_API mtime_t aout_FifoFirstDate( aout_instance_t *, aout_fifo_t * ) LIBVLC_USED;
VLC_EXPORT( aout_buffer_t *, aout_FifoPop, ( aout_instance_t * p_aout, aout_fifo_t * p_fifo ) LIBVLC_USED ); VLC_API aout_buffer_t * aout_FifoPop( aout_instance_t * p_aout, aout_fifo_t * p_fifo ) LIBVLC_USED;
/* From intf.c : */ /* From intf.c : */
VLC_EXPORT( void, aout_VolumeSoftInit, ( aout_instance_t * ) ); VLC_API void aout_VolumeSoftInit( aout_instance_t * );
VLC_EXPORT( void, aout_VolumeNoneInit, ( aout_instance_t * ) ); VLC_API void aout_VolumeNoneInit( aout_instance_t * );
VLC_EXPORT( audio_volume_t, aout_VolumeGet, ( vlc_object_t * ) ); VLC_API audio_volume_t aout_VolumeGet( vlc_object_t * );
#define aout_VolumeGet(a) aout_VolumeGet(VLC_OBJECT(a)) #define aout_VolumeGet(a) aout_VolumeGet(VLC_OBJECT(a))
VLC_EXPORT( int, aout_VolumeSet, ( vlc_object_t *, audio_volume_t ) ); VLC_API int aout_VolumeSet( vlc_object_t *, audio_volume_t );
#define aout_VolumeSet(a, b) aout_VolumeSet(VLC_OBJECT(a), b) #define aout_VolumeSet(a, b) aout_VolumeSet(VLC_OBJECT(a), b)
VLC_EXPORT( int, aout_VolumeUp, ( vlc_object_t *, int, audio_volume_t * ) ); VLC_API int aout_VolumeUp( vlc_object_t *, int, audio_volume_t * );
#define aout_VolumeUp(a, b, c) aout_VolumeUp(VLC_OBJECT(a), b, c) #define aout_VolumeUp(a, b, c) aout_VolumeUp(VLC_OBJECT(a), b, c)
VLC_EXPORT( int, aout_VolumeDown, ( vlc_object_t *, int, audio_volume_t * ) ); VLC_API int aout_VolumeDown( vlc_object_t *, int, audio_volume_t * );
#define aout_VolumeDown(a, b, c) aout_VolumeDown(VLC_OBJECT(a), b, c) #define aout_VolumeDown(a, b, c) aout_VolumeDown(VLC_OBJECT(a), b, c)
VLC_EXPORT( int, aout_ToggleMute, ( vlc_object_t *, audio_volume_t * ) ); VLC_API int aout_ToggleMute( vlc_object_t *, audio_volume_t * );
#define aout_ToggleMute(a, b) aout_ToggleMute(VLC_OBJECT(a), b) #define aout_ToggleMute(a, b) aout_ToggleMute(VLC_OBJECT(a), b)
VLC_EXPORT( int, aout_SetMute, ( vlc_object_t *, audio_volume_t *, bool ) ); VLC_API int aout_SetMute( vlc_object_t *, audio_volume_t *, bool );
VLC_EXPORT( bool, aout_IsMuted, ( vlc_object_t * ) ); VLC_API bool aout_IsMuted( vlc_object_t * );
VLC_EXPORT( int, aout_ChannelsRestart, ( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * ) ); VLC_API int aout_ChannelsRestart( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * );
VLC_EXPORT( void, aout_EnableFilter, (vlc_object_t *, const char *, bool )); VLC_API void aout_EnableFilter(vlc_object_t *, const char *, bool );
#define aout_EnableFilter( o, n, b ) \ #define aout_EnableFilter( o, n, b ) \
aout_EnableFilter( VLC_OBJECT(o), n, b ) aout_EnableFilter( VLC_OBJECT(o), n, b )
/* */ /* */
VLC_EXPORT( vout_thread_t *, aout_filter_RequestVout, ( filter_t *, vout_thread_t *p_vout, video_format_t *p_fmt ) LIBVLC_USED ); VLC_API vout_thread_t * aout_filter_RequestVout( filter_t *, vout_thread_t *p_vout, video_format_t *p_fmt ) LIBVLC_USED;
# ifdef __cplusplus # ifdef __cplusplus
} }
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
/* All functions return the atom value _after_ the operation. */ /* All functions return the atom value _after_ the operation. */
VLC_EXPORT(uintptr_t, vlc_atomic_get, (const vlc_atomic_t *)); VLC_API uintptr_t vlc_atomic_get(const vlc_atomic_t *);
VLC_EXPORT(uintptr_t, vlc_atomic_set, (vlc_atomic_t *, uintptr_t)); VLC_API uintptr_t vlc_atomic_set(vlc_atomic_t *, uintptr_t);
VLC_EXPORT(uintptr_t, vlc_atomic_add, (vlc_atomic_t *, uintptr_t)); VLC_API uintptr_t vlc_atomic_add(vlc_atomic_t *, uintptr_t);
static inline uintptr_t vlc_atomic_sub (vlc_atomic_t *atom, uintptr_t v) static inline uintptr_t vlc_atomic_sub (vlc_atomic_t *atom, uintptr_t v)
{ {
...@@ -47,7 +47,7 @@ static inline uintptr_t vlc_atomic_dec (vlc_atomic_t *atom) ...@@ -47,7 +47,7 @@ static inline uintptr_t vlc_atomic_dec (vlc_atomic_t *atom)
return vlc_atomic_sub (atom, 1); return vlc_atomic_sub (atom, 1);
} }
VLC_EXPORT(uintptr_t, vlc_atomic_swap, (vlc_atomic_t *, uintptr_t)); VLC_API uintptr_t vlc_atomic_swap(vlc_atomic_t *, uintptr_t);
VLC_EXPORT(uintptr_t, vlc_atomic_compare_swap, (vlc_atomic_t *, uintptr_t, uintptr_t)); VLC_API uintptr_t vlc_atomic_compare_swap(vlc_atomic_t *, uintptr_t, uintptr_t);
#endif #endif
...@@ -136,9 +136,9 @@ struct block_t ...@@ -136,9 +136,9 @@ struct block_t
* and decrease are supported). Use it as it is optimised. * and decrease are supported). Use it as it is optimised.
* - block_Duplicate : create a copy of a block. * - block_Duplicate : create a copy of a block.
****************************************************************************/ ****************************************************************************/
VLC_EXPORT( void, block_Init, ( block_t *, void *, size_t ) ); VLC_API void block_Init( block_t *, void *, size_t );
VLC_EXPORT( block_t *, block_Alloc, ( size_t ) LIBVLC_USED ); VLC_API block_t * block_Alloc( size_t ) LIBVLC_USED;
VLC_EXPORT( block_t *, block_Realloc, ( block_t *, ssize_t i_pre, size_t i_body ) LIBVLC_USED ); VLC_API block_t * block_Realloc( block_t *, ssize_t i_pre, size_t i_body ) LIBVLC_USED;
#define block_New( dummy, size ) block_Alloc(size) #define block_New( dummy, size ) block_Alloc(size)
...@@ -165,9 +165,9 @@ static inline void block_Release( block_t *p_block ) ...@@ -165,9 +165,9 @@ static inline void block_Release( block_t *p_block )
p_block->pf_release( p_block ); p_block->pf_release( p_block );
} }
VLC_EXPORT( block_t *, block_heap_Alloc, (void *, void *, size_t) LIBVLC_USED ); VLC_API block_t * block_heap_Alloc(void *, void *, size_t) LIBVLC_USED;
VLC_EXPORT( block_t *, block_mmap_Alloc, (void *addr, size_t length) LIBVLC_USED ); VLC_API block_t * block_mmap_Alloc(void *addr, size_t length) LIBVLC_USED;
VLC_EXPORT( block_t *, block_File, (int fd) LIBVLC_USED ); VLC_API block_t * block_File(int fd) LIBVLC_USED;
static inline void block_Cleanup (void *block) static inline void block_Cleanup (void *block)
{ {
...@@ -306,15 +306,15 @@ static inline block_t *block_ChainGather( block_t *p_list ) ...@@ -306,15 +306,15 @@ static inline block_t *block_ChainGather( block_t *p_list )
* block_FifoGet and block_FifoShow are cancellation points. * block_FifoGet and block_FifoShow are cancellation points.
****************************************************************************/ ****************************************************************************/
VLC_EXPORT( block_fifo_t *, block_FifoNew, ( void ) LIBVLC_USED ); VLC_API block_fifo_t * block_FifoNew( void ) LIBVLC_USED;
VLC_EXPORT( void, block_FifoRelease, ( block_fifo_t * ) ); VLC_API void block_FifoRelease( block_fifo_t * );
VLC_EXPORT( void, block_FifoPace, ( block_fifo_t *fifo, size_t max_depth, size_t max_size ) ); VLC_API void block_FifoPace( block_fifo_t *fifo, size_t max_depth, size_t max_size );
VLC_EXPORT( void, block_FifoEmpty, ( block_fifo_t * ) ); VLC_API void block_FifoEmpty( block_fifo_t * );
VLC_EXPORT( size_t, block_FifoPut, ( block_fifo_t *, block_t * ) ); VLC_API size_t block_FifoPut( block_fifo_t *, block_t * );
VLC_EXPORT( void, block_FifoWake, ( block_fifo_t * ) ); VLC_API void block_FifoWake( block_fifo_t * );
VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) LIBVLC_USED ); VLC_API block_t * block_FifoGet( block_fifo_t * ) LIBVLC_USED;
VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) ); VLC_API block_t * block_FifoShow( block_fifo_t * );
size_t block_FifoSize( const block_fifo_t *p_fifo ) LIBVLC_USED; size_t block_FifoSize( const block_fifo_t *p_fifo ) LIBVLC_USED;
VLC_EXPORT( size_t, block_FifoCount, ( const block_fifo_t *p_fifo ) LIBVLC_USED ); VLC_API size_t block_FifoCount( const block_fifo_t *p_fifo ) LIBVLC_USED;
#endif /* VLC_BLOCK_H */ #endif /* VLC_BLOCK_H */
...@@ -32,24 +32,24 @@ ...@@ -32,24 +32,24 @@
/* iconv wrappers (defined in src/extras/libc.c) */ /* iconv wrappers (defined in src/extras/libc.c) */
typedef void *vlc_iconv_t; typedef void *vlc_iconv_t;
VLC_EXPORT( vlc_iconv_t, vlc_iconv_open, ( const char *, const char * ) LIBVLC_USED ); VLC_API vlc_iconv_t vlc_iconv_open( const char *, const char * ) LIBVLC_USED;
VLC_EXPORT( size_t, vlc_iconv, ( vlc_iconv_t, const char **, size_t *, char **, size_t * ) LIBVLC_USED ); VLC_API size_t vlc_iconv( vlc_iconv_t, const char **, size_t *, char **, size_t * ) LIBVLC_USED;
VLC_EXPORT( int, vlc_iconv_close, ( vlc_iconv_t ) ); VLC_API int vlc_iconv_close( vlc_iconv_t );
#include <stdarg.h> #include <stdarg.h>
VLC_EXPORT( void, LocaleFree, ( const char * ) ); VLC_API void LocaleFree( const char * );
VLC_EXPORT( char *, FromLocale, ( const char * ) LIBVLC_USED ); VLC_API char * FromLocale( const char * ) LIBVLC_USED;
VLC_EXPORT( char *, FromLocaleDup, ( const char * ) LIBVLC_USED ); VLC_API char * FromLocaleDup( const char * ) LIBVLC_USED;
VLC_EXPORT( char *, ToLocale, ( const char * ) LIBVLC_USED ); VLC_API char * ToLocale( const char * ) LIBVLC_USED;
VLC_EXPORT( char *, ToLocaleDup, ( const char * ) LIBVLC_USED ); VLC_API char * ToLocaleDup( const char * ) LIBVLC_USED;
VLC_EXPORT( int, utf8_vfprintf, ( FILE *stream, const char *fmt, va_list ap ) ); VLC_API int utf8_vfprintf( FILE *stream, const char *fmt, va_list ap );
VLC_EXPORT( int, utf8_fprintf, ( FILE *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) ); VLC_API int utf8_fprintf( FILE *, const char *, ... ) LIBVLC_FORMAT( 2, 3 );
VLC_EXPORT( char *, vlc_strcasestr, (const char *, const char *) LIBVLC_USED ); VLC_API char * vlc_strcasestr(const char *, const char *) LIBVLC_USED;
VLC_EXPORT( char *, EnsureUTF8, ( char * ) ); VLC_API char * EnsureUTF8( char * );
VLC_EXPORT( const char *, IsUTF8, ( const char * ) LIBVLC_USED ); VLC_API const char * IsUTF8( const char * ) LIBVLC_USED;
#ifdef WIN32 #ifdef WIN32
LIBVLC_USED LIBVLC_USED
...@@ -108,13 +108,13 @@ static inline char *FromLatin1 (const char *latin) ...@@ -108,13 +108,13 @@ static inline char *FromLatin1 (const char *latin)
return utf8 ? utf8 : str; return utf8 ? utf8 : str;
} }
VLC_EXPORT( char *, FromCharset, ( const char *charset, const void *data, size_t data_size ) LIBVLC_USED ); VLC_API char * FromCharset( const char *charset, const void *data, size_t data_size ) LIBVLC_USED;
VLC_EXPORT( void *, ToCharset, ( const char *charset, const char *in, size_t *outsize ) LIBVLC_USED ); VLC_API void * ToCharset( const char *charset, const char *in, size_t *outsize ) LIBVLC_USED;
VLC_EXPORT( double, us_strtod, ( const char *, char ** ) LIBVLC_USED ); VLC_API double us_strtod( const char *, char ** ) LIBVLC_USED;
VLC_EXPORT( float, us_strtof, ( const char *, char ** ) LIBVLC_USED ); VLC_API float us_strtof( const char *, char ** ) LIBVLC_USED;
VLC_EXPORT( double, us_atof, ( const char * ) LIBVLC_USED ); VLC_API double us_atof( const char * ) LIBVLC_USED;
VLC_EXPORT( int, us_vasprintf, ( char **, const char *, va_list ) ); VLC_API int us_vasprintf( char **, const char *, va_list );
VLC_EXPORT( int, us_asprintf, ( char **, const char *, ... ) LIBVLC_USED ); VLC_API int us_asprintf( char **, const char *, ... ) LIBVLC_USED;
#endif #endif
...@@ -180,67 +180,67 @@ struct encoder_t ...@@ -180,67 +180,67 @@ struct encoder_t
* buffer. You have to release it using decoder_DeletePicture or by returning * buffer. You have to release it using decoder_DeletePicture or by returning
* it to the caller as a pf_decode_video return value. * it to the caller as a pf_decode_video return value.
*/ */
VLC_EXPORT( picture_t *, decoder_NewPicture, ( decoder_t * ) LIBVLC_USED ); VLC_API picture_t * decoder_NewPicture( decoder_t * ) LIBVLC_USED;
/** /**
* This function will release a picture create by decoder_NewPicture. * This function will release a picture create by decoder_NewPicture.
*/ */
VLC_EXPORT( void, decoder_DeletePicture, ( decoder_t *, picture_t *p_picture ) ); VLC_API void decoder_DeletePicture( decoder_t *, picture_t *p_picture );
/** /**
* This function will increase the picture reference count. * This function will increase the picture reference count.
* (picture_Hold is not usable.) * (picture_Hold is not usable.)
*/ */
VLC_EXPORT( void, decoder_LinkPicture, ( decoder_t *, picture_t * ) ); VLC_API void decoder_LinkPicture( decoder_t *, picture_t * );
/** /**
* This function will decrease the picture reference count. * This function will decrease the picture reference count.
* (picture_Release is not usable.) * (picture_Release is not usable.)
*/ */
VLC_EXPORT( void, decoder_UnlinkPicture, ( decoder_t *, picture_t * ) ); VLC_API void decoder_UnlinkPicture( decoder_t *, picture_t * );
/** /**
* This function will return a new audio buffer usable by a decoder as an * This function will return a new audio buffer usable by a decoder as an
* output buffer. You have to release it using decoder_DeleteAudioBuffer * output buffer. You have to release it using decoder_DeleteAudioBuffer
* or by returning it to the caller as a pf_decode_audio return value. * or by returning it to the caller as a pf_decode_audio return value.
*/ */
VLC_EXPORT( aout_buffer_t *, decoder_NewAudioBuffer, ( decoder_t *, int i_size ) LIBVLC_USED ); VLC_API aout_buffer_t * decoder_NewAudioBuffer( decoder_t *, int i_size ) LIBVLC_USED;
/** /**
* This function will release a audio buffer created by decoder_NewAudioBuffer. * This function will release a audio buffer created by decoder_NewAudioBuffer.
*/ */
VLC_EXPORT( void, decoder_DeleteAudioBuffer, ( decoder_t *, aout_buffer_t *p_buffer ) ); VLC_API void decoder_DeleteAudioBuffer( decoder_t *, aout_buffer_t *p_buffer );
/** /**
* This function will return a new subpicture usable by a decoder as an output * This function will return a new subpicture usable by a decoder as an output
* buffer. You have to release it using decoder_DeleteSubpicture or by returning * buffer. You have to release it using decoder_DeleteSubpicture or by returning
* it to the caller as a pf_decode_sub return value. * it to the caller as a pf_decode_sub return value.
*/ */
VLC_EXPORT( subpicture_t *, decoder_NewSubpicture, ( decoder_t *, const subpicture_updater_t * ) LIBVLC_USED ); VLC_API subpicture_t * decoder_NewSubpicture( decoder_t *, const subpicture_updater_t * ) LIBVLC_USED;
/** /**
* This function will release a subpicture created by decoder_NewSubicture. * This function will release a subpicture created by decoder_NewSubicture.
*/ */
VLC_EXPORT( void, decoder_DeleteSubpicture, ( decoder_t *, subpicture_t *p_subpicture ) ); VLC_API void decoder_DeleteSubpicture( decoder_t *, subpicture_t *p_subpicture );
/** /**
* This function gives all input attachments at once. * This function gives all input attachments at once.
* *
* You MUST release the returned values * You MUST release the returned values
*/ */
VLC_EXPORT( int, decoder_GetInputAttachments, ( decoder_t *, input_attachment_t ***ppp_attachment, int *pi_attachment ) ); VLC_API int decoder_GetInputAttachments( decoder_t *, input_attachment_t ***ppp_attachment, int *pi_attachment );
/** /**
* This function converts a decoder timestamp into a display date comparable * This function converts a decoder timestamp into a display date comparable
* to mdate(). * to mdate().
* You MUST use it *only* for gathering statistics about speed. * You MUST use it *only* for gathering statistics about speed.
*/ */
VLC_EXPORT( mtime_t, decoder_GetDisplayDate, ( decoder_t *, mtime_t ) LIBVLC_USED ); VLC_API mtime_t decoder_GetDisplayDate( decoder_t *, mtime_t ) LIBVLC_USED;
/** /**
* This function returns the current input rate. * This function returns the current input rate.
* You MUST use it *only* for gathering statistics about speed. * You MUST use it *only* for gathering statistics about speed.
*/ */
VLC_EXPORT( int, decoder_GetDisplayRate, ( decoder_t * ) LIBVLC_USED ); VLC_API int decoder_GetDisplayRate( decoder_t * ) LIBVLC_USED;
#endif /* _VLC_CODEC_H */ #endif /* _VLC_CODEC_H */
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
VLC_EXPORT( decoder_synchro_t *, decoder_SynchroInit, ( decoder_t *, int ) LIBVLC_USED ); VLC_API decoder_synchro_t * decoder_SynchroInit( decoder_t *, int ) LIBVLC_USED;
VLC_EXPORT( void, decoder_SynchroRelease, ( decoder_synchro_t * ) ); VLC_API void decoder_SynchroRelease( decoder_synchro_t * );
VLC_EXPORT( void, decoder_SynchroReset, ( decoder_synchro_t * ) ); VLC_API void decoder_SynchroReset( decoder_synchro_t * );
VLC_EXPORT( bool, decoder_SynchroChoose, ( decoder_synchro_t *, int, int, bool ) ); VLC_API bool decoder_SynchroChoose( decoder_synchro_t *, int, int, bool );
VLC_EXPORT( void, decoder_SynchroTrash, ( decoder_synchro_t * ) ); VLC_API void decoder_SynchroTrash( decoder_synchro_t * );
VLC_EXPORT( void, decoder_SynchroDecode, ( decoder_synchro_t * ) ); VLC_API void decoder_SynchroDecode( decoder_synchro_t * );
VLC_EXPORT( void, decoder_SynchroEnd, ( decoder_synchro_t *, int, bool ) ); VLC_API void decoder_SynchroEnd( decoder_synchro_t *, int, bool );
VLC_EXPORT( mtime_t, decoder_SynchroDate, ( decoder_synchro_t * ) LIBVLC_USED ); VLC_API mtime_t decoder_SynchroDate( decoder_synchro_t * ) LIBVLC_USED;
VLC_EXPORT( void, decoder_SynchroNewPicture, ( decoder_synchro_t *, int, int, mtime_t, mtime_t, bool ) ); VLC_API void decoder_SynchroNewPicture( decoder_synchro_t *, int, int, mtime_t, mtime_t, bool );
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* common.h: common definitions * common.h: common definitions
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2005 the VideoLAN team * Copyright (C) 1998-2011 the VideoLAN team
* $Id$
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org> * Gildas Bazin <gbazin@videolan.org>
* Rémi Denis-Courmont
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -108,6 +108,24 @@ ...@@ -108,6 +108,24 @@
# define LIBVLC_DEPRECATED # define LIBVLC_DEPRECATED
#endif #endif
/* Linkage */
#ifdef __cplusplus
# define LIBVLC_EXTERN extern "C"
#else
# define LIBVLC_EXTERN
#endif
#if defined (__GNUC__) && (__GNUC__ >= 4)
# define LIBVLC_EXPORT __attribute__((visibility("default")))
#elif defined (WIN32) && defined (DLL_EXPORT)
# define LIBVLC_EXPORT __declspec(dllexport)
#else
# define LIBVLC_EXPORT
#endif
#define VLC_API LIBVLC_EXTERN LIBVLC_EXPORT
/***************************************************************************** /*****************************************************************************
* Basic types definitions * Basic types definitions
*****************************************************************************/ *****************************************************************************/
...@@ -462,26 +480,6 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ ...@@ -462,26 +480,6 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
vlc_value_t, /* new value */ vlc_value_t, /* new value */
void * ); /* callback data */ void * ); /* callback data */
/*****************************************************************************
* Plug-in stuff
*****************************************************************************/
#ifdef __cplusplus
# define LIBVLC_EXTERN extern "C"
#else
# define LIBVLC_EXTERN extern
#endif
#if defined (WIN32) && defined (DLL_EXPORT)
#if defined (UNDER_CE)
# include <windef.h>
#endif
# define LIBVLC_EXPORT __declspec(dllexport)
#else
# define LIBVLC_EXPORT
#endif
#define VLC_EXPORT( type, name, args ) \
LIBVLC_EXTERN LIBVLC_EXPORT type name args
/***************************************************************************** /*****************************************************************************
* OS-specific headers and thread types * OS-specific headers and thread types
*****************************************************************************/ *****************************************************************************/
...@@ -557,9 +555,9 @@ typedef struct gc_object_t ...@@ -557,9 +555,9 @@ typedef struct gc_object_t
*/ */
#define VLC_GC_MEMBERS gc_object_t vlc_gc_data; #define VLC_GC_MEMBERS gc_object_t vlc_gc_data;
VLC_EXPORT(void *, vlc_gc_init, (gc_object_t *, void (*)(gc_object_t *))); VLC_API void * vlc_gc_init(gc_object_t *, void (*)(gc_object_t *));
VLC_EXPORT(void *, vlc_hold, (gc_object_t *)); VLC_API void * vlc_hold(gc_object_t *);
VLC_EXPORT(void, vlc_release, (gc_object_t *)); VLC_API void vlc_release(gc_object_t *);
#define vlc_gc_init( a,b ) vlc_gc_init( &(a)->vlc_gc_data, (b) ) #define vlc_gc_init( a,b ) vlc_gc_init( &(a)->vlc_gc_data, (b) )
#define vlc_gc_incref( a ) vlc_hold( &(a)->vlc_gc_data ) #define vlc_gc_incref( a ) vlc_hold( &(a)->vlc_gc_data )
...@@ -649,7 +647,7 @@ static inline unsigned popcount (unsigned x) ...@@ -649,7 +647,7 @@ static inline unsigned popcount (unsigned x)
#define EMPTY_STR(str) (!str || !*str) #define EMPTY_STR(str) (!str || !*str)
VLC_EXPORT( char const *, vlc_error, ( int ) LIBVLC_USED ); VLC_API char const * vlc_error( int ) LIBVLC_USED;
#include <vlc_arrays.h> #include <vlc_arrays.h>
...@@ -829,24 +827,24 @@ static inline uint64_t ntoh64 (uint64_t ll) ...@@ -829,24 +827,24 @@ static inline uint64_t ntoh64 (uint64_t ll)
# include <tchar.h> # include <tchar.h>
#endif #endif
VLC_EXPORT( bool, vlc_ureduce, ( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t ) ); VLC_API bool vlc_ureduce( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t );
VLC_EXPORT( void *, vlc_memalign, ( void **base, size_t alignment, size_t size ) LIBVLC_USED ); VLC_API void * vlc_memalign( void **base, size_t alignment, size_t size ) LIBVLC_USED;
/* execve wrapper (defined in src/extras/libc.c) */ /* execve wrapper (defined in src/extras/libc.c) */
VLC_EXPORT( int, vlc_execve, ( vlc_object_t *p_object, int i_argc, char *const *pp_argv, char *const *pp_env, const char *psz_cwd, const char *p_in, size_t i_in, char **pp_data, size_t *pi_data ) LIBVLC_USED ); VLC_API int vlc_execve( vlc_object_t *p_object, int i_argc, char *const *pp_argv, char *const *pp_env, const char *psz_cwd, const char *p_in, size_t i_in, char **pp_data, size_t *pi_data ) LIBVLC_USED;
#define vlc_execve(a,b,c,d,e,f,g,h,i) vlc_execve(VLC_OBJECT(a),b,c,d,e,f,g,h,i) #define vlc_execve(a,b,c,d,e,f,g,h,i) vlc_execve(VLC_OBJECT(a),b,c,d,e,f,g,h,i)
VLC_EXPORT( void, vlc_tdestroy, ( void *, void (*)(void *) ) ); VLC_API void vlc_tdestroy( void *, void (*)(void *) );
/* Fast large memory copy and memory set */ /* Fast large memory copy and memory set */
VLC_EXPORT( void *, vlc_memcpy, ( void *, const void *, size_t ) ); VLC_API void * vlc_memcpy( void *, const void *, size_t );
VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) ); VLC_API void