Change SmackExecLabel to SmackProcessLabel
[platform/core/appfw/message-port-dbus.git] / common / dbus-error.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 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 #ifndef __MSGPORT_ERROR_H
27 #define __MSGPORT_ERROR_H
28
29 #include <glib.h>
30
31 #define MSGPORT_ERROR_QUARK (msgport_error_quark())
32
33 G_BEGIN_DECLS
34
35 typedef enum _MsgPortError
36 {
37     MSGPORT_ERROR_IO_ERROR = 100,
38     MSGPORT_ERROR_OUT_OF_MEMORY,
39     MSGPORT_ERROR_INVALID_PARAMS,
40     MSGPORT_ERROR_NOT_FOUND,
41     MSGPORT_ERROR_ALREADY_EXISTING,
42     MSGPORT_ERROR_CERTIFICATE_MISMATCH,
43     MSGPORT_ERROR_UNKNOWN
44
45 } MsgPortError;
46
47 GQuark
48 msgport_error_quark ();
49
50 #define msgport_error_new(id, msg, args...) \
51     g_error_new (MSGPORT_ERROR_QUARK, id, msg, ##args) 
52
53 #define msgport_error_port_existing_new(app_id, port_name) \
54     msgport_error_new (MSGPORT_ERROR_ALREADY_EXISTING, \
55                        "port already existing with name '%s' on application '%s'", port_name, app_id)
56
57 #define msgport_error_no_memory_new() \
58     msgport_error_new (MSGPORT_ERROR_OUT_OF_MEMORY, "no memomry")
59
60 #define msgport_error_port_not_found(app_id, port_name) \
61     msgport_error_new (MSGPORT_ERROR_NOT_FOUND, "port not found with name '%s' on application '%s'", port_name, app_id)
62
63 #define msgport_error_port_id_not_found_new(service_id) \
64     msgport_error_new (MSGPORT_ERROR_NOT_FOUND, "no port found with id '%d'", service_id)
65
66 #define msgport_error_certificate_mismatch_new() \
67     msgport_error_new (MSGPORT_ERROR_CERTIFICATE_MISMATCH, "cerficates not matched")
68
69 #define msgport_error_unknown_new() \
70     msgport_error_new (MSGPORT_ERROR_UNKNOWN, "unknown")
71
72 G_END_DECLS
73
74 #endif /* __MSGPORT_ERROR_H */