Home > Support > Documentation

rtxError.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2008 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 
00082 #define OSRTASSERT(condition) \
00083 if (!(condition)) { rtxErrAssertionFailed(#condition,__LINE__,__FILE__); }
00084 
00091 #define OSRTCHECKPARAM(condition) if (condition) { /* do nothing */ }
00092 #else
00093 #define LOG_RTERR(pctxt,stat) \
00094 rtxErrSetData(pctxt,stat,0,0)
00095 
00096 #define LOG_RTERRNEW(pctxt,stat) \
00097 rtxErrSetNewData(pctxt,stat,0,0)
00098 
00099 #define OSRTASSERT(condition)
00100 #define OSRTCHECKPARAM(condition)
00101 #endif /* _COMPACT */
00102 
00103 #define LOG_RTERR1(pctxt,stat,a) \
00104 (a,LOG_RTERR (pctxt, stat),stat)
00105 
00106 #define LOG_RTERRNEW1(pctxt,stat,a) \
00107 (a,LOG_RTERRNEW (pctxt, stat),stat)
00108 
00109 #define LOG_RTERR2(pctxt,stat,a,b) \
00110 (a,b,LOG_RTERR (pctxt, stat),stat)
00111 
00112 #define LOG_RTERRNEW2(pctxt,stat,a,b) \
00113 (a,b,LOG_RTERRNEW (pctxt, stat),stat)
00114 
00115 
00116 typedef int (*OSErrCbFunc) (const char* ptext, void* cbArg_p);
00117 
00127 EXTERNRT OSBOOL rtxErrAddCtxtBufParm (OSCTXT* pctxt);
00128 
00138 EXTERNRT OSBOOL rtxErrAddDoubleParm (OSCTXT* pctxt, double errParm);
00139 
00152 EXTERNRT OSBOOL rtxErrAddErrorTableEntry 
00153 (const char** ppStatusText, OSINT32 minErrCode, OSINT32 maxErrCode);
00154 
00167 EXTERNRT OSBOOL rtxErrAddIntParm (OSCTXT* pctxt, int errParm);
00168 
00169 #if !defined(_NO_INT64_SUPPORT)
00170 
00183 EXTERNRT OSBOOL rtxErrAddInt64Parm (OSCTXT* pctxt, OSINT64 errParm);
00184 #endif /* !defined(_NO_INT64_SUPPORT) */
00185 
00195 EXTERNRT OSBOOL rtxErrAddStrParm (OSCTXT* pctxt, const char* pErrParm);
00196 
00207 EXTERNRT OSBOOL rtxErrAddStrnParm 
00208    (OSCTXT* pctxt, const char* pErrParm, size_t nchars);
00209 
00219 EXTERNRT OSBOOL rtxErrAddUniStrParm (OSCTXT* pctxt, 
00220                                       const OSUNICHAR* pErrParm);
00221 
00231 EXTERNRT OSBOOL rtxErrAddUIntParm (OSCTXT* pctxt, unsigned int errParm);
00232 
00233 #if !defined(_NO_INT64_SUPPORT)
00234 
00243 EXTERNRT OSBOOL rtxErrAddUInt64Parm (OSCTXT* pctxt, OSUINT64 errParm);
00244 #endif /* !defined(_NO_INT64_SUPPORT) */
00245 
00256 EXTERNRT void rtxErrAssertionFailed (const char* conditionText, 
00257                                       int lineNo, const char* fileName);
00258 
00266 EXTERNRT void rtxErrFreeParms (OSCTXT* pctxt);
00267 
00287 EXTERNRT char* rtxErrGetText (OSCTXT* pctxt, char* pBuf, size_t* pBufSize);
00288 
00298 EXTERNRT char* rtxErrGetTextBuf (OSCTXT* pctxt, char* pbuf, size_t bufsiz);
00299 
00309 EXTERNRT OSRTErrInfo* rtxErrNewNode (OSCTXT* pctxt);
00310 
00317 EXTERNRT void rtxErrInit ();
00318 
00326 EXTERNRT int rtxErrReset (OSCTXT* pctxt);
00327 
00345 EXTERNRT void rtxErrLogUsingCB (OSCTXT* pctxt, OSErrCbFunc cb, void* cbArg_p);
00346 
00354 EXTERNRT void rtxErrPrint (OSCTXT* pctxt);
00355 
00363 EXTERNRT void rtxErrPrintElement (OSRTErrInfo* pErrInfo);
00364 
00376 EXTERNRT int rtxErrSetData (OSCTXT* pctxt, int status, 
00377                              const char* module, int lineno);
00378 
00390 EXTERNRT int rtxErrSetNewData (OSCTXT* pctxt, int status,
00391                                 const char* module, int lineno);
00398 EXTERNRT int rtxErrGetFirstError (const OSCTXT* pctxt);
00399 
00406 EXTERNRT int rtxErrGetLastError (const OSCTXT* pctxt);
00407 
00414 EXTERNRT OSUINT32 rtxErrGetErrorCnt (const OSCTXT* pctxt);
00415 
00426 EXTERNRT int rtxErrGetStatus (const OSCTXT* pctxt);
00427 
00438 EXTERNRT int rtxErrResetLastErrors (OSCTXT* pctxt, int errorsToReset);
00439 
00444 #ifdef __cplusplus
00445 }
00446 #endif
00447 
00448 #endif