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

Rename msg_item_* to vlc_log_* (cosmetic)

(This is needed for the next change.)
parent a5d95db0
...@@ -104,12 +104,12 @@ VLC_API void libvlc_Quit( libvlc_int_t * ); ...@@ -104,12 +104,12 @@ VLC_API void libvlc_Quit( libvlc_int_t * );
/** /**
* Message logging callback signature. * Message logging callback signature.
* \param data data pointer as provided to vlc_msg_SetCallback(). * \param data data pointer as provided to vlc_msg_SetCallback().
* \param type message type (VLC_MSG_* values from enum msg_item_type) * \param type message type (VLC_MSG_* values from enum vlc_log_type)
* \param item meta informations * \param item meta informations
* \param fmt format string * \param fmt format string
* \param args format string arguments * \param args format string arguments
*/ */
typedef void (*vlc_log_cb) (void *data, int type, const msg_item_t *item, typedef void (*vlc_log_cb) (void *data, int type, const vlc_log_t *item,
const char *fmt, va_list args); const char *fmt, va_list args);
VLC_API void vlc_LogSet(libvlc_int_t *, vlc_log_cb cb, void *data); VLC_API void vlc_LogSet(libvlc_int_t *, vlc_log_cb cb, void *data);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
*/ */
/** Message types */ /** Message types */
enum msg_item_type enum vlc_log_type
{ {
VLC_MSG_INFO=0, /**< Important information */ VLC_MSG_INFO=0, /**< Important information */
VLC_MSG_ERR, /**< Error */ VLC_MSG_ERR, /**< Error */
...@@ -54,13 +54,13 @@ enum msg_item_type ...@@ -54,13 +54,13 @@ enum msg_item_type
/** /**
* Log message * Log message
*/ */
typedef struct typedef struct vlc_log_t
{ {
uintptr_t i_object_id; /**< Emitter (temporaly) unique object ID or 0 */ uintptr_t i_object_id; /**< Emitter (temporaly) unique object ID or 0 */
const char *psz_object_type; /**< Emitter object type name */ const char *psz_object_type; /**< Emitter object type name */
const char *psz_module; /**< Emitter module (source code) */ const char *psz_module; /**< Emitter module (source code) */
const char *psz_header; /**< Additional header (used by VLM media) */ const char *psz_header; /**< Additional header (used by VLM media) */
} msg_item_t; } vlc_log_t;
VLC_API void vlc_Log(vlc_object_t *, int, VLC_API void vlc_Log(vlc_object_t *, int,
const char *, const char *, ...) VLC_FORMAT( 4, 5 ); const char *, const char *, ...) VLC_FORMAT( 4, 5 );
......
...@@ -60,7 +60,7 @@ static void libvlc_log (int level, const char *fmt, ...) ...@@ -60,7 +60,7 @@ static void libvlc_log (int level, const char *fmt, ...)
va_end (ap); va_end (ap);
} }
static void libvlc_logf (void *dummy, int level, const msg_item_t *item, static void libvlc_logf (void *dummy, int level, const vlc_log_t *item,
const char *fmt, va_list ap) const char *fmt, va_list ap)
{ {
char *msg; char *msg;
......
...@@ -201,7 +201,7 @@ struct intf_sys_t ...@@ -201,7 +201,7 @@ struct intf_sys_t
- (IBAction)showMessagesPanel:(id)sender; - (IBAction)showMessagesPanel:(id)sender;
- (IBAction)updateMessagesPanel:(id)sender; - (IBAction)updateMessagesPanel:(id)sender;
- (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)type withStr: (char *)str; - (void)processReceivedlibvlcMessage:(const vlc_log_t *) item ofType: (int)type withStr: (char *)str;
- (void)updateTogglePlaylistState; - (void)updateTogglePlaylistState;
......
...@@ -82,7 +82,7 @@ static void updateProgressPanel (void *, const char *, float); ...@@ -82,7 +82,7 @@ static void updateProgressPanel (void *, const char *, float);
static bool checkProgressPanel (void *); static bool checkProgressPanel (void *);
static void destroyProgressPanel (void *); static void destroyProgressPanel (void *);
static void MsgCallback(void *data, int type, const msg_item_t *item, const char *format, va_list ap); static void MsgCallback(void *data, int type, const vlc_log_t *item, const char *format, va_list ap);
static int InputEvent(vlc_object_t *, const char *, static int InputEvent(vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void *); vlc_value_t, vlc_value_t, void *);
...@@ -300,7 +300,7 @@ static void Run(intf_thread_t *p_intf) ...@@ -300,7 +300,7 @@ static void Run(intf_thread_t *p_intf)
* ready to be displayed. We store everything in a NSArray in our Cocoa part * ready to be displayed. We store everything in a NSArray in our Cocoa part
* of this file. * of this file.
*****************************************************************************/ *****************************************************************************/
static void MsgCallback(void *data, int type, const msg_item_t *item, const char *format, va_list ap) static void MsgCallback(void *data, int type, const vlc_log_t *item, const char *format, va_list ap)
{ {
int canc = vlc_savecancel(); int canc = vlc_savecancel();
char *str; char *str;
...@@ -1901,7 +1901,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1901,7 +1901,7 @@ static VLCMain *_o_sharedMainInstance = nil;
return @""; return @"";
} }
- (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)i_type withStr: (char *)str - (void)processReceivedlibvlcMessage:(const vlc_log_t *) item ofType: (int)i_type withStr: (char *)str
{ {
if (o_msg_arr) { if (o_msg_arr) {
NSColor *o_white = [NSColor whiteColor]; NSColor *o_white = [NSColor whiteColor];
......
...@@ -194,7 +194,7 @@ struct intf_sys_t ...@@ -194,7 +194,7 @@ struct intf_sys_t
struct struct
{ {
int type; int type;
msg_item_t *item; vlc_log_t *item;
char *msg; char *msg;
} msgs[50]; // ring buffer } msgs[50]; // ring buffer
int i_msgs; int i_msgs;
...@@ -999,7 +999,7 @@ static int DrawMessages(intf_thread_t *intf) ...@@ -999,7 +999,7 @@ static int DrawMessages(intf_thread_t *intf)
vlc_mutex_lock(&sys->msg_lock); vlc_mutex_lock(&sys->msg_lock);
int i = sys->i_msgs; int i = sys->i_msgs;
for(;;) { for(;;) {
msg_item_t *msg = sys->msgs[i].item; vlc_log_t *msg = sys->msgs[i].item;
if (msg) { if (msg) {
if (sys->color) if (sys->color)
color_set(sys->msgs[i].type + C_INFO, NULL); color_set(sys->msgs[i].type + C_INFO, NULL);
...@@ -1698,9 +1698,9 @@ static void HandleKey(intf_thread_t *intf) ...@@ -1698,9 +1698,9 @@ static void HandleKey(intf_thread_t *intf)
/* /*
* *
*/ */
static msg_item_t *msg_Copy (const msg_item_t *msg) static vlc_log_t *msg_Copy (const vlc_log_t *msg)
{ {
msg_item_t *copy = (msg_item_t *)xmalloc (sizeof (*copy)); vlc_log_t *copy = (vlc_log_t *)xmalloc (sizeof (*copy));
copy->i_object_id = msg->i_object_id; copy->i_object_id = msg->i_object_id;
copy->psz_object_type = msg->psz_object_type; copy->psz_object_type = msg->psz_object_type;
copy->psz_module = strdup (msg->psz_module); copy->psz_module = strdup (msg->psz_module);
...@@ -1708,14 +1708,14 @@ static msg_item_t *msg_Copy (const msg_item_t *msg) ...@@ -1708,14 +1708,14 @@ static msg_item_t *msg_Copy (const msg_item_t *msg)
return copy; return copy;
} }
static void msg_Free (msg_item_t *msg) static void msg_Free (vlc_log_t *msg)
{ {
free ((char *)msg->psz_module); free ((char *)msg->psz_module);
free ((char *)msg->psz_header); free ((char *)msg->psz_header);
free (msg); free (msg);
} }
static void MsgCallback(void *data, int type, const msg_item_t *msg, static void MsgCallback(void *data, int type, const vlc_log_t *msg,
const char *format, va_list ap) const char *format, va_list ap)
{ {
intf_sys_t *sys = data; intf_sys_t *sys = data;
......
...@@ -50,7 +50,7 @@ enum { ...@@ -50,7 +50,7 @@ enum {
class MsgEvent : public QEvent class MsgEvent : public QEvent
{ {
public: public:
MsgEvent( int, const msg_item_t *, const char * ); MsgEvent( int, const vlc_log_t *, const char * );
int priority; int priority;
uintptr_t object_id; uintptr_t object_id;
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
QString text; QString text;
}; };
MsgEvent::MsgEvent( int type, const msg_item_t *msg, const char *text ) MsgEvent::MsgEvent( int type, const vlc_log_t *msg, const char *text )
: QEvent( (QEvent::Type)MsgEvent_Type ), : QEvent( (QEvent::Type)MsgEvent_Type ),
priority( type ), priority( type ),
object_id( msg->i_object_id ), object_id( msg->i_object_id ),
...@@ -332,7 +332,7 @@ void MessagesDialog::tabChanged( int i ) ...@@ -332,7 +332,7 @@ void MessagesDialog::tabChanged( int i )
: qtr("Clear the messages") ); : qtr("Clear the messages") );
} }
void MessagesDialog::MsgCallback( void *self, int type, const msg_item_t *item, void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item,
const char *format, va_list ap ) const char *format, va_list ap )
{ {
MessagesDialog *dialog = (MessagesDialog *)self; MessagesDialog *dialog = (MessagesDialog *)self;
......
...@@ -50,13 +50,13 @@ private: ...@@ -50,13 +50,13 @@ private:
virtual ~MessagesDialog(); virtual ~MessagesDialog();
Ui::messagesPanelWidget ui; Ui::messagesPanelWidget ui;
static void sinkMessage( void *, msg_item_t *, unsigned ); static void sinkMessage( void *, vlc_log_t *, unsigned );
void customEvent( QEvent * ); void customEvent( QEvent * );
void sinkMessage( const MsgEvent * ); void sinkMessage( const MsgEvent * );
bool matchFilter( const QString& ); bool matchFilter( const QString& );
vlc_atomic_t verbosity; vlc_atomic_t verbosity;
static void MsgCallback( void *, int, const msg_item_t *, const char *, static void MsgCallback( void *, int, const vlc_log_t *, const char *,
va_list ); va_list );
private slots: private slots:
......
...@@ -84,14 +84,13 @@ struct intf_sys_t ...@@ -84,14 +84,13 @@ struct intf_sys_t
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static void TextPrint(void *, int, const msg_item_t *, const char *, va_list); static void TextPrint(void *, int, const vlc_log_t *, const char *, va_list);
static void HtmlPrint(void *, int, const msg_item_t *, const char *, va_list); static void HtmlPrint(void *, int, const vlc_log_t *, const char *, va_list);
#ifdef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H
static void SyslogPrint(void *, int, const msg_item_t *, const char *, static void SyslogPrint(void *, int, const vlc_log_t *, const char *, va_list);
va_list);
#endif #endif
#ifdef __ANDROID__ #ifdef __ANDROID__
static void AndroidPrint(void *, int, const msg_item_t *, const char *, va_list); static void AndroidPrint(void *, int, const vlc_log_t *, const char *, va_list);
#endif #endif
/***************************************************************************** /*****************************************************************************
...@@ -357,7 +356,7 @@ static const android_LogPriority prioritytype[4] = { ...@@ -357,7 +356,7 @@ static const android_LogPriority prioritytype[4] = {
ANDROID_LOG_DEBUG ANDROID_LOG_DEBUG
}; };
static void AndroidPrint( void *opaque, int type, const msg_item_t *item, static void AndroidPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap ) const char *fmt, va_list ap )
{ {
(void)item; (void)item;
...@@ -372,7 +371,7 @@ static void AndroidPrint( void *opaque, int type, const msg_item_t *item, ...@@ -372,7 +371,7 @@ static void AndroidPrint( void *opaque, int type, const msg_item_t *item,
} }
#endif #endif
static void TextPrint( void *opaque, int type, const msg_item_t *item, static void TextPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap ) const char *fmt, va_list ap )
{ {
intf_thread_t *p_intf = opaque; intf_thread_t *p_intf = opaque;
...@@ -391,7 +390,7 @@ static void TextPrint( void *opaque, int type, const msg_item_t *item, ...@@ -391,7 +390,7 @@ static void TextPrint( void *opaque, int type, const msg_item_t *item,
} }
#ifdef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H
static void SyslogPrint( void *opaque, int type, const msg_item_t *item, static void SyslogPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap ) const char *fmt, va_list ap )
{ {
static const int i_prio[4] = { LOG_INFO, LOG_ERR, LOG_WARNING, LOG_DEBUG }; static const int i_prio[4] = { LOG_INFO, LOG_ERR, LOG_WARNING, LOG_DEBUG };
...@@ -416,7 +415,7 @@ static void SyslogPrint( void *opaque, int type, const msg_item_t *item, ...@@ -416,7 +415,7 @@ static void SyslogPrint( void *opaque, int type, const msg_item_t *item,
} }
#endif #endif
static void HtmlPrint( void *opaque, int type, const msg_item_t *item, static void HtmlPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap ) const char *fmt, va_list ap )
{ {
static const unsigned color[4] = { static const unsigned color[4] = {
......
...@@ -150,7 +150,7 @@ typedef struct libvlc_priv_t ...@@ -150,7 +150,7 @@ typedef struct libvlc_priv_t
/* Logging */ /* Logging */
struct struct
{ {
void (*cb) (void *, int, const msg_item_t *, const char *, va_list); void (*cb) (void *, int, const vlc_log_t *, const char *, va_list);
void *opaque; void *opaque;
vlc_rwlock_t lock; vlc_rwlock_t lock;
} log; } log;
......
...@@ -68,7 +68,7 @@ void vlc_Log (vlc_object_t *obj, int type, const char *module, ...@@ -68,7 +68,7 @@ void vlc_Log (vlc_object_t *obj, int type, const char *module,
} }
#ifdef WIN32 #ifdef WIN32
static void Win32DebugOutputMsg (void *, int , const msg_item_t *, static void Win32DebugOutputMsg (void *, int , const vlc_log_t *,
const char *, va_list); const char *, va_list);
#endif #endif
...@@ -143,7 +143,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module, ...@@ -143,7 +143,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module,
#endif #endif
/* Fill message information fields */ /* Fill message information fields */
msg_item_t msg; vlc_log_t msg;
msg.i_object_id = (uintptr_t)obj; msg.i_object_id = (uintptr_t)obj;
msg.psz_object_type = (obj != NULL) ? obj->psz_object_type : "generic"; msg.psz_object_type = (obj != NULL) ? obj->psz_object_type : "generic";
...@@ -185,7 +185,7 @@ static const char msg_type[4][9] = { "", " error", " warning", " debug" }; ...@@ -185,7 +185,7 @@ static const char msg_type[4][9] = { "", " error", " warning", " debug" };
#define GRAY "\033[0m" #define GRAY "\033[0m"
static const char msg_color[4][8] = { WHITE, RED, YELLOW, GRAY }; static const char msg_color[4][8] = { WHITE, RED, YELLOW, GRAY };
static void PrintColorMsg (void *d, int type, const msg_item_t *p_item, static void PrintColorMsg (void *d, int type, const vlc_log_t *p_item,
const char *format, va_list ap) const char *format, va_list ap)
{ {
FILE *stream = stderr; FILE *stream = stderr;
...@@ -211,7 +211,7 @@ static void PrintColorMsg (void *d, int type, const msg_item_t *p_item, ...@@ -211,7 +211,7 @@ static void PrintColorMsg (void *d, int type, const msg_item_t *p_item,
vlc_restorecancel (canc); vlc_restorecancel (canc);
} }
static void PrintMsg (void *d, int type, const msg_item_t *p_item, static void PrintMsg (void *d, int type, const vlc_log_t *p_item,
const char *format, va_list ap) const char *format, va_list ap)
{ {
FILE *stream = stderr; FILE *stream = stderr;
...@@ -238,7 +238,7 @@ static void PrintMsg (void *d, int type, const msg_item_t *p_item, ...@@ -238,7 +238,7 @@ static void PrintMsg (void *d, int type, const msg_item_t *p_item,
} }
#ifdef WIN32 #ifdef WIN32
static void Win32DebugOutputMsg (void* d, int type, const msg_item_t *p_item, static void Win32DebugOutputMsg (void* d, int type, const vlc_log_t *p_item,
const char *format, va_list dol) const char *format, va_list dol)
{ {
VLC_UNUSED(p_item); VLC_UNUSED(p_item);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment