Project

General

Profile

Statistics
| Branch: | Revision:

root / mainbox / event.h @ 15928a3d

History | View | Annotate | Download (562 Bytes)

1
#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
  time_t tstart;
10
  time_t tend;
11
  struct event_t *next;
12
};
13

    
14
/*
15
 * After event_alloc, you must call either event_free or event_q_push.
16
 * Periodically call event_q_process to send events in the queue to the server.
17
 * When an event is successfully sent, the event will be removed from the queue
18
 * and freed.
19
 */
20
struct event_t *event_alloc();
21
void event_free(struct event_t *event);
22
void event_q_push(struct event_t *event);
23
void event_q_process();
24

    
25
#endif