Home > Support > Documentation

rtxError.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2007 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00028 #ifndef __RTXERROR_H__
00029 #define __RTXERROR_H__
00030 
00031 #include "rtxsrc/rtxContext.h"
00032 #include "rtxsrc/rtxErrCodes.h"
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 /* Error handling */
00039 
00057 #ifndef _COMPACT
00058 
00059 #ifndef __MODULE__
00060 #define LOG_RTERR(pctxt,stat) \
00061 rtxErrSetData(pctxt,stat,__FILE__,__LINE__)
00062 
00063 #define LOG_RTERRNEW(pctxt,stat) \
00064 rtxErrSetNewData(pctxt,stat,__FILE__,__LINE__)
00065 
00066 #else /* Should significantly decrease use of RAM in ARM systems */
00067 #define LOG_RTERR(pctxt,stat) \
00068 rtxErrSetData(pctxt,stat,__MODULE__,__LINE__)
00069 
00070 #define LOG_RTERRNEW(pctxt,stat) \
00071 rtxErrSetNewData(pctxt,stat,__MODULE__,__LINE__)
00072 #endif /* not defined __MODULE__ */
00073 
00083 #define OSRTASSERT(condition) \
00084 if (!(condition)) { rtxErrAssertionFailed(#condition,__LINE__,__FILE__); }
00085 #else
00086 #define LOG_RTERR(pctxt,stat) \
00087 rtxErrSetData(pctxt,stat,0,0)
00088 
00089 #define LOG_RTERRNEW(pctxt,stat) \
00090 rtxErrSetNewData(pctxt,stat,0,0)
00091 
00092 #define OSRTASSERT(condition)
00093 #endif /* _COMPACT */
00094 
00095 #define LOG_RTERR1(pctxt,stat,a) \
00096 (a,LOG_RTERR (pctxt, stat),stat)
00097 
00098 #define LOG_RTERRNEW1(pctxt,stat,a) \
00099 (a,LOG_RTERRNEW (pctxt, stat),stat)
00100 
00101 
00102 #define LOG_RTERR2(pctxt,stat,a,b) \
00103 (a,b,LOG_RTERR (pctxt, stat),stat)
00104 
00105 #define LOG_RTERRNEW2(pctxt,stat,a,b) \
00106 (a,b,LOG_RTERRNEW (pctxt, stat),stat)
00107 
00108 
00109 typedef int (*OSErrCbFunc) (const char* ptext, void* cbArg_p);
00110 
00120 EXTERNRTX OSBOOL rtxErrAddCtxtBufParm (OSCTXT* pctxt);
00121 
00131 EXTERNRTX OSBOOL rtxErrAddDoubleParm (OSCTXT* pctxt, double errParm);
00132 
00145 EXTERNRTX OSBOOL rtxErrAddErrorTableEntry 
00146 (const char** ppStatusText, OSINT32 minErrCode, OSINT32 maxErrCode);
00147 
00160 EXTERNRTX OSBOOL rtxErrAddIntParm (OSCTXT* pctxt, int errParm);
00161 
00162 #if !defined(_NO_INT64_SUPPORT)
00163 
00176 EXTERNRTX OSBOOL rtxErrAddInt64Parm (OSCTXT* pctxt, OSINT64 errParm);
00177 #endif /* !defined(_NO_INT64_SUPPORT) */
00178 
00188 EXTERNRTX OSBOOL rtxErrAddStrParm (OSCTXT* pctxt, const char* pErrParm);
00189 
00200 EXTERNRTX OSBOOL rtxErrAddStrnParm 
00201    (OSCTXT* pctxt, const char* pErrParm, size_t nchars);
00202 
00212 EXTERNRTX OSBOOL rtxErrAddUniStrParm (OSCTXT* pctxt, 
00213                                       const OSUNICHAR* pErrParm);
00214 
00224 EXTERNRTX OSBOOL rtxErrAddUIntParm (OSCTXT* pctxt, unsigned int errParm);
00225 
00226 #if !defined(_NO_INT64_SUPPORT)
00227 
00236 EXTERNRTX OSBOOL rtxErrAddUInt64Parm (OSCTXT* pctxt, OSUINT64 errParm);
00237 #endif /* !defined(_NO_INT64_SUPPORT) */
00238 
00249 EXTERNRTX void rtxErrAssertionFailed (const char* conditionText, 
00250                                       int lineNo, const char* fileName);
00251 
00259 EXTERNRTX void rtxErrFreeParms (OSCTXT* pctxt);
00260 
00280 EXTERNRTX char* rtxErrGetText (OSCTXT* pctxt, char* pBuf, size_t* pBufSize);
00281 
00291 EXTERNRTX OSRTErrInfo* rtxErrNewNode (OSCTXT* pctxt);
00292 
00299 EXTERNRTX void rtxErrInit ();
00300 
00308 EXTERNRTX int rtxErrReset (OSCTXT* pctxt);
00309 
00327 EXTERNRTX void rtxErrLogUsingCB (OSCTXT* pctxt, OSErrCbFunc cb, void* cbArg_p);
00328 
00336 EXTERNRTX void rtxErrPrint (OSCTXT* pctxt);
00337 
00345 EXTERNRTX void rtxErrPrintElement (OSRTErrInfo* pErrInfo);
00346 
00358 EXTERNRTX int rtxErrSetData (OSCTXT* pctxt, int status, 
00359                              const char* module, int lineno);
00360 
00372 EXTERNRTX int rtxErrSetNewData (OSCTXT* pctxt, int status,
00373                                 const char* module, int lineno);
00380 EXTERNRTX int rtxErrGetFirstError (const OSCTXT* pctxt);
00381 
00388 EXTERNRTX int rtxErrGetLastError (const OSCTXT* pctxt);
00389 
00396 EXTERNRTX OSUINT32 rtxErrGetErrorCnt (const OSCTXT* pctxt);
00397 
00408 EXTERNRTX int rtxErrGetStatus (const OSCTXT* pctxt);
00409 
00420 EXTERNRTX int rtxErrResetLastErrors (OSCTXT* pctxt, int errorsToReset);
00421 
00426 #ifdef __cplusplus
00427 }
00428 #endif
00429 
00430 #endif