XBinder  Version 2.6.x
rtxDiag.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  *****************************************************************************/
28 #ifndef _RTXDIAG_H_
29 #define _RTXDIAG_H_
30 
31 #include <stdarg.h>
32 #include "rtxsrc/rtxContext.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /* Diagnostic trace functions */
51 #ifdef _TRACE
52 #define RTDIAG1(pctxt,msg) rtxDiagPrint(pctxt,msg)
53 #define RTDIAG2(pctxt,msg,a) rtxDiagPrint(pctxt,msg,a)
54 #define RTDIAG3(pctxt,msg,a,b) rtxDiagPrint(pctxt,msg,a,b)
55 #define RTDIAG4(pctxt,msg,a,b,c) rtxDiagPrint(pctxt,msg,a,b,c)
56 #define RTDIAG5(pctxt,msg,a,b,c,d) rtxDiagPrint(pctxt,msg,a,b,c,d)
57 #define RTHEXDUMP(pctxt,buffer,numocts) rtxDiagHexDump(pctxt,buffer,numocts)
58 #define RTDIAGCHARS(pctxt,buf,nchars) rtxDiagPrintChars(pctxt,buf,nchars)
59 
60 #ifndef _NO_STREAM
61 
62 #define RTDIAGSTRM2(pctxt,msg) rtxDiagStream(pctxt,msg)
63 #define RTDIAGSTRM3(pctxt,msg,a) rtxDiagStream(pctxt,msg,a)
64 #define RTDIAGSTRM4(pctxt,msg,a,b) rtxDiagStream(pctxt,msg,a,b)
65 #define RTDIAGSTRM5(pctxt,msg,a,b,c) rtxDiagStream(pctxt,msg,a,b,c)
66 #define RTHEXDUMPSTRM(pctxt,buffer,numocts) \
67 rtxDiagStreamHexDump(pctxt,buffer,numocts)
68 #define RTDIAGSCHARS(pctxt,buf,nchars) \
69 rtxDiagStreamPrintChars(pctxt,buf,nchars)
70 
71 #else /* _NO_STREAM */
72 
73 #define RTDIAGSTRM2(pctxt,msg) rtxDiagPrint(pctxt,msg)
74 #define RTDIAGSTRM3(pctxt,msg,a) rtxDiagPrint(pctxt,msg,a)
75 #define RTDIAGSTRM4(pctxt,msg,a,b) rtxDiagPrint(pctxt,msg,a,b)
76 #define RTDIAGSTRM5(pctxt,msg,a,b,c) rtxDiagPrint(pctxt,msg,a,b,c)
77 #define RTHEXDUMPSTRM(pctxt,buffer,numocts) rtxDiagHexDump(pctxt,buffer,numocts)
78 #define RTDIAGSCHARS(pctxt,buf,nchars) rtxDiagPrintChars(pctxt,buf,nchars)
79 
80 #endif /* _NO_STREAM */
81 
82 #else /* _TRACE */
83 
84 #define RTDIAG1(pctxt,msg)
85 #define RTDIAG2(pctxt,msg,a)
86 #define RTDIAG3(pctxt,msg,a,b)
87 #define RTDIAG4(pctxt,msg,a,b,c)
88 #define RTDIAG5(pctxt,msg,a,b,c,d)
89 #define RTDIAGU(pctxt,ucstr)
90 #define RTHEXDUMP(pctxt,buffer,numocts)
91 #define RTDIAGCHARS(pctxt,buf,nchars)
92 
93 #define RTDIAGSTRM2(pctxt,msg)
94 #define RTDIAGSTRM3(pctxt,msg,a)
95 #define RTDIAGSTRM4(pctxt,msg,a,b)
96 #define RTDIAGSTRM5(pctxt,msg,a,b,c)
97 #define RTHEXDUMPSTRM(pctxt,buffer,numocts)
98 #define RTDIAGSCHARS(pctxt,buf,nchars)
99 
100 #endif /* _TRACE */
101 
102 typedef enum {
103  OSRTDiagError,
104  OSRTDiagWarning,
105  OSRTDiagInfo,
106  OSRTDiagDebug
107 } OSRTDiagTraceLevel;
108 
117 EXTERNRT OSBOOL rtxDiagEnabled (OSCTXT* pctxt);
118 
131 EXTERNRT OSBOOL rtxSetDiag (OSCTXT* pctxt, OSBOOL value);
132 
133 #ifndef __SYMBIAN32__
134 
143 EXTERNRT OSBOOL rtxSetGlobalDiag (OSBOOL value);
144 #endif
145 
164 EXTERNRT void rtxDiagPrint (OSCTXT* pctxt, const char* fmtspec, ...);
165 
166 #ifndef _NO_STREAM
167 
176 EXTERNRT void rtxDiagStream (OSCTXT* pctxt, const char* fmtspec, ...);
177 #endif /* _NO_STREAM */
178 
187 EXTERNRT void rtxDiagHexDump
188 (OSCTXT* pctxt, const OSOCTET* data, size_t numocts);
189 
190 #ifndef _NO_STREAM
191 
199 EXTERNRT void rtxDiagStreamHexDump
200 (OSCTXT* pctxt, const OSOCTET* data, size_t numocts);
201 #endif /* _NO_STREAM */
202 
213 EXTERNRT void rtxDiagPrintChars
214 (OSCTXT* pctxt, const char* data, size_t nchars);
215 
216 #ifndef _NO_STREAM
217 
227 EXTERNRT void rtxDiagStreamPrintChars
228 (OSCTXT* pctxt, const char* data, size_t nchars);
229 
240 EXTERNRT void rtxDiagStreamPrintBits
241 (OSCTXT* pctxt, const char* descr, const OSOCTET* data,
242  size_t bitIndex, size_t nbits);
243 #endif /* _NO_STREAM */
244 
255 EXTERNRT void rtxDiagSetTraceLevel (OSCTXT* pctxt, OSRTDiagTraceLevel level);
256 
264 EXTERNRT OSBOOL rtxDiagTraceLevelEnabled
265 (OSCTXT* pctxt, OSRTDiagTraceLevel level);
266 
271 #ifdef __cplusplus
272 }
273 #endif
274 
275 #endif
EXTERNRT void rtxDiagStream(OSCTXT *pctxt, const char *fmtspec,...)
This function conditionally outputs diagnostic trace messages to an output stream defined within the ...
EXTERNRT OSBOOL rtxDiagEnabled(OSCTXT *pctxt)
This function is used to determine if diagnostic tracing is currently enabled for the specified conte...
EXTERNRT void rtxDiagHexDump(OSCTXT *pctxt, const OSOCTET *data, size_t numocts)
This function is used to print a diagnostics hex dump of a section of memory.
EXTERNRT void rtxDiagSetTraceLevel(OSCTXT *pctxt, OSRTDiagTraceLevel level)
This function is used to set the maximum trace level for diagnostic trace messages.
EXTERNRT void rtxDiagStreamPrintBits(OSCTXT *pctxt, const char *descr, const OSOCTET *data, size_t bitIndex, size_t nbits)
This function is used to print a given number of bits as &#39;1&#39; or &#39;0&#39; values to a print stream...
EXTERNRT void rtxDiagPrintChars(OSCTXT *pctxt, const char *data, size_t nchars)
This function is used to print a given number of characters to standard output.
Common run-time context definitions.
EXTERNRT void rtxDiagPrint(OSCTXT *pctxt, const char *fmtspec,...)
This function is used to print a diagnostics message to stdout.
EXTERNRT OSBOOL rtxSetGlobalDiag(OSBOOL value)
This function is used to turn diagnostic tracing on or off at run-time on a global basis...
EXTERNRT OSBOOL rtxSetDiag(OSCTXT *pctxt, OSBOOL value)
This function is used to turn diagnostic tracing on or off at run-time on a per-context basis...
EXTERNRT OSBOOL rtxDiagTraceLevelEnabled(OSCTXT *pctxt, OSRTDiagTraceLevel level)
This function tests if a given trace level is enabled.
EXTERNRT void rtxDiagStreamHexDump(OSCTXT *pctxt, const OSOCTET *data, size_t numocts)
This function is used to print a diagnostics hex dump of a section of memory to a print stream...
Run-time context structure.
Definition: rtxContext.h:185
EXTERNRT void rtxDiagStreamPrintChars(OSCTXT *pctxt, const char *data, size_t nchars)
This function is used to print a given number of characters to a print stream.