1
#ifndef IOLOOP_PRIVATE_H
2
#define IOLOOP_PRIVATE_H
7
#ifndef IOLOOP_INITIAL_FD_COUNT
8
# define IOLOOP_INITIAL_FD_COUNT 128
14
struct ioloop_context *cur_ctx;
16
struct io_file *io_files;
17
struct io_file *next_io_file;
18
struct priorityq *timeouts;
20
struct ioloop_handler_context *handler_context;
21
struct ioloop_notify_handler_context *notify_handler_context;
22
unsigned int max_fd_count;
24
io_loop_time_moved_callback_t *time_moved_callback;
27
unsigned int running:1;
31
enum io_condition condition;
32
unsigned int source_linenum;
34
io_callback_t *callback;
37
struct ioloop *ioloop;
38
struct ioloop_context *ctx;
44
/* use a doubly linked list so that io_remove() is quick */
45
struct io_file *prev, *next;
52
struct priorityq_item item;
53
unsigned int source_linenum;
56
struct timeval next_run;
58
timeout_callback_t *callback;
61
struct ioloop *ioloop;
62
struct ioloop_context *ctx;
65
struct ioloop_context_callback {
66
io_callback_t *activate;
67
io_callback_t *deactivate;
71
struct ioloop_context {
73
struct ioloop *ioloop;
74
ARRAY_DEFINE(callbacks, struct ioloop_context_callback);
77
int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
78
void io_loop_handle_timeouts(struct ioloop *ioloop);
79
void io_loop_call_io(struct io *io);
81
/* I/O handler calls */
82
void io_loop_handle_add(struct io_file *io);
83
void io_loop_handle_remove(struct io_file *io, bool closed);
85
void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count);
86
void io_loop_handler_deinit(struct ioloop *ioloop);
88
void io_loop_notify_remove(struct io *io);
89
void io_loop_notify_handler_deinit(struct ioloop *ioloop);
91
void io_loop_context_activate(struct ioloop_context *ctx);
92
void io_loop_context_deactivate(struct ioloop_context *ctx);