updated licence header
[profile/ivi/message-port.git] / common / dbus-error.c
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 message-port.
5  *
6  * Copyright (C) 2013 Intel Corporation.
7  *
8  * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
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
26 #include "dbus-error.h"
27
28 #include <gio/gio.h>
29
30 #define MSGPORT_ERROR_DOMAIN "messagport"
31 #define _PREFIX              "org.tizen.MessagePort.Error"
32
33 GDBusErrorEntry __msgport_errors [] = {
34     {MSGPORT_ERROR_IO_ERROR,             _PREFIX".IOError"},
35     {MSGPORT_ERROR_INVALID_PARAMS,       _PREFIX".InvalidParams"},
36     {MSGPORT_ERROR_OUT_OF_MEMORY,        _PREFIX".OutOfMemory"},
37     {MSGPORT_ERROR_NOT_FOUND,            _PREFIX".NotFound"},
38     {MSGPORT_ERROR_ALREADY_EXISTING,     _PREFIX".AlreadyExisting"},
39     {MSGPORT_ERROR_CERTIFICATE_MISMATCH, _PREFIX".CertificateMismatch"},
40     {MSGPORT_ERROR_UNKNOWN,              _PREFIX".Unknown"}
41 };
42
43 GQuark
44 msgport_error_quark (void)
45 {
46     static volatile gsize quark_volatile = 0;
47
48     if (!quark_volatile) {
49         g_dbus_error_register_error_domain (MSGPORT_ERROR_DOMAIN, 
50                                             &quark_volatile,
51                                             __msgport_errors,
52                                             G_N_ELEMENTS (__msgport_errors));
53     }
54
55     return quark_volatile;
56 }