X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/e1ccd441d11d1581fc91aeeb4442865843221dd4..bb1cbbe82a40a9cffb8d143bed2e3aa245595450:/exc.h diff --git a/exc.h b/exc.h index f5d1dc9..1db4a37 100644 --- a/exc.h +++ b/exc.h @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: exc.h,v 1.4 1999/10/22 22:39:18 mdw Exp $ + * $Id: exc.h,v 1.7 2004/04/08 01:36:11 mdw Exp $ * * Structured exception handling in C * * (c) 1998 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the mLib utilities library. * @@ -15,37 +15,20 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * mLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with mLib; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: exc.h,v $ - * Revision 1.4 1999/10/22 22:39:18 mdw - * Add an exception group for mLib. - * - * Revision 1.3 1999/05/06 19:51:35 mdw - * Reformatted the LGPL notice a little bit. - * - * Revision 1.2 1999/05/05 18:50:31 mdw - * Change licensing conditions to LGPL. - * - * Revision 1.1.1.1 1998/06/17 23:44:42 mdw - * Initial version of mLib - * - */ - -#ifndef EXC_H -#define EXC_H +#ifndef MLIB_EXC_H +#define MLIB_EXC_H #ifdef __cplusplus extern "C" { @@ -113,11 +96,11 @@ * ... something dangerous ... * } CATCH switch (exc_type) { * case EXC_INTERESTING: - * ... handle exception ... - * break; + * ... handle exception ... + * break; * default: - * ... do tidying up ... - * RETHROW; + * ... do tidying up ... + * RETHROW; * } END_TRY; */ @@ -134,7 +117,7 @@ * the type of the value field (see below). */ -/* --- Type type of an exception --- */ +/* --- Type of an exception --- */ typedef unsigned long exc_extype; @@ -277,10 +260,10 @@ extern __exc_hnd *__exc_list; /* List of active handlers */ * __exc_hnd h; * add_handler(&h); * if (!setjmp(h.buf)) { - * do while (0); - * remove_handler(&h); + * do while (0); + * remove_handler(&h); * } else - * + * * } while (0) * * Everything else is ugly hacking to make things work.