Frameworks/libpurple.framework/Versions/0.6.2/Headers/debug.h
changeset 2592 e8d15275025e
parent 2535 39c3c161de14
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/debug.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,239 @@
     1.4 +/**
     1.5 + * @file debug.h Debug API
     1.6 + * @ingroup core
     1.7 + */
     1.8 +
     1.9 +/* purple
    1.10 + *
    1.11 + * Purple is the legal property of its developers, whose names are too numerous
    1.12 + * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.13 + * source distribution.
    1.14 + *
    1.15 + * This program is free software; you can redistribute it and/or modify
    1.16 + * it under the terms of the GNU General Public License as published by
    1.17 + * the Free Software Foundation; either version 2 of the License, or
    1.18 + * (at your option) any later version.
    1.19 + *
    1.20 + * This program is distributed in the hope that it will be useful,
    1.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.23 + * GNU General Public License for more details.
    1.24 + *
    1.25 + * You should have received a copy of the GNU General Public License
    1.26 + * along with this program; if not, write to the Free Software
    1.27 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.28 + */
    1.29 +#ifndef _PURPLE_DEBUG_H_
    1.30 +#define _PURPLE_DEBUG_H_
    1.31 +
    1.32 +#include <glib.h>
    1.33 +#include <stdarg.h>
    1.34 +
    1.35 +/**
    1.36 + * Debug levels.
    1.37 + */
    1.38 +typedef enum
    1.39 +{
    1.40 +	PURPLE_DEBUG_ALL = 0,  /**< All debug levels.              */
    1.41 +	PURPLE_DEBUG_MISC,     /**< General chatter.               */
    1.42 +	PURPLE_DEBUG_INFO,     /**< General operation Information. */
    1.43 +	PURPLE_DEBUG_WARNING,  /**< Warnings.                      */
    1.44 +	PURPLE_DEBUG_ERROR,    /**< Errors.                        */
    1.45 +	PURPLE_DEBUG_FATAL     /**< Fatal errors.                  */
    1.46 +
    1.47 +} PurpleDebugLevel;
    1.48 +
    1.49 +/**
    1.50 + * Debug UI operations.
    1.51 + */
    1.52 +typedef struct
    1.53 +{
    1.54 +	void (*print)(PurpleDebugLevel level, const char *category,
    1.55 +				  const char *arg_s);
    1.56 +	gboolean (*is_enabled)(PurpleDebugLevel level,
    1.57 +			const char *category);
    1.58 +
    1.59 +	void (*_purple_reserved1)(void);
    1.60 +	void (*_purple_reserved2)(void);
    1.61 +	void (*_purple_reserved3)(void);
    1.62 +	void (*_purple_reserved4)(void);
    1.63 +} PurpleDebugUiOps;
    1.64 +
    1.65 +#ifdef __cplusplus
    1.66 +extern "C" {
    1.67 +#endif
    1.68 +
    1.69 +/**************************************************************************/
    1.70 +/** @name Debug API                                                       */
    1.71 +/**************************************************************************/
    1.72 +/**
    1.73 + * Outputs debug information.
    1.74 + *
    1.75 + * @param level    The debug level.
    1.76 + * @param category The category (or @c NULL).
    1.77 + * @param format   The format string.
    1.78 + */
    1.79 +void purple_debug(PurpleDebugLevel level, const char *category,
    1.80 +				const char *format, ...) G_GNUC_PRINTF(3, 4);
    1.81 +
    1.82 +/**
    1.83 + * Outputs misc. level debug information.
    1.84 + *
    1.85 + * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_MISC as
    1.86 + * the level.
    1.87 + *
    1.88 + * @param category The category (or @c NULL).
    1.89 + * @param format   The format string.
    1.90 + *
    1.91 + * @see purple_debug()
    1.92 + */
    1.93 +void purple_debug_misc(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
    1.94 +
    1.95 +/**
    1.96 + * Outputs info level debug information.
    1.97 + *
    1.98 + * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_INFO as
    1.99 + * the level.
   1.100 + *
   1.101 + * @param category The category (or @c NULL).
   1.102 + * @param format   The format string.
   1.103 + *
   1.104 + * @see purple_debug()
   1.105 + */
   1.106 +void purple_debug_info(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
   1.107 +
   1.108 +/**
   1.109 + * Outputs warning level debug information.
   1.110 + *
   1.111 + * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_WARNING as
   1.112 + * the level.
   1.113 + *
   1.114 + * @param category The category (or @c NULL).
   1.115 + * @param format   The format string.
   1.116 + *
   1.117 + * @see purple_debug()
   1.118 + */
   1.119 +void purple_debug_warning(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
   1.120 +
   1.121 +/**
   1.122 + * Outputs error level debug information.
   1.123 + *
   1.124 + * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_ERROR as
   1.125 + * the level.
   1.126 + *
   1.127 + * @param category The category (or @c NULL).
   1.128 + * @param format   The format string.
   1.129 + *
   1.130 + * @see purple_debug()
   1.131 + */
   1.132 +void purple_debug_error(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
   1.133 +
   1.134 +/**
   1.135 + * Outputs fatal error level debug information.
   1.136 + *
   1.137 + * This is a wrapper for purple_debug(), and uses PURPLE_DEBUG_ERROR as
   1.138 + * the level.
   1.139 + *
   1.140 + * @param category The category (or @c NULL).
   1.141 + * @param format   The format string.
   1.142 + *
   1.143 + * @see purple_debug()
   1.144 + */
   1.145 +void purple_debug_fatal(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
   1.146 +
   1.147 +/**
   1.148 + * Enable or disable printing debug output to the console.
   1.149 + *
   1.150 + * @param enabled TRUE to enable debug output or FALSE to disable it.
   1.151 + */
   1.152 +void purple_debug_set_enabled(gboolean enabled);
   1.153 +
   1.154 +/**
   1.155 + * Check if console debug output is enabled.
   1.156 + *
   1.157 + * @return TRUE if debugging is enabled, FALSE if it is not.
   1.158 + */
   1.159 +gboolean purple_debug_is_enabled(void);
   1.160 +
   1.161 +/**
   1.162 + * Enable or disable verbose debugging.  This ordinarily should only be called
   1.163 + * by #purple_debug_init, but there are cases where this can be useful for
   1.164 + * plugins.
   1.165 + *
   1.166 + * @param verbose TRUE to enable verbose debugging or FALSE to disable it.
   1.167 + *
   1.168 + * @since 2.6.0
   1.169 + */
   1.170 +void purple_debug_set_verbose(gboolean verbose);
   1.171 +
   1.172 +/**
   1.173 + * Check if verbose logging is enabled.
   1.174 + *
   1.175 + * @return TRUE if verbose debugging is enabled, FALSE if it is not.
   1.176 + *
   1.177 + * @since 2.6.0
   1.178 + */
   1.179 +gboolean purple_debug_is_verbose(void);
   1.180 +
   1.181 +/**
   1.182 + * Enable or disable verbose debugging.  This ordinarily should only be called
   1.183 + * by #purple_debug_init, but there are cases where this can be useful for
   1.184 + * plugins.
   1.185 + *
   1.186 + * @param unsafe  TRUE to enable verbose debugging or FALSE to disable it.
   1.187 + *
   1.188 + * @since 2.6.0
   1.189 + */
   1.190 +void purple_debug_set_unsafe(gboolean unsafe);
   1.191 +
   1.192 +/**
   1.193 + * Check if unsafe debugging is enabled.
   1.194 + *
   1.195 + * @return TRUE if verbose debugging is enabled, FALSE if it is not.
   1.196 + *
   1.197 + * @since 2.6.0
   1.198 + */
   1.199 +gboolean purple_debug_is_unsafe(void);
   1.200 +
   1.201 +/*@}*/
   1.202 +
   1.203 +/**************************************************************************/
   1.204 +/** @name UI Registration Functions                                       */
   1.205 +/**************************************************************************/
   1.206 +/*@{*/
   1.207 +
   1.208 +/**
   1.209 + * Sets the UI operations structure to be used when outputting debug
   1.210 + * information.
   1.211 + *
   1.212 + * @param ops The UI operations structure.
   1.213 + */
   1.214 +void purple_debug_set_ui_ops(PurpleDebugUiOps *ops);
   1.215 +
   1.216 +/**
   1.217 + * Returns the UI operations structure used when outputting debug
   1.218 + * information.
   1.219 + *
   1.220 + * @return The UI operations structure in use.
   1.221 + */
   1.222 +PurpleDebugUiOps *purple_debug_get_ui_ops(void);
   1.223 +
   1.224 +/*@}*/
   1.225 +
   1.226 +/**************************************************************************/
   1.227 +/** @name Debug Subsystem                                                 */
   1.228 +/**************************************************************************/
   1.229 +/*@{*/
   1.230 +
   1.231 +/**
   1.232 + * Initializes the debug subsystem.
   1.233 + */
   1.234 +void purple_debug_init(void);
   1.235 +
   1.236 +/*@}*/
   1.237 +
   1.238 +#ifdef __cplusplus
   1.239 +}
   1.240 +#endif
   1.241 +
   1.242 +#endif /* _PURPLE_DEBUG_H_ */