|
Defines | |
| #define | MQ_ERROR_PANIC ((struct MqS*)NULL) |
| panic on error | |
| #define | MQ_ERROR_IGNORE ((struct MqS*)0x1) |
| ignore error and do not generate any error-text (don't fill the error object) | |
| #define | MQ_ERROR_PRINT ((struct MqS*)0x2) |
| print error to stderr | |
| #define | MQ_ERROR_IS_POINTER(e) (e>MQ_ERROR_PRINT) |
| #define | MqPanicC(context, prefix, errnum, string) MqPanicV(context,prefix,errnum,"%s",string); |
| do a panic with string as argument | |
| #define | MqPanicSYS(context) |
| do a panic with a system error message | |
| #define | MqErrorV(error, prefix, errnum, format,...) MqErrorSGenV(error,prefix,MQ_ERROR,errnum,format, __VA_ARGS__) |
| customized edition of MqErrorSGenV | |
| #define | MqErrorSAppendC(error, str) MqErrorSAppendV(error,"%s",str); |
| append a string to a MqErrorS | |
| #define | MqErrorStack(error) MqErrorStackP(error, __func__, __FILE__) |
| convenience wrapper for MqErrorStackP | |
| #define | MqErrorCheckI(PROC) (unlikely((PROC) >= MQ_ERROR)) |
| check on error | |
| #define | MqErrorCheck(PROC) if (MqErrorCheckI(PROC)) goto error |
| version of MqErrorCheckI | |
| #define | MqErrorSwitch(PROC) |
| process error message | |
| #define | MqErrorReturn(PROC) |
| process error message | |
| #define | MqErrorCheck1(PROC) if (MqErrorCheckI(PROC)) goto error1 |
| check on error and goto label error1 | |
| #define | MqErrorCheck2(PROC, JUMP) if (MqErrorCheckI(PROC)) goto JUMP |
| check on error and goto label JUMP | |
Enumerations | |
| enum | MqErrorE { MQ_OK = 0, MQ_CONTINUE = 1, MQ_ERROR = 2, MQ_EXIT = 3 } |
| collection for the different error-codes More... | |
Functions | |
| MQ_EXTERN void | MqPanicVL (struct MqS *const context, MQ_CST const prefix, MQ_INT const errnum, MQ_CST const fmt, va_list var_list) |
| do a panic with a vararg argument list | |
| MQ_EXTERN void | MqPanicV (struct MqS *const context, MQ_CST const prefix, MQ_INT const errnum, MQ_CST const fmt,...) |
| do a panic with vararg arguments | |
| MQ_EXTERN void | MqErrorReset (struct MqS *const context) |
| reset a MqErrorS object, change error code to MQ_OK | |
| MQ_EXTERN enum MqErrorE | MqErrorSGenVL (struct MqS *const context, MQ_CST const prefix, enum MqErrorE const errorcode, MQ_INT const errnum, MQ_CST const fmt, va_list var_list) |
| set an error-code in MqErrorS with vararg list argument | |
| MQ_EXTERN enum MqErrorE | MqErrorSGenV (struct MqS *const context, MQ_CST const prefix, enum MqErrorE const errorcode, MQ_INT const errnum, MQ_CST const fmt,...) |
| set a error-code in MqErrorS with vararg string argument | |
| MQ_EXTERN enum MqErrorE | MqErrorC (struct MqS *const context, MQ_CST const prefix, MQ_INT const errnum, MQ_CST const message) |
| customized edition of MqErrorSGenV | |
| MQ_EXTERN enum MqErrorE | MqErrorSAppendV (struct MqS const *const context, MQ_CST const fmt,...) |
| append a vararg string to a MqErrorS | |
| MQ_EXTERN enum MqErrorE | MqErrorStackP (struct MqS *const context, MQ_CST const func, MQ_CST const file) |
| append a function and filename to the error-buffer | |
| MQ_EXTERN enum MqErrorE | MqErrorGetCode (struct MqS const *const context) |
| return the value of MqErrorS code member | |
| MQ_EXTERN enum MqErrorE | MqErrorSetCode (struct MqS *const context, enum MqErrorE code) |
| set the value of MqErrorS code member | |
| MQ_EXTERN MQ_CST | MqErrorGetText (struct MqS const *const context) |
| return the value of MqErrorS text member | |
| MQ_EXTERN void | MqErrorPrint (struct MqS *const context) |
| return the value of MqErrorS num member | |
| MQ_EXTERN MQ_INT | MqErrorGetNum (struct MqS const *const context) |
| brint an error to stderr and clear the error after | |
| MQ_EXTERN enum MqErrorE | MqErrorSet (struct MqS *const context, int num, enum MqErrorE code, MQ_CST const message) |
| set the value of the MqErrorS object | |
| MQ_EXTERN void | MqErrorLog (struct MqS const *const context, MQ_CST const prefix) |
| log the MqErrorS for debugging | |
| MQ_EXTERN enum MqErrorE | MqErrorCopy (struct MqS *const out, struct MqS *const in) |
| copy a MqErrorS from in to out | |
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.
| #define MQ_ERROR_IGNORE ((struct MqS*)0x1) |
ignore error and do not generate any error-text (don't fill the error object)
This item is used as special meaning for the struct MqErrorS argument of error-functions
Definition at line 2620 of file msgque.h.
Referenced by GenericDelete(), MqErrorSAppendV(), MqErrorSGenV(), MqErrorSGenVL(), MqPanicV(), MqPanicVL(), pIoDelete(), sSysMqErrorMsg(), and SysSocketPair().
| #define MQ_ERROR_IS_POINTER | ( | e | ) | (e>MQ_ERROR_PRINT) |
Definition at line 2628 of file msgque.h.
Referenced by MqDLogX(), MqErrorSGenV(), MqErrorStackP(), pErrorReport(), pMqShutdown(), and sLogVL().
| #define MQ_ERROR_PANIC ((struct MqS*)NULL) |
panic on error
This item is used as special meaning for the struct MqErrorS argument of error-functions
Definition at line 2614 of file msgque.h.
Referenced by _pBufferNewSize(), GenericCreate(), MqBufferAppendVL(), MqBufferCreate(), MqBufferLAppendC(), MqBufferLAppendD(), MqBufferLAppendF(), MqBufferLAppendI(), MqBufferLAppendO(), MqBufferLAppendS(), MqBufferLAppendW(), MqBufferLAppendY(), MqBufferLCreate(), MqContextCreate(), MqErrorSGenVL(), MqLinkCreate(), MqPanicVL(), MqSlaveWorker(), pBufferCreateRef(), pCacheCreate(), pCachePush(), pErrorSetup(), pEventAdd(), pIoCreate(), pIoStartServer(), PipeCreate(), pLogBDY(), pReadCreate(), pReadHDR(), pSlaveChildCreate(), pSlaveCreate(), pTokenCreate(), pTransCreate(), pTransItemCreate(), sBufferLNewSize(), sEventAlloc(), sEventCreate(), sIoFillArgvC(), sTokenSpaceAdd(), sTokenSpaceCreate(), SysServerThread(), TcpCreate(), and UdsCreate().
| #define MQ_ERROR_PRINT ((struct MqS*)0x2) |
print error to stderr
This item is used as special meaning for the struct MqErrorS argument of error-functions
Definition at line 2626 of file msgque.h.
Referenced by MqErrorSGenVL().
| #define MqErrorCheck | ( | PROC | ) | if (MqErrorCheckI(PROC)) goto error |
version of MqErrorCheckI
Definition at line 2836 of file msgque.h.
Referenced by GenericBind(), GenericConnect(), GenericCreateSocket(), GenericServer(), MqBufferCastTo(), MqBufferLCheckOptionC(), MqConfigSetDaemon(), MqDefaultLinkCreate(), MqLinkCreate(), MqProcessEvent(), MqReadC(), MqReadL(), MqReadL_START(), MqReadProxy(), MqSendEND_AND_WAIT(), MqSendERROR(), MqSendRETURN(), MqSetupDup(), MqSlaveWorker(), pCallFactory(), pEventCreate(), pIoConnect(), pIoCreate(), pIoEventAdd(), pIoStartServer(), PipeCreate(), pRead_RET_START(), pReadHDR(), pTokenAddHdl(), pTokenCheckSystem(), pTransSetResult(), pUSleep(), sBufferLCheckOptionA(), sDefaultFactory(), sLogDynItem(), sMqCheckArg(), sMqEventStart(), sReadA1(), sReadA2(), sReadA4(), sReadA8(), sSysServerThreadCreate(), sTcpCreateAddrInfo(), SysDaemonize(), SysServerFork(), SysSocketPair(), TcpConnect(), TcpCreate(), UdsConnect(), UdsCreate(), and UdsServer().
| #define MqErrorCheck1 | ( | PROC | ) | if (MqErrorCheckI(PROC)) goto error1 |
check on error and goto label error1
Definition at line 2846 of file msgque.h.
Referenced by MqSlaveWorker(), pTokenCheckSystem(), pTransSetResult(), and SysServerFork().
| #define MqErrorCheck2 | ( | PROC, | |||
| JUMP | ) | if (MqErrorCheckI(PROC)) goto JUMP |
| #define MqErrorCheckI | ( | PROC | ) | (unlikely((PROC) >= MQ_ERROR)) |
check on error
Definition at line 2834 of file msgque.h.
Referenced by MqErrorStackP(), MqLinkCreate(), MqReadProxy(), pSlaveCreate(), and pTokenCheckSystem().
| #define MqErrorReturn | ( | PROC | ) |
Value:
switch (PROC) {\ case MQ_OK: return MQ_OK; case MQ_CONTINUE: return MQ_CONTINUE; case MQ_EXIT: case MQ_ERROR: return MqErrorStack (MQ_CONTEXT_S);\ }; return MQ_OK;
Definition at line 2842 of file msgque.h.
Referenced by MqSendEND_AND_CALLBACK(), MqSendEOF(), MqSendFTR(), pIoRead(), pIoSelect(), pIoSend(), pMqSendEND(), and pSendSYSTEM_RETR().
| #define MqErrorSAppendC | ( | error, | |||
| str | ) | MqErrorSAppendV(error,"%s",str); |
| #define MqErrorStack | ( | error | ) | MqErrorStackP(error, __func__, __FILE__) |
convenience wrapper for MqErrorStackP
Definition at line 2767 of file msgque.h.
Referenced by GenericBind(), GenericConnect(), GenericCreateSocket(), GenericServer(), MqBufferCastTo(), MqBufferLCheckOptionC(), MqConfigSetDaemon(), MqDefaultLinkCreate(), MqLinkCreate(), MqProcessEvent(), MqReadC(), MqReadL(), MqReadL_START(), MqSendEND_AND_WAIT(), MqSendERROR(), MqSendRETURN(), MqSetupDup(), MqSlaveWorker(), pEventCreate(), pEventStart(), pIoConnect(), pIoCreate(), pIoEventAdd(), pIoStartServer(), PipeCreate(), pRead_RET_START(), pReadHDR(), pSlaveCreate(), pTokenAddHdl(), pTokenCheckSystem(), pTransSetResult(), pUSleep(), pWaitForToken(), pWaitOnEvent(), sBufferLCheckOptionA(), sMqCheckArg(), sMqEventStart(), sReadA1(), sReadA2(), sReadA4(), sReadA8(), sReadFIX(), sTcpCreateAddrInfo(), SysDaemonize(), SysRecv(), SysSend(), SysSocketPair(), TcpConnect(), TcpCreate(), TcpServer(), UdsConnect(), UdsCreate(), and UdsServer().
| #define MqErrorSwitch | ( | PROC | ) |
Value:
switch (PROC) {\ case MQ_OK: break; case MQ_ERROR: goto error; case MQ_EXIT: return MQ_EXIT; case MQ_CONTINUE: return MQ_CONTINUE;\ }
Definition at line 2838 of file msgque.h.
Referenced by pReadHDR(), pWaitForToken(), and sReadFIX().
| #define MqErrorV | ( | error, | |||
| prefix, | |||||
| errnum, | |||||
| format, | |||||
| ... | ) | MqErrorSGenV(error,prefix,MQ_ERROR,errnum,format, __VA_ARGS__) |
customized edition of MqErrorSGenV
Definition at line 2732 of file msgque.h.
Referenced by MqBufferLDeleteItem(), MqBufferLGetU(), MqSendEND_AND_WAIT(), pReadHDR(), pTokenAddHdl(), pTokenCheckSystem(), pTokenInvoke(), pTransSetResult(), sReadFIX(), sSysMqErrorMsg(), sTokenSpaceDelItem(), SysGetAddrInfo(), SysGetEnv(), SysInetAton(), SysUnLink(), and SysUnlink().
| #define MqPanicC | ( | context, | |||
| prefix, | |||||
| errnum, | |||||
| string | ) | MqPanicV(context,prefix,errnum,"%s",string); |
do a panic with string as argument
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment | |
| errnum | the error number | |
| string | the string to be displayed |
Definition at line 2665 of file msgque.h.
Referenced by MqSendEND_AND_WAIT(), sEventCreate(), and sLogDynItem().
| #define MqPanicSYS | ( | context | ) |
Value:
MqPanicV(context,__func__,-1,\ "internal ERROR in function '%s', please contact your local support", __func__);
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 2670 of file msgque.h.
Referenced by MqExit(), MqSendRETURN(), MqSendU(), and pEventStart().
| enum MqErrorE |
| MQ_EXTERN enum MqErrorE MqErrorC | ( | struct MqS *const | context, | |
| MQ_CST const | prefix, | |||
| MQ_INT const | errnum, | |||
| MQ_CST const | message | |||
| ) |
customized edition of MqErrorSGenV
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment | |
| errnum | the error number | |
| [in] | message | string message to set |
Definition at line 191 of file error.c.
References MQ_ERROR, and MqErrorSGenV().
Referenced by MqConfigSetIoUds(), MqSendEND_AND_WAIT(), MqSysCalloc(), MqSysMalloc(), and MqSysRealloc().

copy a MqErrorS from in to out
| out | the MqS::error object created by MqLinkCreate | |
| in | the MqS::error object created by MqLinkCreate |
Definition at line 376 of file error.c.
References MqErrorS::code, MqS::error, MQ_OK, MqErrorReset(), and pErrorSync().
Referenced by MqExit(), MqLinkCreate(), MqPanicVL(), MqReadProxy(), MqSlaveWorker(), pCallFactory(), pEventStart(), pSlaveCreate(), pTokenCheckSystem(), sDefaultFactory(), and sMqEventStart().

return the value of MqErrorS code member
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 273 of file error.c.
References MqErrorS::code, and MqS::error.
Referenced by MqCheckForLeftOverArguments(), MqLinkCreate(), MqReadProxy(), MqSendRETURN(), pCallFactory(), pEventStart(), and sDefaultFactory().

brint an error to stderr and clear the error after
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 311 of file error.c.
References MqS::error, and MqErrorS::num.
Referenced by MqExit(), MqSendERROR(), and MqSendRETURN().

return the value of MqErrorS text member
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 290 of file error.c.
References MqBufferS::data, MqS::error, and MqErrorS::text.
Referenced by MqSendERROR(), and MqSendRETURN().

log the MqErrorS for debugging
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment |
| MQ_EXTERN void MqErrorPrint | ( | struct MqS *const | context | ) |
return the value of MqErrorS num member
Definition at line 319 of file error.c.
References MqBufferS::data, MqS::error, MqErrorReset(), and MqErrorS::text.
| MQ_EXTERN void MqErrorReset | ( | struct MqS *const | context | ) |
reset a MqErrorS object, change error code to MQ_OK
| [in] | context | the initial MqS object created by MqContextCreate |
Definition at line 298 of file error.c.
References MqErrorS::append, MqErrorS::code, MqS::error, MQ_OK, MQ_YES, MqBufferReset(), MqErrorS::num, and MqErrorS::text.
Referenced by MqErrorCopy(), MqErrorPrint(), MqLinkCreate(), MqSendERROR(), MqSendRETURN(), MqSlaveDelete(), pErrorReport(), pMqShutdown(), pSlaveBqError(), pTokenInvoke(), and sEventAlloc().

append a vararg string to a MqErrorS
| [in] | context | the initial MqS object created by MqContextCreate |
| fmt | a printf like format string |
Definition at line 223 of file error.c.
References MqErrorS::append, MqErrorS::code, MqS::config, MqS::error, MqConfigS::master, MQ_ERROR, MQ_ERROR_IGNORE, MQ_IS_CHILD, MQ_IS_SERVER, MqBufferAppendV(), MqBufferAppendVL(), MqDLogEVL(), MqLog(), MqConfigS::name, and MqErrorS::text.
Referenced by MqCheckForLeftOverArguments(), MqErrorStackP(), MqPanicVL(), and pReadHDR().

| MQ_EXTERN enum MqErrorE MqErrorSet | ( | struct MqS *const | context, | |
| int | num, | |||
| enum MqErrorE | code, | |||
| MQ_CST const | message | |||
| ) |
set the value of the MqErrorS object
| [in] | context | the initial MqS object created by MqContextCreate |
| [in] | num | the error number to set |
| [in] | code | the error code to set |
| [in] | message | the error message to set |
Definition at line 330 of file error.c.
References MqErrorS::append, MqErrorS::code, MqS::config, MqS::error, MqConfigS::master, MQ_YES, MqBufferSetC(), MqErrorS::num, pErrorSync(), and MqErrorS::text.
Referenced by pTokenCheckSystem().

set the value of MqErrorS code member
| [in] | context | the initial MqS object created by MqContextCreate |
| code | the code to set for error |
Definition at line 281 of file error.c.
References MqErrorS::code, and MqS::error.
| MQ_EXTERN enum MqErrorE MqErrorSGenV | ( | struct MqS *const | context, | |
| MQ_CST const | prefix, | |||
| enum MqErrorE const | errorcode, | |||
| MQ_INT const | errnum, | |||
| MQ_CST const | fmt, | |||
| ... | ||||
| ) |
set a error-code in MqErrorS with vararg string argument
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment | |
| errorcode | identify the code | |
| errnum | the error number | |
| fmt | a printf like format string |
Definition at line 171 of file error.c.
References MqErrorS::code, MqS::error, MQ_ERROR_IGNORE, MQ_ERROR_IS_POINTER, MQ_EXIT, and MqErrorSGenVL().
Referenced by MqErrorC(), and pErrorSetEXIT().

| MQ_EXTERN enum MqErrorE MqErrorSGenVL | ( | struct MqS *const | context, | |
| MQ_CST const | prefix, | |||
| enum MqErrorE const | errorcode, | |||
| MQ_INT const | errnum, | |||
| MQ_CST const | fmt, | |||
| va_list | var_list | |||
| ) |
set an error-code in MqErrorS with vararg list argument
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment | |
| errorcode | identify the code | |
| errnum | the error number | |
| fmt | a printf like format string | |
| var_list | a variable argument list object |
Definition at line 124 of file error.c.
References MqErrorS::code, MqS::config, MqBufferS::data, MqS::error, MqConfigS::master, MQ_ERROR, MQ_ERROR_IGNORE, MQ_ERROR_PANIC, MQ_ERROR_PRINT, MQ_FORMAT_I, MQ_IS_CHILD, MQ_IS_SERVER, MqBufferAppendV(), MqBufferAppendVL(), MqBufferCreate(), MqBufferDelete(), MqBufferReset(), MqBufferSetV(), MqDLogEVL(), MqPanicVL(), MqConfigS::name, MqErrorS::num, pErrorSync(), and MqErrorS::text.
Referenced by MqErrorSGenV(), and MqPanicVL().

| MQ_EXTERN enum MqErrorE MqErrorStackP | ( | struct MqS *const | context, | |
| MQ_CST const | func, | |||
| MQ_CST const | file | |||
| ) |
append a function and filename to the error-buffer
| [in] | context | the initial MqS object created by MqContextCreate |
| func | the name of the function to display (e.g. __func__) | |
| file | the name of the file to display (e.g. __FILE__) |
Definition at line 203 of file error.c.
References MqErrorS::code, MqS::error, MQ_ERROR, MQ_ERROR_IS_POINTER, MQ_YES, MqDLogX(), MqErrorCheckI, MqErrorSAppendV(), MqLogErrorCode(), and MqSysBasename().
| MQ_EXTERN void MqPanicV | ( | struct MqS *const | context, | |
| MQ_CST const | prefix, | |||
| MQ_INT const | errnum, | |||
| MQ_CST const | fmt, | |||
| ... | ||||
| ) |
do a panic with vararg arguments
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment | |
| errnum | the error number | |
| fmt | a printf like format string |
Definition at line 84 of file error.c.
References MQ_ERROR_IGNORE, and MqPanicVL().
Referenced by MqBufferAppendVL().

| MQ_EXTERN void MqPanicVL | ( | struct MqS *const | context, | |
| MQ_CST const | prefix, | |||
| MQ_INT const | errnum, | |||
| MQ_CST const | fmt, | |||
| va_list | var_list | |||
| ) |
do a panic with a vararg argument list
| [in] | context | the initial MqS object created by MqContextCreate |
| prefix | used to identify the calling function (e.g. __func__) or the environment | |
| errnum | the error number | |
| fmt | a printf like format string | |
| var_list | a variable argument list object |
Definition at line 58 of file error.c.
References MqBufferU::C, MqBufferS::cur, MQ_ERROR, MQ_ERROR_IGNORE, MQ_ERROR_PANIC, MqBufferCreate(), MqBufferDelete(), MqBufferSetV(), MqDLogEVL(), MqErrorCopy(), MqErrorSAppendV(), MqErrorSGenVL(), MqExit(), pErrorReport(), pMqGetFirstParent(), and SysAbort().
Referenced by MqErrorSGenVL(), and MqPanicV().

1.5.8