My Project
Loading...
Searching...
No Matches
omError.h
Go to the documentation of this file.
1/*******************************************************************
2 * File: omError.h
3 * Purpose: Error handling of omalloc
4 * Author: obachman (Olaf Bachmann)
5 * Created: 11/99
6 *******************************************************************/
7#ifndef OM_ERROR_H
8#define OM_ERROR_H
9
10#include <stdio.h>
11/*******************************************************************
12 *
13 * error codes
14 *
15 *******************************************************************/
17{
43};
44typedef enum omError_e omError_t;
45
46/* global variable holding last omError */
48/* globale variable holding last low-level omError */
50/* returns description of error */
51const char* omError2String(omError_t error);
52/* returns error as string */
53const char* omError2Serror(omError_t error);
54extern omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL,
55 const char* fmt, ...);
56
57/* this is a dummy function and used as default for om_Opts.ErrorHook */
58extern void omErrorBreak(void);
59
60#ifndef OM_NDEBUG
61extern void omPrintAddrInfo(FILE* fd, void* addr, const char* s);
62#else
63#define omPrintAddrInfo(fd, addr, s) fprintf(fd, "OM_NDEBUG: no addr info available\n")
64#endif
65
66/*BEGINPRIVATE*/
67
68#ifndef OM_NDEBUG
69extern int om_CallErrorHook;
70#else
71#define om_CallErrorHook 1
72#endif
73
74/*******************************************************************
75 *
76 * om_assume(x) -- a handy macro for assumptions
77 *
78 ******************************************************************/
79#ifndef HAVE_OM_ASSUME
80
81#define omAssume(x) do {} while (0)
82
83#else /* ! HAVE_OM_ASSUME */
84
85#define omAssume(x) \
86do \
87{ \
88 if (! (x)) \
89 { \
90 omReportError(omError_InternalBug, omError_InternalBug, OM_FLR, "omAssume violation"); \
91 } \
92} \
93while (0)
94
95#endif /* HAVE_OM_ASSUME */
96/*ENDPRIVATE*/
97
98#endif /* OM_LOCAL_H */
const CanonicalForm int s
Definition: facAbsFact.cc:51
#define error(a)
Definition: mpr_numeric.cc:966
omError_t om_ErrorStatus
Definition: omError.c:13
const char * omError2String(omError_t error)
Definition: omError.c:54
const char * omError2Serror(omError_t error)
Definition: omError.c:65
int om_CallErrorHook
Definition: omError.c:77
omError_e
Definition: omError.h:17
@ omError_WrongSize
Definition: omError.h:26
@ omError_ListCycleError
Definition: omError.h:34
@ omError_BackPattern
Definition: omError.h:38
@ omError_NullAddr
Definition: omError.h:22
@ omError_NullSizeAlloc
Definition: omError.h:33
@ omError_MaxError
Definition: omError.h:42
@ omError_FrontPattern
Definition: omError.h:39
@ omError_UnalignedAddr
Definition: omError.h:32
@ omError_MemoryCorrupted
Definition: omError.h:21
@ omError_FreedAddr
Definition: omError.h:27
@ omError_UnknownBin
Definition: omError.h:30
@ omError_FreedAddrOrMemoryCorrupted
Definition: omError.h:28
@ omError_NotString
Definition: omError.h:40
@ omError_SortedListError
Definition: omError.h:35
@ omError_KeptAddrListCorrupted
Definition: omError.h:36
@ omError_InternalBug
Definition: omError.h:20
@ omError_NotBinAddr
Definition: omError.h:31
@ omError_InvalidRangeAddr
Definition: omError.h:23
@ omError_FalseAddr
Definition: omError.h:24
@ omError_WrongBin
Definition: omError.h:29
@ omError_NoError
Definition: omError.h:18
@ omError_Unknown
Definition: omError.h:19
@ omError_StickyBin
Definition: omError.h:41
@ omError_FreePattern
Definition: omError.h:37
@ omError_FalseAddrOrMemoryCorrupted
Definition: omError.h:25
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
Definition: omError.c:80
omError_t om_InternalErrorStatus
Definition: omError.c:14
enum omError_e omError_t
Definition: omError.h:44
void omErrorBreak(void)
Definition: omError.c:137
int status int fd
Definition: si_signals.h:59
#define omPrintAddrInfo(A, B, C)
Definition: xalloc.h:270