-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.h
196 lines (192 loc) · 7.74 KB
/
event.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/**
* @file event.h
* @brief Defines the Event function.
* @author Yavuz Koroglu
* @see event.c
*/
#ifndef EVENT_H
#define EVENT_H
#include "srcmetrics/metrics/abc.h"
#include "srcmetrics/metrics/ams.h"
#include "srcmetrics/metrics/cc.h"
#include "srcmetrics/metrics/hsm.h"
#include "srcmetrics/metrics/mc.h"
#include "srcmetrics/metrics/mnd.h"
#include "srcmetrics/metrics/npm.h"
#include "srcmetrics/metrics/rfu.h"
#include "srcmetrics/metrics/sloc.h"
typedef void(*Event)(struct srcsax_context*, ...);
/**
* @brief Gets a pointer to the static event handler for metrics.
* @return A pointer to the metric event handler.
*/
struct srcsax_handler* getStaticEventHandler(void);
#define ALL_EVENTS_AT_START_DOCUMENT { \
ABC_EVENT_AT_START_DOCUMENT, \
AMS_EVENT_AT_START_DOCUMENT, \
CC_EVENT_AT_START_DOCUMENT, \
HSM_EVENT_AT_START_DOCUMENT, \
MC_EVENT_AT_START_DOCUMENT, \
MND_EVENT_AT_START_DOCUMENT, \
NPM_EVENT_AT_START_DOCUMENT, \
RFU_EVENT_AT_START_DOCUMENT, \
SLOC_EVENT_AT_START_DOCUMENT, \
NULL \
}
#define ALL_EVENTS_AT_END_DOCUMENT { \
ABC_EVENT_AT_END_DOCUMENT, \
AMS_EVENT_AT_END_DOCUMENT, \
CC_EVENT_AT_END_DOCUMENT, \
HSM_EVENT_AT_END_DOCUMENT, \
MC_EVENT_AT_END_DOCUMENT, \
MND_EVENT_AT_END_DOCUMENT, \
NPM_EVENT_AT_END_DOCUMENT, \
RFU_EVENT_AT_END_DOCUMENT, \
SLOC_EVENT_AT_END_DOCUMENT, \
NULL \
}
#define ALL_EVENTS_AT_START_ROOT { \
ABC_EVENT_AT_START_ROOT, \
AMS_EVENT_AT_START_ROOT, \
CC_EVENT_AT_START_ROOT, \
HSM_EVENT_AT_START_ROOT, \
MC_EVENT_AT_START_ROOT, \
MND_EVENT_AT_START_ROOT, \
NPM_EVENT_AT_START_ROOT, \
RFU_EVENT_AT_START_ROOT, \
SLOC_EVENT_AT_START_ROOT, \
NULL \
}
#define ALL_EVENTS_AT_START_UNIT { \
ABC_EVENT_AT_START_UNIT, \
AMS_EVENT_AT_START_UNIT, \
CC_EVENT_AT_START_UNIT, \
HSM_EVENT_AT_START_UNIT, \
MC_EVENT_AT_START_UNIT, \
MND_EVENT_AT_START_UNIT, \
NPM_EVENT_AT_START_UNIT, \
RFU_EVENT_AT_START_UNIT, \
SLOC_EVENT_AT_START_UNIT, \
NULL \
}
#define ALL_EVENTS_AT_START_ELEMENT { \
ABC_EVENT_AT_START_ELEMENT, \
AMS_EVENT_AT_START_ELEMENT, \
CC_EVENT_AT_START_ELEMENT, \
HSM_EVENT_AT_START_ELEMENT, \
MC_EVENT_AT_START_ELEMENT, \
MND_EVENT_AT_START_ELEMENT, \
NPM_EVENT_AT_START_ELEMENT, \
RFU_EVENT_AT_START_ELEMENT, \
SLOC_EVENT_AT_START_ELEMENT, \
NULL \
}
#define ALL_EVENTS_AT_END_ROOT { \
ABC_EVENT_AT_END_ROOT, \
AMS_EVENT_AT_END_ROOT, \
CC_EVENT_AT_END_ROOT, \
HSM_EVENT_AT_END_ROOT, \
MC_EVENT_AT_END_ROOT, \
MND_EVENT_AT_END_ROOT, \
NPM_EVENT_AT_END_ROOT, \
RFU_EVENT_AT_END_ROOT, \
SLOC_EVENT_AT_END_ROOT, \
NULL \
}
#define ALL_EVENTS_AT_END_UNIT { \
ABC_EVENT_AT_END_UNIT, \
AMS_EVENT_AT_END_UNIT, \
CC_EVENT_AT_END_UNIT, \
HSM_EVENT_AT_END_UNIT, \
MC_EVENT_AT_END_UNIT, \
MND_EVENT_AT_END_UNIT, \
NPM_EVENT_AT_END_UNIT, \
RFU_EVENT_AT_END_UNIT, \
SLOC_EVENT_AT_END_UNIT, \
NULL \
}
#define ALL_EVENTS_AT_END_ELEMENT { \
ABC_EVENT_AT_END_ELEMENT, \
AMS_EVENT_AT_END_ELEMENT, \
CC_EVENT_AT_END_ELEMENT, \
HSM_EVENT_AT_END_ELEMENT, \
MC_EVENT_AT_END_ELEMENT, \
MND_EVENT_AT_END_ELEMENT, \
NPM_EVENT_AT_END_ELEMENT, \
RFU_EVENT_AT_END_ELEMENT, \
SLOC_EVENT_AT_END_ELEMENT, \
NULL \
}
#define ALL_EVENTS_AT_CHARACTERS_ROOT { \
ABC_EVENT_AT_CHARACTERS_ROOT, \
AMS_EVENT_AT_CHARACTERS_ROOT, \
CC_EVENT_AT_CHARACTERS_ROOT, \
HSM_EVENT_AT_CHARACTERS_ROOT, \
MC_EVENT_AT_CHARACTERS_ROOT, \
MND_EVENT_AT_CHARACTERS_ROOT, \
NPM_EVENT_AT_CHARACTERS_ROOT, \
RFU_EVENT_AT_CHARACTERS_ROOT, \
SLOC_EVENT_AT_CHARACTERS_ROOT, \
NULL \
}
#define ALL_EVENTS_AT_CHARACTERS_UNIT { \
ABC_EVENT_AT_CHARACTERS_UNIT, \
AMS_EVENT_AT_CHARACTERS_UNIT, \
CC_EVENT_AT_CHARACTERS_UNIT, \
HSM_EVENT_AT_CHARACTERS_UNIT, \
MC_EVENT_AT_CHARACTERS_UNIT, \
MND_EVENT_AT_CHARACTERS_UNIT, \
NPM_EVENT_AT_CHARACTERS_UNIT, \
RFU_EVENT_AT_CHARACTERS_UNIT, \
SLOC_EVENT_AT_CHARACTERS_UNIT, \
NULL \
}
#define ALL_EVENTS_AT_META_TAG { \
ABC_EVENT_AT_META_TAG, \
AMS_EVENT_AT_META_TAG, \
CC_EVENT_AT_META_TAG, \
HSM_EVENT_AT_META_TAG, \
MC_EVENT_AT_META_TAG, \
MND_EVENT_AT_META_TAG, \
NPM_EVENT_AT_META_TAG, \
RFU_EVENT_AT_META_TAG, \
SLOC_EVENT_AT_META_TAG, \
NULL \
}
#define ALL_EVENTS_AT_COMMENT { \
ABC_EVENT_AT_COMMENT, \
AMS_EVENT_AT_COMMENT, \
CC_EVENT_AT_COMMENT, \
HSM_EVENT_AT_COMMENT, \
MC_EVENT_AT_COMMENT, \
MND_EVENT_AT_COMMENT, \
NPM_EVENT_AT_COMMENT, \
RFU_EVENT_AT_COMMENT, \
SLOC_EVENT_AT_COMMENT, \
NULL \
}
#define ALL_EVENTS_AT_CDATA_BLOCK { \
ABC_EVENT_AT_CDATA_BLOCK, \
AMS_EVENT_AT_CDATA_BLOCK, \
CC_EVENT_AT_CDATA_BLOCK, \
HSM_EVENT_AT_CDATA_BLOCK, \
MC_EVENT_AT_CDATA_BLOCK, \
MND_EVENT_AT_CDATA_BLOCK, \
NPM_EVENT_AT_CDATA_BLOCK, \
RFU_EVENT_AT_CDATA_BLOCK, \
SLOC_EVENT_AT_CDATA_BLOCK, \
NULL \
}
#define ALL_EVENTS_AT_PROC_INFO { \
ABC_EVENT_AT_PROC_INFO, \
AMS_EVENT_AT_PROC_INFO, \
CC_EVENT_AT_PROC_INFO, \
HSM_EVENT_AT_PROC_INFO, \
MC_EVENT_AT_PROC_INFO, \
MND_EVENT_AT_PROC_INFO, \
NPM_EVENT_AT_PROC_INFO, \
RFU_EVENT_AT_PROC_INFO, \
SLOC_EVENT_AT_PROC_INFO, \
NULL \
}
#endif