ViewVC logotype

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

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

Revision 1.1 - (hide annotations) (download) (as text)
Sat Oct 13 12:00:22 2001 UTC (17 years, 9 months ago) by stdarg
Branch: MAIN
File MIME type: text/x-csrc
Added code for C-based microsecond-precision timers.
Made utimer and timer use the new timer stuff. (But utimers and timers don't work with it yet, either does killtimer + killutimer, maybe somebody else can update those :) or I'll do it later)
Added new tcl command, mutimer, to make a timer with a fractional second (i.e. mutimer 500000 hi == run 'hi' after 1/2 second)
Made net.c change the select() timeout based on the shortest timer.
Added a guard clause to lostdcc(n) to make sure n is valid.
When the socket table is reallocated, now the new sockets are marked SOCK_UNUSED (heh).
Fixed a typo in filesys.mod (mine) (looked up the wrong bind table)

1 stdarg 1.1 #ifndef _EGG_TIMER_H_
2     #define _EGG_TIMER_H_
4     typedef struct egg_timeval_b {
5     int sec;
6     int usec;
7     } egg_timeval_t;
9     #define TIMER_REPEAT 1
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)
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)
17     int timer_get_time(egg_timeval_t *curtime);
18     int timer_create_complex(egg_timeval_t *howlong, Function callback, void *client_data, int flags);
19     int timer_destroy(int timer_id);
20     int timer_get_shortest(egg_timeval_t *howlong);
21     int timer_run();
23     #endif /* _EGG_TIMER_H_ */

ViewVC Help
Powered by ViewVC 1.1.23