Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/lib/ioloop.h @ 953:411006be3c66 HEAD
Naming change for function typedefs.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 11 Jan 2003 21:55:56 +0200 |
parents | fd8888f6f037 |
children | e37e626902c3 |
comparison
equal
deleted
inserted
replaced
952:5c8cd0bf94c1 | 953:411006be3c66 |
---|---|
12 | 12 |
13 struct io; | 13 struct io; |
14 struct timeout; | 14 struct timeout; |
15 struct ioloop; | 15 struct ioloop; |
16 | 16 |
17 typedef void (*IOFunc) (void *context, int fd, struct io *io); | 17 typedef void (*io_callback_t) (void *context, int fd, struct io *io); |
18 typedef void (*TimeoutFunc) (void *context, struct timeout *timeout); | 18 typedef void (*timeout_callback_t) (void *context, struct timeout *timeout); |
19 | 19 |
20 /* Time when the I/O loop started calling handlers. | 20 /* Time when the I/O loop started calling handlers. |
21 Can be used instead of time(NULL). */ | 21 Can be used instead of time(NULL). */ |
22 extern time_t ioloop_time; | 22 extern time_t ioloop_time; |
23 extern struct timeval ioloop_timeval; | 23 extern struct timeval ioloop_timeval; |
24 extern struct timezone ioloop_timezone; | 24 extern struct timezone ioloop_timezone; |
25 | 25 |
26 /* I/O listeners - you can create different handlers for IO_READ and IO_WRITE, | 26 /* I/O listeners - you can create different handlers for IO_READ and IO_WRITE, |
27 but make sure you don't create multiple handlers of same type, it's not | 27 but make sure you don't create multiple handlers of same type, it's not |
28 checked and removing one will stop the other from working as well. */ | 28 checked and removing one will stop the other from working as well. */ |
29 struct io *io_add(int fd, int condition, IOFunc func, void *context); | 29 struct io *io_add(int fd, int condition, io_callback_t callback, void *context); |
30 struct io *io_add_priority(int fd, int priority, int condition, | 30 struct io *io_add_priority(int fd, int priority, int condition, |
31 IOFunc func, void *context); | 31 io_callback_t callback, void *context); |
32 void io_remove(struct io *io); | 32 void io_remove(struct io *io); |
33 | 33 |
34 /* Timeout handlers */ | 34 /* Timeout handlers */ |
35 struct timeout *timeout_add(int msecs, TimeoutFunc func, void *context); | 35 struct timeout *timeout_add(int msecs, timeout_callback_t callback, |
36 void *context); | |
36 void timeout_remove(struct timeout *timeout); | 37 void timeout_remove(struct timeout *timeout); |
37 | 38 |
38 void io_loop_run(struct ioloop *ioloop); | 39 void io_loop_run(struct ioloop *ioloop); |
39 void io_loop_stop(struct ioloop *ioloop); /* safe to run in signal handler */ | 40 void io_loop_stop(struct ioloop *ioloop); /* safe to run in signal handler */ |
40 | 41 |