28 #ifndef __RTXERROR_H__ 29 #define __RTXERROR_H__ 39 #if !defined(_DLL) && !defined(_MT) && !defined(_WIN32_WCE) 45 #if defined(_WIN32) || defined(_WIN64) 46 #define ERRNO WSAGetLastError() 47 #elif !defined (_WIN32_WCE) 79 #define LOG_RTERR(pctxt,stat) \ 80 rtxErrSetData(pctxt,stat,__FILE__,__LINE__) 82 #define LOG_RTERRNEW(pctxt,stat) \ 83 rtxErrSetNewData(pctxt,stat,__FILE__,__LINE__) 86 #define LOG_RTERR(pctxt,stat) \ 87 rtxErrSetData(pctxt,stat,__MODULE__,__LINE__) 89 #define LOG_RTERRNEW(pctxt,stat) \ 90 rtxErrSetNewData(pctxt,stat,__MODULE__,__LINE__) 93 #define RETURN_RTERR(pctxt, stat) \ 94 return LOG_RTERR(pctxt, stat) 104 #define OSRTASSERT(condition) \ 105 if (!(condition)) { rtxErrAssertionFailed(#condition,__LINE__,__FILE__); } 113 #define OSRTCHECKPARAM(condition) if (condition) { } 115 #define LOG_RTERR(pctxt,stat) \ 116 rtxErrSetData(pctxt,stat,0,0) 118 #define LOG_RTERRNEW(pctxt,stat) \ 119 rtxErrSetNewData(pctxt,stat,0,0) 121 #define RETURN_RTERR(pctxt, stat) return stat 123 #define OSRTASSERT(condition) 124 #define OSRTCHECKPARAM(condition) 127 #define LOG_RTERR1(pctxt,stat,a) \ 128 (a,LOG_RTERR (pctxt, stat),stat) 130 #define LOG_RTERRNEW1(pctxt,stat,a) \ 131 (a,LOG_RTERRNEW (pctxt, stat),stat) 133 #define LOG_RTERR2(pctxt,stat,a,b) \ 134 (a,b,LOG_RTERR (pctxt, stat),stat) 136 #define LOG_RTERRNEW2(pctxt,stat,a,b) \ 137 (a,b,LOG_RTERRNEW (pctxt, stat),stat) 149 #define LOG_RTERR_AND_FREE_MEM(ctxt_p,stat,mem_p) \ 150 rtxMemFreePtr ((ctxt_p),(mem_p)), LOG_RTERR(ctxt_p, stat) 152 typedef int (*OSErrCbFunc) (
const char* ptext,
void* cbArg_p);
189 #if !defined(_ARMTCC) && !defined(__SYMBIAN32__) 190 (
const char*
const* ppStatusText, OSINT32 minErrCode, OSINT32 maxErrCode);
221 #if !defined(_NO_INT64_SUPPORT) 274 (
OSCTXT* pctxt,
const char* pErrParm, OSSIZE nchars);
287 #if !defined(_NO_INT64_SUPPORT) 311 (
const char* conditionText,
int lineNo,
const char* fileName);
323 (
OSRTErrInfo* pErrInfo,
char* bufp, OSSIZE bufsiz);
490 const char* module,
int lineno);
504 const char* module,
int lineno);
EXTERNRT void rtxErrLogUsingCB(OSCTXT *pctxt, OSErrCbFunc cb, void *cbArg_p)
This function allows error information to be logged using a user-defined callback routine...
EXTERNRT void rtxErrPrintElement(OSRTErrInfo *pErrInfo)
This function is used to print the error information stored in the error information element to the s...
EXTERNRT int rtxErrCopy(OSCTXT *pDestCtxt, const OSCTXT *pSrcCtxt)
This function copies error information from one context into another.
EXTERNRT OSSIZE rtxErrGetErrorCnt(const OSCTXT *pctxt)
This function returns the total number of error records, including non-fatal errors.
EXTERNRT int rtxErrGetFirstError(const OSCTXT *pctxt)
This function returns the error code, stored in the first error record.
EXTERNRT OSBOOL rtxErrAddInt64Parm(OSCTXT *pctxt, OSINT64 errParm)
This function adds a 64-bit integer parameter to an error information structure.
EXTERNRT int rtxErrInvUIntOpt(OSCTXT *pctxt, OSUINT32 ident)
This function create an 'invalid option' error (RTERR_INVOPT) in the context using an unsigned intege...
EXTERNRT int rtxErrResetLastErrors(OSCTXT *pctxt, OSSIZE errorsToReset)
This function resets last 'errorsToReset` errors in the context.
EXTERNRT int rtxErrSetNewData(OSCTXT *pctxt, int status, const char *module, int lineno)
This function is used to record an error in the context structure.
EXTERNRT char * rtxErrGetTextBuf(OSCTXT *pctxt, char *pbuf, OSSIZE bufsiz)
This function returns error text in the given fixed-size memory buffer.
Common run-time context definitions.
EXTERNRT OSBOOL rtxErrAddCtxtBufParm(OSCTXT *pctxt)
This function adds the contents of the context buffer to the error information structure in the conte...
EXTERNRT char * rtxErrGetMsgTextBuf(OSCTXT *pctxt, char *pbuf, OSSIZE bufsiz)
This function returns error message text in a static memory buffer.
EXTERNRT int rtxErrCheckNonFatal(OSCTXT *pctxt)
This function checks the context structure for non-fatal errors.
EXTERNRT OSRTErrInfo * rtxErrNewNode(OSCTXT *pctxt)
This function creates a new empty error record for the passed context.
EXTERNRT void rtxErrFreeParms(OSCTXT *pctxt)
This function is used to free dynamic memory that was used in the recording of error parameters...
EXTERNRT OSBOOL rtxErrAddSizeParm(OSCTXT *pctxt, OSSIZE errParm)
This function adds a size-typed parameter to an error information structure.
EXTERNRT OSBOOL rtxErrAddUIntParm(OSCTXT *pctxt, unsigned int errParm)
This function adds an unsigned integer parameter to an error information structure.
EXTERNRT char * rtxErrGetText(OSCTXT *pctxt, char *pBuf, OSSIZE *pBufSize)
This function returns error text in a memory buffer.
EXTERNRT OSBOOL rtxErrAddErrorTableEntry(const char *const *ppStatusText, OSINT32 minErrCode, OSINT32 maxErrCode)
This function adds a set of error codes to the global error table.
EXTERNRT void rtxErrSetNonFatal(OSCTXT *pctxt)
This marks the last error recorded in the context as non-fatal.
EXTERNRT void rtxErrAssertionFailed(const char *conditionText, int lineNo, const char *fileName)
This function is used to record an assertion failure.
EXTERNRT OSBOOL rtxErrAddUInt64Parm(OSCTXT *pctxt, OSUINT64 errParm)
This function adds an unsigned 64-bit integer parameter to an error information structure.
EXTERNRT OSBOOL rtxErrAddStrParm(OSCTXT *pctxt, const char *pErrParm)
This function adds a character string parameter to an error information structure.
EXTERNRT int rtxErrGetStatus(const OSCTXT *pctxt)
This function returns the status value from the context.
EXTERNRT int rtxErrResetErrInfo(OSCTXT *pctxt)
This function is used to reset the error state recorded in the context to successful.
EXTERNRT OSBOOL rtxErrAddStrnParm(OSCTXT *pctxt, const char *pErrParm, OSSIZE nchars)
This function adds a given number of characters from a character string parameter to an error informa...
EXTERNRT int rtxErrReset(OSCTXT *pctxt)
This function is used to reset the error state recorded in the context to successful.
Run-time error information structure.
List of numeric status codes that can be returned by common run-time functions and generated code...
EXTERNRT int rtxErrAppend(OSCTXT *pDestCtxt, const OSCTXT *pSrcCtxt)
This function appends error information from one context into another.
EXTERNRT void rtxErrInit(OSVOIDARG)
This function is a one-time initialization function that must be called before any other error proces...
EXTERNRT OSBOOL rtxErrAddIntParm(OSCTXT *pctxt, int errParm)
This function adds an integer parameter to an error information structure.
EXTERNRT OSBOOL rtxErrAddElemNameParm(OSCTXT *pctxt)
This function adds an element name parameter to the context error information structure.
Run-time context structure.
EXTERNRT int rtxErrSetData(OSCTXT *pctxt, int status, const char *module, int lineno)
This function is used to record an error in the context structure.
EXTERNRT char * rtxErrGetMsgText(OSCTXT *pctxt)
This function returns error message text in a memory buffer.
EXTERNRT int rtxErrGetLastError(const OSCTXT *pctxt)
This function returns the error code, stored in the last error record.
EXTERNRT OSBOOL rtxErrAddDoubleParm(OSCTXT *pctxt, double errParm)
This function adds a double parameter to an error information structure.
EXTERNRT const char * rtxErrFmtMsg(OSRTErrInfo *pErrInfo, char *bufp, OSSIZE bufsiz)
This function formats a given error structure from the context into a finished status message includi...
EXTERNRT void rtxErrPrint(OSCTXT *pctxt)
This function is used to print the error information stored in the context to the standard output dev...