1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 * Copyright (C) 2013 Intel Corporation.
6 * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 #ifndef __MSGPORT_ERROR_H
25 #define __MSGPORT_ERROR_H
29 #define MSGPORT_ERROR_QUARK (msgport_error_quark())
33 typedef enum _MsgPortError
35 MSGPORT_ERROR_IO_ERROR = 100,
36 MSGPORT_ERROR_OUT_OF_MEMORY,
37 MSGPORT_ERROR_INVALID_PARAMS,
38 MSGPORT_ERROR_NOT_FOUND,
39 MSGPORT_ERROR_ALREADY_EXISTING,
40 MSGPORT_ERROR_CERTIFICATE_MISMATCH,
46 msgport_error_quark ();
48 #define msgport_error_new(id, msg, args...) \
49 g_error_new (MSGPORT_ERROR_QUARK, id, msg, ##args)
51 #define msgport_error_port_existing_new(app_id, port_name) \
52 msgport_error_new (MSGPORT_ERROR_ALREADY_EXISTING, \
53 "port already existing with name '%s' on application '%s'", port_name, app_id)
55 #define msgport_error_no_memory_new() \
56 msgport_error_new (MSGPORT_ERROR_OUT_OF_MEMORY, "no memomry")
58 #define msgport_error_port_not_found(app_id, port_name) \
59 msgport_error_new (MSGPORT_ERROR_NOT_FOUND, "port not found with name '%s' on application '%s'", port_name, app_id)
61 #define msgport_error_port_id_not_found_new(service_id) \
62 msgport_error_new (MSGPORT_ERROR_NOT_FOUND, "no port found with id '%d'", service_id);
64 #define msgport_error_certificate_mismatch_new() \
65 msgport_error_new (MSGPORT_ERROR_CERTIFICATE_MISMATCH, "cerficates not matched");
67 #define msgport_error_unknown_new() \
68 msgport_error_new (MSGPORT_ERROR_UNKNOWN, "unknown");
72 #endif /* __MSGPORT_ERROR_H */