/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for 
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #                                      
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Error3.c
    Author:  Copyright  1995 Julian Smith
    Version: 1.00 (07 Sep 1995)
    Purpose: Error handling
*/


#include "DeskLib:Error2.h"



Desk_error2_handler	Desk_error2__handlerfn	= NULL;

#ifdef _DLL
Desk_error2_handler*	Desk_Error2__Ref__handlerfn( void)	{ return &Desk_error2__handlerfn;	}
#endif



Desk_error2_block	*Desk_Error2_XHandle( Desk_error2_block *error)
{
if (Desk_error2__handlerfn)	return Desk_error2__handlerfn( error);
else			Desk_Error2_Exit( error);

return NULL;
}


void	Desk_Error2_Handle( Desk_error2_block *error)
{
error = Desk_Error2_XHandle( error);
if ( error != Desk_error2_HANDLED)	Desk_Error2_Exit( error);
}


void	Desk_Error2_ClearErrorBlock( Desk_error2_block *error)
{
error->type		= Desk_error2_type_NONE;
error->data.misc	= NULL;
}
