From dde93dd57310505e956d6de30b0715533b2b2aa8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 18 Mar 2013 22:38:05 +0200 Subject: [PATCH] Rename msg_item_* to vlc_log_* (cosmetic) (This is needed for the next change.) --- include/vlc_interface.h | 4 ++-- include/vlc_messages.h | 6 +++--- lib/log.c | 2 +- modules/gui/macosx/intf.h | 2 +- modules/gui/macosx/intf.m | 6 +++--- modules/gui/ncurses.c | 12 ++++++------ modules/gui/qt4/dialogs/messages.cpp | 6 +++--- modules/gui/qt4/dialogs/messages.hpp | 4 ++-- modules/misc/logger.c | 17 ++++++++--------- src/libvlc.h | 2 +- src/misc/messages.c | 10 +++++----- 11 files changed, 35 insertions(+), 36 deletions(-) diff --git a/include/vlc_interface.h b/include/vlc_interface.h index 1dabb2dc13..0ba9154cf3 100644 --- a/include/vlc_interface.h +++ b/include/vlc_interface.h @@ -104,12 +104,12 @@ VLC_API void libvlc_Quit( libvlc_int_t * ); /** * Message logging callback signature. * \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 fmt format string * \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); VLC_API void vlc_LogSet(libvlc_int_t *, vlc_log_cb cb, void *data); diff --git a/include/vlc_messages.h b/include/vlc_messages.h index 69aaea4465..79aa519e00 100644 --- a/include/vlc_messages.h +++ b/include/vlc_messages.h @@ -43,7 +43,7 @@ */ /** Message types */ -enum msg_item_type +enum vlc_log_type { VLC_MSG_INFO=0, /**< Important information */ VLC_MSG_ERR, /**< Error */ @@ -54,13 +54,13 @@ enum msg_item_type /** * Log message */ -typedef struct +typedef struct vlc_log_t { uintptr_t i_object_id; /**< Emitter (temporaly) unique object ID or 0 */ const char *psz_object_type; /**< Emitter object type name */ const char *psz_module; /**< Emitter module (source code) */ 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, const char *, const char *, ...) VLC_FORMAT( 4, 5 ); diff --git a/lib/log.c b/lib/log.c index 0999c56209..f74081f38d 100644 --- a/lib/log.c +++ b/lib/log.c @@ -60,7 +60,7 @@ static void libvlc_log (int level, const char *fmt, ...) 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) { char *msg; diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index 084191908b..8c5d1e7462 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -201,7 +201,7 @@ struct intf_sys_t - (IBAction)showMessagesPanel:(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; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 6a3a92d5cf..edd8b7135c 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -82,7 +82,7 @@ static void updateProgressPanel (void *, const char *, float); static bool checkProgressPanel (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 *, vlc_value_t, vlc_value_t, void *); @@ -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 * 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(); char *str; @@ -1901,7 +1901,7 @@ static VLCMain *_o_sharedMainInstance = nil; 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) { NSColor *o_white = [NSColor whiteColor]; diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c index 6b46bbba1f..40b36bf144 100644 --- a/modules/gui/ncurses.c +++ b/modules/gui/ncurses.c @@ -194,7 +194,7 @@ struct intf_sys_t struct { int type; - msg_item_t *item; + vlc_log_t *item; char *msg; } msgs[50]; // ring buffer int i_msgs; @@ -999,7 +999,7 @@ static int DrawMessages(intf_thread_t *intf) vlc_mutex_lock(&sys->msg_lock); int i = sys->i_msgs; for(;;) { - msg_item_t *msg = sys->msgs[i].item; + vlc_log_t *msg = sys->msgs[i].item; if (msg) { if (sys->color) color_set(sys->msgs[i].type + C_INFO, NULL); @@ -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->psz_object_type = msg->psz_object_type; copy->psz_module = strdup (msg->psz_module); @@ -1708,14 +1708,14 @@ static msg_item_t *msg_Copy (const msg_item_t *msg) 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_header); 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) { intf_sys_t *sys = data; diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp index ef00245431..223c4798f2 100644 --- a/modules/gui/qt4/dialogs/messages.cpp +++ b/modules/gui/qt4/dialogs/messages.cpp @@ -50,7 +50,7 @@ enum { class MsgEvent : public QEvent { public: - MsgEvent( int, const msg_item_t *, const char * ); + MsgEvent( int, const vlc_log_t *, const char * ); int priority; uintptr_t object_id; @@ -60,7 +60,7 @@ public: 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 ), priority( type ), object_id( msg->i_object_id ), @@ -332,7 +332,7 @@ void MessagesDialog::tabChanged( int i ) : 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 ) { MessagesDialog *dialog = (MessagesDialog *)self; diff --git a/modules/gui/qt4/dialogs/messages.hpp b/modules/gui/qt4/dialogs/messages.hpp index 99637077dc..945db4fa29 100644 --- a/modules/gui/qt4/dialogs/messages.hpp +++ b/modules/gui/qt4/dialogs/messages.hpp @@ -50,13 +50,13 @@ private: virtual ~MessagesDialog(); Ui::messagesPanelWidget ui; - static void sinkMessage( void *, msg_item_t *, unsigned ); + static void sinkMessage( void *, vlc_log_t *, unsigned ); void customEvent( QEvent * ); void sinkMessage( const MsgEvent * ); bool matchFilter( const QString& ); 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 ); private slots: diff --git a/modules/misc/logger.c b/modules/misc/logger.c index 333d3b0c0e..9d6dd234f4 100644 --- a/modules/misc/logger.c +++ b/modules/misc/logger.c @@ -84,14 +84,13 @@ struct intf_sys_t static int Open ( vlc_object_t * ); static void Close ( vlc_object_t * ); -static void TextPrint(void *, int, const msg_item_t *, const char *, va_list); -static void HtmlPrint(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 vlc_log_t *, const char *, va_list); #ifdef HAVE_SYSLOG_H -static void SyslogPrint(void *, int, const msg_item_t *, const char *, - va_list); +static void SyslogPrint(void *, int, const vlc_log_t *, const char *, va_list); #endif #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 /***************************************************************************** @@ -357,7 +356,7 @@ static const android_LogPriority prioritytype[4] = { 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 ) { (void)item; @@ -372,7 +371,7 @@ static void AndroidPrint( void *opaque, int type, const msg_item_t *item, } #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 ) { intf_thread_t *p_intf = opaque; @@ -391,7 +390,7 @@ static void TextPrint( void *opaque, int type, const msg_item_t *item, } #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 ) { 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, } #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 ) { static const unsigned color[4] = { diff --git a/src/libvlc.h b/src/libvlc.h index b939faac39..79bce5ec38 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -150,7 +150,7 @@ typedef struct libvlc_priv_t /* Logging */ 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; vlc_rwlock_t lock; } log; diff --git a/src/misc/messages.c b/src/misc/messages.c index 15ec77556d..abc6c98cde 100644 --- a/src/misc/messages.c +++ b/src/misc/messages.c @@ -68,7 +68,7 @@ void vlc_Log (vlc_object_t *obj, int type, const char *module, } #ifdef WIN32 -static void Win32DebugOutputMsg (void *, int , const msg_item_t *, +static void Win32DebugOutputMsg (void *, int , const vlc_log_t *, const char *, va_list); #endif @@ -143,7 +143,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module, #endif /* Fill message information fields */ - msg_item_t msg; + vlc_log_t msg; msg.i_object_id = (uintptr_t)obj; 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" }; #define GRAY "\033[0m" 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) { FILE *stream = stderr; @@ -211,7 +211,7 @@ static void PrintColorMsg (void *d, int type, const msg_item_t *p_item, 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) { FILE *stream = stderr; @@ -238,7 +238,7 @@ static void PrintMsg (void *d, int type, const msg_item_t *p_item, } #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) { VLC_UNUSED(p_item); -- 2.39.2