Loading...
Searching...
No Matches
omError.h
Go to the documentation of this file.
/*******************************************************************
* File: omError.h
* Purpose: Error handling of omalloc
* Author: obachman (Olaf Bachmann)
* Created: 11/99
*******************************************************************/
#ifndef OM_ERROR_H
#define OM_ERROR_H
#include <stdio.h>
/*******************************************************************
*
* error codes
*
*******************************************************************/
enum omError_e
{
omError_NoError = 0,
omError_Unknown,
omError_InternalBug,
omError_MemoryCorrupted,
omError_NullAddr,
omError_InvalidRangeAddr,
omError_FalseAddr,
omError_FalseAddrOrMemoryCorrupted,
omError_WrongSize,
omError_FreedAddr,
omError_FreedAddrOrMemoryCorrupted,
omError_WrongBin,
omError_UnknownBin,
omError_NotBinAddr,
omError_UnalignedAddr,
omError_NullSizeAlloc,
omError_ListCycleError,
omError_SortedListError,
omError_KeptAddrListCorrupted,
omError_FreePattern,
omError_BackPattern,
omError_FrontPattern,
omError_NotString,
omError_StickyBin,
omError_MaxError
};
typedef enum omError_e omError_t;
/* global variable holding last omError */
extern omError_t om_ErrorStatus;
/* globale variable holding last low-level omError */
extern omError_t om_InternalErrorStatus;
/* returns description of error */
const char* omError2String(omError_t error);
/* returns error as string */
const char* omError2Serror(omError_t error);
extern omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL,
const char* fmt, ...);
/* this is a dummy function and used as default for om_Opts.ErrorHook */
extern void omErrorBreak(void);
#ifndef OM_NDEBUG
extern void omPrintAddrInfo(FILE* fd, void* addr, const char* s);
#else
#define omPrintAddrInfo(fd, addr, s) fprintf(fd, "OM_NDEBUG: no addr info available\n")
#endif
/*BEGINPRIVATE*/
#ifndef OM_NDEBUG
extern int om_CallErrorHook;
#else
#define om_CallErrorHook 1
#endif
/*******************************************************************
*
* om_assume(x) -- a handy macro for assumptions
*
******************************************************************/
#ifndef HAVE_OM_ASSUME
#define omAssume(x) do {} while (0)
#else /* ! HAVE_OM_ASSUME */
#define omAssume(x) \
do \
{ \
if (! (x)) \
{ \
omReportError(omError_InternalBug, omError_InternalBug, OM_FLR, "omAssume violation"); \
} \
} \
while (0)
#endif /* HAVE_OM_ASSUME */
/*ENDPRIVATE*/
#endif /* OM_LOCAL_H */
s
const CanonicalForm int s
Definition facAbsFact.cc:51
error
#define error(a)
Definition mpr_numeric.cc:966
om_ErrorStatus
omError_t om_ErrorStatus
Definition omError.c:13
om_CallErrorHook
int om_CallErrorHook
Definition omError.c:77
om_InternalErrorStatus
omError_t om_InternalErrorStatus
Definition omError.c:14
omError2String
const char * omError2String(omError_t error)
Definition omError.c:54
omError2Serror
const char * omError2Serror(omError_t error)
Definition omError.c:65
omError_e
omError_e
Definition omError.h:17
omError_WrongSize
@ omError_WrongSize
Definition omError.h:26
omError_ListCycleError
@ omError_ListCycleError
Definition omError.h:34
omError_BackPattern
@ omError_BackPattern
Definition omError.h:38
omError_NullAddr
@ omError_NullAddr
Definition omError.h:22
omError_NullSizeAlloc
@ omError_NullSizeAlloc
Definition omError.h:33
omError_MaxError
@ omError_MaxError
Definition omError.h:42
omError_FrontPattern
@ omError_FrontPattern
Definition omError.h:39
omError_UnalignedAddr
@ omError_UnalignedAddr
Definition omError.h:32
omError_MemoryCorrupted
@ omError_MemoryCorrupted
Definition omError.h:21
omError_FreedAddr
@ omError_FreedAddr
Definition omError.h:27
omError_UnknownBin
@ omError_UnknownBin
Definition omError.h:30
omError_FreedAddrOrMemoryCorrupted
@ omError_FreedAddrOrMemoryCorrupted
Definition omError.h:28
omError_NotString
@ omError_NotString
Definition omError.h:40
omError_SortedListError
@ omError_SortedListError
Definition omError.h:35
omError_KeptAddrListCorrupted
@ omError_KeptAddrListCorrupted
Definition omError.h:36
omError_InternalBug
@ omError_InternalBug
Definition omError.h:20
omError_NotBinAddr
@ omError_NotBinAddr
Definition omError.h:31
omError_InvalidRangeAddr
@ omError_InvalidRangeAddr
Definition omError.h:23
omError_FalseAddr
@ omError_FalseAddr
Definition omError.h:24
omError_WrongBin
@ omError_WrongBin
Definition omError.h:29
omError_NoError
@ omError_NoError
Definition omError.h:18
omError_Unknown
@ omError_Unknown
Definition omError.h:19
omError_StickyBin
@ omError_StickyBin
Definition omError.h:41
omError_FreePattern
@ omError_FreePattern
Definition omError.h:37
omError_FalseAddrOrMemoryCorrupted
@ omError_FalseAddrOrMemoryCorrupted
Definition omError.h:25
omReportError
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
Definition omError.c:80
omError_t
enum omError_e omError_t
Definition omError.h:44
omErrorBreak
void omErrorBreak(void)
Definition omError.c:137
fd
int status int fd
Definition si_signals.h:69
omPrintAddrInfo
#define omPrintAddrInfo(A, B, C)
Definition xalloc.h:270