Files | |
file | engines.h |
Event system engine header file. | |
Data Structures | |
struct | _ev_englink_s |
Engine link helper structure. More... | |
struct | _ev_sockets_s |
Engine sockets helper structure. More... | |
struct | _ev_signals_s |
Engine signals helper structure. More... | |
struct | _ev_timers_s |
Engine timers helper structure. More... | |
struct | _ev_engine_s |
Event engine structure. More... | |
Defines | |
#define | ENGINE_MODULE |
Engine module name. | |
#define | _ev__p(l, r) |
Paste arguments. | |
#define | _ev_paste(l, r) |
Paste arguments with macro expansion. | |
#define | EV_ENGINE_MAGIC |
Event engine magic number. | |
#define | EV_ENGINE_INIT(name, desc, flags, init, poll, fini, so_add, so_rem,so_ev, si_add, si_rem, ti_add, ti_rem) |
Event engine initialization. | |
#define | EV_ENGINE_SOCKET |
Socket engine flag. | |
#define | EV_ENGINE_SIGNAL |
Signal engine flag. | |
#define | EV_ENGINE_TIMER |
Timer engine flag. | |
#define | EV_ENGINE_COMPMASK |
Engine components mask. | |
#define | EV_ENGINE_REGISTERED |
Engine registered flag. | |
#define | EV_ENGINE_RUNNING |
Engine running flag. | |
#define | eng_verify(eng) |
Event engine verification macro. | |
#define | eng_name(eng) |
Event engine name. | |
#define | eng_desc(eng) |
Event engine description. | |
#define | eng_flags(eng) |
Event engine flags. | |
#define | eng_runfl(eng) |
Event running engine flags. | |
#define | eng_runfl_set(eng, fl) |
Set event engine run flag. | |
#define | eng_runfl_clr(eng, fl) |
Clear event engine run flag. | |
#define | eng_data(eng) |
Engine-specific data. | |
#define | eng_data_set(eng, data) |
Set engine-specific data. | |
#define | eng_sockdata(eng) |
Socket-specific data. | |
#define | eng_sockdata_set(eng, data) |
Set socket-specific data. | |
#define | eng_sigdata(eng) |
Signal-specific data. | |
#define | eng_sigdata_set(eng, data) |
Set signal-specific data. | |
#define | eng_timdata(eng) |
Timer-specific data. | |
#define | eng_timdata_set(eng, data) |
Set timer-specific data. | |
#define | so_eevents_set(sock, flags) |
Set engine socket event flags. | |
#define | so_eevents_clr(sock, flags) |
Clear engine socket event flags. | |
Typedefs | |
typedef _ev_engine_s | ev_engine_t |
Event engine. | |
typedef _ev_englink_s | _ev_englink_t |
Engine link helper. | |
typedef _ev_sockets_s | _ev_sockets_t |
Engine sockets helper. | |
typedef _ev_signals_s | _ev_signals_t |
Engine signals helper. | |
typedef _ev_timers_s | _ev_timers_t |
Engine timers helper. | |
typedef ev_engine_t *(* | ev_modinit_t )(ev_ctx_t *ctx) |
Initialize engine module. | |
typedef ev_err_t(* | ev_init_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_flags_t *eng_flags) |
Initialize event engine. | |
typedef ev_err_t(* | ev_poll_t )(ev_ctx_t *ctx, ev_engine_t *engine, struct timeval *timeout) |
Poll engine events. | |
typedef void(* | ev_fini_t )(ev_ctx_t *ctx, ev_engine_t *engine) |
Finalize event engine. | |
typedef ev_err_t(* | ev_sockadd_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_sock_t *sock) |
Add a socket to an event engine. | |
typedef ev_err_t(* | ev_sockrem_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_sock_t *sock) |
Remove a socket from an event engine. | |
typedef ev_err_t(* | ev_sockev_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_sock_t *sock, ev_flags_t evs) |
Change event interest set on a socket. | |
typedef ev_err_t(* | ev_sigadd_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_sig_t *sig) |
Add a signal to an event engine. | |
typedef ev_err_t(* | ev_sigrem_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_sig_t *sig) |
Remove a signal from an event engine. | |
typedef ev_err_t(* | ev_timadd_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_tim_t *tim) |
Add a timer to an event engine. | |
typedef ev_err_t(* | ev_timrem_t )(ev_ctx_t *ctx, ev_engine_t *engine, ev_tim_t *tim) |
Remove a timer from an event engine. | |
Functions | |
ev_engine_t * | engine_mod_init (ev_ctx_t *ctx) |
Engine module initialization function. | |
ev_err_t | engine_register (ev_ctx_t *ctx, ev_engine_t *engine) |
Register an engine. | |
ev_err_t | engine_activate (ev_ctx_t *ctx, ev_engine_t *engine, ev_flags_t comps) |
Activate an engine. | |
ev_err_t | event_attr_engine (ev_attr_t *attr, ev_engine_t *engine) |
Register an application-specific engine. | |
Variables | |
ev_engine_t * | engine_module |
Engine module descriptor. |
|
For internal use only. This macro causes its arguments to be pasted together.
|
|
For internal use only. This macro causes its arguments to be macro expanded, then pasted together by use of _ev__p().
|
|
This macro retrieves the engine-specific data for the given engine.
Definition at line 628 of file engines.h. Referenced by main(). |
|
This macro sets the engine-specific data for the given engine.
Definition at line 639 of file engines.h. Referenced by ei_init(). |
|
This macro retrieves the engine description for the ev_engine_t.
|
|
This macro retrieves the engine flags for the ev_engine_t.
|
|
This macro retrieves the engine name for the ev_engine_t.
Definition at line 566 of file engines.h. Referenced by main(). |
|
This macro retrieves the run flags for a running engine's ev_engine_t.
|
|
This macro clears a specific (or a set of specific) run flags on the given ev_engine_t.
|
|
This macro sets a specific (or a set of specific) run flags on the given ev_engine_t.
Definition at line 607 of file engines.h. Referenced by engine_activate(). |
|
This macro retrieves the signal-specific data for the given engine.
|
|
This macro sets the signal-specific data for the given engine.
|
|
This macro retrieves the socket-specific data for the given engine.
|
|
This macro sets the socket-specific data for the given engine.
|
|
This macro retrieves the timer-specific data for the given engine.
|
|
This macro sets the timer-specific data for the given engine.
|
|
This macro verifies that a given pointer actually does point to an ev_engine_t.
Definition at line 556 of file engines.h. Referenced by engine_activate(), engine_register(), and event_attr_engine(). |
|
All engines built as modules must define this macro to contain the name of the engine prior to the definition of engine_mod_init() or engine_module. Note that this name must be a valid C symbol. |
|
This mask is simply a bit-wise OR of EV_ENGINE_SOCKET, EV_ENGINE_SIGNAL, and EV_ENGINE_TIMER, used to extract only the engine components from the run flags (or wherever). Definition at line 527 of file engines.h. Referenced by engine_activate(), engine_load(), and event_init(). |
|
This macro is used to initialize an ev_engine_t.
|
|
This is the magic number used for the event engine structure. |
|
This flag is used to mark the engine as having already been registered with the events library. Definition at line 535 of file engines.h. Referenced by engine_activate(), engine_load(), engine_register(), and event_attr_engine(). |
|
This flag is used to indicate that the engine has been initialized by the events library and is running. Definition at line 542 of file engines.h. Referenced by engine_activate(), engine_load(), and event_destroy(). |
|
This flag is used to inform the events library that the engine can handle signals. It is also used by the library, in the call to the engine initialization method, to request that the engine initialize its signal interface--and returned by that method to indicate which engines were initialized. Definition at line 509 of file engines.h. Referenced by engine_activate(), engine_load(), engine_register(), and event_attr_engine(). |
|
This flag is used to inform the events library that the engine can handle sockets. It is also used by the library, in the call to the engine initialization method, to request that the engine initialize its socket interface--and returned by that method to indicate which engines were initialized. Definition at line 499 of file engines.h. Referenced by engine_activate(), engine_load(), engine_register(), and event_attr_engine(). |
|
This flag is used to inform the events library that the engine can handle timers. It is also used by the library, in the call to the engine initialization method, to request that the engine initialize its timer interface--and returned by that method to indicate which engines were initialized. Definition at line 519 of file engines.h. Referenced by engine_activate(), and engine_load(). |
|
This macro is used to clear the engine event flags on a socket.
|
|
This macro is used to set the engine event flags on a socket.
|
|
For internal use only. This type is a helper type for specifying a linked list of engines. It is used merely to simplify the struct _ev_engine_s structure. |
|
For internal use only. This type is a helper type for specifying a set of signal callback functions and ancillary data. It is used merely to simplify the struct _ev_engine_s structure. |
|
For internal use only. This type is a helper type for specifying a set of socket callback functions and ancillary data. It is used merely to simplify the struct _ev_engine_s structure. |
|
For internal use only. This type is a helper type for specifying a set of timer callback functions and ancillary data. It is used merely to simplify the struct _ev_engine_s structure. |
|
The event engine structure describes an event engine. Each engine must declare and initialize an ev_engine_t and register it with engine_register(). |
|
This type describes an engine callback method for finalizing the event engine. Any engine allocating system resources SHOULD implement this method to do any necessary clean-up.
|
|
This type describes an engine callback method for initializing the event engine. All engines MUST implement this method. This method should make calls to engine_activate().
|
|
This type describes a callback function used to initialize an engine module loaded by event_init(). The callback function MUST make a call to engine_register() and MUST return an ev_engine_t for event_init() to initialize.
|
|
This type describes an engine callback method for polling for events by the engine. All engines MUST implement this method. This method should make calls to event_generate().
|
|
This type describes an engine callback method for registering a signal with the event engine. Any engine implementing signal events MUST implement this method.
|
|
This type describes an engine callback method for unregistering a signal from the event engine. Any engine implementing signal events MUST implement this method.
|
|
This type describes an engine callback method for registering a socket with the event engine. Any engine implementing socket events MUST implement this method.
|
|
This type describes an engine callback method for changing the interest set on a socket. Any engine implementing socket events MUST implement this method.
|
|
This type describes an engine callback method for unregistering a socket from the event engine. Any engine implementing socket events MUST implement this method.
|
|
This type describes an engine callback method for registering a timer with the event engine. Any engine implementing timer events MUST implement this method.
|
|
This type describes an engine callback method for unregistering a timer from the event engine. Any engine implementing timer events MUST implement this method.
|
|
This function is used to activate an engine for the given engine component.
Definition at line 64 of file engine_activate.c. References ec_verify, eng_link, _ev_engine_s::eng_runfl, eng_runfl_set, eng_verify, EV_ENGINE_COMPMASK, EV_ENGINE_REGISTERED, EV_ENGINE_RUNNING, EV_ENGINE_SIGNAL, EV_ENGINE_SOCKET, EV_ENGINE_TIMER, ev_init, and ev_return. Referenced by em_init(), and emi_init(). |
|
This function, if defined by an engine module, will be called upon module load by event_init(). It may perform any initialization tasks that must be done prior to the call to the engine's initialization method. It MUST make a call to engine_register() AND return a pointer to the registered ev_engine_t.
Definition at line 169 of file engmodinit.c. References engine_register(). Here is the call graph for this function: ![]() |
|
|
Engines must be registered with the library during the event_init() call. This function allows the application to specify a list of application-specific engines to be attached to the attributes object, so that applications may provide their own engines.
Definition at line 35 of file event_attr_engine.c. References ea_engines, ea_verify, _ev_englink_s::el_next, _ev_englink_s::el_prev, _ev_engine_s::eng_flags, _ev_engine_s::eng_init, _ev_engine_s::eng_list, _ev_engine_s::eng_name, _ev_engine_s::eng_poll, _ev_engine_s::eng_runfl, _ev_engine_s::eng_signal, _ev_engine_s::eng_socket, eng_verify, _ev_signals_s::esi_add, _ev_signals_s::esi_rem, _ev_sockets_s::eso_add, _ev_sockets_s::eso_ev, _ev_sockets_s::eso_rem, EV_ENGINE_REGISTERED, EV_ENGINE_SIGNAL, EV_ENGINE_SOCKET, ev_init, and ev_return. Referenced by main(). |
|
This variable, if defined by an engine module which does not define an engine_mod_init() function, MUST contain the engine descriptor for the engine contained within the loadable module. The event_init() function will pass this descriptor to engine_register() and will initialize the module described by it.
Definition at line 153 of file engmodule.c. |