1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-execpetion.h : exception utils */
7 * Bertrand Guiheneuf <bertrand@helixcode.com>
9 * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of version 2 of the GNU Lesser General Public
13 * License as published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
28 #ifndef CAMEL_EXCEPTION_H
29 #define CAMEL_EXCEPTION_H 1
31 #include <camel/camel-types.h>
36 #include "camel-exception-list.def"
40 struct _CamelException {
41 /* do not access the fields directly */
46 #define CAMEL_EXCEPTION_INITIALISER { 0, NULL }
48 /* creation and destruction functions */
49 CamelException * camel_exception_new (void);
50 void camel_exception_free (CamelException *ex);
51 void camel_exception_init (CamelException *ex);
54 /* exception content manipulation */
55 void camel_exception_clear (CamelException *ex);
56 void camel_exception_set (CamelException *ex,
59 void camel_exception_setv (CamelException *ex,
64 /* exception content transfer */
65 void camel_exception_xfer (CamelException *ex_dst,
66 CamelException *ex_src);
69 /* exception content retrieval */
70 ExceptionId camel_exception_get_id (CamelException *ex);
71 const char * camel_exception_get_description (CamelException *ex);
73 #define camel_exception_is_set(ex) (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE)
77 #endif /* CAMEL_EXCEPTION_H */