- char *psz_msg; /**< Message text */
-} msg_item_t;
-
-VLC_MALLOC VLC_USED
-static inline msg_item_t *msg_Copy (const msg_item_t *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_Free (msg_item_t *msg)
-{
- free ((char *)msg->psz_module);
- free ((char *)msg->psz_header);
- free (msg->psz_msg);
- free (msg);
-}
-
-/**
- * Used by interface plugins which subscribe to the message bank.
- */
-typedef struct msg_subscription_t msg_subscription_t;
-
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
-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, \
- MODULE_STRING, __VA_ARGS__ )
-#define msg_Err( p_this, ... ) \
- 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, \
- MODULE_STRING, __VA_ARGS__ )
-#define msg_Dbg( p_this, ... ) \
- msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, \
- MODULE_STRING, __VA_ARGS__ )
+ const char *file; /**< Source code file name or NULL */
+ int line; /**< Source code file line number or -1 */
+ const char *func; /**< Source code calling function name or NULL */
+} vlc_log_t;
+
+VLC_API void vlc_Log(vlc_object_t *obj, int prio, const char *module,
+ const char *file, unsigned line, const char *func,
+ const char *format, ...) VLC_FORMAT(7, 8);
+VLC_API void vlc_vaLog(vlc_object_t *obj, int prio, const char *module,
+ const char *file, unsigned line, const char *func,
+ const char *format, va_list ap);
+#define msg_GenericVa(o, p, fmt, ap) \
+ vlc_vaLog(VLC_OBJECT(o), p, MODULE_STRING, __FILE__, __LINE__, __func__, \
+ fmt, ap)
+
+#define msg_Generic(o, p, ...) \
+ vlc_Log(VLC_OBJECT(o), p, MODULE_STRING, __FILE__, __LINE__, \
+ __func__, __VA_ARGS__)
+#define msg_Info(p_this, ...) \
+ msg_Generic(p_this, VLC_MSG_INFO, __VA_ARGS__)
+#define msg_Err(p_this, ...) \
+ msg_Generic(p_this, VLC_MSG_ERR, __VA_ARGS__)
+#define msg_Warn(p_this, ...) \
+ msg_Generic(p_this, VLC_MSG_WARN, __VA_ARGS__)
+#define msg_Dbg(p_this, ...) \
+ msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)
+
+#ifndef MODULE_STRING
+# define MODULE_STRING __FILE__
+#endif