Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:11:36

0001 /* GDBus - GLib D-Bus Library
0002  *
0003  * Copyright (C) 2008-2010 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: David Zeuthen <davidz@redhat.com>
0021  */
0022 
0023 #ifndef __G_DBUS_ERROR_H__
0024 #define __G_DBUS_ERROR_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/giotypes.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 /**
0035  * G_DBUS_ERROR:
0036  *
0037  * Error domain for errors generated by a remote message bus.
0038  *
0039  * Errors in this domain will be from the [error@Gio.DBusError] enumeration.
0040  * See [type@GLib.Error] for more information on error domains.
0041  *
0042  * Note that this error domain is intended only for
0043  * returning errors from a remote message bus process. Errors
0044  * generated locally in-process (for example, by [class@Gio.DBusConnection])
0045  * should use the [error@Gio.IOErrorEnum] domain.
0046  *
0047  * Since: 2.26
0048  */
0049 #define G_DBUS_ERROR g_dbus_error_quark()
0050 
0051 GIO_AVAILABLE_IN_ALL
0052 GQuark g_dbus_error_quark (void);
0053 
0054 /* Used by applications to check, get and strip the D-Bus error name */
0055 GIO_AVAILABLE_IN_ALL
0056 gboolean g_dbus_error_is_remote_error       (const GError    *error);
0057 GIO_AVAILABLE_IN_ALL
0058 gchar   *g_dbus_error_get_remote_error      (const GError    *error);
0059 GIO_AVAILABLE_IN_ALL
0060 gboolean g_dbus_error_strip_remote_error    (GError          *error);
0061 
0062 /**
0063  * GDBusErrorEntry:
0064  * @error_code: an error code
0065  * @dbus_error_name: the D-Bus error name to associate with @error_code
0066  *
0067  * Struct used in [func@Gio.DBusError.register_error_domain].
0068  *
0069  * Since: 2.26
0070  */
0071 struct _GDBusErrorEntry
0072 {
0073   gint         error_code;
0074   const gchar *dbus_error_name;
0075 };
0076 
0077 GIO_AVAILABLE_IN_ALL
0078 gboolean g_dbus_error_register_error        (GQuark                 error_domain,
0079                                              gint                   error_code,
0080                                              const gchar           *dbus_error_name);
0081 GIO_AVAILABLE_IN_ALL
0082 gboolean g_dbus_error_unregister_error      (GQuark                 error_domain,
0083                                              gint                   error_code,
0084                                              const gchar           *dbus_error_name);
0085 GIO_AVAILABLE_IN_ALL
0086 void     g_dbus_error_register_error_domain (const gchar           *error_domain_quark_name,
0087                                              volatile gsize        *quark_volatile,
0088                                              const GDBusErrorEntry *entries,
0089                                              guint                  num_entries);
0090 
0091 /* Only used by object mappings to map back and forth to GError */
0092 GIO_AVAILABLE_IN_ALL
0093 GError  *g_dbus_error_new_for_dbus_error    (const gchar     *dbus_error_name,
0094                                              const gchar     *dbus_error_message);
0095 GIO_AVAILABLE_IN_ALL
0096 void     g_dbus_error_set_dbus_error        (GError         **error,
0097                                              const gchar     *dbus_error_name,
0098                                              const gchar     *dbus_error_message,
0099                                              const gchar     *format,
0100                                              ...) G_GNUC_PRINTF(4, 5);
0101 GIO_AVAILABLE_IN_ALL
0102 void     g_dbus_error_set_dbus_error_valist (GError         **error,
0103                                              const gchar     *dbus_error_name,
0104                                              const gchar     *dbus_error_message,
0105                                              const gchar     *format,
0106                                              va_list          var_args) G_GNUC_PRINTF(4, 0);
0107 GIO_AVAILABLE_IN_ALL
0108 gchar   *g_dbus_error_encode_gerror         (const GError    *error);
0109 
0110 G_END_DECLS
0111 
0112 #endif /* __G_DBUS_ERROR_H__ */