blob: 8328d9ae9c98088eef39c079f70cbbb948b39e98 [file] [log] [blame]
/******************************************************************************
*(C) Copyright 2008 Marvell International Ltd.
* All Rights Reserved
******************************************************************************/
/*****************************************************************************
* Utility Library
*
* Error-handling utilities header file
*
*****************************************************************************/
#ifndef _UTL_ERROR_INCLUDED
#define _UTL_ERROR_INCLUDED
#include <assert.h>
#include <errno.h>
#include "utlTypes.h"
#include <string.h>
#include "utlTrace.h"
/*--- Macros ----------------------------------------------------------------*/
#define utlHERE __FILE__, __func__, __LINE__
#define utlHERE_FILE file_path_p
#define utlHERE_FUNC func_name_p
#define utlHERE_LINE line_num
#define utlHERE_DECLARATION const char *utlHERE_FILE UNUSED, const char *utlHERE_FUNC UNUSED, const size_t utlHERE_LINE UNUSED
#define utlHERE_VALUES utlHERE_FILE, utlHERE_FUNC, utlHERE_LINE
#define utlAssert(test) ((utlDoAssert(utlHERE, test, #test)) ? (void)0 : eeh_panic(__FILE__, __LINE__, __func__, #test))
#define utlError ERRMSG
#define utlSigError ERRMSG
/*--- Prototypes ------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
extern bool utlDoAssert(utlHERE_DECLARATION, const int result, const char *assertion_p);
extern void utlDoError(utlHERE_DECLARATION, const char *msg_p, ...);
extern void utlDoSigError(utlHERE_DECLARATION, const char *msg_p, ...);
#ifdef __cplusplus
}
#endif
#endif /* _UTL_ERRNO_INCLUDED */