#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_libevent_time.h>
#endif
#include <sys/queue.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include "event.h"
#include "event-internal.h"
#include "evutil.h"
#include "log.h"
#ifdef HAVE_EVENT_PORTS
extern const struct eventop evportops;
#endif
#ifdef HAVE_SELECT
extern const struct eventop selectops;
#endif
#ifdef HAVE_POLL
extern const struct eventop pollops;
#endif
#ifdef HAVE_EPOLL
extern const struct eventop epollops;
#endif
#ifdef HAVE_WORKING_KQUEUE
extern const struct eventop kqops;
#endif
#ifdef HAVE_DEVPOLL
extern const struct eventop devpollops;
#endif
#ifdef WIN32
extern const struct eventop win32ops;
#endif
static const struct eventop *eventops[] = …;
struct event_base *current_base = …;
extern struct event_base *evsignal_base;
static int use_monotonic = …;
static void event_queue_insert(struct event_base *, struct event *, int);
static void event_queue_remove(struct event_base *, struct event *, int);
static int event_haveevents(struct event_base *);
static void event_process_active(struct event_base *);
static int timeout_next(struct event_base *, struct timeval **);
static void timeout_process(struct event_base *);
static void timeout_correct(struct event_base *, struct timeval *);
static int
gettime(struct event_base *base, struct timeval *tp)
{ … }
struct event_base *
event_init(void)
{ … }
struct event_base *
event_base_new(void)
{ … }
void
event_base_free(struct event_base *base)
{ … }
int
event_reinit(struct event_base *base)
{ … }
int
event_priority_init(int npriorities)
{ … }
int
event_base_priority_init(struct event_base *base, int npriorities)
{ … }
int
event_haveevents(struct event_base *base)
{ … }
static void
event_process_active(struct event_base *base)
{ … }
int
event_dispatch(void)
{ … }
int
event_base_dispatch(struct event_base *event_base)
{ … }
const char *
event_base_get_method(struct event_base *base)
{ … }
static void
event_loopexit_cb(int fd, short what, void *arg)
{ … }
int
event_loopexit(const struct timeval *tv)
{ … }
int
event_base_loopexit(struct event_base *event_base, const struct timeval *tv)
{ … }
int
event_loopbreak(void)
{ … }
int
event_base_loopbreak(struct event_base *event_base)
{ … }
int
event_loop(int flags)
{ … }
int
event_base_loop(struct event_base *base, int flags)
{ … }
struct event_once { … };
static void
event_once_cb(int fd, short events, void *arg)
{ … }
int
event_once(int fd, short events,
void (*callback)(int, short, void *), void *arg, const struct timeval *tv)
{ … }
int
event_base_once(struct event_base *base, int fd, short events,
void (*callback)(int, short, void *), void *arg, const struct timeval *tv)
{ … }
void
event_set(struct event *ev, int fd, short events,
void (*callback)(int, short, void *), void *arg)
{ … }
int
event_base_set(struct event_base *base, struct event *ev)
{ … }
int
event_priority_set(struct event *ev, int pri)
{ … }
int
event_pending(struct event *ev, short event, struct timeval *tv)
{ … }
int
event_add(struct event *ev, const struct timeval *tv)
{ … }
int
event_del(struct event *ev)
{ … }
void
event_active(struct event *ev, int res, short ncalls)
{ … }
static int
timeout_next(struct event_base *base, struct timeval **tv_p)
{ … }
static void
timeout_correct(struct event_base *base, struct timeval *tv)
{ … }
void
timeout_process(struct event_base *base)
{ … }
void
event_queue_remove(struct event_base *base, struct event *ev, int queue)
{ … }
void
event_queue_insert(struct event_base *base, struct event *ev, int queue)
{ … }
const char *
event_get_version(void)
{ … }
const char *
event_get_method(void)
{ … }