2017-08-29 01:36:01 +09:30
|
|
|
#ifndef LIGHTNING_COMMON_TIMEOUT_H
|
|
|
|
#define LIGHTNING_COMMON_TIMEOUT_H
|
2016-01-22 06:41:48 +10:30
|
|
|
#include "config.h"
|
|
|
|
|
2016-04-24 19:37:13 +09:30
|
|
|
#include <ccan/tal/tal.h>
|
2016-01-22 06:41:48 +10:30
|
|
|
#include <ccan/timer/timer.h>
|
|
|
|
|
2016-05-10 06:26:09 +09:30
|
|
|
/* tal_free this to disable timer. */
|
2017-02-04 15:32:02 +01:00
|
|
|
struct oneshot *new_reltimer_(struct timers *timers,
|
2016-05-10 06:26:09 +09:30
|
|
|
const tal_t *ctx,
|
|
|
|
struct timerel expire,
|
|
|
|
void (*cb)(void *), void *arg);
|
2016-01-22 06:41:48 +10:30
|
|
|
|
2017-02-04 15:32:02 +01:00
|
|
|
#define new_reltimer(timers, ctx, relexpire, func, arg) \
|
|
|
|
new_reltimer_((timers), (ctx), (relexpire), \
|
2016-05-10 06:26:09 +09:30
|
|
|
typesafe_cb(void, void *, (func), (arg)), (arg))
|
2016-01-22 06:41:48 +10:30
|
|
|
|
2021-10-07 14:27:05 +10:30
|
|
|
/* Get timer arg. */
|
|
|
|
void *reltimer_arg(struct oneshot *t);
|
|
|
|
|
2017-02-04 15:32:02 +01:00
|
|
|
void timer_expired(tal_t *ctx, struct timer *timer);
|
2016-01-22 06:45:27 +10:30
|
|
|
|
2017-08-29 01:36:01 +09:30
|
|
|
#endif /* LIGHTNING_COMMON_TIMEOUT_H */
|