using dlog for logging
[profile/ivi/message-port.git] / common / dbus-error.c
1 #include "dbus-error.h"
2
3 #include <gio/gio.h>
4
5 #define MSGPORT_ERROR_DOMAIN "messagport"
6 #define _PREFIX              "org.tizen.MessagePort.Error"
7
8 GDBusErrorEntry __msgport_errors [] = {
9     {MSGPORT_ERROR_IO_ERROR,             _PREFIX".IOError"},
10     {MSGPORT_ERROR_INVALID_PARAMS,       _PREFIX".InvalidParams"},
11     {MSGPORT_ERROR_OUT_OF_MEMORY,        _PREFIX".OutOfMemory"},
12     {MSGPORT_ERROR_NOT_FOUND,            _PREFIX".NotFound"},
13     {MSGPORT_ERROR_ALREADY_EXISTING,     _PREFIX".AlreadyExisting"},
14     {MSGPORT_ERROR_CERTIFICATE_MISMATCH, _PREFIX".CertificateMismatch"},
15     {MSGPORT_ERROR_UNKNOWN,              _PREFIX ".Unknown"}
16 };
17
18 GQuark
19 msgport_error_quark (void)
20 {
21     static volatile gsize quark_volatile = 0;
22
23     if (!quark_volatile) {
24         g_dbus_error_register_error_domain (MSGPORT_ERROR_DOMAIN, 
25                                             &quark_volatile,
26                                             __msgport_errors,
27                                             G_N_ELEMENTS (__msgport_errors));
28     }
29
30     return quark_volatile;
31 }