Debian Codegraph @

addons/ooh323c/src/ootrace.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2004-2005 by Objective Systems, Inc.
3 *
4 * This software is furnished under an open source license and may be
5 * used and copied only in accordance with the terms of this license.
6 * The text of the license may generally be found in the root
7 * directory of this installation in the COPYING file. It
8 * can also be viewed online at the following URL:
9 *
10 * http://www.obj-sys.com/open/license.html
11 *
12 * Any redistributions of this file including modified versions must
13 * maintain this copyright notice.
14 *
15 *****************************************************************************/
16
17 /**
18 * @file ootrace.h
19 * This file defines the trace functionality
20 */
21 #include "ooCommon.h"
22 #ifndef _OOTRACE_H_
23 #define _OOTRACE_H_
24
25
26 /* tracing */
27 #define OOTRCLVLERR 1
28 #define OOTRCLVLWARN 2
29 #define OOTRCLVLINFO 3
30 #define OOTRCLVLDBGA 4
31 #define OOTRCLVLDBGB 5
32 #define OOTRCLVLDBGC 6
33
34 #ifdef _OOWARNING
35 #define TRACELVL OOTRCLVLWARN
36 #endif
37 #ifdef _OOINFO
38 #define TRACELVL OOTRCLVLINFO
39 #endif
40 #ifdef _OODEBUGA
41 #define TRACELVL OOTRCLVLDBGA
42 #endif
43 #ifdef _OODEBUGB
44 #define TRACELVL OOTRCLVLDBGB
45 #endif
46 #ifdef _OODEBUGC
47 #define TRACELVL OOTRCLVLDBGC
48 #endif
49
50 /* Ensure we always log error messages */
51 #ifndef TRACELVL
52 #define TRACELVL 1
53 #endif
54
55 #define OOTRACEERR1(a) ooTrace(OOTRCLVLERR,a)
56 #define OOTRACEERR2(a,b) ooTrace(OOTRCLVLERR,a,b)
57 #define OOTRACEERR3(a,b,c) ooTrace(OOTRCLVLERR,a,b,c)
58 #define OOTRACEERR4(a,b,c,d) ooTrace(OOTRCLVLERR,a,b,c,d)
59 #define OOTRACEERR5(a,b,c,d,e) ooTrace(OOTRCLVLERR,a,b,c,d,e)
60 #define OOTRACEWARN1(a) ooTrace(OOTRCLVLWARN,a)
61 #define OOTRACEWARN2(a,b) ooTrace(OOTRCLVLWARN,a,b)
62 #define OOTRACEWARN3(a,b,c) ooTrace(OOTRCLVLWARN,a,b,c)
63 #define OOTRACEWARN4(a,b,c,d) ooTrace(OOTRCLVLWARN,a,b,c,d)
64 #define OOTRACEINFO1(a) ooTrace(OOTRCLVLINFO, a)
65 #define OOTRACEINFO2(a,b) ooTrace(OOTRCLVLINFO,a,b)
66 #define OOTRACEINFO3(a,b,c) ooTrace(OOTRCLVLINFO,a,b,c)
67 #define OOTRACEINFO4(a,b,c,d) ooTrace(OOTRCLVLINFO,a,b,c,d)
68 #define OOTRACEINFO5(a,b,c,d,e) ooTrace(OOTRCLVLINFO,a,b,c,d,e)
69 #define OOTRACEINFO6(a,b,c,d,e,f) ooTrace(OOTRCLVLINFO,a,b,c,d,e, f)
70 #ifndef _COMPACT
71 #define OOTRACEDBGA1(a) ooTrace(OOTRCLVLDBGA,a)
72 #define OOTRACEDBGA2(a,b) ooTrace(OOTRCLVLDBGA,a,b)
73 #define OOTRACEDBGA3(a,b,c) ooTrace(OOTRCLVLDBGA,a,b,c)
74 #define OOTRACEDBGA4(a,b,c,d) ooTrace(OOTRCLVLDBGA,a,b,c,d)
75 #define OOTRACEDBGA5(a,b,c,d,e) ooTrace(OOTRCLVLDBGA,a,b,c,d,e)
76 #define OOTRACEDBGB1(a) ooTrace(OOTRCLVLDBGB,a)
77 #define OOTRACEDBGB2(a,b) ooTrace(OOTRCLVLDBGB,a,b)
78 #define OOTRACEDBGB3(a,b,c) ooTrace(OOTRCLVLDBGB,a,b,c)
79 #define OOTRACEDBGB4(a,b,c,d) ooTrace(OOTRCLVLDBGB,a,b,c,d)
80 #define OOTRACEDBGC1(a) ooTrace(OOTRCLVLDBGC,a)
81 #define OOTRACEDBGC2(a,b) ooTrace(OOTRCLVLDBGC,a,b)
82 #define OOTRACEDBGC3(a,b,c) ooTrace(OOTRCLVLDBGC,a,b,c)
83 #define OOTRACEDBGC4(a,b,c,d) ooTrace(OOTRCLVLDBGC,a,b,c,d)
84 #define OOTRACEDBGC5(a,b,c,d,e) ooTrace(OOTRCLVLDBGC,a,b,c,d,e)
85 #else
86 #define OOTRACEDBGA1(a)
87 #define OOTRACEDBGA2(a,b)
88 #define OOTRACEDBGA3(a,b,c)
89 #define OOTRACEDBGA4(a,b,c,d)
90 #define OOTRACEDBGA5(a,b,c,d,e)
91 #define OOTRACEDBGB1(a)
92 #define OOTRACEDBGB2(a,b)
93 #define OOTRACEDBGB3(a,b,c)
94 #define OOTRACEDBGB4(a,b,c,d)
95 #define OOTRACEDBGC1(a)
96 #define OOTRACEDBGC2(a,b)
97 #define OOTRACEDBGC3(a,b,c)
98 #define OOTRACEDBGC4(a,b,c,d)
99 #define OOTRACEDBGC5(a,b,c,d,e)
100 #endif
101
102 #ifdef __cplusplus
103 extern "C" {
104 #endif
105
106 #ifndef EXTERN
107 #ifdef MAKE_DLL
108 #define EXTERN __declspec(dllexport)
109 #else
110 #define EXTERN
111 #endif /* MAKE_DLL */
112 #endif /* EXTERN */
113
114 /**
115 * This function is used to set the trace level.
116 * @param traceLevel New trace level. Various values are: OOTRCLVLERR,
117 * OOTRCLVLWARN, OOTRCLVLINFO, OOTRCLVLDBGA, OOTRCLVLDBGB,
118 * OOTRCLVLDBGC
119 *
120 * @return None
121 */
122 EXTERN void ooSetTraceThreshold(OOUINT32 traceLevel);
123
124 /**
125 * This function is used to write the messages to the trace file.
126 *
127 * @param traceLevel Trace level for the message.
128 * @param fmtspec Printf style format spec.
129 * @param ... Printf style variable list of arguments
130 *
131 * @return - none
132 */
133 EXTERN void ooTrace(OOUINT32 traceLevel, const char * fmtspec, ...);
134
135 /**
136 * Helper function for the trace function. This function performs actual
137 * writing to file.
138 * @param logMessage Log message to be writted to file.
139 *
140 * @return - none
141 */
142 void ooTraceLogMessage(const char * logMessage);
143
144 /**
145 *
146 */
147 void ooChangeIPToNWOrder(char * internetIP, char* networkIP);
148
149 int ooLogAsn1Error(int stat, const char * fname, int lno);
150 #ifdef __cplusplus
151 }
152 #endif
153 #endif