Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

MqErrorS API
[MqS API]

the MqErrorS API is used to manage error messages. More...

Defines

#define MqPanicC(error, prefix, errnum, string)   MqPanicV(error,prefix,errnum,"%s",string);
 do a 'panic' with string as argument
Attention:
this procedure will never return

#define MqPanicSYS(error)   MqPanicV(error,__func__,-1,"%s","internal ERROR, please contact your local support");
 do a 'panic' with a 'system' error message
Attention:
this procedure will never return

#define MqErrorC(error, prefix, errnum, str)   MqErrorSGenV(error,prefix,MQ_ERROR ,errnum,"%s", str);
 set an error in MqErrorS with string argument
#define MqWarningC(error, prefix, str)   MqErrorSGenV(error,prefix,MQ_WARNING,-1,"%s", str);
 set a warning in MqErrorS with string argument
#define MqErrorV(error, prefix, errnum, fmt, args...)   MqErrorSGenV(error,prefix,MQ_ERROR,errnum,fmt, args);
 set an error in MqErrorS with vararg string argument
#define MqWarningV(error, prefix, fmt, args...)   MqErrorSGenV(error,prefix,MQ_WARNING,-1,fmt,args);
 set a warning in MqErrorS with vararg string argument
#define MqErrorSAppendC(error, str)   MqErrorSAppendV(error,"%s",str);
 append a string to a MqErrorS
#define MQ_ERROR_PROC_FMT   "found in procedure \"%s\" at file " cppxstr(__FILE__)
 append the procedure stack to a MqErrorS
#define MqErrorCheck(PROC)   if (unlikely((PROC) == MQ_ERROR)) goto error
 check on error and goto label error
#define MqErrorCheck1(PROC)   if (unlikely((PROC) == MQ_ERROR)) goto error1
 check on error and goto label error1
#define MqErrorCheck2(PROC, JUMP)   if (unlikely((PROC) == MQ_ERROR)) goto JUMP
 check on error and goto label JUMP
#define MqOkCheck(PROC)   if (likely((PROC) == MQ_OK)) goto ok
 check on OK and goto label ok
#define MqErrorCheckNULL(PROC)   if (unlikely((PROC) == NULL)) goto error
 check on NULL and goto error
#define MqErrorCheckNULL1(PROC)   if (unlikely((PROC) == NULL)) goto error1
 check on NULL and goto error1

Enumerations

enum  MqErrorE { MQ_OK, MQ_ERROR, MQ_WARNING, MQ_CONTINUE }
 collection for the different states of an error More...

Functions

MQ_EXTERN void MqPanicVL (MqErrorSP const error, const char *prefix, const MQ_INT4 errnum, const char *fmt, va_list ap) __attribute__((noreturn))
 do a 'panic' with vararg list
Attention:
this procedure will never return

MQ_EXTERN void MqPanicV (MqErrorSP const error, const char *prefix, const MQ_INT4 errnum, const char *fmt,...) __attribute__((noreturn))
 do a 'panic' with vararg strings
Attention:
this procedure will never return

MQ_EXTERN void MqErrorReset (MqErrorSP const error)
 reset a MqErrorS, change state to MQ_OK
MQ_EXTERN MqErrorE MqErrorSGenVL (MqErrorSP const error, const char *prefix, const MqErrorE status, const MQ_INT4 errnum, const char *fmt, va_list ap)
 set a state in MqErrorS with vararg list argument
MQ_EXTERN MqErrorE MqErrorSGenV (MqErrorSP const error, const char *prefix, const MqErrorE status, const MQ_INT4 errnum, const char *fmt,...)
 set a state in MqErrorS with vararg string argument
MQ_EXTERN MqErrorE MqErrorSAppendV (MqErrorSP const error, const char *fmt,...)
 append a vararg string to a MqErrorS
MQ_EXTERN MqErrorE MqErrorSSend (MqErrorSP const error, const char *prefix)
 send or print a MqErrorS
MQ_EXTERN MqErrorE MqErrorGetStatus (MqErrorSP const error)
 return the value of MqErrorS status member
MQ_EXTERN MQ_STR MqErrorGetString (MqErrorSP const error)
 return the value of MqErrorS text member
MQ_EXTERN MQ_INT2 MqErrorGetNum (MqErrorSP const error)
 return the value of MqErrorS num member
MQ_EXTERN MqBufferSP const MqErrorGetText (MqErrorSP const error)
 reset the MqErrorS status member to OK and return the text member as MqBufferS
MQ_EXTERN MqSP MqErrorGetMsgque (MqErrorSP const error)
 get MqErrorS msgque member
MQ_EXTERN void MqErrorLog (MqErrorSP const error, const char *prefix)
 log the MqErrorS for debugging
MQ_EXTERN MqErrorE MqErrorCopy (MqErrorSP out, MqErrorSP const in)
 copy a MqErrorS from in to out

Detailed Description

the MqErrorS API is used to manage error messages.

the management is done with a MqErrorS object created by MgCreate. every MqS object has only one MqErrorS object and every MqErrorS object has only one MqS object. the MqErrorS object is used to collect all data needed to handle an error.


Enumeration Type Documentation

enum MqErrorE
 

collection for the different states of an error

Enumeration values:
MQ_OK  everything is OK, no error available (persistent)
MQ_ERROR  something is wrong (persistent)
MQ_WARNING  something is suspect (only return message, non persistent)
MQ_CONTINUE  a state for misc purpose (non persistent)

Definition at line 300 of file types.h.


Generated on Tue Nov 23 16:13:06 2004 for libFreiburg by  doxygen 1.3.8-20040928