XBinder  Version 2.6.x
rtxDiagBitTrace.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2018 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
29 #ifndef _RTXDIAGBITTRACE_H_
30 #define _RTXDIAGBITTRACE_H_
31 
32 #include <stdarg.h>
33 #include "rtxsrc/rtxMemBuf.h"
34 #include "rtxsrc/rtxSList.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
44 typedef struct {
45  OSUINT8 lb, lbm;
46  char fmtBitBuffer[40], fmtHexBuffer[10], fmtAscBuffer[10];
47  int fmtBitCharIdx, fmtHexCharIdx, fmtAscCharIdx;
48 } OSRTDiagBinDumpBuffer;
49 
50 typedef struct OSRTDiagBitFieldList {
51  OSUINT16 disabledCount;
52  OSRTSList fieldList; /* list of OSRTDiagBitField */
53  OSRTMEMBUF* pCaptureBuf; /* capture buffer for streams */
54  OSRTDiagBinDumpBuffer printBuffer; /* formatted text buffer */
55  OSRTSListNode* pLastPrinted; /* last node in list that was printed */
56 } OSRTDiagBitFieldList;
57 
58 typedef struct {
59  const char* elemName;
60  const char* nameSuffix;
61  size_t bitOffset;
62  size_t numbits;
63  OSRTDiagBitFieldList* pOpenTypeFieldList;
64 } OSRTDiagBitField;
65 
66 /* Macros */
67 
68 #ifdef _TRACE
69 #define RTDIAG_INSBITFLDLEN(pctxt) \
70 rtxDiagInsBitFieldLen((pctxt)->pBitFldList)
71 
72 #define RTDIAG_NEWBITFIELD(pctxt,suffix) \
73 rtxDiagNewBitField((pctxt)->pBitFldList,suffix)
74 
75 #define RTDIAG_SETBITFLDOFFSET(pctxt) \
76 rtxDiagSetBitFldOffset((pctxt)->pBitFldList)
77 
78 #define RTDIAG_SETBITFLDCOUNT(pctxt) \
79 rtxDiagSetBitFldCount((pctxt)->pBitFldList)
80 #else
81 #define RTDIAG_INSBITFLDLEN(pctxt)
82 #define RTDIAG_NEWBITFIELD(pctxt,suffix)
83 #define RTDIAG_SETBITFLDOFFSET(pctxt)
84 #define RTDIAG_SETBITFLDCOUNT(pctxt)
85 #endif
86 
91 #define RTDIAG_GETCTXTBITOFFSET(pctxt) \
92 (((pctxt)->buffer.byteIndex * 8) + (8 - (pctxt)->buffer.bitOffset))
93 
100 EXTERNRT int rtxDiagCtxtBitFieldListInit (OSCTXT* pctxt);
101 
108 EXTERNRT void rtxDiagBitFieldListInit
109 (OSCTXT* pctxt, OSRTDiagBitFieldList* pBFList);
110 
117 EXTERNRT void rtxDiagInsBitFieldLen (OSRTDiagBitFieldList* pBFList);
118 
127 EXTERNRT OSRTDiagBitField* rtxDiagNewBitField
128 (OSRTDiagBitFieldList* pBFList, const char* nameSuffix);
129 
136 EXTERNRT void rtxDiagSetBitFldOffset (OSRTDiagBitFieldList* pBFList);
137 
144 EXTERNRT void rtxDiagSetBitFldCount (OSRTDiagBitFieldList* pBFList);
145 
154 EXTERNRT void rtxDiagSetBitFldNameSuffix
155 (OSRTDiagBitFieldList* pBFList, const char* nameSuffix);
156 
167 EXTERNRT OSBOOL rtxDiagSetBitFldDisabled
168 (OSRTDiagBitFieldList* pBFList, OSBOOL value);
169 
178 EXTERNRT void rtxDiagBitTracePrint
179 (OSRTDiagBitFieldList* pBFList, const char* varname);
180 
188 EXTERNRT void rtxDiagBitTracePrintHTML
189 (const char* filename, OSRTDiagBitFieldList* pBFList, const char* varname);
190 
199 EXTERNRT void rtxDiagBitFldAppendNamePart
200 (OSRTDiagBitFieldList* pBFList, const char* namePart);
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif
EXTERNRT void rtxDiagSetBitFldOffset(OSRTDiagBitFieldList *pBFList)
This function is used to set the bit offset in the current bit field structure.
EXTERNRT void rtxDiagBitTracePrint(OSRTDiagBitFieldList *pBFList, const char *varname)
This function prints the bit field list to a an output stream.
EXTERNRT int rtxDiagCtxtBitFieldListInit(OSCTXT *pctxt)
This function initializes the standard bit field list structure within the context.
EXTERNRT void rtxDiagBitFldAppendNamePart(OSRTDiagBitFieldList *pBFList, const char *namePart)
This function appends the given name part to the element name in the bit field.
EXTERNRT void rtxDiagSetBitFldNameSuffix(OSRTDiagBitFieldList *pBFList, const char *nameSuffix)
This function is used to set the name suffix in the current bit field structure.
EXTERNRT void rtxDiagBitFieldListInit(OSCTXT *pctxt, OSRTDiagBitFieldList *pBFList)
This function initializes a bit field list structure.
EXTERNRT OSBOOL rtxDiagSetBitFldDisabled(OSRTDiagBitFieldList *pBFList, OSBOOL value)
This function increments or decrements the disabled count.
EXTERNRT OSRTDiagBitField * rtxDiagNewBitField(OSRTDiagBitFieldList *pBFList, const char *nameSuffix)
This function allocates a new bit field structure and adds it to the bit field list.
EXTERNRT void rtxDiagInsBitFieldLen(OSRTDiagBitFieldList *pBFList)
This function inserts a special length field before the current record in the bit field list...
EXTERNRT void rtxDiagSetBitFldCount(OSRTDiagBitFieldList *pBFList)
This function is used to set the bit count in the current bit field structure.
Run-time context structure.
Definition: rtxContext.h:185
EXTERNRT void rtxDiagBitTracePrintHTML(const char *filename, OSRTDiagBitFieldList *pBFList, const char *varname)
This function prints the bit field list to a an HTML document.