core cleanup: move MD4/MD5 digest calculation to backend
[siplcs.git] / src / api / sipe-backend.h
blobed7d433ef1d091c4ec4d0ecd7fe0426c04ae44a5
1 /**
2 * @file sipe-backend.h
4 * pidgin-sipe
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /** DEBUGGING ****************************************************************/
25 typedef enum {
26 SIPE_DEBUG_LEVEL_INFO,
27 SIPE_DEBUG_LEVEL_WARNING,
28 SIPE_DEBUG_LEVEL_ERROR,
29 SIPE_DEBUG_LEVEL_FATAL,
30 } sipe_debug_level;
32 /**
33 * Output debug information
35 * Shouldn't be used directly. Instead use SIPE_DEBUG_xxx() macros
37 * @param level debug level
38 * @param format format string. "\n" will be automatically appended.
40 void sipe_backend_debug(sipe_debug_level level,
41 const gchar *format,
42 ...) G_GNUC_PRINTF(2, 3);
44 /* Convenience macros */
45 #define SIPE_DEBUG_INFO(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_INFO, fmt, __VA_ARGS__)
46 #define SIPE_DEBUG_INFO_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_INFO, msg)
47 #define SIPE_DEBUG_WARNING(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_WARNING, fmt, __VA_ARGS__)
48 #define SIPE_DEBUG_WARNING_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_WARNING, msg)
49 #define SIPE_DEBUG_ERROR(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_ERROR, fmt, __VA_ARGS__)
50 #define SIPE_DEBUG_ERROR_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_ERROR, msg)
51 #define SIPE_DEBUG_FATAL(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_FATAL, fmt, __VA_ARGS__)
52 #define SIPE_DEBUG_FATAL_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_FATAL, msg)
54 /** DIGEST *******************************************************************/
56 #define SIPE_DIGEST_MD4_LENGTH 16
57 void sipe_backend_digest_md4(const guchar *data, gsize length, guchar *digest);
59 #define SIPE_DIGEST_MD5_LENGTH 16
60 void sipe_backend_digest_md5(const guchar *data, gsize length, guchar *digest);
62 #define SIPE_DIGEST_SHA1_LENGTH 20
63 void sipe_backend_digest_sha1(const guchar *data, gsize length, guchar *digest);
65 /** MARKUP *******************************************************************/
67 gchar *sipe_backend_markup_css_property(const gchar *style,
68 const gchar *option);
69 gchar *sipe_backend_markup_strip_html(const gchar *html);
71 /** NETWORK ******************************************************************/
73 const gchar *sipe_backend_network_ip_address(void);