X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/0875b58fcccadd756e11487185c2ac1d3ed8ab4d..f23d010aa281711352a1e8ea2b8d631742a41b82:/exc.c diff --git a/exc.c b/exc.c index 1c6468d..8f50696 100644 --- a/exc.c +++ b/exc.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: exc.c,v 1.1 1998/06/17 23:44:42 mdw Exp $ + * $Id: exc.c,v 1.6 2004/04/08 01:36:11 mdw Exp $ * * Structured exception handling in C * @@ -12,26 +12,19 @@ * This file is part of the mLib utilities library. * * mLib is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 General Public License for more details. - * - * You should have received a copy of the GNU 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.c,v $ - * Revision 1.1 1998/06/17 23:44:42 mdw - * Initial revision + * 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. */ #include @@ -46,7 +39,7 @@ __exc_hnd *__exc_list = 0; /*----- Functions ---------------------------------------------------------*/ -/* --- @exc__duff@ --- * +/* --- @duff@ --- * * * Arguments: @exc_extype type@ = type of duff exception * @exc_exval val@ = extra data supplied @@ -56,18 +49,18 @@ __exc_hnd *__exc_list = 0; * Use: Default handler when everything goes wrong. */ -static void exc__duff(exc_extype type, exc_exval val) +static void duff(exc_extype type, exc_exval val) { - fprintf(stderr, "fatal error: uncaught exception (type = %lu)\n", type); + fprintf(stderr, "fatal error: uncaught exception (type = %lx)\n", type); abort(); } -/* --- @exc__duffproc@ --- * +/* --- @duffproc@ --- * * * Current handler when there are no more exceptions left. */ -static exc__uncaught exc__duffproc = exc__duff; +static exc__uncaught duffproc = duff; /* --- @exc_uncaught@ --- * * @@ -80,9 +73,9 @@ static exc__uncaught exc__duffproc = exc__duff; exc__uncaught exc_uncaught(exc__uncaught proc) { - exc__uncaught p = exc__duffproc; + exc__uncaught p = duffproc; if (proc) - exc__duffproc = proc; + duffproc = proc; return (p); } @@ -135,11 +128,11 @@ void __exc_rethrow(exc_extype type, exc_exval val) { __exc_hnd *p = __exc_list; if (!p) - exc__duffproc(type, val); + duffproc(type, val); p->type = type; p->val = val; __exc_list = p->next; longjmp(p->buf, type); -} +} /*----- That's all, folks -------------------------------------------------*/