2020-06-28 17:43:08 +00:00
|
|
|
#ifndef WF_IMPL_TIMER_TIMER_H
|
|
|
|
#define WF_IMPL_TIMER_TIMER_H
|
2020-03-29 15:40:33 +00:00
|
|
|
|
2020-06-28 17:43:08 +00:00
|
|
|
#include "webfuse/impl/timer/timer.h"
|
|
|
|
#include "webfuse/impl/timer/on_timer_fn.h"
|
|
|
|
#include "webfuse/impl/timer/timepoint.h"
|
2020-03-29 15:40:33 +00:00
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdbool.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct wf_timer
|
|
|
|
{
|
|
|
|
struct wf_timer_manager * manager;
|
|
|
|
wf_timer_timepoint timeout;
|
|
|
|
wf_timer_on_timer_fn * on_timer;
|
|
|
|
void * user_data;
|
|
|
|
struct wf_timer * next;
|
|
|
|
struct wf_timer * prev;
|
|
|
|
};
|
|
|
|
|
2020-06-28 17:43:08 +00:00
|
|
|
extern bool wf_impl_timer_is_timeout(
|
2020-03-29 15:40:33 +00:00
|
|
|
struct wf_timer * timer);
|
|
|
|
|
2020-06-28 17:43:08 +00:00
|
|
|
extern void wf_impl_timer_trigger(
|
2020-03-29 15:40:33 +00:00
|
|
|
struct wf_timer * timer);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|