1 /*
2  * Distributed under the Boost Software License, Version 1.0.
3  *    (See accompanying file LICENSE_1_0.txt or copy at
4  *          http://www.boost.org/LICENSE_1_0.txt)
5  */
6 module glib.gerror;
7 
8 import glib.gtypes;
9 public import glib.gquark;
10 import core.stdc.stdlib;
11 import core.stdc.stdarg;
12 
13 
14 
15 struct GError
16 {
17     GQuark domain;
18     gint code;
19     gchar *message;
20 }
21 
22 
23 extern(C) {
24 
25     GError* g_error_new (GQuark domain,
26                          gint code,
27                          const(gchar) *format, ...);
28 
29     GError* g_error_new_literal (GQuark domain,
30                                  gint code,
31                                  const(gchar) *message);
32 
33     GError* g_error_new_valist (GQuark domain,
34                                 gint code,
35                                 const(gchar) *format,
36                                 va_list args);
37 
38     void g_error_free (GError *error);
39 
40     GError* g_error_copy (const(GError) *error);
41 
42     gboolean g_error_matches (const(GError) *error,
43                               GQuark domain,
44                               gint code);
45 
46     void g_set_error (GError **err,
47                       GQuark domain,
48                       gint code,
49                       const(gchar) *format, ...);
50 
51     void g_set_error_literal (GError **err,
52                               GQuark domain,
53                               gint code,
54                               const(gchar) *message);
55 
56     void g_propagate_error (GError **dest,
57                             GError *src);
58 
59     void g_clear_error (GError **err);
60 
61     void g_prefix_error (GError **err, const(gchar) *format, ...);
62 
63     void g_propagate_prefixed_error (GError **dest, GError *src,
64                                      const(gchar) *format, ...);
65 
66 }
67