XBinder  Version 2.6.x
Macros | Functions
rtxError.h File Reference

Error handling function and macro definitions. More...

#include "rtxsrc/rtxContext.h"
#include "rtxsrc/rtxErrCodes.h"
#include <errno.h>

Go to the source code of this file.

Macros

#define LOG_RTERR(pctxt, stat)   rtxErrSetData(pctxt,stat,__FILE__,__LINE__)
 This macro is used to log a run-time error in the context. More...
 
#define OSRTASSERT(condition)   if (!(condition)) { rtxErrAssertionFailed(#condition,__LINE__,__FILE__); }
 This macro is used to check an assertion. More...
 
#define OSRTCHECKPARAM(condition)   if (condition) { /* do nothing */ }
 This macro check a condition but takes no action. More...
 
#define LOG_RTERR_AND_FREE_MEM(ctxt_p, stat, mem_p)   rtxMemFreePtr ((ctxt_p),(mem_p)), LOG_RTERR(ctxt_p, stat)
 This logs an error to a global context and frees a memory pointer allocated for encoding or decoding. More...
 

Functions

EXTERNRT OSBOOL rtxErrAddCtxtBufParm (OSCTXT *pctxt)
 This function adds the contents of the context buffer to the error information structure in the context. More...
 
EXTERNRT OSBOOL rtxErrAddDoubleParm (OSCTXT *pctxt, double errParm)
 This function adds a double parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddErrorTableEntry (const char *const *ppStatusText, OSINT32 minErrCode, OSINT32 maxErrCode)
 This function adds a set of error codes to the global error table. More...
 
EXTERNRT OSBOOL rtxErrAddElemNameParm (OSCTXT *pctxt)
 This function adds an element name parameter to the context error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddIntParm (OSCTXT *pctxt, int errParm)
 This function adds an integer parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddInt64Parm (OSCTXT *pctxt, OSINT64 errParm)
 This function adds a 64-bit integer parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddSizeParm (OSCTXT *pctxt, OSSIZE errParm)
 This function adds a size-typed parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddStrParm (OSCTXT *pctxt, const char *pErrParm)
 This function adds a character string parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddStrnParm (OSCTXT *pctxt, const char *pErrParm, size_t nchars)
 This function adds a given number of characters from a character string parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddUIntParm (OSCTXT *pctxt, unsigned int errParm)
 This function adds an unsigned integer parameter to an error information structure. More...
 
EXTERNRT OSBOOL rtxErrAddUInt64Parm (OSCTXT *pctxt, OSUINT64 errParm)
 This function adds an unsigned 64-bit integer parameter to an error information structure. More...
 
EXTERNRT void rtxErrAssertionFailed (const char *conditionText, int lineNo, const char *fileName)
 This function is used to record an assertion failure. More...
 
EXTERNRT const char * rtxErrFmtMsg (OSRTErrInfo *pErrInfo, char *bufp, size_t bufsiz)
 This function formats a given error structure from the context into a finished status message including substituted parameters. More...
 
EXTERNRT void rtxErrFreeParms (OSCTXT *pctxt)
 This function is used to free dynamic memory that was used in the recording of error parameters. More...
 
EXTERNRT char * rtxErrGetText (OSCTXT *pctxt, char *pBuf, size_t *pBufSize)
 This function returns error text in a memory buffer. More...
 
EXTERNRT char * rtxErrGetTextBuf (OSCTXT *pctxt, char *pbuf, size_t bufsiz)
 This function returns error text in the given fixed-size memory buffer. More...
 
EXTERNRT char * rtxErrGetMsgText (OSCTXT *pctxt)
 This function returns error message text in a memory buffer. More...
 
EXTERNRT char * rtxErrGetMsgTextBuf (OSCTXT *pctxt, char *pbuf, size_t bufsiz)
 This function returns error message text in a static memory buffer. More...
 
EXTERNRT OSRTErrInfortxErrNewNode (OSCTXT *pctxt)
 This function creates a new empty error record for the passed context. More...
 
EXTERNRT void rtxErrInit (OSVOIDARG)
 This function is a one-time initialization function that must be called before any other error processing functions can be called. More...
 
EXTERNRT int rtxErrReset (OSCTXT *pctxt)
 This function is used to reset the error state recorded in the context to successful. More...
 
EXTERNRT void rtxErrLogUsingCB (OSCTXT *pctxt, OSErrCbFunc cb, void *cbArg_p)
 This function allows error information to be logged using a user-defined callback routine. More...
 
EXTERNRT void rtxErrPrint (OSCTXT *pctxt)
 This function is used to print the error information stored in the context to the standard output device. More...
 
EXTERNRT void rtxErrPrintElement (OSRTErrInfo *pErrInfo)
 This function is used to print the error information stored in the error information element to the standard output device. More...
 
EXTERNRT int rtxErrSetData (OSCTXT *pctxt, int status, const char *module, int lineno)
 This function is used to record an error in the context structure. More...
 
EXTERNRT int rtxErrSetNewData (OSCTXT *pctxt, int status, const char *module, int lineno)
 This function is used to record an error in the context structure. More...
 
EXTERNRT int rtxErrGetFirstError (const OSCTXT *pctxt)
 This function returns the error code, stored in the first error record. More...
 
EXTERNRT int rtxErrGetLastError (const OSCTXT *pctxt)
 This function returns the error code, stored in the last error record. More...
 
EXTERNRT OSSIZE rtxErrGetErrorCnt (const OSCTXT *pctxt)
 This function returns the total number of error records. More...
 
EXTERNRT int rtxErrGetStatus (const OSCTXT *pctxt)
 This function returns the status value from the context. More...
 
EXTERNRT int rtxErrResetLastErrors (OSCTXT *pctxt, OSSIZE errorsToReset)
 This function resets last 'errorsToReset` errors in the context. More...
 
EXTERNRT int rtxErrCopy (OSCTXT *pDestCtxt, const OSCTXT *pSrcCtxt)
 This function copies error information from one context into another. More...
 
EXTERNRT int rtxErrAppend (OSCTXT *pDestCtxt, const OSCTXT *pSrcCtxt)
 This function appends error information from one context into another. More...
 
EXTERNRT int rtxErrInvUIntOpt (OSCTXT *pctxt, OSUINT32 ident)
 This function create an 'invalid option' error (RTERR_INVOPT) in the context using an unsigned integer parameter. More...
 

Detailed Description

Error handling function and macro definitions.

Definition in file rtxError.h.