/[cvs]/eggdrop1.9/src/egg_timer.h
ViewVC logotype

Contents of /eggdrop1.9/src/egg_timer.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Mon Feb 25 02:59:50 2002 UTC (17 years, 4 months ago) by stdarg
Branch: MAIN
Changes since 1.2: +1 -0 lines
File MIME type: text/x-csrc
* Added 'timers' and 'timer_info' commands
* Removed some unnecessary usage of time(NULL) in logfile.c
* New global variable egg_timeval_now (like 'now' but with microseconds)
* Fixed some bugs, cleaned up some code, in egg_timer.c

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 int timer_diff(egg_timeval_t *from_time, egg_timeval_t *to_time, egg_timeval_t *diff);
19 int timer_create_complex(egg_timeval_t *howlong, Function callback, void *client_data, int flags);
20 int timer_destroy(int timer_id);
21 int timer_destroy_all();
22 int timer_get_shortest(egg_timeval_t *howlong);
23 int timer_run();
24
25 #endif /* _EGG_TIMER_H_ */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23