mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
49 lines
885 B
C
49 lines
885 B
C
#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
|