make it possible to disable single-file includes by defining
[platform/upstream/glib.git] / glib / gerror.h
index 7eafa94..dc36fb3 100644 (file)
  *   Boston, MA 02111-1307, USA.
  */
 
-#ifndef __GERROR_H__
-#define __GERROR_H__
-
-#ifdef __cplusplus
-extern "C"
-{
+#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__G_LIB_H__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
 #endif
 
+#ifndef __G_ERROR_H__
+#define __G_ERROR_H__
+
+#include <glib/gquark.h>
+
+G_BEGIN_DECLS
+
 typedef struct _GError GError;
 
 struct _GError
@@ -60,13 +63,25 @@ void     g_set_error           (GError       **err,
                                 const gchar   *format,
                                 ...) G_GNUC_PRINTF (4, 5);
 
+/* if (dest) *dest = src; also has some sanity checks.
+ */
+void     g_propagate_error     (GError       **dest,
+                               GError        *src);
+
 /* if (err && *err) { g_error_free(*err); *err = NULL; } */
 void     g_clear_error         (GError       **err);
 
+/* if (err) prefix the formatted string to the ->message */
+void     g_prefix_error               (GError       **err,
+                                       const gchar   *format,
+                                       ...) G_GNUC_PRINTF (2, 3);
 
-#ifdef __cplusplus
-}
-#endif
+/* g_propagate_error then g_error_prefix on dest */
+void     g_propagate_prefixed_error   (GError       **dest,
+                                       GError        *src,
+                                       const gchar   *format,
+                                       ...) G_GNUC_PRINTF (3, 4);
 
-#endif /* __GERROR_H__ */
+G_END_DECLS
 
+#endif /* __G_ERROR_H__ */