1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2002-2005 Imendio AB
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #ifndef __GOSSIP_UTILS_H__
22 #define __GOSSIP_UTILS_H__
25 #include <glib-object.h>
27 #include <libxml/parser.h>
28 #include <libxml/tree.h>
30 #include "gossip-contact.h"
34 #define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
44 /* Regular expressions */
45 gchar * gossip_substring (const gchar *str,
48 gint gossip_regex_match (GossipRegExType type,
54 gint gossip_strcasecmp (const gchar *s1,
56 gint gossip_strncasecmp (const gchar *s1,
61 gboolean gossip_xml_validate (xmlDoc *doc,
62 const gchar *dtd_filename);
63 xmlNodePtr gossip_xml_node_get_child (xmlNodePtr node,
64 const gchar *child_name);
65 xmlChar * gossip_xml_node_get_child_content (xmlNodePtr node,
66 const gchar *child_name);
67 xmlNodePtr gossip_xml_node_find_child_prop_value (xmlNodePtr node,
68 const gchar *prop_name,
69 const gchar *prop_value);
73 GType gossip_dbus_type_to_g_type (const gchar *dbus_type_string);
74 const gchar *gossip_g_type_to_dbus_type (GType g_type);
75 gchar * gossip_g_value_to_string (const GValue *value);
76 GValue * gossip_string_to_g_value (const gchar *str,
78 gboolean gossip_g_value_equal (const GValue *value1,
79 const GValue *value2);
81 guint gossip_account_hash (gconstpointer key);
82 gboolean gossip_account_equal (gconstpointer a,
84 GossipContact * gossip_get_own_contact_from_contact (GossipContact *contact);
87 #endif /* __GOSSIP_UTILS_H__ */