Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:55

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. Errors
0038  * in this domain will be from the #GDBusError enumeration.  See
0039  * #GError for more information on error domains.
0040  *
0041  * Note that this error domain is intended only for
0042  * returning errors from a remote message bus process. Errors
0043  * generated locally in-process by e.g. #GDBusConnection should use the
0044  * %G_IO_ERROR domain.
0045  *
0046  * Since: 2.26
0047  */
0048 #define G_DBUS_ERROR g_dbus_error_quark()
0049 
0050 GIO_AVAILABLE_IN_ALL
0051 GQuark g_dbus_error_quark (void);
0052 
0053 /* Used by applications to check, get and strip the D-Bus error name */
0054 GIO_AVAILABLE_IN_ALL
0055 gboolean g_dbus_error_is_remote_error       (const GError    *error);
0056 GIO_AVAILABLE_IN_ALL
0057 gchar   *g_dbus_error_get_remote_error      (const GError    *error);
0058 GIO_AVAILABLE_IN_ALL
0059 gboolean g_dbus_error_strip_remote_error    (GError          *error);
0060 
0061 /**
0062  * GDBusErrorEntry:
0063  * @error_code: An error code.
0064  * @dbus_error_name: The D-Bus error name to associate with @error_code.
0065  *
0066  * Struct used in g_dbus_error_register_error_domain().
0067  *
0068  * Since: 2.26
0069  */
0070 struct _GDBusErrorEntry
0071 {
0072   gint         error_code;
0073   const gchar *dbus_error_name;
0074 };
0075 
0076 GIO_AVAILABLE_IN_ALL
0077 gboolean g_dbus_error_register_error        (GQuark                 error_domain,
0078                                              gint                   error_code,
0079                                              const gchar           *dbus_error_name);
0080 GIO_AVAILABLE_IN_ALL
0081 gboolean g_dbus_error_unregister_error      (GQuark                 error_domain,
0082                                              gint                   error_code,
0083                                              const gchar           *dbus_error_name);
0084 GIO_AVAILABLE_IN_ALL
0085 void     g_dbus_error_register_error_domain (const gchar           *error_domain_quark_name,
0086                                              volatile gsize        *quark_volatile,
0087                                              const GDBusErrorEntry *entries,
0088                                              guint                  num_entries);
0089 
0090 /* Only used by object mappings to map back and forth to GError */
0091 GIO_AVAILABLE_IN_ALL
0092 GError  *g_dbus_error_new_for_dbus_error    (const gchar     *dbus_error_name,
0093                                              const gchar     *dbus_error_message);
0094 GIO_AVAILABLE_IN_ALL
0095 void     g_dbus_error_set_dbus_error        (GError         **error,
0096                                              const gchar     *dbus_error_name,
0097                                              const gchar     *dbus_error_message,
0098                                              const gchar     *format,
0099                                              ...) G_GNUC_PRINTF(4, 5);
0100 GIO_AVAILABLE_IN_ALL
0101 void     g_dbus_error_set_dbus_error_valist (GError         **error,
0102                                              const gchar     *dbus_error_name,
0103                                              const gchar     *dbus_error_message,
0104                                              const gchar     *format,
0105                                              va_list          var_args) G_GNUC_PRINTF(4, 0);
0106 GIO_AVAILABLE_IN_ALL
0107 gchar   *g_dbus_error_encode_gerror         (const GError    *error);
0108 
0109 G_END_DECLS
0110 
0111 #endif /* __G_DBUS_ERROR_H__ */