2016-01-21 20:11:48 +00:00
|
|
|
#ifndef LIGHTNING_DAEMON_TIMEOUT_H
|
|
|
|
#define LIGHTNING_DAEMON_TIMEOUT_H
|
|
|
|
#include "config.h"
|
|
|
|
|
2016-04-24 11:07:13 +01:00
|
|
|
#include <ccan/tal/tal.h>
|
2016-01-21 20:11:48 +00:00
|
|
|
#include <ccan/time/time.h>
|
|
|
|
#include <ccan/timer/timer.h>
|
|
|
|
#include <ccan/typesafe_cb/typesafe_cb.h>
|
|
|
|
|
2016-05-09 21:56:09 +01:00
|
|
|
/* tal_free this to disable timer. */
|
2017-02-04 14:32:02 +00:00
|
|
|
struct oneshot *new_reltimer_(struct timers *timers,
|
2016-05-09 21:56:09 +01:00
|
|
|
const tal_t *ctx,
|
|
|
|
struct timerel expire,
|
|
|
|
void (*cb)(void *), void *arg);
|
2016-01-21 20:11:48 +00:00
|
|
|
|
2017-02-04 14:32:02 +00:00
|
|
|
#define new_reltimer(timers, ctx, relexpire, func, arg) \
|
|
|
|
new_reltimer_((timers), (ctx), (relexpire), \
|
2016-05-09 21:56:09 +01:00
|
|
|
typesafe_cb(void, void *, (func), (arg)), (arg))
|
2016-01-21 20:11:48 +00:00
|
|
|
|
2017-02-04 14:32:02 +00:00
|
|
|
void timer_expired(tal_t *ctx, struct timer *timer);
|
2016-01-21 20:15:27 +00:00
|
|
|
|
2016-01-21 20:11:48 +00:00
|
|
|
#endif /* LIGHTNING_DAEMON_TIMEOUT_H */
|