Libevent Code Doxygen document
Public Attributes | List of all members
eventop Struct Reference

#include <event-internal.h>

Public Attributes

const char * name
 
void *(* init )(struct event_base *)
 
int(* add )(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo)
 
int(* del )(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo)
 
int(* dispatch )(struct event_base *, struct timeval *)
 
void(* dealloc )(struct event_base *)
 
int need_reinit
 
enum event_method_feature features
 
size_t fdinfo_len
 

Detailed Description

Structure to define the backend of a given event_base.

Member Data Documentation

◆ add

int(* eventop::add) (struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo)

Enable reading/writing on a given fd or signal. 'events' will be the events that we're trying to enable: one or more of EV_READ, EV_WRITE, EV_SIGNAL, and EV_ET. 'old' will be those events that were enabled on this fd previously. 'fdinfo' will be a structure associated with the fd by the evmap; its size is defined by the fdinfo field below. It will be set to 0 the first time the fd is added. The function should return 0 on success and -1 on error.

◆ dealloc

void(* eventop::dealloc) (struct event_base *)

Function to clean up and free our data from the event_base.

◆ del

int(* eventop::del) (struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo)

As "add", except 'events' contains the events we mean to disable.

◆ dispatch

int(* eventop::dispatch) (struct event_base *, struct timeval *)

Function to implement the core of an event loop. It must see which added events are ready, and cause event_active to be called for each active event (usually via event_io_active or such). It should return 0 on success and -1 on error.

◆ fdinfo_len

size_t eventop::fdinfo_len

Length of the extra information we should record for each fd that has one or more active events. This information is recorded as part of the evmap entry for each fd, and passed as an argument to the add and del functions above.

◆ features

enum event_method_feature eventop::features

Bit-array of supported event_method_features that this backend can provide.

◆ init

void*(* eventop::init) (struct event_base *)

Function to set up an event_base to use this backend. It should create a new structure holding whatever information is needed to run the backend, and return it. The returned pointer will get stored by event_init into the event_base.evbase field. On failure, this function should return NULL.

◆ name

const char* eventop::name

The name of this backend.

◆ need_reinit

int eventop::need_reinit

Flag: set if we need to reinitialize the event base after we fork.


The documentation for this struct was generated from the following file: