peer to peer dbus support added
[platform/upstream/libgsignon-glib.git] / libsignon-glib / signon-utils.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of libsignon-glib
5  *
6  * Copyright (C) 2009-2010 Nokia Corporation.
7  * Copyright (C) 2012 Canonical Ltd.
8  *
9  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * version 2.1 as published by the Free Software Foundation.
14  *
15  * This library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  */
25 #ifndef _SIGNON_UTILS_H_
26 #define _SIGNON_UTILS_H_
27
28 #include <glib-object.h>
29
30 #define SIGNON_RETURN_IF_CANCELLED(error) \
31     if (error != NULL && \
32         error->domain == G_IO_ERROR && \
33         error->code == G_IO_ERROR_CANCELLED) \
34     { \
35         g_error_free (error); \
36         return; \
37     }
38
39 G_GNUC_INTERNAL
40 GValue *signon_gvalue_new (GType type);
41 G_GNUC_INTERNAL
42 void signon_gvalue_free (gpointer val);
43
44 G_GNUC_INTERNAL
45 GHashTable *signon_hash_table_from_variant (GVariant *variant);
46 G_GNUC_INTERNAL
47 GVariant *signon_hash_table_to_variant (const GHashTable *hash_table);
48
49 #endif //_SIGNON_UTILS_H_