1 /* GDBus - GLib D-Bus Library
3 * Copyright (C) 2008-2010 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: David Zeuthen <davidz@redhat.com>
23 #ifndef __G_DBUS_ERROR_H__
24 #define __G_DBUS_ERROR_H__
26 #include <gio/giotypes.h>
33 * Error domain for errors generated by a remote message bus. Errors
34 * in this domain will be from the #GDBusError enumeration. See
35 * #GError for more information on error domains.
37 * Note that errors in this error domain is intended only for
38 * returning errors from a remote message bus process. Errors
39 * generated locally in-process by e.g. #GDBusConnection is from the
44 #define G_DBUS_ERROR g_dbus_error_quark()
46 GQuark g_dbus_error_quark (void);
48 /* Used by applications to check, get and strip the D-Bus error name */
49 gboolean g_dbus_error_is_remote_error (const GError *error);
50 gchar *g_dbus_error_get_remote_error (const GError *error);
51 gboolean g_dbus_error_strip_remote_error (GError *error);
55 * @error_code: An error code.
56 * @dbus_error_name: The D-Bus error name to associate with @error_code.
58 * Struct used in g_dbus_error_register_error_domain().
62 struct _GDBusErrorEntry
65 const gchar *dbus_error_name;
68 gboolean g_dbus_error_register_error (GQuark error_domain,
70 const gchar *dbus_error_name);
71 gboolean g_dbus_error_unregister_error (GQuark error_domain,
73 const gchar *dbus_error_name);
74 void g_dbus_error_register_error_domain (const gchar *error_domain_quark_name,
75 volatile gsize *quark_volatile,
76 const GDBusErrorEntry *entries,
79 /* Only used by object mappings to map back and forth to GError */
80 GError *g_dbus_error_new_for_dbus_error (const gchar *dbus_error_name,
81 const gchar *dbus_error_message);
82 void g_dbus_error_set_dbus_error (GError **error,
83 const gchar *dbus_error_name,
84 const gchar *dbus_error_message,
87 void g_dbus_error_set_dbus_error_valist (GError **error,
88 const gchar *dbus_error_name,
89 const gchar *dbus_error_message,
92 gchar *g_dbus_error_encode_gerror (const GError *error);
96 #endif /* __G_DBUS_ERROR_H__ */