Home > Support > Documentation

rtxDiag.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 _RTXDIAG_H_
00029 #define _RTXDIAG_H_
00030 
00031 #include <stdarg.h>
00032 #include "rtxsrc/rtxContext.h"
00033 #include "rtxsrc/rtxPrintToStream.h"
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 /* Diagnostic trace functions */
00052 #ifdef _TRACE
00053 #define RTDIAG1(pctxt,msg)              rtxDiagPrint(pctxt,msg)
00054 #define RTDIAG2(pctxt,msg,a)            rtxDiagPrint(pctxt,msg,a)
00055 #define RTDIAG3(pctxt,msg,a,b)          rtxDiagPrint(pctxt,msg,a,b)
00056 #define RTDIAG4(pctxt,msg,a,b,c)        rtxDiagPrint(pctxt,msg,a,b,c)
00057 #define RTDIAG5(pctxt,msg,a,b,c,d)      rtxDiagPrint(pctxt,msg,a,b,c,d)
00058 #define RTDIAGU(pctxt,ucstr)            rtxDiagPrintUCS(pctxt,ucstr)
00059 #define RTHEXDUMP(pctxt,buffer,numocts) rtxDiagHexDump(pctxt,buffer,numocts)
00060 #define RTDIAGCHARS(pctxt,buf,nchars)   rtxDiagPrintChars(pctxt,buf,nchars)
00061 #define RTDIAGSTRM2(pctxt,msg)          rtxDiagStream(pctxt,msg)
00062 #define RTDIAGSTRM3(pctxt,msg,a)        rtxDiagStream(pctxt,msg,a)
00063 #define RTDIAGSTRM4(pctxt,msg,a,b)      rtxDiagStream(pctxt,msg,a,b)
00064 #define RTDIAGSTRM5(pctxt,msg,a,b,c)    rtxDiagStream(pctxt,msg,a,b,c)
00065 #define RTHEXDUMPSTRM(pctxt,buffer,numocts) \
00066 rtxDiagStreamHexDump(pctxt,buffer,numocts)
00067 #define RTDIAGSCHARS(pctxt,buf,nchars) \
00068 rtxDiagStreamPrintChars(pctxt,buf,nchars)
00069 #else
00070 #define RTDIAG1(pctxt,msg)
00071 #define RTDIAG2(pctxt,msg,a)
00072 #define RTDIAG3(pctxt,msg,a,b)
00073 #define RTDIAG4(pctxt,msg,a,b,c)
00074 #define RTDIAG5(pctxt,msg,a,b,c,d)
00075 #define RTDIAGU(pctxt,ucstr)
00076 #define RTHEXDUMP(pctxt,buffer,numocts)
00077 #define RTDIAGCHARS(pctxt,buf,nchars)
00078 #define RTDIAGSTRM2(pctxt,msg)
00079 #define RTDIAGSTRM3(pctxt,msg,a)
00080 #define RTDIAGSTRM4(pctxt,msg,a,b)
00081 #define RTDIAGSTRM5(pctxt,msg,a,b,c)
00082 #define RTHEXDUMPSTRM(pctxt,buffer,numocts)
00083 #define RTDIAGSCHARS(pctxt,buf,nchars)
00084 #endif
00085 
00086 typedef enum {
00087    OSRTDiagError, 
00088    OSRTDiagWarning, 
00089    OSRTDiagInfo,
00090    OSRTDiagDebug
00091 } OSRTDiagTraceLevel;
00092 
00101 EXTERNRT OSBOOL rtxDiagEnabled (OSCTXT* pctxt);
00102 
00115 EXTERNRT OSBOOL rtxSetDiag (OSCTXT* pctxt, OSBOOL value);
00116 
00126 EXTERNRT OSBOOL rtxSetGlobalDiag (OSBOOL value);
00127 
00146 EXTERNRT void rtxDiagPrint (OSCTXT* pctxt, const char* fmtspec, ...);
00147 
00157 EXTERNRT void rtxDiagStream (OSCTXT* pctxt, const char* fmtspec, ...);
00158 
00167 EXTERNRT void rtxDiagHexDump 
00168 (OSCTXT* pctxt, const OSOCTET* data, OSUINT32 numocts);
00169 
00178 EXTERNRT void rtxDiagStreamHexDump 
00179 (OSCTXT* pctxt, const OSOCTET* data, OSUINT32 numocts);
00180 
00191 EXTERNRT void rtxDiagPrintChars
00192 (OSCTXT* pctxt, const char* data, OSUINT32 nchars);
00193 
00204 EXTERNRT void rtxDiagStreamPrintChars
00205 (OSCTXT* pctxt, const char* data, OSUINT32 nchars);
00206 
00217 EXTERNRT void rtxDiagSetTraceLevel (OSCTXT* pctxt, OSRTDiagTraceLevel level);
00218 
00223 #ifdef __cplusplus
00224 }
00225 #endif
00226 
00227 #endif
00228