You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
885 B
49 lines
885 B
6 years ago
|
#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
|