1 |
stdarg |
1.1 |
#ifndef _EGG_TIMER_H_ |
2 |
|
|
#define _EGG_TIMER_H_ |
3 |
|
|
|
4 |
|
|
typedef struct egg_timeval_b { |
5 |
|
|
int sec; |
6 |
|
|
int usec; |
7 |
|
|
} egg_timeval_t; |
8 |
|
|
|
9 |
|
|
#define TIMER_REPEAT 1 |
10 |
|
|
|
11 |
|
|
/* Create a simple timer with no client data and no flags. */ |
12 |
|
|
#define timer_create(howlong,callback) timer_create_complex(howlong, callback, NULL, 0) |
13 |
|
|
|
14 |
|
|
/* Create a simple timer with no client data, but it repeats. */ |
15 |
|
|
#define timer_create_repeater(howlong,callback) timer_create_complex(howlong, callback, NULL, TIMER_REPEAT) |
16 |
|
|
|
17 |
|
|
int timer_get_time(egg_timeval_t *curtime); |
18 |
stdarg |
1.3 |
int timer_diff(egg_timeval_t *from_time, egg_timeval_t *to_time, egg_timeval_t *diff); |
19 |
stdarg |
1.1 |
int timer_create_complex(egg_timeval_t *howlong, Function callback, void *client_data, int flags); |
20 |
|
|
int timer_destroy(int timer_id); |
21 |
stdarg |
1.2 |
int timer_destroy_all(); |
22 |
stdarg |
1.1 |
int timer_get_shortest(egg_timeval_t *howlong); |
23 |
|
|
int timer_run(); |
24 |
|
|
|
25 |
|
|
#endif /* _EGG_TIMER_H_ */ |