Mercurial > MadButterfly
comparison src/mb_timer.h @ 39:db2aa914e14b
timer for animation
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 06 Aug 2008 21:05:11 +0800 |
parents | |
children | 400b4b5db0dc |
comparison
equal
deleted
inserted
replaced
38:8d219ebd729e | 39:db2aa914e14b |
---|---|
1 #ifndef __MB_TIMER_H_ | |
2 #define __MB_TIMER_H_ | |
3 | |
4 typedef uint32_t mbsec_t; | |
5 typedef uint32_t mbusec_t; | |
6 typedef struct _mb_timer mb_timer_t; | |
7 typedef struct _mb_tman mb_tman_t; | |
8 | |
9 typedef void (*mb_tmo_hdlr)(mbsec_t sec, mbusec_t usec, | |
10 mbsec_t now_sec, mbusec_t now_usec, | |
11 void *arg); | |
12 | |
13 extern mb_tman_t *mb_tman_new(void); | |
14 extern void mb_tman_free(mb_tman_t *tman); | |
15 extern mb_timer_t *mb_tman_timeout(mb_tman_t *tman, | |
16 mbsec_t sec, mbusec_t usec, | |
17 mb_tmo_hdlr hdlr, void *arg); | |
18 extern int mb_tman_remove(mb_tman_t *tman, mb_timer_t *timer); | |
19 extern int mb_tman_next_timeout(mb_tman_t *tman, | |
20 mbsec_t now_sec, mbusec_t now_usec, | |
21 mbsec_t *after_sec, mbusec_t *after_usec); | |
22 extern int mb_tman_handle_timeout(mb_tman_t *tman, | |
23 mbsec_t now_sec, mbusec_t now_usec); | |
24 | |
25 | |
26 | |
27 #endif /* __MB_TIMER_H_ */ |