Functions | Variables
mini_event.c File Reference

fake libevent implementation. More...

#include "config.h"
#include <time.h>
#include <sys/time.h>
#include <signal.h>
#include "util/mini_event.h"
#include "util/fptr_wlist.h"

Functions

int mini_ev_cmp (const void *a, const void *b)
 compare events in tree, based on timevalue, ptr for uniqueness
static int settime (struct event_base *base)
 set time
void * event_init (uint32_t *time_secs, struct timeval *time_tv)
 create event base
const char * event_get_version (void)
 get version
const char * event_get_method (void)
 get polling method, select
static void handle_timeouts (struct event_base *base, struct timeval *now, struct timeval *wait)
 call timeouts handlers, and return how long to wait for next one or -1
static int handle_select (struct event_base *base, struct timeval *wait)
 call select and callbacks for that
int event_base_dispatch (struct event_base *base)
 run select in a loop
int event_base_loopexit (struct event_base *base, struct timeval *tv)
 exit that loop
void event_base_free (struct event_base *base)
void event_set (struct event *ev, int fd, short bits, void(*cb)(int, short, void *), void *arg)
 set content of event
int event_base_set (struct event_base *base, struct event *ev)
int event_add (struct event *ev, struct timeval *tv)
int event_del (struct event *ev)
static RETSIGTYPE sigh (int sig)
 signal handler
int signal_add (struct event *ev, struct timeval *tv)
 install signal handler
int signal_del (struct event *ev)
 remove signal handler

Variables

static struct event_base * signal_base = NULL
 which base gets to handle signals

Detailed Description

fake libevent implementation.

Less broad in functionality, and only supports select(2).