ioloop-private.h revision 4c096615cb86a826fda377b87df22c579bfe5525
#ifndef IOLOOP_PRIVATE_H
#define IOLOOP_PRIVATE_H
#include "priorityq.h"
#include "ioloop.h"
#ifndef IOLOOP_INITIAL_FD_COUNT
# define IOLOOP_INITIAL_FD_COUNT 128
#endif
struct ioloop {
struct ioloop_context *cur_ctx;
struct io_file *next_io_file;
struct ioloop_handler_context *handler_context;
unsigned int max_fd_count;
unsigned int io_pending_count;
unsigned int running:1;
unsigned int iolooping:1;
};
struct io {
enum io_condition condition;
unsigned int source_linenum;
/* trigger I/O callback even if OS doesn't think there is input
pending */
bool pending;
void *context;
struct ioloop_context *ctx;
};
struct io_file {
/* use a doubly linked list so that io_remove() is quick */
int refcount;
int fd;
/* only for io_add_istream(), a bit kludgy to be here.. */
};
struct timeout {
struct priorityq_item item;
unsigned int source_linenum;
unsigned int msecs;
void *context;
struct ioloop_context *ctx;
};
struct ioloop_context_callback {
void *context;
};
struct ioloop_context {
int refcount;
};
/* I/O handler calls */
#endif