\doxysection{src/core/rbtree.c File Reference}
\label{rbtree_8c}\index{src/core/rbtree.c@{src/core/rbtree.c}}
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/core/linuxrbtree.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ \+\_\+\+\_\+rb\+\_\+rotate\+\_\+left} (struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node}, struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
static void \textbf{ \+\_\+\+\_\+rb\+\_\+rotate\+\_\+right} (struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node}, struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
void \textbf{ rb\+\_\+insert\+\_\+color} (struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node}, struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
static void \textbf{ \+\_\+\+\_\+rb\+\_\+erase\+\_\+color} (struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node}, struct \textbf{ rb\+\_\+node} $\ast$parent, struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
void \textbf{ rb\+\_\+erase} (struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node}, struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
struct \textbf{ rb\+\_\+node} $\ast$ \textbf{ rb\+\_\+first} (const struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
struct \textbf{ rb\+\_\+node} $\ast$ \textbf{ rb\+\_\+last} (const struct \textbf{ rb\+\_\+root} $\ast$root)
\item 
struct \textbf{ rb\+\_\+node} $\ast$ \textbf{ rb\+\_\+next} (const struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node})
\item 
struct \textbf{ rb\+\_\+node} $\ast$ \textbf{ rb\+\_\+prev} (const struct \textbf{ rb\+\_\+node} $\ast$\textbf{ node})
\item 
void \textbf{ rb\+\_\+replace\+\_\+node} (struct \textbf{ rb\+\_\+node} $\ast$victim, struct \textbf{ rb\+\_\+node} $\ast$new, struct \textbf{ rb\+\_\+root} $\ast$root)
\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{rbtree_8c_aca783acd80f2acbb1ab41d57e620258d}} 
\index{rbtree.c@{rbtree.c}!\_\_rb\_erase\_color@{\_\_rb\_erase\_color}}
\index{\_\_rb\_erase\_color@{\_\_rb\_erase\_color}!rbtree.c@{rbtree.c}}
\doxysubsubsection{\_\_rb\_erase\_color()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+rb\+\_\+erase\+\_\+color (\begin{DoxyParamCaption}\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{node,  }\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{parent,  }\item[{struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ \+\_\+\+\_\+rb\+\_\+rotate\+\_\+left()}, \textbf{ \+\_\+\+\_\+rb\+\_\+rotate\+\_\+right()}, \textbf{ node}, \textbf{ rb\+\_\+color}, \textbf{ rb\+\_\+is\+\_\+black}, \textbf{ rb\+\_\+is\+\_\+red}, \textbf{ rb\+\_\+node\+::rb\+\_\+left}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ rb\+\_\+parent}, \textbf{ rb\+\_\+node\+::rb\+\_\+right}, \textbf{ rb\+\_\+set\+\_\+black}, \textbf{ rb\+\_\+set\+\_\+color()}, and \textbf{ rb\+\_\+set\+\_\+red}.



Referenced by \textbf{ rb\+\_\+erase()}.

\mbox{\label{rbtree_8c_a673637582dd160489ff1b49e43a502cc}} 
\index{rbtree.c@{rbtree.c}!\_\_rb\_rotate\_left@{\_\_rb\_rotate\_left}}
\index{\_\_rb\_rotate\_left@{\_\_rb\_rotate\_left}!rbtree.c@{rbtree.c}}
\doxysubsubsection{\_\_rb\_rotate\_left()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+rb\+\_\+rotate\+\_\+left (\begin{DoxyParamCaption}\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{node,  }\item[{struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ node}, \textbf{ rb\+\_\+node\+::rb\+\_\+left}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ rb\+\_\+parent}, \textbf{ rb\+\_\+node\+::rb\+\_\+right}, and \textbf{ rb\+\_\+set\+\_\+parent()}.



Referenced by \textbf{ \+\_\+\+\_\+rb\+\_\+erase\+\_\+color()}, and \textbf{ rb\+\_\+insert\+\_\+color()}.

\mbox{\label{rbtree_8c_afad2a114dd2972b3e98ccbd788a00e45}} 
\index{rbtree.c@{rbtree.c}!\_\_rb\_rotate\_right@{\_\_rb\_rotate\_right}}
\index{\_\_rb\_rotate\_right@{\_\_rb\_rotate\_right}!rbtree.c@{rbtree.c}}
\doxysubsubsection{\_\_rb\_rotate\_right()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+rb\+\_\+rotate\+\_\+right (\begin{DoxyParamCaption}\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{node,  }\item[{struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ node}, \textbf{ rb\+\_\+node\+::rb\+\_\+left}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ rb\+\_\+parent}, \textbf{ rb\+\_\+node\+::rb\+\_\+right}, and \textbf{ rb\+\_\+set\+\_\+parent()}.



Referenced by \textbf{ \+\_\+\+\_\+rb\+\_\+erase\+\_\+color()}, and \textbf{ rb\+\_\+insert\+\_\+color()}.

\mbox{\label{rbtree_8c_aaf97b19a6ab48c3ac68356712c86de99}} 
\index{rbtree.c@{rbtree.c}!rb\_erase@{rb\_erase}}
\index{rb\_erase@{rb\_erase}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_erase()}
{\footnotesize\ttfamily void rb\+\_\+erase (\begin{DoxyParamCaption}\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{node,  }\item[{struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})}



References \textbf{ \+\_\+\+\_\+rb\+\_\+erase\+\_\+color()}, \textbf{ color()}, \textbf{ node}, \textbf{ RB\+\_\+\+BLACK}, \textbf{ rb\+\_\+color}, \textbf{ rb\+\_\+left}, \textbf{ rb\+\_\+node\+::rb\+\_\+left}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ rb\+\_\+parent}, \textbf{ rb\+\_\+node\+::rb\+\_\+parent\+\_\+color}, \textbf{ rb\+\_\+node\+::rb\+\_\+right}, and \textbf{ rb\+\_\+set\+\_\+parent()}.



Referenced by \textbf{ osmo\+\_\+timer\+\_\+del()}.

\mbox{\label{rbtree_8c_a1297e3f835e459a923c678ca425469f2}} 
\index{rbtree.c@{rbtree.c}!rb\_first@{rb\_first}}
\index{rb\_first@{rb\_first}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_first()}
{\footnotesize\ttfamily struct \textbf{ rb\+\_\+node} $\ast$ rb\+\_\+first (\begin{DoxyParamCaption}\item[{const struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})}



References \textbf{ n}, and \textbf{ rb\+\_\+root\+::rb\+\_\+node}.



Referenced by \textbf{ osmo\+\_\+timers\+\_\+check()}, \textbf{ osmo\+\_\+timers\+\_\+prepare()}, and \textbf{ osmo\+\_\+timers\+\_\+update()}.

\mbox{\label{rbtree_8c_aaa9d2b611f394a0598c1f26919a4bbe3}} 
\index{rbtree.c@{rbtree.c}!rb\_insert\_color@{rb\_insert\_color}}
\index{rb\_insert\_color@{rb\_insert\_color}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_insert\_color()}
{\footnotesize\ttfamily void rb\+\_\+insert\+\_\+color (\begin{DoxyParamCaption}\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{node,  }\item[{struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})}



References \textbf{ \+\_\+\+\_\+rb\+\_\+rotate\+\_\+left()}, \textbf{ \+\_\+\+\_\+rb\+\_\+rotate\+\_\+right()}, \textbf{ node}, \textbf{ rb\+\_\+is\+\_\+red}, \textbf{ rb\+\_\+node\+::rb\+\_\+left}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ rb\+\_\+parent}, \textbf{ rb\+\_\+node\+::rb\+\_\+right}, \textbf{ rb\+\_\+set\+\_\+black}, and \textbf{ rb\+\_\+set\+\_\+red}.



Referenced by \textbf{ \+\_\+\+\_\+add\+\_\+timer()}.

\mbox{\label{rbtree_8c_ae8169b2c6514051b96ddc64e2e1c71f3}} 
\index{rbtree.c@{rbtree.c}!rb\_last@{rb\_last}}
\index{rb\_last@{rb\_last}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_last()}
{\footnotesize\ttfamily struct \textbf{ rb\+\_\+node} $\ast$ rb\+\_\+last (\begin{DoxyParamCaption}\item[{const struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})}



References \textbf{ n}, and \textbf{ rb\+\_\+root\+::rb\+\_\+node}.

\mbox{\label{rbtree_8c_a501296ccc0bfadb5543888bd118640ed}} 
\index{rbtree.c@{rbtree.c}!rb\_next@{rb\_next}}
\index{rb\_next@{rb\_next}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_next()}
{\footnotesize\ttfamily struct \textbf{ rb\+\_\+node} $\ast$ rb\+\_\+next (\begin{DoxyParamCaption}\item[{const struct \textbf{ rb\+\_\+node} $\ast$}]{node }\end{DoxyParamCaption})}



References \textbf{ node}, \textbf{ rb\+\_\+parent}, and \textbf{ rb\+\_\+node\+::rb\+\_\+right}.



Referenced by \textbf{ osmo\+\_\+timers\+\_\+check()}, and \textbf{ osmo\+\_\+timers\+\_\+update()}.

\mbox{\label{rbtree_8c_a4356073ebfcc558daf8891b0fa4ac762}} 
\index{rbtree.c@{rbtree.c}!rb\_prev@{rb\_prev}}
\index{rb\_prev@{rb\_prev}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_prev()}
{\footnotesize\ttfamily struct \textbf{ rb\+\_\+node} $\ast$ rb\+\_\+prev (\begin{DoxyParamCaption}\item[{const struct \textbf{ rb\+\_\+node} $\ast$}]{node }\end{DoxyParamCaption})}



References \textbf{ node}, \textbf{ rb\+\_\+node\+::rb\+\_\+left}, and \textbf{ rb\+\_\+parent}.

\mbox{\label{rbtree_8c_ad71b2a7ccaea205813fad9cfeb3b0765}} 
\index{rbtree.c@{rbtree.c}!rb\_replace\_node@{rb\_replace\_node}}
\index{rb\_replace\_node@{rb\_replace\_node}!rbtree.c@{rbtree.c}}
\doxysubsubsection{rb\_replace\_node()}
{\footnotesize\ttfamily void rb\+\_\+replace\+\_\+node (\begin{DoxyParamCaption}\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{victim,  }\item[{struct \textbf{ rb\+\_\+node} $\ast$}]{new,  }\item[{struct \textbf{ rb\+\_\+root} $\ast$}]{root }\end{DoxyParamCaption})}



References \textbf{ rb\+\_\+node\+::rb\+\_\+left}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ rb\+\_\+parent}, \textbf{ rb\+\_\+node\+::rb\+\_\+right}, and \textbf{ rb\+\_\+set\+\_\+parent()}.

