1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/lib/wsfs/adapter/impl/time/timer.h

49 lines
1.0 KiB
C
Raw Normal View History

#ifndef WSFS_ADAPTER_IMPL_TIME_TIMER_H
#define WSFS_ADAPTER_IMPL_TIME_TIMER_H
2019-02-09 18:02:53 +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