libosmocore
1.5.1
Osmocom core library
|
Go to the documentation of this file.
51 #define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60)
52 #define OSMO_SEC2HRS(sec) ((sec % (60 * 60 * 24)) / (60 * 60))
53 #define OSMO_SEC2DAY(sec) ((sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24))
81 const struct timeval *now,
82 struct timeval *remaining);
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
shim around gettimeofday to be able to set the time manually.
Definition: timer_gettimeofday.c:60
A structure representing a single instance of a timer.
Definition: timer.h:56
void osmo_timer_add(struct osmo_timer_list *timer)
add a new timer to the timer management
Definition: timer.c:84
int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp)
int osmo_timers_nearest_ms(void)
Determine time between now and the nearest timer in milliseconds.
Definition: timer.c:190
int osmo_timers_update(void)
fire all timers...
Definition: timer.c:237
void osmo_gettimeofday_override_add(time_t secs, suseconds_t usecs)
convenience function to advance the fake time.
Definition: timer_gettimeofday.c:72
struct timeval timeout
expiration time
Definition: timer.h:59
void osmo_clock_override_add(clockid_t clk_id, time_t secs, long nsecs)
void * data
user data for callback
Definition: timer.h:63
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
schedule a timer at a given future relative time
Definition: timer.c:103
void osmo_clock_override_enable(clockid_t clk_id, bool enable)
bool osmo_gettimeofday_override
Definition: timer_gettimeofday.c:48
void osmo_timers_prepare(void)
Find the nearest time and update nearest_p.
Definition: timer.c:219
struct timeval * osmo_timers_nearest(void)
Determine time between now and the nearest timer.
Definition: timer.c:179
(double) linked list header structure
Definition: linuxlist.h:46
struct llist_head list
internal list header
Definition: timer.h:58
int osmo_timer_pending(struct osmo_timer_list *timer)
check if given timer is still pending
Definition: timer.c:138
struct rb_node node
rb-tree node header
Definition: timer.h:57
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
set up timer callback and data
Definition: timer.c:74
struct timeval osmo_gettimeofday_override_time
Definition: timer_gettimeofday.c:49
struct timespec * osmo_clock_override_gettimespec(clockid_t clk_id)
void(* cb)(void *)
call-back called at timeout
Definition: timer.h:62
void osmo_timer_del(struct osmo_timer_list *timer)
delete a timer from timer management
Definition: timer.c:120
Definition: linuxrbtree.h:100
unsigned int active
is it active?
Definition: timer.h:60
int osmo_timers_check(void)
Check how many timers we have in the system.
Definition: timer.c:283
int osmo_timer_remaining(const struct osmo_timer_list *timer, const struct timeval *now, struct timeval *remaining)
compute the remaining time of a timer
Definition: timer.c:152