* 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
*****************************************************************************
/* 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*/
{
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 );
}
-/*****************************************************************************
- * 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 ?)
*****************************************************************************
{
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 );
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",
#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
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;
}
}