00001 /***************************************************************************** 00002 * vlc_messages.h: messages interface 00003 * This library provides basic functions for threads to interact with user 00004 * interface, such as message output. 00005 ***************************************************************************** 00006 * Copyright (C) 1999, 2000, 2001, 2002 VLC authors and VideoLAN 00007 * $Id: 69aaea4465cb1a67e67b8adfb1cbeeedf2016f40 $ 00008 * 00009 * Authors: Vincent Seguin <seguin@via.ecp.fr> 00010 * Samuel Hocevar <sam@zoy.org> 00011 * 00012 * This program is free software; you can redistribute it and/or modify it 00013 * under the terms of the GNU Lesser General Public License as published by 00014 * the Free Software Foundation; either version 2.1 of the License, or 00015 * (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public License 00023 * along with this program; if not, write to the Free Software Foundation, 00024 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00025 *****************************************************************************/ 00026 00027 #ifndef VLC_MESSAGES_H_ 00028 #define VLC_MESSAGES_H_ 00029 00030 /** 00031 * \file 00032 * This file defines structures and functions to handle messages and statistics gathering 00033 */ 00034 00035 #include <stdarg.h> 00036 00037 /** 00038 * \defgroup messages Messages 00039 * This library provides basic functions for threads to interact with user 00040 * interface, such as message output. 00041 * 00042 * @{ 00043 */ 00044 00045 /** Message types */ 00046 enum msg_item_type 00047 { 00048 VLC_MSG_INFO=0, /**< Important information */ 00049 VLC_MSG_ERR, /**< Error */ 00050 VLC_MSG_WARN, /**< Warning */ 00051 VLC_MSG_DBG, /**< Debug */ 00052 }; 00053 00054 /** 00055 * Log message 00056 */ 00057 typedef struct 00058 { 00059 uintptr_t i_object_id; /**< Emitter (temporaly) unique object ID or 0 */ 00060 const char *psz_object_type; /**< Emitter object type name */ 00061 const char *psz_module; /**< Emitter module (source code) */ 00062 const char *psz_header; /**< Additional header (used by VLM media) */ 00063 } msg_item_t; 00064 00065 VLC_API void vlc_Log(vlc_object_t *, int, 00066 const char *, const char *, ...) VLC_FORMAT( 4, 5 ); 00067 VLC_API void vlc_vaLog(vlc_object_t *, int, 00068 const char *, const char *, va_list); 00069 #define msg_GenericVa(a, b, c, d, e) vlc_vaLog(VLC_OBJECT(a), b, c, d, e) 00070 00071 #define msg_Info( p_this, ... ) \ 00072 vlc_Log( VLC_OBJECT(p_this), VLC_MSG_INFO, MODULE_STRING, __VA_ARGS__ ) 00073 #define msg_Err( p_this, ... ) \ 00074 vlc_Log( VLC_OBJECT(p_this), VLC_MSG_ERR, MODULE_STRING, __VA_ARGS__ ) 00075 #define msg_Warn( p_this, ... ) \ 00076 vlc_Log( VLC_OBJECT(p_this), VLC_MSG_WARN, MODULE_STRING, __VA_ARGS__ ) 00077 #define msg_Dbg( p_this, ... ) \ 00078 vlc_Log( VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, __VA_ARGS__ ) 00079 00080 /** 00081 * @} 00082 */ 00083 #endif
1.7.1