mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
common: reltimer_arg to access a timer argument.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
09459a97c7
commit
3018113012
2 changed files with 8 additions and 0 deletions
|
@ -30,6 +30,11 @@ struct oneshot *new_reltimer_(struct timers *timers,
|
|||
return t;
|
||||
}
|
||||
|
||||
void *reltimer_arg(struct oneshot *t)
|
||||
{
|
||||
return t->arg;
|
||||
}
|
||||
|
||||
void timer_expired(tal_t *ctx, struct timer *timer)
|
||||
{
|
||||
struct oneshot *t = container_of(timer, struct oneshot, timer);
|
||||
|
|
|
@ -15,6 +15,9 @@ struct oneshot *new_reltimer_(struct timers *timers,
|
|||
new_reltimer_((timers), (ctx), (relexpire), \
|
||||
typesafe_cb(void, void *, (func), (arg)), (arg))
|
||||
|
||||
/* Get timer arg. */
|
||||
void *reltimer_arg(struct oneshot *t);
|
||||
|
||||
void timer_expired(tal_t *ctx, struct timer *timer);
|
||||
|
||||
#endif /* LIGHTNING_COMMON_TIMEOUT_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue