]> git.sesse.net Git - vlc/blobdiff - include/vlc/vlc.h
vlc.h: Don't actually put the __attribute__((deprecated)) when the header is used...
[vlc] / include / vlc / vlc.h
index d8e00dcd9e3b4a78478704b10d5e96d01feac040..95212e4ab331543eaee84c62ee99930f96eee075 100644 (file)
 
 # ifdef __cplusplus
 extern "C" {
+# else
+#  include <stdbool.h>
 # endif
 
 /*****************************************************************************
  * Our custom types
  *****************************************************************************/
-typedef int vlc_bool_t;
+typedef bool vlc_bool_t;
 typedef struct vlc_list_t vlc_list_t;
 typedef struct vlc_object_t vlc_object_t;
 
@@ -131,8 +133,8 @@ struct vlc_list_t
 /*****************************************************************************
  * Booleans
  *****************************************************************************/
-#define VLC_FALSE 0
-#define VLC_TRUE  1
+#define VLC_FALSE false
+#define VLC_TRUE  true
 
 /*****************************************************************************
  * Playlist
@@ -162,6 +164,23 @@ struct vlc_list_t
 #  define VLC_PUBLIC_API extern
 #endif
 
+/*****************************************************************************
+ * Compiler specific
+ *****************************************************************************/
+
+#ifndef VLC_DEPRECATED_API
+# ifdef __LIBVLC__
+/* Avoid unuseful warnings from libvlc with our deprecated APIs */
+#    define VLC_DEPRECATED_API VLC_PUBLIC_API
+# else /* __LIBVLC__ */
+#  if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#    define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
+#  else
+#    define VLC_DEPRECATED_API VLC_PUBLIC_API
+#  endif
+# endif /* __LIBVLC__ */
+#endif
+
 /*****************************************************************************
  * Exported libvlc API
  *****************************************************************************/
@@ -172,49 +191,49 @@ struct vlc_list_t
  *
  * \return a string containing the libvlc version
  */
-VLC_PUBLIC_API char const * VLC_Version ( void );
+VLC_DEPRECATED_API char const * VLC_Version ( void );
 
 /**
  * Retrieve libvlc compile time
  *
  * \return a string containing the libvlc compile time
  */
-VLC_PUBLIC_API char const * VLC_CompileTime ( void );
+VLC_DEPRECATED_API char const * VLC_CompileTime ( void );
 
 /**
  * Retrieve the username of the libvlc builder
  *
  * \return a string containing the username of the libvlc builder
  */
-VLC_PUBLIC_API char const * VLC_CompileBy ( void );
+VLC_DEPRECATED_API char const * VLC_CompileBy ( void );
 
 /**
  * Retrieve the host of the libvlc builder
  *
  * \return a string containing the host of the libvlc builder
  */
-VLC_PUBLIC_API char const * VLC_CompileHost ( void );
+VLC_DEPRECATED_API char const * VLC_CompileHost ( void );
 
 /**
  * Retrieve the domain name of the host of the libvlc builder
  *
  * \return a string containing the domain name of the host of the libvlc builder
  */
-VLC_PUBLIC_API char const * VLC_CompileDomain ( void );
+VLC_DEPRECATED_API char const * VLC_CompileDomain ( void );
 
 /**
  * Retrieve libvlc compiler version
  *
  * \return a string containing the libvlc compiler version
  */
-VLC_PUBLIC_API char const * VLC_Compiler ( void );
+VLC_DEPRECATED_API char const * VLC_Compiler ( void );
 
 /**
  * Retrieve libvlc changeset
  *
  * \return a string containing the libvlc subversion changeset
  */
-VLC_PUBLIC_API char const * VLC_Changeset ( void );
+VLC_DEPRECATED_API char const * VLC_Changeset ( void );
 
 /**
  * Return an error string
@@ -222,7 +241,7 @@ VLC_PUBLIC_API char const * VLC_Changeset ( void );
  * \param i_err an error code
  * \return an error string
  */
-VLC_PUBLIC_API char const * VLC_Error ( int i_err );
+VLC_DEPRECATED_API char const * VLC_Error ( int i_err );
 
 #endif /* __LIBVLC__ */
 
@@ -316,7 +335,7 @@ VLC_PUBLIC_API int     VLC_Destroy( int );
  * \param value a vlc_value_t structure
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int     VLC_VariableSet( int, char const *, vlc_value_t );
+VLC_DEPRECATED_API int     VLC_VariableSet( int, char const *, vlc_value_t );
 
 /**
  * Get a VLC variable
@@ -331,7 +350,7 @@ VLC_PUBLIC_API int     VLC_VariableSet( int, char const *, vlc_value_t );
  * \param p_value a pointer to a vlc_value_t structure
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int     VLC_VariableGet( int, char const *, vlc_value_t * );
+VLC_DEPRECATED_API int     VLC_VariableGet( int, char const *, vlc_value_t * );
 
 /**
  * Get a VLC variable type
@@ -344,7 +363,7 @@ VLC_PUBLIC_API int     VLC_VariableGet( int, char const *, vlc_value_t * );
  * \param pi_type a pointer to an integer
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int     VLC_VariableType( int, char const *, int * );
+VLC_DEPRECATED_API int     VLC_VariableType( int, char const *, int * );
 
 /**
  * Add a target to the current playlist
@@ -372,7 +391,7 @@ VLC_PUBLIC_API int     VLC_AddTarget( int, char const *, const char **, int, int
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int     VLC_Play( int );
+VLC_DEPRECATED_API int     VLC_Play( int );
 
 /**
  * Pause the currently playing item. Resume it if already paused
@@ -383,7 +402,7 @@ VLC_PUBLIC_API int     VLC_Play( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int     VLC_Pause( int );
+VLC_DEPRECATED_API int     VLC_Pause( int );
 
 /**
  * Stop the playlist
@@ -396,7 +415,7 @@ VLC_PUBLIC_API int     VLC_Pause( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int             VLC_Stop( int );
+VLC_DEPRECATED_API int             VLC_Stop( int );
 
 /**
  * Tell if VLC is playing
@@ -407,7 +426,7 @@ VLC_PUBLIC_API int             VLC_Stop( int );
  * \param i_object a vlc object id
  * \return VLC_TRUE or VLC_FALSE
  */
-VLC_PUBLIC_API vlc_bool_t      VLC_IsPlaying( int );
+VLC_DEPRECATED_API vlc_bool_t      VLC_IsPlaying( int );
 
 /**
  * Get the current position in a input
@@ -419,7 +438,7 @@ VLC_PUBLIC_API vlc_bool_t      VLC_IsPlaying( int );
  * \param i_object a vlc object id
  * \return a float in the range of 0.0 - 1.0
  */
-VLC_PUBLIC_API float           VLC_PositionGet( int );
+VLC_DEPRECATED_API float           VLC_PositionGet( int );
 
 /**
  * Set the current position in a input
@@ -432,7 +451,7 @@ VLC_PUBLIC_API float           VLC_PositionGet( int );
  * \param i_position a float in the range of 0.0 - 1.0
  * \return a float in the range of 0.0 - 1.0
  */
-VLC_PUBLIC_API float           VLC_PositionSet( int, float );
+VLC_DEPRECATED_API float           VLC_PositionSet( int, float );
 
 /**
  * Get the current position in a input
@@ -443,7 +462,7 @@ VLC_PUBLIC_API float           VLC_PositionSet( int, float );
  * \param i_object a vlc object id
  * \return the offset from 0:00 in seconds
  */
-VLC_PUBLIC_API int             VLC_TimeGet( int );
+VLC_DEPRECATED_API int             VLC_TimeGet( int );
 
 /**
  * Seek to a position in the current input
@@ -458,7 +477,7 @@ VLC_PUBLIC_API int             VLC_TimeGet( int );
  * \param b_relative seek relative from current position
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int             VLC_TimeSet( int, int, vlc_bool_t );
+VLC_DEPRECATED_API int             VLC_TimeSet( int, int, vlc_bool_t );
 
 /**
  * Get the total length of a input
@@ -469,7 +488,7 @@ VLC_PUBLIC_API int             VLC_TimeSet( int, int, vlc_bool_t );
  * \param i_object a vlc object id
  * \return the length in seconds
  */
-VLC_PUBLIC_API int             VLC_LengthGet( int );
+VLC_DEPRECATED_API int             VLC_LengthGet( int );
 
 /**
  * Play the input faster than realtime
@@ -480,7 +499,7 @@ VLC_PUBLIC_API int             VLC_LengthGet( int );
  * \param i_object a vlc object id
  * \return the current speedrate
  */
-VLC_PUBLIC_API float           VLC_SpeedFaster( int );
+VLC_DEPRECATED_API float           VLC_SpeedFaster( int );
 
 /**
  * Play the input slower than realtime
@@ -491,7 +510,7 @@ VLC_PUBLIC_API float           VLC_SpeedFaster( int );
  * \param i_object a vlc object id
  * \return the current speedrate
  */
-VLC_PUBLIC_API float           VLC_SpeedSlower( int );
+VLC_DEPRECATED_API float           VLC_SpeedSlower( int );
 
 /**
  * Return the current playlist item
@@ -499,7 +518,7 @@ VLC_PUBLIC_API float           VLC_SpeedSlower( int );
  * \param i_object a vlc object id
  * \return the index of the playlistitem that is currently selected for play
  */
-VLC_PUBLIC_API int             VLC_PlaylistIndex( int );
+VLC_DEPRECATED_API int             VLC_PlaylistIndex( int );
 
 /**
  * Total amount of items in the playlist
@@ -507,7 +526,7 @@ VLC_PUBLIC_API int             VLC_PlaylistIndex( int );
  * \param i_object a vlc object id
  * \return amount of playlist items
  */
-VLC_PUBLIC_API int             VLC_PlaylistNumberOfItems( int );
+VLC_DEPRECATED_API int             VLC_PlaylistNumberOfItems( int );
 
 /**
  * Next playlist item
@@ -517,7 +536,7 @@ VLC_PUBLIC_API int             VLC_PlaylistNumberOfItems( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int             VLC_PlaylistNext( int );
+VLC_DEPRECATED_API int             VLC_PlaylistNext( int );
 
 /**
  * Previous playlist item
@@ -527,7 +546,7 @@ VLC_PUBLIC_API int             VLC_PlaylistNext( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int             VLC_PlaylistPrev( int );
+VLC_DEPRECATED_API int             VLC_PlaylistPrev( int );
 
 /**
  * Clear the contents of the playlist
@@ -539,7 +558,7 @@ VLC_PUBLIC_API int             VLC_PlaylistPrev( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int             VLC_PlaylistClear( int );
+VLC_DEPRECATED_API int             VLC_PlaylistClear( int );
 
 /**
  * Change the volume
@@ -548,7 +567,7 @@ VLC_PUBLIC_API int             VLC_PlaylistClear( int );
  * \param i_volume something in a range from 0-200
  * \return the new volume (range 0-200 %)
  */
-VLC_PUBLIC_API int             VLC_VolumeSet( int, int );
+VLC_DEPRECATED_API int             VLC_VolumeSet( int, int );
 
 /**
  * Get the current volume
@@ -558,7 +577,7 @@ VLC_PUBLIC_API int             VLC_VolumeSet( int, int );
  * \param i_object a vlc object id
  * \return the current volume (range 0-200 %)
  */
-VLC_PUBLIC_API int             VLC_VolumeGet( int );
+VLC_DEPRECATED_API int             VLC_VolumeGet( int );
 
 /**
  * Mute/Unmute the volume
@@ -566,7 +585,7 @@ VLC_PUBLIC_API int             VLC_VolumeGet( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int            VLC_VolumeMute( int );
+VLC_DEPRECATED_API int            VLC_VolumeMute( int );
 
 /**
  * Toggle Fullscreen mode
@@ -576,7 +595,7 @@ VLC_PUBLIC_API int            VLC_VolumeMute( int );
  * \param i_object a vlc object id
  * \return VLC_SUCCESS on success
  */
-VLC_PUBLIC_API int             VLC_FullScreen( int );
+VLC_DEPRECATED_API int             VLC_FullScreen( int );
 
 
 # ifdef __cplusplus