create an HklPseudoAxisEngineModeInfo for the Automatic modes.
[hkl.git] / hkl / hkl-error.h
bloba3387bd11eb7101ef7eb675b6756daee6322778a
1 /* gerror.h - Error reporting system
3 * Copyright 2000 Red Hat, Inc.
5 * The Gnome Library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * The Gnome Library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with the Gnome Library; see the file COPYING.LIB. If not,
17 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * modified by Picca Frédéric-emmanuel <picca@synchrotron-soleil.fr>
23 * for the hkl project
25 #ifndef __HKL_ERROR_H__
26 #define __HKL_ERROR_H__
28 #include <stdarg.h>
29 #include <hkl/hkl-macros.h>
31 HKL_BEGIN_DECLS
33 typedef struct _HklError HklError;
35 struct _HklError /*<skip>*/
37 char *message;
40 HklError* hkl_error_new (const char *format, ...) G_GNUC_PRINTF (1, 2);
42 HklError* hkl_error_new_literal (const char *message);
43 HklError* hkl_error_new_valist (const char *format, va_list args);
45 void hkl_error_free (HklError *error);
47 HklError* hkl_error_new_copy (const HklError *error);
49 /* if (err) *err = hkl_error_new(domain, code, format, ...), also has
50 * some sanity checks.
52 void hkl_error_set (HklError **err, const char *format, ...) G_GNUC_PRINTF (2, 3);
54 void hkl_error_set_literal (HklError **err, const char *message);
56 /* if (dest) *dest = src; also has some sanity checks.
58 void hkl_error_propagate (HklError **dest, HklError *src);
60 /* if (err && *err) { hkl_error_free(*err); *err = NULL; } */
61 void hkl_error_clear (HklError **err);
63 /* if (err) prefix the formatted string to the ->message */
64 void hkl_error_prefix (HklError **err, const char *format, ...) G_GNUC_PRINTF (2, 3);
66 /* hkl_propagate_error then hkl_error_prefix on dest */
67 void hkl_error_propagate_prefixed (HklError **dest, HklError *src,
68 const char *format, ...) G_GNUC_PRINTF (3, 4);
70 HKL_END_DECLS
72 #endif /* __HKL_ERROR_H__ */