00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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 OSUINT8 lb, lbm;
00046 char fmtBitBuffer[40], fmtHexBuffer[10], fmtAscBuffer[10];
00047 int fmtBitCharIdx, fmtHexCharIdx, fmtAscCharIdx;
00048 } OSRTDiagBinDumpBuffer;
00049
00050 typedef struct OSRTDiagBitFieldList {
00051 OSUINT16 disabledCount;
00052 OSRTSList fieldList;
00053 OSRTMEMBUF* pCaptureBuf;
00054 OSRTDiagBinDumpBuffer printBuffer;
00055 OSRTSListNode* pLastPrinted;
00056 } OSRTDiagBitFieldList;
00057
00058 typedef struct {
00059 const char* elemName;
00060 const char* nameSuffix;
00061 size_t bitOffset;
00062 size_t numbits;
00063 OSRTDiagBitFieldList* pOpenTypeFieldList;
00064 } OSRTDiagBitField;
00065
00066
00067
00068 #ifdef _TRACE
00069 #define RTDIAG_INSBITFLDLEN(pctxt) \
00070 rtxDiagInsBitFieldLen((pctxt)->pBitFldList)
00071
00072 #define RTDIAG_NEWBITFIELD(pctxt,suffix) \
00073 rtxDiagNewBitField((pctxt)->pBitFldList,suffix)
00074
00075 #define RTDIAG_SETBITFLDOFFSET(pctxt) \
00076 rtxDiagSetBitFldOffset((pctxt)->pBitFldList)
00077
00078 #define RTDIAG_SETBITFLDCOUNT(pctxt) \
00079 rtxDiagSetBitFldCount((pctxt)->pBitFldList)
00080 #else
00081 #define RTDIAG_INSBITFLDLEN(pctxt)
00082 #define RTDIAG_NEWBITFIELD(pctxt,suffix)
00083 #define RTDIAG_SETBITFLDOFFSET(pctxt)
00084 #define RTDIAG_SETBITFLDCOUNT(pctxt)
00085 #endif
00086
00091 #define RTDIAG_GETCTXTBITOFFSET(pctxt) \
00092 (((pctxt)->buffer.byteIndex * 8) + (8 - (pctxt)->buffer.bitOffset))
00093
00100 EXTERNRT int rtxDiagCtxtBitFieldListInit (OSCTXT* pctxt);
00101
00108 EXTERNRT void rtxDiagBitFieldListInit
00109 (OSCTXT* pctxt, OSRTDiagBitFieldList* pBFList);
00110
00117 EXTERNRT void rtxDiagInsBitFieldLen (OSRTDiagBitFieldList* pBFList);
00118
00127 EXTERNRT OSRTDiagBitField* rtxDiagNewBitField
00128 (OSRTDiagBitFieldList* pBFList, const char* nameSuffix);
00129
00136 EXTERNRT void rtxDiagSetBitFldOffset (OSRTDiagBitFieldList* pBFList);
00137
00144 EXTERNRT void rtxDiagSetBitFldCount (OSRTDiagBitFieldList* pBFList);
00145
00154 EXTERNRT void rtxDiagSetBitFldNameSuffix
00155 (OSRTDiagBitFieldList* pBFList, const char* nameSuffix);
00156
00167 EXTERNRT OSBOOL rtxDiagSetBitFldDisabled
00168 (OSRTDiagBitFieldList* pBFList, OSBOOL value);
00169
00178 EXTERNRT void rtxDiagBitTracePrint
00179 (OSRTDiagBitFieldList* pBFList, const char* varname);
00180
00188 EXTERNRT void rtxDiagBitTracePrintHTML
00189 (const char* filename, OSRTDiagBitFieldList* pBFList, const char* varname);
00190
00199 EXTERNRT void rtxDiagBitFldAppendNamePart
00200 (OSRTDiagBitFieldList* pBFList, const char* namePart);
00201
00202 #ifdef __cplusplus
00203 }
00204 #endif
00205
00206 #endif