+
+/*
+ please read the comments in events.c before modifying
+*/
+
+
+struct event_context {
+ /* list of filedescriptor events */
+ struct fd_event {
+ struct event_context *event_ctx;
+ struct fd_event *next, *prev;
+ int fd;
+ uint16_t flags; /* see EVENT_FD_* flags */
+ event_fd_handler_t handler;
+ void *private;
+ } *fd_events;
+
+ /* list of timed events */
+ struct timed_event {
+ struct event_context *event_ctx;
+ struct timed_event *next, *prev;
+ struct timeval next_event;
+ event_timed_handler_t handler;
+ void *private;
+ } *timed_events;
+
+ /* the maximum file descriptor number in fd_events */
+ int maxfd;
+
+ /* information for exiting from the event loop */
+ int exit_code;
+
+ /* this is changed by the destructors for any event type. It
+ is used to detect event destruction by event handlers,
+ which means the code that is calling all event handles
+ needs to assume that the linked list is no longer valid
+ */
+ uint32_t destruction_count;
+};
+