intf_msg.h 3.57 KB
Newer Older
1
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
2 3
 * intf_msg.h: messages interface
 * This library provides basic functions for threads to interact with user
Vincent Seguin's avatar
Vincent Seguin committed
4
 * interface, such as message output. See config.h for output configuration.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *****************************************************************************
 * Copyright (C) 1999, 2000 VideoLAN
 *
 * Authors:
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
24
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
25

26
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
27
 * intf_DbgMsg macros and functions
28 29
 *****************************************************************************
 * The intf_DbgMsg* functions are defined as macro to be able to use the
Michel Kaempf's avatar
Michel Kaempf committed
30 31 32 33
 * compiler extensions and print the file, the function and the line number
 * from which they have been called. They call _intf_DbgMsg*() functions after
 * having added debugging informations.
 * Outside DEBUG mode, intf_DbgMsg* functions do nothing.
34
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
35 36 37
#ifdef DEBUG

/* DEBUG mode */
38
void    _intf_DbgMsg        ( char *psz_file, char *psz_function, int i_line,
Michel Kaempf's avatar
Michel Kaempf committed
39 40 41 42 43 44 45 46 47 48 49 50
                              char *psz_format, ... );
void    _intf_DbgMsgImm     ( char *psz_file, char *psz_function, int i_line,
                              char *psz_format, ... );

#define intf_DbgMsg( format, args... ) \
    _intf_DbgMsg( __FILE__, __FUNCTION__, __LINE__, format, ## args )
#define intf_DbgMsgImm( format, args... ) \
    _intf_DbgMsg( __FILE__, __FUNCTION__, __LINE__, format, ## args )

#else

/* Non-DEBUG mode */
51 52
#define intf_DbgMsg( format, args... )
#define intf_DbgMsgImm( format, args...)
Michel Kaempf's avatar
Michel Kaempf committed
53 54 55

#endif

56
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
57
 * intf_FlushMsg macro and function
58
 *****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
59
 * intf_FlushMsg is a function which flushs message queue and print all messages
60
 * remaining. It is only useful if INTF_MSG_QUEUE is defined. In this case, it
Michel Kaempf's avatar
Michel Kaempf committed
61
 * is really a function. In the other case, it is a macro doing nothing.
62
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
63 64 65 66 67 68 69 70 71 72 73 74
#ifdef INTF_MSG_QUEUE

/* Message queue mode */
void    intf_FlushMsg       ( void );

#else

/* Direct mode */
#define intf_FlushMsg()     ;

#endif

75 76 77
/*****************************************************************************
 * Prototypes
 *****************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
78 79
p_intf_msg_t intf_MsgCreate      ( void );
void         intf_MsgDestroy     ( void );
Michel Kaempf's avatar
Michel Kaempf committed
80

Vincent Seguin's avatar
Vincent Seguin committed
81 82 83
void         intf_Msg            ( char *psz_format, ... );
void         intf_ErrMsg         ( char *psz_format, ... );
void         intf_IntfMsg        ( char *psz_format, ... );
Michel Kaempf's avatar
Michel Kaempf committed
84

Vincent Seguin's avatar
Vincent Seguin committed
85 86
void         intf_MsgImm         ( char *psz_format, ... );
void         intf_ErrMsgImm      ( char *psz_format, ... );