/******************************************************************************/
/*                       Copyright 2001 Broadcom Corporation                  */
/*                                                                            */
/* This material is the confidential trade secret and proprietary information */
/* of Broadcom Corp.  It may not be reproduced, used, sold or transferred to  */
/* any third party without the prior written consent of Broadcom Corp.        */
/* All rights reserved.                                                       */
/******************************************************************************/
/*   FileName        : bcm_errorHandler.h                                     */
/*   Purpose         : Header for errorHandler function                       */
/*   Limitations     : None                                                   */
/*   Author          : Emmanuel Hanssens                                      */
/*   Creation Date   : 14-Sep-2001                                            */
/*   History         : Compiled by CVS                                        */
/******************************************************************************/
/*   $Id: bcm_errorHandler.h,v 1.2 2004/09/27 15:33:10 hanssens Exp $  */
/******************************************************************************/
#ifndef ERROR_HANDLER_H
# define ERROR_HANDLER_H

# include <stdio.h>

# define MAX_ERROR_LEN 200

# define SOFT_ERROR(...) errorHandler(__FILE__, __LINE__, __VA_ARGS__)

/* errorHandler: function that is being called when a recovery action
   can be performed by one of the above layer */
int errorHandler(const char *fileName,     /* file name where error was seen */
                 const int   line,         /* line in file */
                 int         errorType,    /* type of detected error */
                 const char *fmt,          /* format string (like printf) */
                 ...);

# define FATAL_ERROR(...) fatalError(__FILE__, __LINE__, __VA_ARGS__)

/* fatalError: function that is being called when a fatal error has been
   detected */
void fatalError(const char *fileName,     /* file name where error was seen */
                const int   line,         /* line in file */
                const char *fmt,          /* format string (like printf) */
                ...);

#endif
