[vlc-commits] Move message subscription stuff from vlc_messages.h to vlc_interface.h

Rémi Denis-Courmont git at videolan.org
Wed Apr 18 23:13:41 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 18 23:22:41 2012 +0300| [b549105cfb4db9febec9f9ecef0c93e8515d44f1] | committer: Rémi Denis-Courmont

Move message subscription stuff from vlc_messages.h to vlc_interface.h

This is not particularly clean and intuitive. But <vlc_messages.h> is
included and used all over the place, whereas the back-end is only used
by interfaces.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b549105cfb4db9febec9f9ecef0c93e8515d44f1
---

 include/vlc_interface.h |   27 +++++++++++++++++++++------
 include/vlc_messages.h  |   18 ------------------
 src/misc/messages.c     |    8 +++-----
 3 files changed, 24 insertions(+), 29 deletions(-)

diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index d4d16e9..2acf5aa 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -96,19 +96,34 @@ struct intf_dialog_args_t
     struct interaction_dialog_t *p_dialog;
 };
 
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
 VLC_API int intf_Create( vlc_object_t *, const char * );
 #define intf_Create(a,b) intf_Create(VLC_OBJECT(a),b)
 
 VLC_API void libvlc_Quit( libvlc_int_t * );
 
+/**
+ * \defgroup vlc_subscription Log messages subscription
+ * These functions deal with log messages.
+ * @{
+ */
+
+/**
+ * Used by interface plugins which subscribe to the message bank.
+ */
+typedef struct msg_subscription_t msg_subscription_t;
+
+/**
+ * Message logging callback signature.
+ * Accepts one private data pointer, the message, and an overrun counter.
+ */
+typedef void (*msg_callback_t) (void *, int, const msg_item_t *,
+                                const char *, va_list);
+
+VLC_API msg_subscription_t *vlc_Subscribe(msg_callback_t, void *) VLC_USED;
+VLC_API void vlc_Unsubscribe(msg_subscription_t *);
+
 /*@}*/
 
-/*****************************************************************************
- * Macros
- *****************************************************************************/
 #if defined( WIN32 ) && !defined( UNDER_CE )
 #    define CONSOLE_INTRO_MSG \
          if( !getenv( "PWD" ) ) /* detect Cygwin shell or Wine */ \
diff --git a/include/vlc_messages.h b/include/vlc_messages.h
index b358955..69aaea4 100644
--- a/include/vlc_messages.h
+++ b/include/vlc_messages.h
@@ -62,14 +62,6 @@ typedef struct
     const char *psz_header; /**< Additional header (used by VLM media) */
 } msg_item_t;
 
-/**
- * Used by interface plugins which subscribe to the message bank.
- */
-typedef struct msg_subscription_t msg_subscription_t;
-
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
 VLC_API void vlc_Log(vlc_object_t *, int,
                      const char *, const char *, ...) VLC_FORMAT( 4, 5 );
 VLC_API void vlc_vaLog(vlc_object_t *, int,
@@ -86,16 +78,6 @@ VLC_API void vlc_vaLog(vlc_object_t *, int,
     vlc_Log( VLC_OBJECT(p_this), VLC_MSG_DBG,  MODULE_STRING, __VA_ARGS__ )
 
 /**
- * Message logging callback signature.
- * Accepts one private data pointer, the message, and an overrun counter.
- */
-typedef void (*msg_callback_t) (void *, int, const msg_item_t *,
-                                const char *, va_list);
-
-VLC_API msg_subscription_t *vlc_Subscribe(msg_callback_t, void *) VLC_USED;
-VLC_API void vlc_Unsubscribe(msg_subscription_t *);
-
-/**
  * @}
  */
 #endif
diff --git a/src/misc/messages.c b/src/misc/messages.c
index 317319a..c2f9820 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -32,8 +32,6 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-
 #include <stdarg.h>                                       /* va_list for BSD */
 #ifdef __APPLE__
 # include <xlocale.h>
@@ -41,13 +39,13 @@
 # include <locale.h>
 #endif
 #include <errno.h>                                                  /* errno */
+#include <assert.h>
 
+#include <vlc_common.h>
+#include <vlc_interface.h>
 #ifdef WIN32
 #   include <vlc_network.h>          /* 'net_strerror' and 'WSAGetLastError' */
 #endif
-
-#include <assert.h>
-
 #include <vlc_charset.h>
 #include "../libvlc.h"
 



More information about the vlc-commits mailing list