2020-06-16 21:57:41 +00:00
|
|
|
#ifndef WFP_TIMER_TIMER_H
|
|
|
|
#define WFP_TIMER_TIMER_H
|
2020-03-29 15:40:33 +00:00
|
|
|
|
2020-06-16 21:39:45 +00:00
|
|
|
#include "webfuse_provider/impl/timer/timer.h"
|
|
|
|
#include "webfuse_provider/impl/timer/on_timer_fn.h"
|
|
|
|
#include "webfuse_provider/impl/timer/timepoint.h"
|
2020-03-29 15:40:33 +00:00
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdbool.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_timer
|
2020-03-29 15:40:33 +00:00
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_timer_manager * manager;
|
|
|
|
wfp_timer_timepoint timeout;
|
|
|
|
wfp_timer_on_timer_fn * on_timer;
|
2020-03-29 15:40:33 +00:00
|
|
|
void * user_data;
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_timer * next;
|
|
|
|
struct wfp_timer * prev;
|
2020-03-29 15:40:33 +00:00
|
|
|
};
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern bool wfp_timer_is_timeout(
|
|
|
|
struct wfp_timer * timer);
|
2020-03-29 15:40:33 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void wfp_timer_trigger(
|
|
|
|
struct wfp_timer * timer);
|
2020-03-29 15:40:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|