Loading...
Searching...
No Matches
omError.h File Reference
`#include <stdio.h>`

Go to the source code of this file.

## Macros

#define | omAssume(x)

## Typedefs

typedef enum omError_e | omError_t

## Enumerations

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
}

## Functions

const char * | omError2String (omError_t error)
const char * | omError2Serror (omError_t error)
omError_t | omReportError (omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
void | omErrorBreak (void)
void | omPrintAddrInfo (FILE *fd, void *addr, const char *s)

## Variables

omError_t | om_ErrorStatus
omError_t | om_InternalErrorStatus
int | om_CallErrorHook

## Macro Definition Documentation

## omAssume

#define omAssume | ( |  | x | ) |

Value:
do \
{ \
if (! (x)) \
{ \
omReportError(omError_InternalBug, omError_InternalBug, OM_FLR, "omAssume violation"); \
} \
} \
while (0)
x
Variable x
Definition cfModGcd.cc:4090
omError_InternalBug
@ omError_InternalBug
Definition omError.h:20

Definition at line 85 of file omError.h.

#define omAssume(x) \
do \
{ \
if (! (x)) \
{ \
omReportError(omError_InternalBug, omError_InternalBug, OM_FLR, "omAssume violation"); \
} \
} \
while (0)

## Typedef Documentation

## omError_t

typedef enum omError_e omError_t

Definition at line 44 of file omError.h.

## Enumeration Type Documentation

## omError_e

enum omError_e

Enumerator
omError_NoError |
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 |

Definition at line 16 of file omError.h.

{
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
};
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_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

## Function Documentation

## omError2Serror()

const char * omError2Serror | ( | omError_t | error | ) |

Definition at line 65 of file omError.c.

{
int i = 0;
while (! (om_ErrorStrings[i].string == NULL && om_ErrorStrings[i].error == omError_MaxError))
{
if (om_ErrorStrings[i].error == error) return om_ErrorStrings[i].s_error;
i++;
}
return "omError_UnKnown";
}
i
int i
Definition cfEzgcd.cc:132
error
#define error(a)
Definition mpr_numeric.cc:966
om_ErrorStrings
static const struct omErrorString_s om_ErrorStrings[]
Definition omError.c:24
NULL
#define NULL
Definition omList.c:12

## omError2String()

const char * omError2String | ( | omError_t | error | ) |

Definition at line 54 of file omError.c.

{
int i = 0;
while (! (om_ErrorStrings[i].string == NULL && om_ErrorStrings[i].error == omError_MaxError))
{
if (om_ErrorStrings[i].error == error) return om_ErrorStrings[i].string;
i++;
}
return "undocumented error";
}

## omErrorBreak()

void omErrorBreak | ( | void |  | ) |

extern

Definition at line 137 of file omError.c.

{}

## omPrintAddrInfo()

void omPrintAddrInfo | ( | FILE * | fd,
|  | void * | addr,
|  | const char * | s )

extern

Definition at line 453 of file omDebugCheck.c.

{
_omPrintAddrInfo(fd, omError_NoError, addr, NULL, 0, 10, s);
}
s
const CanonicalForm int s
Definition facAbsFact.cc:51
_omPrintAddrInfo
static void _omPrintAddrInfo(FILE *fd, omError_t error, void *addr, void *bin_size, omTrackFlags_t flags, int max_frames, const char *s)
Definition omDebugCheck.c:421
fd
int status int fd
Definition si_signals.h:69

## omReportError()

omError_t omReportError | ( | omError_t | error,
|  | omError_t | report_error,
|  | OM_FLR_DECL | ,
|  | const char * | fmt,
|  |  | ... )

extern

Definition at line 80 of file omError.c.

{
int max_check, max_track;
if (report_error == omError_MaxError) return error;
/* reset MaxTrack and MaxCheck to prevent infinite loop, in case
printf allocates memory */
max_check = om_Opts.MaxCheck;
max_track = om_Opts.MaxTrack;
om_Opts.MaxCheck = 0;
om_Opts.MaxTrack = 0;
om_InternalErrorStatus = error;
om_ErrorStatus = (report_error == omError_NoError ? error : report_error);
if (om_Opts.HowToReportErrors && om_ErrorStatus != omError_NoError)
{
/* to avoid spurious error msg in 64 bit mode*/
if (om_ErrorStatus == omError_StickyBin) return error;
fprintf(stderr, "***%s: %s", omError2Serror(om_ErrorStatus), omError2String(om_ErrorStatus));
#ifdef OM_INTERNAL_DEBUG
if (om_ErrorStatus != error)
fprintf(stderr, "\n___%s: %s", omError2Serror(error), omError2String(error));
#endif
if (om_Opts.HowToReportErrors > 2 && fmt != NULL && *fmt != '\0')
{
va_list ap;
va_start(ap, fmt);
fputs( ": ",stderr);
vfprintf(stderr, fmt, ap);
va_end(ap);
}
if (om_Opts.HowToReportErrors > 1)
{
#ifndef OM_NDEBUG
fputs("\n occurred at: ",stderr);
if (! _omPrintCurrentBackTrace(stderr, OM_FLR_VAL))
fputs(" ??",stderr);
#endif
}
fputc('\n',stderr);
fflush(stderr);
}
if (om_CallErrorHook)
om_Opts.ErrorHook();
om_Opts.MaxCheck = max_check;
om_Opts.MaxTrack = max_track;
return error;
}
ap
Definition ap.h:40
om_ErrorStatus
omError_t om_ErrorStatus
Definition omError.c:13
omError2String
const char * omError2String(omError_t error)
Definition omError.c:54
omError2Serror
const char * omError2Serror(omError_t error)
Definition omError.c:65
om_CallErrorHook
int om_CallErrorHook
Definition omError.c:77
om_InternalErrorStatus
omError_t om_InternalErrorStatus
Definition omError.c:14
om_Opts
omOpts_t om_Opts
Definition omOpts.c:13
_omPrintCurrentBackTrace
int _omPrintCurrentBackTrace(FILE *fd, OM_FLR_DECL)
Definition omRet2Info.c:271

## Variable Documentation

## om_CallErrorHook

int om_CallErrorHook

extern

Definition at line 77 of file omError.c.

## om_ErrorStatus

omError_t om_ErrorStatus

extern

Definition at line 13 of file omError.c.

## om_InternalErrorStatus

omError_t om_InternalErrorStatus

extern

Definition at line 14 of file omError.c.