dect
/
libdect
Archived
13
0
Fork 0

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>
This commit is contained in:
Patrick McHardy 2010-11-15 19:02:02 +01:00
parent d84f619c3a
commit 293fb1e809
3 changed files with 29 additions and 10 deletions

22
include/dect/timer.h Normal file
View File

@ -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 */

View File

@ -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 */

View File

@ -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)