Files | |
file | tim.h |
Timer event system header file. | |
Data Structures | |
struct | _ev_timnode_s |
Timer node structure. More... | |
struct | _ev_tim_s |
Timer generator structure. More... | |
Defines | |
#define | EV_TIM_MAGIC |
Timer generator magic number. | |
#define | ti_verify(tim) |
Timer generator verification macro. | |
#define | ti_type(tim) |
Timer type. | |
#define | ti_value(tim) |
Timer value. | |
#define | ti_expire(tim) |
Timer expiration time. | |
Typedefs | |
typedef _ev_tim_s | ev_tim_t |
Timer generator. | |
typedef _ev_timnode_s | _ev_timnode_t |
Timer node. | |
Enumerations | |
enum | ev_timtype_t { TT_ABSOLUTE, TT_RELATIVE, TT_PERIODIC } |
Timer types. More... | |
Functions | |
ev_err_t | timer_create (ev_ctx_t *ctx, ev_timtype_t type, struct timeval *value, ev_call_t call, void *data, ev_tim_t **tim_p) |
Create a timer. | |
ev_err_t | timer_resched (ev_ctx_t *ctx, ev_tim_t *tim, ev_timtype_t type, struct timeval *value) |
Reschedule an existing timer. | |
ev_err_t | timer_destroy (ev_ctx_t *ctx, ev_tim_t *tim) |
Destroy an existing timer. |
|
This is the magic number used for the timer generator structure. Definition at line 117 of file tim.h. Referenced by event_init(), and main(). |
|
This macro returns the absolute expiration time for this timer, as computed by timer_create() or timer_resched() (or upon timer expiration, for TT_PERIODIC timers).
Definition at line 168 of file tim.h. Referenced by main(). |
|
This macro returns the type of the given timer.
Definition at line 142 of file tim.h. Referenced by main(). |
|
This macro returns the original time that was passed in the call to timer_create(). For TT_PERIODIC timers, this is the relative time for which the timer will be reset upon expiration.
Definition at line 155 of file tim.h. Referenced by main(). |
|
This macro verifies that a given pointer actually does point to an ev_tim_t.
Definition at line 131 of file tim.h. Referenced by timer_destroy(), and timer_resched(). |
|
For internal use only. Timers are stored in a priority queue. This structure specifies an entry on the timer queue. |
|
Timers are described using this structure. |
|
All timers have a timer type describing the kind of timer that is set. |
|
This function creates and schedules a timer for the specified
Definition at line 82 of file timer_create.c. References _timer_insert(), _ev_ctx_s::ec_timer, ec_verify, eg_callback_set, eg_calldata_set, eg_ref_inc, EGT_TIMER, _ev_englist_s::el_first, _ev_englink_s::el_next, _ev_englink_s::el_prev, eng_tim_add, eng_tim_rem, _ev_engine_s::eng_timer, _ev_timers_s::eti_active, ev_init, ev_return, event_gen_alloc(), event_gen_release(), ti_expire_comp, _ev_tim_s::ti_type, _ev_tim_s::ti_value, TT_ABSOLUTE, TT_PERIODIC, and TT_RELATIVE. Referenced by main(). Here is the call graph for this function: ![]() |
|
This function is used to destroy an existing timer. It may be used from the event callback for TT_PERIODIC timers.
Definition at line 109 of file timer_destroy.c. References _timer_untree(), _ev_ctx_s::ec_timer, ec_verify, eg_context, eg_flags, eg_flags_set, eg_ref_dec, _ev_englist_s::el_last, _ev_englink_s::el_prev, eng_tim_rem, _ev_engine_s::eng_timer, _ev_timers_s::eti_active, EV_GEN_DELETED, ev_init, ev_return, and ti_verify. Referenced by _timer_insert(), main(), and timer_resched(). Here is the call graph for this function: ![]() |
|
Sometimes, a timer must be rescheduled. This function provides a means for doing that. The function may be used from the event callback for the timer.
Definition at line 32 of file timer_resched.c. References _timer_heapify_down(), _timer_heapify_up(), _timer_insert(), _timer_untree(), _ev_ctx_s::ec_timer, ec_verify, eg_context, eg_flags, eg_flags_clr, eg_flags_set, eg_ref_dec, _ev_englist_s::el_first, _ev_englist_s::el_last, _ev_englink_s::el_next, _ev_englink_s::el_prev, eng_tim_add, eng_tim_rem, _ev_engine_s::eng_timer, _ev_timers_s::eti_active, EV_GEN_DELETED, ev_init, ev_return, _ev_tim_s::ti_expire, ti_expire_comp, _ev_tim_s::ti_type, _ev_tim_s::ti_value, ti_verify, timer_destroy(), TT_ABSOLUTE, TT_PERIODIC, TT_RELATIVE, and tv_comp. Referenced by main(). Here is the call graph for this function: ![]() |