2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * File: exception.h $XConsortium: exception.h /main/3 1995/10/26 16:12:07 rswiston $
26 * (c) Copyright 1993, 1994 Hewlett-Packard Company
27 * (c) Copyright 1993, 1994 International Business Machines Corp.
28 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
29 * (c) Copyright 1993, 1994 Novell, Inc.
31 /* C++ exception handler package */
33 #ifndef __EXCEPTION_H_
34 #define __EXCEPTION_H_
40 typedef const char *const Exception;
44 char raised, accepted;
52 int accept(Exception val);
54 void raise(Exception val);
56 extern _Exception *_curr_exception;
57 extern void _raise_exception(Exception val);
59 #define TRY _Exception _new_exception; if (setjmp(_new_exception.buf) == 0)
60 #define RECOVER else if (_new_exception.recover())
61 #define HANDLE(val) else if (_new_exception.accept(val))
62 #define RAISE(val) _raise_exception(val)
63 #define EXCEPTION (_curr_exception != NULL ? _curr_exception->val : NULL)
66 #endif /* __EXCEPTION_H_ */
68 @(#)REV: 2.18 90/12/13