root / mainbox / event.h @ 5305e5e7
History | View | Annotate | Download (574 Bytes)
1 | 75cef49f | Tom Mullins | #ifndef EVENT_H
|
---|---|---|---|
2 | #define EVENT_H
|
||
3 | |||
4 | #include <time.h> |
||
5 | |||
6 | struct event_t {
|
||
7 | unsigned int user; |
||
8 | int tool_id;
|
||
9 | 38df0012 | Tom Mullins | int succ;
|
10 | 75cef49f | Tom Mullins | time_t tstart; |
11 | time_t tend; |
||
12 | struct event_t *next;
|
||
13 | }; |
||
14 | |||
15 | 880dc54f | Tom Mullins | /*
|
16 | * After event_alloc, you must call either event_free or event_q_push.
|
||
17 | * Periodically call event_q_process to send events in the queue to the server.
|
||
18 | * When an event is successfully sent, the event will be removed from the queue
|
||
19 | * and freed.
|
||
20 | */
|
||
21 | 75cef49f | Tom Mullins | struct event_t *event_alloc();
|
22 | void event_free(struct event_t *event); |
||
23 | void event_q_push(struct event_t *event); |
||
24 | void event_q_process();
|
||
25 | |||
26 | #endif |