/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "Licence").
 * You may not use this file except in compliance with the Licence.
 *
 * You can obtain a copy of the licence at RISC OS path @.^.LICENCE
 * or  http://www.riscosdev.com/lanman98/LICENCE.CDDL
 * See the Licence for the specific language governing permissions
 * and limitations under the Licence.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the Licence file. If applicable, add the
 * following below this CDDL HEADER, with the fields enclosed by
 * brackets "[]" replaced with your own identifying information:
 * Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
 
/*
 *   Copyright 1996 Warm Silence Software Ltd.  All rights reserved.
 *   Use is subject to license terms.
 */

/*
 *   PHBG 8/1/97: Initial version
 *   PHBG 28/1/97: Made ExceptEndTry unnecessary, and directed errors thrown
 *                 by the catch clause to the next level out.
 *   PHBG 29/1/97: Corrected problem with reentrance (thanks to Julian Smith
 *                 for pointing it out).
 */

#ifndef _EXCEPT_
#define _EXCEPT_

#include "kernel.h"
#include "memory.h"

typedef struct exception_stack_s *exception_stack_t;

#include "errorxxx.h"

/*
    Macros for ExceptTry and ExceptCatch are defined in errorxxx.h,
    but their definitions are best ignored.  Just use them as follows:

    ExceptTry
    {
       .
       .
       .
    }
    ExceptCatch
    {
       .
       .
       .
    }

    and don't return from within the try clause.
*/

void Error(char *, ...);

void ErrorFatal(char *, ...);

void ErrorErr(_kernel_oserror *);

void ErrorNum(int, char *);

_kernel_oserror *ExceptCaught(void);

void ExceptRethrow(void);

exception_stack_t ExceptGetStack(void);

void ExceptSetStack(exception_stack_t);

#endif /* EXCEPT */
