-typedef struct
-{
- int i_code;
- char * psz_message;
-} msg_context_t;
-
-static vlc_threadvar_t msg_context;
-static uintptr_t banks = 0;
-
-/*****************************************************************************
- * Local macros
- *****************************************************************************/
-#if defined(HAVE_VA_COPY)
-# define vlc_va_copy(dest,src) va_copy(dest,src)
-#elif defined(HAVE___VA_COPY)
-# define vlc_va_copy(dest,src) __va_copy(dest,src)
-#else
-# define vlc_va_copy(dest,src) (dest)=(src)
-#endif
-
-#define QUEUE priv->msg_bank
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static void QueueMsg ( vlc_object_t *, int, const char *,
- const char *, va_list );
-static void FlushMsg ( msg_bank_t * );
-static void PrintMsg ( vlc_object_t *, msg_item_t * );
-
-static vlc_mutex_t msg_stack_lock = VLC_STATIC_MUTEX;
-
-/**
- * Initialize messages queues
- * This function initializes all message queues
- */
-void msg_Create (libvlc_int_t *p_libvlc)
-{
- libvlc_priv_t *priv = libvlc_priv (p_libvlc);
- vlc_mutex_init( &QUEUE.lock );
- vlc_dictionary_init( &priv->msg_enabled_objects, 0 );
- priv->msg_all_objects_enabled = true;
-
- QUEUE.b_overflow = false;
- QUEUE.i_start = 0;
- QUEUE.i_stop = 0;
- QUEUE.i_sub = 0;
- QUEUE.pp_sub = 0;
-
-#ifdef UNDER_CE
- QUEUE.logfile =
- CreateFile( L"vlc-log.txt", GENERIC_WRITE,
- FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
- CREATE_ALWAYS, 0, NULL );
- SetFilePointer( QUEUE.logfile, 0, NULL, FILE_END );
-#endif
-
- vlc_mutex_lock( &msg_stack_lock );
- if( banks++ == 0 )
- vlc_threadvar_create( &msg_context, NULL );
- vlc_mutex_unlock( &msg_stack_lock );
-}
-
-/**
- * Flush all message queues
- */
-void msg_Flush (libvlc_int_t *p_libvlc)
-{
- libvlc_priv_t *priv = libvlc_priv (p_libvlc);
- vlc_mutex_lock( &QUEUE.lock );
- FlushMsg( &QUEUE );
- vlc_mutex_unlock( &QUEUE.lock );
-}
-
-