34 |
34 |
35 #ifdef __cplusplus |
35 #ifdef __cplusplus |
36 extern "C" { |
36 extern "C" { |
37 #endif |
37 #endif |
38 |
38 |
39 struct event_handler { |
39 struct EventHandler { |
40 int *ep; // epoll fds |
40 /* |
41 uint32_t nep; // number of epoll fds |
41 * epoll fd |
42 uint32_t lep; // last fd |
42 */ |
43 // TODO: message queue/thread pool |
43 int ep; |
|
44 /* |
|
45 * pipe read fd |
|
46 */ |
|
47 int eventin; |
|
48 /* |
|
49 * pipe write fd |
|
50 */ |
|
51 int eventout; |
44 }; |
52 }; |
45 |
53 |
46 typedef struct ev_thr_conf { |
54 void ev_handle_events(EventHandler *ev); |
47 event_handler_t *handler; |
|
48 int ep; |
|
49 } ev_thr_conf_t; |
|
50 |
55 |
51 void ev_handle_events(ev_thr_conf_t *conf); |
56 int ev_convert2sys_events(int events); |
52 |
|
53 int ev_get_port(event_handler_t *h); |
|
54 |
57 |
55 #ifdef __cplusplus |
58 #ifdef __cplusplus |
56 } |
59 } |
57 #endif |
60 #endif |
58 |
61 |