]> git.sesse.net Git - vlc/blobdiff - src/interface/intf_msg.c
* DirectX plugin by Gildas Bazin <gbazin@netcourrier.com>.
[vlc] / src / interface / intf_msg.c
index 40866681e1a483a34779408896721c06e5136c8d..62e2cc101d9dc87aca42a8532863535015b49c2c 100644 (file)
@@ -4,7 +4,7 @@
  * interface, such as message output. See config.h for output configuration.
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: intf_msg.c,v 1.31 2001/04/27 19:29:11 massiot Exp $
+ * $Id: intf_msg.c,v 1.36 2001/06/02 01:09:03 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
 #include <stdarg.h>                                       /* va_list for BSD */
 #include <stdlib.h>                                              /* malloc() */
 #include <string.h>                                            /* strerror() */
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>                                      /* close(), write() */
+#endif
 
 #include "config.h"
 #include "common.h"
 
 #include "intf_msg.h"
 #include "interface.h"
-#include "intf_console.h"
 
 #include "main.h"
 
+#ifdef WIN32
+#ifndef snprintf
+#define snprintf _snprintf         /* snprintf not defined in mingw32 (bug?) */
+#endif
+#endif
+
 /*****************************************************************************
  * intf_msg_item_t
  *****************************************************************************
@@ -72,7 +80,6 @@ typedef struct
 /* Message types */
 #define INTF_MSG_STD    0                                /* standard message */
 #define INTF_MSG_ERR    1                                   /* error message */
-#define INTF_MSG_INTF   2                               /* interface message */
 #define INTF_MSG_DBG    3                                   /* debug message */
 #define INTF_MSG_WARN   4                                  /* warning message*/
 
@@ -225,7 +232,7 @@ void intf_WarnMsg( int i_level, char *psz_format, ... )
 {
     va_list ap;
     
-    if( i_level >= p_main->i_warning_level )
+    if( i_level <= p_main->i_warning_level )
     {
         va_start( ap, psz_format );
         QueueMsg( p_main->p_msg, INTF_MSG_WARN, psz_format, ap );
@@ -234,26 +241,6 @@ void intf_WarnMsg( int i_level, char *psz_format, ... )
 }
 
 
-/*****************************************************************************
- * intf_IntfMsg : print an interface message                             (ok ?)
- *****************************************************************************
- * In opposition to all other intf_*Msg function, this function does not print
- * it's message on default terminal (stdout or stderr), but send it to
- * interface (in fact to the X11 console). This means that the interface MUST
- * be initialized and a X11 console openned before this function is used, and
- * that once the console is closed, this call is vorbidden.
- * Practically, only the interface thread itself should call this function, and
- * flush all messages before intf_CloseX11Console() is called.
- *****************************************************************************/
-void intf_IntfMsg(char *psz_format, ...)
-{
-    va_list ap;
-
-    va_start( ap, psz_format );
-    QueueMsg( p_main->p_msg, INTF_MSG_INTF, psz_format, ap );
-    va_end( ap );
-}
-
 /*****************************************************************************
  * _intf_DbgMsg: print a debugging message                               (ok ?)
  *****************************************************************************
@@ -317,7 +304,7 @@ void intf_WarnMsgImm( int i_level, char *psz_format, ... )
 {
     va_list ap;
 
-    if( i_level >= p_main->i_warning_level )
+    if( i_level <= p_main->i_warning_level )
     {
         va_start( ap, psz_format );
         QueueMsg( p_main->p_msg, INTF_MSG_WARN, psz_format, ap );
@@ -604,10 +591,6 @@ static void PrintMsg( intf_msg_item_t *p_msg )
 
         break;
         
-    case INTF_MSG_INTF:                                /* interface messages */
-        snprintf( psz_msg, i_msg_len, "%s", p_msg->psz_msg );
-        break;
-
     case INTF_MSG_DBG:                                     /* debug messages */
         mstrtime( psz_date, p_msg->date );
         snprintf( psz_msg, i_msg_len, "(%s) " INTF_MSG_DBG_FORMAT "%s",
@@ -631,9 +614,6 @@ static void PrintMsg( intf_msg_item_t *p_msg )
 #endif
         fprintf( stderr, "%s\n", psz_msg );
         break;
-    case INTF_MSG_INTF:                                /* interface messages */
-        intf_ConsolePrint( p_main->p_intf->p_console, psz_msg );
-        break;
     }
 
 #ifdef TRACE_LOG
@@ -666,9 +646,6 @@ static void PrintMsg( intf_msg_item_t *p_msg )
     case INTF_MSG_WARN:
         fprintf( stderr, "%s\n", p_msg->psz_msg );        /* warning message */
         break;
-    case INTF_MSG_INTF:                                /* interface messages */
-        intf_ConsolePrint( p_main->p_intf->p_console, p_msg->psz_msg );
-        break;
     }
 }