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
#ifndef _EVENT_H_
#define _EVENT_H_
#include "utils.h"
#include "../T_defs.h"
#ifdef T_SEND_TIME
#include <time.h>
#endif
/* maximum number of arguments for the T macro */
#define T_MAX_ARGS 32
enum event_arg_type {
EVENT_INT,
EVENT_ULONG,
EVENT_STRING,
EVENT_BUFFER
};
typedef struct {
enum event_arg_type type;
//int offset;
union {
int i;
unsigned long ul;
char *s;
struct {
int bsize;
void *b;
};
};
} event_arg;
typedef struct {
#ifdef T_SEND_TIME
struct timespec sending_time;
#endif
int type;
char *buffer;
event_arg e[T_MAX_ARGS];
int ecount;
} event;
event get_event(int s, OBUF *v, void *d);
#ifdef T_SEND_TIME
event new_event(struct timespec sending_time, int type,
int length, char *buffer, void *database);
#else
event new_event(int type, int length, char *buffer, void *database);
#endif
#endif /* _EVENT_H_ */