Home > Support > Documentation

rtxDiagBitTrace.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  *****************************************************************************/
00029 #ifndef _RTXDIAGBITTRACE_H_
00030 #define _RTXDIAGBITTRACE_H_
00031 
00032 #include <stdarg.h>
00033 #include "rtxsrc/rtxMemBuf.h"
00034 #include "rtxsrc/rtxSList.h"
00035 #include "rtxsrc/rtxPrintToStream.h"
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00044 typedef struct {
00045    const char*  elemName;
00046    const char*  nameSuffix;
00047    size_t       bitOffset;
00048    size_t       numbits;
00049 } OSRTDiagBitField;
00050 
00051 typedef struct {
00052    OSUINT16  disabledCount;
00053    OSRTSList fieldList; /* list of OSRTDiagBitField */
00054    OSRTMEMBUF* pCaptureBuf; /* capture buffer for streams */
00055 } OSRTDiagBitFieldList;
00056 
00057 /* Macros */
00058 
00059 #ifdef _TRACE
00060 #define RTDIAG_INSBITFLDLEN(pctxt)        rtxDiagInsBitFieldLen(pctxt)
00061 #define RTDIAG_NEWBITFIELD(pctxt,suffix)  rtxDiagNewBitField(pctxt,suffix)
00062 #define RTDIAG_SETBITFLDOFFSET(pctxt)     rtxDiagSetBitFldOffset(pctxt)
00063 #define RTDIAG_SETBITFLDCOUNT(pctxt)      rtxDiagSetBitFldCount(pctxt)
00064 #else
00065 #define RTDIAG_INSBITFLDLEN(pctxt)
00066 #define RTDIAG_NEWBITFIELD(pctxt,suffix)
00067 #define RTDIAG_SETBITFLDOFFSET(pctxt)
00068 #define RTDIAG_SETBITFLDCOUNT(pctxt)
00069 #endif
00070 
00075 #define RTDIAG_GETCTXTBITOFFSET(pctxt) \
00076 (((pctxt)->buffer.byteIndex * 8) + (8 - (pctxt)->buffer.bitOffset))
00077 
00085 EXTERNRT OSBOOL rtxDiagSetBitTraceEnabled (OSCTXT* pctxt, OSBOOL value);
00086 
00093 EXTERNRT OSBOOL rtxDiagBitTraceEnabled (OSCTXT* pctxt);
00094 
00101 EXTERNRT void rtxDiagBitFieldListInit
00102 (OSCTXT* pctxt, OSRTDiagBitFieldList* pBFList);
00103 
00110 EXTERNRT void rtxDiagInsBitFieldLen (OSRTDiagBitFieldList* pBFList);
00111 
00120 EXTERNRT OSRTDiagBitField* rtxDiagNewBitField 
00121 (OSRTDiagBitFieldList* pBFList, const char* nameSuffix);
00122 
00129 EXTERNRT void rtxDiagSetBitFldOffset (OSRTDiagBitFieldList* pBFList);
00130 
00137 EXTERNRT void rtxDiagSetBitFldCount (OSRTDiagBitFieldList* pBFList);
00138 
00147 EXTERNRT void rtxDiagSetBitFldNameSuffix 
00148 (OSRTDiagBitFieldList* pBFList, const char* nameSuffix);
00149 
00159 EXTERNRT void rtxDiagSetBitFldDisabled 
00160 (OSRTDiagBitFieldList* pBFList, OSBOOL value);
00161 
00170 EXTERNRT void rtxDiagBitTracePrint 
00171 (OSRTDiagBitFieldList* pBFList, const char* varname);
00172 
00180 EXTERNRT void rtxDiagBitTracePrintHTML 
00181 (const char* filename, OSRTDiagBitFieldList* pBFList, const char* varname);
00182 
00191 EXTERNRT void rtxDiagBitFldAppendNamePart
00192 (OSRTDiagBitFieldList* pBFList, const char* namePart);
00193 
00194 #ifdef __cplusplus
00195 }
00196 #endif
00197 
00198 #endif