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

49 lines
885 B
C
Raw Normal View History

2019-02-09 18:02:53 +00:00
#ifndef _WSFS_TIMER_H
#define _WSFS_TIMER_H
#include "wsfs/time/timepoint.h"
struct wsfs_timer;
struct wsfs_timeout_manager;
typedef void wsfs_timer_timeout_fn(struct wsfs_timer * timer);
struct wsfs_timer
{
struct wsfs_timeout_manager * manager;
wsfs_timepoint timeout;
wsfs_timer_timeout_fn * timeout_handler;
void * user_data;
struct wsfs_timer * next;
struct wsfs_timer * prev;
};
#ifdef __cplusplus
extern "C"
{
#endif
extern void wsfs_timer_init(
struct wsfs_timer * timer,
struct wsfs_timeout_manager * manager);
extern void wsfs_timer_cleanup(
struct wsfs_timer * timer);
extern void wsfs_timer_start(
struct wsfs_timer * timer,
wsfs_timepoint absolute_timeout,
wsfs_timer_timeout_fn * handler,
void * user_data);
extern void wsfs_timer_cancel(
struct wsfs_timer * timer);
#ifdef __cplusplus
}
#endif
#endif