]> git.sesse.net Git - vlc/blobdiff - include/vlc_messages.h
Qt: enable tearOff on Navigation and Bookmarks menus.
[vlc] / include / vlc_messages.h
index 8fa89768fd79bbdd4e8cd7570d8975e568474984..a8782ab46131c48c63bf1afb65fac3633f3dab0e 100644 (file)
@@ -50,12 +50,9 @@ typedef struct
     int     i_type;                             /**< message type, see below */
     uintptr_t   i_object_id;
     const char *psz_object_type;
-    char *  psz_module;
+    const char *psz_module;
+    const char *psz_header;                     /**< Additional header */
     char *  psz_msg;                            /**< the message itself */
-    char *  psz_header;                         /**< Additional header */
-
-    mtime_t date;                               /**< Message date */
-    gc_object_t vlc_gc_data;
 } msg_item_t;
 
 /* Message types */
@@ -68,15 +65,25 @@ typedef struct
 /** debug messages */
 #define VLC_MSG_DBG   3
 
-static inline msg_item_t *msg_Hold (msg_item_t *msg)
+VLC_MALLOC VLC_USED
+static inline msg_item_t *msg_Copy (const msg_item_t *msg)
 {
-    vlc_hold (&msg->vlc_gc_data);
-    return msg;
+    msg_item_t *copy = (msg_item_t *)xmalloc (sizeof (*copy));
+    copy->i_type = msg->i_type;
+    copy->i_object_id = msg->i_object_id;
+    copy->psz_object_type = msg->psz_object_type;
+    copy->psz_module = strdup (msg->psz_module);
+    copy->psz_msg = strdup (msg->psz_msg);
+    copy->psz_header = msg->psz_header ? strdup (msg->psz_header) : NULL;
+    return copy;
 }
 
-static inline void msg_Release (msg_item_t *msg)
+static inline void msg_Free (msg_item_t *msg)
 {
-    vlc_release (&msg->vlc_gc_data);
+    free ((char *)msg->psz_module);
+    free ((char *)msg->psz_header);
+    free (msg->psz_msg);
+    free (msg);
 }
 
 /**
@@ -87,21 +94,21 @@ typedef struct msg_subscription_t msg_subscription_t;
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-VLC_EXPORT( void, __msg_Generic, ( vlc_object_t *, int, const char *, const char *, ... ) LIBVLC_FORMAT( 4, 5 ) );
-VLC_EXPORT( void, __msg_GenericVa, ( vlc_object_t *, int, const char *, const char *, va_list args ) );
-#define msg_GenericVa(a, b, c, d, e) __msg_GenericVa(VLC_OBJECT(a), b, c, d, e)
+VLC_API void msg_Generic( vlc_object_t *, int, const char *, const char *, ... ) VLC_FORMAT( 4, 5 );
+VLC_API void msg_GenericVa( vlc_object_t *, int, const char *, const char *, va_list args );
+#define msg_GenericVa(a, b, c, d, e) msg_GenericVa(VLC_OBJECT(a), b, c, d, e)
 
 #define msg_Info( p_this, ... ) \
-      __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_INFO, \
+        msg_Generic( VLC_OBJECT(p_this), VLC_MSG_INFO, \
                      MODULE_STRING, __VA_ARGS__ )
 #define msg_Err( p_this, ... ) \
-      __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_ERR, \
+        msg_Generic( VLC_OBJECT(p_this), VLC_MSG_ERR, \
                      MODULE_STRING, __VA_ARGS__ )
 #define msg_Warn( p_this, ... ) \
-      __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_WARN, \
+        msg_Generic( VLC_OBJECT(p_this), VLC_MSG_WARN, \
                      MODULE_STRING, __VA_ARGS__ )
 #define msg_Dbg( p_this, ... ) \
-      __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, \
+        msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, \
                      MODULE_STRING, __VA_ARGS__ )
 
 typedef struct msg_cb_data_t msg_cb_data_t;
@@ -110,16 +117,18 @@ typedef struct msg_cb_data_t msg_cb_data_t;
  * Message logging callback signature.
  * Accepts one private data pointer, the message, and an overrun counter.
  */
-typedef void (*msg_callback_t) (msg_cb_data_t *, msg_item_t *, unsigned);
+typedef void (*msg_callback_t) (msg_cb_data_t *, const msg_item_t *);
 
-VLC_EXPORT( msg_subscription_t*, msg_Subscribe, ( libvlc_int_t *, msg_callback_t, msg_cb_data_t * ) );
-VLC_EXPORT( void, msg_Unsubscribe, ( msg_subscription_t * ) );
+VLC_API msg_subscription_t* msg_Subscribe( libvlc_int_t *, msg_callback_t, msg_cb_data_t * ) VLC_USED;
+VLC_API void msg_Unsubscribe( msg_subscription_t * );
+VLC_API void msg_SubscriptionSetVerbosity( msg_subscription_t *, const int);
 
 /* Enable or disable a certain object debug messages */
-#define msg_EnableObjectPrinting(a,b) __msg_EnableObjectPrinting(VLC_OBJECT(a),b)
-#define msg_DisableObjectPrinting(a,b) __msg_DisableObjectPrinting(VLC_OBJECT(a),b)
-VLC_EXPORT( void, __msg_EnableObjectPrinting, ( vlc_object_t *, const char * psz_object ) );
-VLC_EXPORT( void, __msg_DisableObjectPrinting, ( vlc_object_t *, const char * psz_object ) );
+VLC_API void msg_EnableObjectPrinting( vlc_object_t *, const char * psz_object );
+#define msg_EnableObjectPrinting(a,b) msg_EnableObjectPrinting(VLC_OBJECT(a),b)
+VLC_API void msg_DisableObjectPrinting( vlc_object_t *, const char * psz_object );
+#define msg_DisableObjectPrinting(a,b) msg_DisableObjectPrinting(VLC_OBJECT(a),b)
+
 
 /**
  * @}
@@ -202,19 +211,20 @@ enum
 /*********
  * Timing
  ********/
-#define stats_TimerStart(a,b,c) __stats_TimerStart( VLC_OBJECT(a), b,c )
-#define stats_TimerStop(a,b) __stats_TimerStop( VLC_OBJECT(a), b )
-#define stats_TimerDump(a,b) __stats_TimerDump( VLC_OBJECT(a), b )
-#define stats_TimersDumpAll(a) __stats_TimersDumpAll( VLC_OBJECT(a) )
-VLC_EXPORT( void,__stats_TimerStart, (vlc_object_t*, const char *, unsigned int ) );
-VLC_EXPORT( void,__stats_TimerStop, (vlc_object_t*, unsigned int) );
-VLC_EXPORT( void,__stats_TimerDump, (vlc_object_t*, unsigned int) );
-VLC_EXPORT( void,__stats_TimersDumpAll, (vlc_object_t*) );
-#define stats_TimersCleanAll(a) __stats_TimersCleanAll( VLC_OBJECT(a) )
-VLC_EXPORT( void, __stats_TimersCleanAll, (vlc_object_t * ) );
-
-#define stats_TimerClean(a,b) __stats_TimerClean( VLC_OBJECT(a), b )
-VLC_EXPORT( void, __stats_TimerClean, (vlc_object_t *, unsigned int ) );
+VLC_API void stats_TimerStart(vlc_object_t*, const char *, unsigned int );
+VLC_API void stats_TimerStop(vlc_object_t*, unsigned int);
+VLC_API void stats_TimerDump(vlc_object_t*, unsigned int);
+VLC_API void stats_TimersDumpAll(vlc_object_t*);
+#define stats_TimerStart(a,b,c) stats_TimerStart( VLC_OBJECT(a), b,c )
+#define stats_TimerStop(a,b) stats_TimerStop( VLC_OBJECT(a), b )
+#define stats_TimerDump(a,b) stats_TimerDump( VLC_OBJECT(a), b )
+#define stats_TimersDumpAll(a) stats_TimersDumpAll( VLC_OBJECT(a) )
+
+VLC_API void stats_TimersCleanAll(vlc_object_t * );
+#define stats_TimersCleanAll(a) stats_TimersCleanAll( VLC_OBJECT(a) )
+
+VLC_API void stats_TimerClean(vlc_object_t *, unsigned int );
+#define stats_TimerClean(a,b) stats_TimerClean( VLC_OBJECT(a), b )
 
 /**
  * @}