\doxysection{src/core/timer.c File Reference}
\label{timer_8c}\index{src/core/timer.c@{src/core/timer.c}}
{\ttfamily \#include $<$assert.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$limits.\+h$>$}\newline
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/core/timer.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer\+\_\+compat.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/linuxlist.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ \+\_\+\+\_\+add\+\_\+timer} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\item 
void \textbf{ osmo\+\_\+timer\+\_\+setup} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer, void($\ast$cb)(void $\ast$\textbf{ data}), void $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em set up timer callback and data \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timer\+\_\+add} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\begin{DoxyCompactList}\small\item\em add a new timer to the timer management \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timer\+\_\+schedule} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer, int seconds, int microseconds)
\begin{DoxyCompactList}\small\item\em schedule a timer at a given future relative time \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timer\+\_\+del} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\begin{DoxyCompactList}\small\item\em delete a timer from timer management \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timer\+\_\+pending} (const struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\begin{DoxyCompactList}\small\item\em check if given timer is still pending \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timer\+\_\+remaining} (const struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer, const struct timeval $\ast$now, struct timeval $\ast$remaining)
\begin{DoxyCompactList}\small\item\em compute the remaining time of a timer \end{DoxyCompactList}\item 
struct timeval $\ast$ \textbf{ osmo\+\_\+timers\+\_\+nearest} (void)
\begin{DoxyCompactList}\small\item\em Determine time between now and the nearest timer. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timers\+\_\+nearest\+\_\+ms} (void)
\begin{DoxyCompactList}\small\item\em Determine time between now and the nearest timer in milliseconds. \end{DoxyCompactList}\item 
static void \textbf{ update\+\_\+nearest} (struct timeval $\ast$cand, struct timeval $\ast$current)
\item 
void \textbf{ osmo\+\_\+timers\+\_\+prepare} (void)
\begin{DoxyCompactList}\small\item\em Find the nearest time and update nearest\+\_\+p. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timers\+\_\+update} (void)
\begin{DoxyCompactList}\small\item\em fire all timers... and remove them \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timers\+\_\+check} (void)
\begin{DoxyCompactList}\small\item\em Check how many timers we have in the system. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static \+\_\+\+\_\+thread struct timeval \textbf{ nearest}
\item 
static \+\_\+\+\_\+thread struct timeval $\ast$ \textbf{ nearest\+\_\+p}
\item 
static \+\_\+\+\_\+thread struct \textbf{ rb\+\_\+root} \textbf{ timer\+\_\+root} = \textbf{ RB\+\_\+\+ROOT}
\end{DoxyCompactItemize}
