Change LGPL-2.1+ to LGPL-2.1-or-later
[platform/upstream/glib.git] / gio / gdbuserror.h
1 /* GDBus - GLib D-Bus Library
2  *
3  * Copyright (C) 2008-2010 Red Hat, Inc.
4  *
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General
18  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19  *
20  * Author: David Zeuthen <davidz@redhat.com>
21  */
22
23 #ifndef __G_DBUS_ERROR_H__
24 #define __G_DBUS_ERROR_H__
25
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
28 #endif
29
30 #include <gio/giotypes.h>
31 #include <gio/tizen_header_glib.h>  /* for TIZEN_PUBLIC_DEPRECATED_API */
32
33 G_BEGIN_DECLS
34
35 /**
36  * G_DBUS_ERROR:
37  *
38  * Error domain for errors generated by a remote message bus. Errors
39  * in this domain will be from the #GDBusError enumeration.  See
40  * #GError for more information on error domains.
41  *
42  * Note that this error domain is intended only for
43  * returning errors from a remote message bus process. Errors
44  * generated locally in-process by e.g. #GDBusConnection should use the
45  * %G_IO_ERROR domain.
46  *
47  * Since: 2.26
48  */
49 #define G_DBUS_ERROR g_dbus_error_quark()
50
51 GIO_AVAILABLE_IN_ALL
52 GQuark g_dbus_error_quark (void) TIZEN_PUBLIC_DEPRECATED_API;
53
54 /* Used by applications to check, get and strip the D-Bus error name */
55 GIO_AVAILABLE_IN_ALL
56 gboolean g_dbus_error_is_remote_error       (const GError    *error) TIZEN_PUBLIC_DEPRECATED_API;
57 GIO_AVAILABLE_IN_ALL
58 gchar   *g_dbus_error_get_remote_error      (const GError    *error) TIZEN_PUBLIC_DEPRECATED_API;
59 GIO_AVAILABLE_IN_ALL
60 gboolean g_dbus_error_strip_remote_error    (GError          *error) TIZEN_PUBLIC_DEPRECATED_API;
61
62 /**
63  * GDBusErrorEntry:
64  * @error_code: An error code.
65  * @dbus_error_name: The D-Bus error name to associate with @error_code.
66  *
67  * Struct used in g_dbus_error_register_error_domain().
68  *
69  * Since: 2.26
70  */
71 struct _GDBusErrorEntry
72 {
73   gint         error_code;
74   const gchar *dbus_error_name;
75 };
76
77 GIO_AVAILABLE_IN_ALL
78 gboolean g_dbus_error_register_error        (GQuark                 error_domain,
79                                              gint                   error_code,
80                                              const gchar           *dbus_error_name) TIZEN_PUBLIC_DEPRECATED_API;
81 GIO_AVAILABLE_IN_ALL
82 gboolean g_dbus_error_unregister_error      (GQuark                 error_domain,
83                                              gint                   error_code,
84                                              const gchar           *dbus_error_name) TIZEN_PUBLIC_DEPRECATED_API;
85 GIO_AVAILABLE_IN_ALL
86 void     g_dbus_error_register_error_domain (const gchar           *error_domain_quark_name,
87                                              volatile gsize        *quark_volatile,
88                                              const GDBusErrorEntry *entries,
89                                              guint                  num_entries) TIZEN_PUBLIC_DEPRECATED_API;
90
91 /* Only used by object mappings to map back and forth to GError */
92 GIO_AVAILABLE_IN_ALL
93 GError  *g_dbus_error_new_for_dbus_error    (const gchar     *dbus_error_name,
94                                              const gchar     *dbus_error_message) TIZEN_PUBLIC_DEPRECATED_API;
95 GIO_AVAILABLE_IN_ALL
96 void     g_dbus_error_set_dbus_error        (GError         **error,
97                                              const gchar     *dbus_error_name,
98                                              const gchar     *dbus_error_message,
99                                              const gchar     *format,
100                                              ...) G_GNUC_PRINTF(4, 5) TIZEN_PUBLIC_DEPRECATED_API;
101 GIO_AVAILABLE_IN_ALL
102 void     g_dbus_error_set_dbus_error_valist (GError         **error,
103                                              const gchar     *dbus_error_name,
104                                              const gchar     *dbus_error_message,
105                                              const gchar     *format,
106                                              va_list          var_args) G_GNUC_PRINTF(4, 0) TIZEN_PUBLIC_DEPRECATED_API;
107 GIO_AVAILABLE_IN_ALL
108 gchar   *g_dbus_error_encode_gerror         (const GError    *error) TIZEN_PUBLIC_DEPRECATED_API;
109
110 G_END_DECLS
111
112 #endif /* __G_DBUS_ERROR_H__ */