gerror.h

Go to the documentation of this file.
00001 /* gerror.h - Error reporting system
00002  *
00003  *  Copyright 2000 Red Hat, Inc.
00004  *
00005  * The Gnome Library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or (at your option) any later version.
00009  *
00010  * The Gnome Library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
00017  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  *   Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef __G_ERROR_H__
00022 #define __G_ERROR_H__
00023 
00024 #include <gquark.h>
00025 
00026 G_BEGIN_DECLS
00027 
00028 typedef struct _GError GError;
00029 
00030 struct _GError
00031 {
00032   GQuark       domain;
00033   gint         code;
00034   gchar       *message;
00035 };
00036 
00037 GError*  g_error_new           (GQuark         domain,
00038                                 gint           code,
00039                                 const gchar   *format,
00040                                 ...) G_GNUC_PRINTF (3, 4);
00041 
00042 GError*  g_error_new_literal   (GQuark         domain,
00043                                 gint           code,
00044                                 const gchar   *message);
00045 
00046 void     g_error_free          (GError        *error);
00047 GError*  g_error_copy          (const GError  *error);
00048 
00049 gboolean g_error_matches       (const GError  *error,
00050                                 GQuark         domain,
00051                                 gint           code);
00052 
00053 /* if (err) *err = g_error_new(domain, code, format, ...), also has
00054  * some sanity checks.
00055  */
00056 void     g_set_error           (GError       **err,
00057                                 GQuark         domain,
00058                                 gint           code,
00059                                 const gchar   *format,
00060                                 ...) G_GNUC_PRINTF (4, 5);
00061 
00062 /* if (dest) *dest = src; also has some sanity checks.
00063  */
00064 void     g_propagate_error     (GError       **dest,
00065                                 GError        *src);
00066 
00067 /* if (err && *err) { g_error_free(*err); *err = NULL; } */
00068 void     g_clear_error         (GError       **err);
00069 
00070 
00071 G_END_DECLS
00072 
00073 #endif /* __G_ERROR_H__ */
00074 

Generated on Tue Jul 5 14:14:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1