diff options
author | Patrick McHardy <kaber@trash.net> | 2010-11-15 19:02:02 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-11-16 15:13:28 +0100 |
commit | 293fb1e809dc73d71bd67f07d8539323065e1809 (patch) | |
tree | c347c3d5b74b2efcaf0f321c3f89ab6ff4b94c56 | |
parent | d84f619c3a5f8eabab9999f04abbb7f1af8a5d82 (diff) |
timer: export timer functions declarations
The functions are already exported, also export the declarations
since they are useful and easier to use than f.i. using libevent
directly.
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | include/dect/timer.h | 22 | ||||
-rw-r--r-- | include/timer.h | 11 | ||||
-rw-r--r-- | src/timer.c | 6 |
3 files changed, 29 insertions, 10 deletions
diff --git a/include/dect/timer.h b/include/dect/timer.h new file mode 100644 index 0000000..dbca28b --- /dev/null +++ b/include/dect/timer.h @@ -0,0 +1,22 @@ +/* + * libdect timer handling + * + * Copyright (c) 2009-2010 Patrick McHardy <kaber@trash.net> + */ + +#ifndef _LIBDECT_DECT_TIMER_H +#define _LIBDECT_DECT_TIMER_H + +extern struct dect_timer *dect_timer_alloc(const struct dect_handle *dh); +extern void dect_timer_free(const struct dect_handle *dh, struct dect_timer *timer); +extern void dect_timer_setup(struct dect_timer *timer, + void (*cb)(struct dect_handle *, struct dect_timer *), + void *data); +extern void dect_timer_start(const struct dect_handle *dh, + struct dect_timer *timer, unsigned int timeout); +extern void dect_timer_stop(const struct dect_handle *dh, struct dect_timer *timer); +extern bool dect_timer_running(const struct dect_timer *timer); + +extern void *dect_timer_data(const struct dect_timer *timer); + +#endif /* _LIBDECT_DECT_TIMER_H */ diff --git a/include/timer.h b/include/timer.h index 5ff9033..665add4 100644 --- a/include/timer.h +++ b/include/timer.h @@ -8,6 +8,7 @@ #define _LIBDECT_TIMER_H #include <utils.h> +#include <dect/timer.h> struct dect_handle; @@ -32,14 +33,4 @@ struct dect_timer { uint8_t priv[] __aligned(__alignof__(uint64_t)); }; -extern struct dect_timer *dect_timer_alloc(const struct dect_handle *dh); -extern void dect_timer_free(const struct dect_handle *dh, struct dect_timer *timer); -extern void dect_timer_setup(struct dect_timer *timer, - void (*cb)(struct dect_handle *, struct dect_timer *), - void *data); -extern void dect_timer_start(const struct dect_handle *dh, - struct dect_timer *timer, unsigned int timeout); -extern void dect_timer_stop(const struct dect_handle *dh, struct dect_timer *timer); -extern bool dect_timer_running(const struct dect_timer *timer); - #endif /* _LIBDECT_TIMER_H */ diff --git a/src/timer.c b/src/timer.c index b1ad429..66d255b 100644 --- a/src/timer.c +++ b/src/timer.c @@ -68,6 +68,12 @@ void *dect_timer_priv(struct dect_timer *timer) } EXPORT_SYMBOL(dect_timer_priv); +void *dect_timer_data(const struct dect_timer *timer) +{ + return timer->data; +} +EXPORT_SYMBOL(dect_timer_data); + void dect_timer_setup(struct dect_timer *timer, void (*cb)(struct dect_handle *, struct dect_timer *), void *data) |