31 |
/* the timeout in seconds */ |
/* the timeout in seconds */ |
32 |
#define ENGINE_TIMEOUT 5 |
#define ENGINE_TIMEOUT 5 |
33 |
|
|
34 |
typedef void (*init_fn_t) (buffer_t *, buffer_t *); |
struct engine_functions |
35 |
typedef int (*want_read_fn_t) (buffer_t *, buffer_t *); |
{ |
36 |
typedef void (*readfn_fn_t) (buffer_t *, buffer_t *, int); |
void (*init) (buffer_t * bufin, buffer_t * bufout); |
37 |
typedef int (*end_fn_t) (buffer_t *, buffer_t *); |
int (*want_read) (buffer_t * bufin); |
38 |
|
int (*want_write) (buffer_t * bufout); |
39 |
|
void (*readfn) (buffer_t * bufin); |
40 |
|
void (*writefn) (buffer_t * bufout); |
41 |
|
void (*timeoutfn) (buffer_t * bufin, buffer_t * bufout, int timeout); |
42 |
|
int (*end) (buffer_t * bufin, buffer_t * bufout); |
43 |
|
}; |
44 |
|
|
45 |
int engine_init (void); |
int engine_init (void); |
46 |
void engine_loop (void); |
void engine_loop (void); |
47 |
void engine_stop (void); |
void engine_stop (void); |
48 |
void engine_register (int fd, int timeout_notify, init_fn_t init, |
void engine_register (int fd, struct engine_functions fn); |
|
want_read_fn_t want_read, readfn_fn_t readfn, |
|
|
end_fn_t end); |
|
49 |
void engine_unregister (int fd); |
void engine_unregister (int fd); |
50 |
void engine_set_readers (fd_set * fdset, int *maxfd); |
void engine_set_readers (fd_set * fdset, int *maxfd); |
51 |
void engine_set_writers (fd_set * fdset, int *maxfd); |
void engine_set_writers (fd_set * fdset, int *maxfd); |
52 |
void engine_read (fd_set * fdset); |
void engine_read (fd_set * fdset); |
53 |
void engine_write (fd_set * fdset); |
void engine_write (fd_set * fdset); |
54 |
void engine_timeout (int timeouts); |
void engine_timeout (); |
55 |
|
|
56 |
|
|
57 |
#endif /* __ENGINE_H__ */ |
#endif /* __ENGINE_H__ */ |