2019-03-24 01:03:31 +00:00
|
|
|
#ifndef WSFS_ADAPTER_IMPL_TIME_TIMER_H
|
|
|
|
#define WSFS_ADAPTER_IMPL_TIME_TIMER_H
|
2019-02-09 18:02:53 +00:00
|
|
|
|
2019-03-24 00:15:29 +00:00
|
|
|
#include "wsfs/adapter/impl/time/timepoint.h"
|
2019-02-09 18:02:53 +00:00
|
|
|
|
2019-03-24 01:10:03 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
struct wsfs_impl_timer;
|
|
|
|
struct wsfs_impl_timeout_manager;
|
2019-02-09 18:02:53 +00:00
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
typedef void wsfs_impl_timer_timeout_fn(struct wsfs_impl_timer * timer);
|
2019-02-09 18:02:53 +00:00
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
struct wsfs_impl_timer
|
2019-02-09 18:02:53 +00:00
|
|
|
{
|
2019-03-24 17:02:28 +00:00
|
|
|
struct wsfs_impl_timeout_manager * manager;
|
|
|
|
wsfs_impl_timepoint timeout;
|
|
|
|
wsfs_impl_timer_timeout_fn * timeout_handler;
|
2019-02-09 18:02:53 +00:00
|
|
|
void * user_data;
|
2019-03-24 17:02:28 +00:00
|
|
|
struct wsfs_impl_timer * next;
|
|
|
|
struct wsfs_impl_timer * prev;
|
2019-02-09 18:02:53 +00:00
|
|
|
};
|
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
extern void wsfs_impl_timer_init(
|
|
|
|
struct wsfs_impl_timer * timer,
|
|
|
|
struct wsfs_impl_timeout_manager * manager);
|
2019-02-09 18:02:53 +00:00
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
extern void wsfs_impl_timer_cleanup(
|
|
|
|
struct wsfs_impl_timer * timer);
|
2019-02-09 18:02:53 +00:00
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
extern void wsfs_impl_timer_start(
|
|
|
|
struct wsfs_impl_timer * timer,
|
|
|
|
wsfs_impl_timepoint absolute_timeout,
|
|
|
|
wsfs_impl_timer_timeout_fn * handler,
|
2019-02-09 18:02:53 +00:00
|
|
|
void * user_data);
|
|
|
|
|
2019-03-24 17:02:28 +00:00
|
|
|
extern void wsfs_impl_timer_cancel(
|
|
|
|
struct wsfs_impl_timer * timer);
|
2019-02-09 18:02:53 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|