]> git.sesse.net Git - vlc/blob - include/intf_msg.h
903fce5ba5ea228eec8d1db3a89d0d72094c6df0
[vlc] / include / intf_msg.h
1 /*****************************************************************************
2  * intf_msg.h: messages interface
3  * This library provides basic functions for threads to interact with user
4  * interface, such as message output. See config.h for output configuration.
5  *****************************************************************************
6  * Copyright (C) 1999, 2000 VideoLAN
7  *
8  * Authors:
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * intf_DbgMsg macros and functions
27  *****************************************************************************
28  * The intf_DbgMsg* functions are defined as macro to be able to use the
29  * compiler extensions and print the file, the function and the line number
30  * from which they have been called. They call _intf_DbgMsg*() functions after
31  * having added debugging informations.
32  * Outside DEBUG mode, intf_DbgMsg* functions do nothing.
33  *****************************************************************************/
34 #ifdef DEBUG
35
36 /* DEBUG mode */
37 void    _intf_DbgMsg        ( char *psz_file, char *psz_function, int i_line,
38                               char *psz_format, ... );
39 void    _intf_DbgMsgImm     ( char *psz_file, char *psz_function, int i_line,
40                               char *psz_format, ... );
41
42 #define intf_DbgMsg( format, args... ) \
43     _intf_DbgMsg( __FILE__, __FUNCTION__, __LINE__, format, ## args )
44 #define intf_DbgMsgImm( format, args... ) \
45     _intf_DbgMsg( __FILE__, __FUNCTION__, __LINE__, format, ## args )
46
47 #else
48
49 /* Non-DEBUG mode */
50 #define intf_DbgMsg( format, args... )
51 #define intf_DbgMsgImm( format, args...)
52
53 #endif
54
55 /*****************************************************************************
56  * intf_FlushMsg macro and function
57  *****************************************************************************
58  * intf_FlushMsg is a function which flushs message queue and print all messages
59  * remaining. It is only useful if INTF_MSG_QUEUE is defined. In this case, it
60  * is really a function. In the other case, it is a macro doing nothing.
61  *****************************************************************************/
62 #ifdef INTF_MSG_QUEUE
63
64 /* Message queue mode */
65 void    intf_FlushMsg       ( void );
66
67 #else
68
69 /* Direct mode */
70 #define intf_FlushMsg()     ;
71
72 #endif
73
74 /*****************************************************************************
75  * Prototypes
76  *****************************************************************************/
77 p_intf_msg_t intf_MsgCreate      ( void );
78 void         intf_MsgDestroy     ( void );
79
80 void         intf_Msg            ( char *psz_format, ... );
81 void         intf_ErrMsg         ( char *psz_format, ... );
82 void         intf_WarnMsg        ( int i_level, char *psz_format, ... );
83 void         intf_IntfMsg        ( char *psz_format, ... );
84
85 void         intf_MsgImm         ( char *psz_format, ... );
86 void         intf_ErrMsgImm      ( char *psz_format, ... );
87 void         intf_WarnMsgImm     ( int i_level, char *psz_format, ... );
88 void         intf_WarnHexDump    ( int i_level, void *p_data, int i_size );
89