\doxysection{include/osmocom/core/bit16gen.h File Reference}
\label{bit16gen_8h}\index{include/osmocom/core/bit16gen.h@{include/osmocom/core/bit16gen.h}}
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+load16le\+\_\+ext} (const void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em load unaligned n-\/byte integer (little-\/endian encoding) into uint16\+\_\+t, into the least significant octets. \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+load16be\+\_\+ext} (const void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em load unaligned n-\/byte integer (big-\/endian encoding) into uint16\+\_\+t, into the MOST significant octets. \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+load16be\+\_\+ext\+\_\+2} (const void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em load unaligned n-\/byte integer (big-\/endian encoding) into uint16\+\_\+t, into the least significant octets. \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store16le\+\_\+ext} (uint16\+\_\+t \textbf{ x}, void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em store unaligned n-\/byte integer (little-\/endian encoding) from uint16\+\_\+t \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store16be\+\_\+ext} (uint16\+\_\+t \textbf{ x}, void $\ast$p, uint8\+\_\+t \textbf{ n})
\begin{DoxyCompactList}\small\item\em store unaligned n-\/byte integer (big-\/endian encoding) from uint16\+\_\+t \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+load16le} (const void $\ast$p)
\begin{DoxyCompactList}\small\item\em load unaligned 16-\/bit integer (little-\/endian encoding) \end{DoxyCompactList}\item 
static uint16\+\_\+t \textbf{ osmo\+\_\+load16be} (const void $\ast$p)
\begin{DoxyCompactList}\small\item\em load unaligned 16-\/bit integer (big-\/endian encoding) \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store16le} (uint16\+\_\+t \textbf{ x}, void $\ast$p)
\begin{DoxyCompactList}\small\item\em store unaligned 16-\/bit integer (little-\/endian encoding) \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+store16be} (uint16\+\_\+t \textbf{ x}, void $\ast$p)
\begin{DoxyCompactList}\small\item\em store unaligned 16-\/bit integer (big-\/endian encoding) \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{bit16gen_8h_ac4316e9600be38095bd3cf9c9ba36034}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_load16be@{osmo\_load16be}}
\index{osmo\_load16be@{osmo\_load16be}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_load16be()}
{\footnotesize\ttfamily static uint16\+\_\+t osmo\+\_\+load16be (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned 16-\/bit integer (big-\/endian encoding) 



References \textbf{ osmo\+\_\+load16be\+\_\+ext()}.



Referenced by \textbf{ bitvec\+\_\+get\+\_\+int16\+\_\+msb()}, \textbf{ bitvec\+\_\+shiftl()}, \textbf{ msgb\+\_\+get\+\_\+u16()}, and \textbf{ msgb\+\_\+pull\+\_\+u16()}.

\mbox{\label{bit16gen_8h_a450dbd88d8858eeb5de9c76f6f02b214}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_load16be\_ext@{osmo\_load16be\_ext}}
\index{osmo\_load16be\_ext@{osmo\_load16be\_ext}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_load16be\_ext()}
{\footnotesize\ttfamily static uint16\+\_\+t osmo\+\_\+load16be\+\_\+ext (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned n-\/byte integer (big-\/endian encoding) into uint16\+\_\+t, into the MOST significant octets. 

WARNING\+: for n $<$ sizeof(uint16\+\_\+t), the result is not returned in the least significant octets, as one might expect. To always return the same value as fed to \doxyref{osmo\+\_\+store16be\+\_\+ext()}{p.}{bit16gen_8h_a6a99c7969c0b344390345c9a3fa2caec} before, use \doxyref{osmo\+\_\+load16be\+\_\+ext\+\_\+2()}{p.}{bit16gen_8h_a5ec2fa851cfe3fe89e4e1cfd717a38af}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p} & Buffer where integer is stored \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes stored in p \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
16 bit unsigned integer 
\end{DoxyReturn}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



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

\mbox{\label{bit16gen_8h_a5ec2fa851cfe3fe89e4e1cfd717a38af}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_load16be\_ext\_2@{osmo\_load16be\_ext\_2}}
\index{osmo\_load16be\_ext\_2@{osmo\_load16be\_ext\_2}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_load16be\_ext\_2()}
{\footnotesize\ttfamily static uint16\+\_\+t osmo\+\_\+load16be\+\_\+ext\+\_\+2 (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned n-\/byte integer (big-\/endian encoding) into uint16\+\_\+t, into the least significant octets. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p} & Buffer where integer is stored \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes stored in p \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
16 bit unsigned integer 
\end{DoxyReturn}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.

\mbox{\label{bit16gen_8h_ac889036814030b1d0cc125fcc17e3718}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_load16le@{osmo\_load16le}}
\index{osmo\_load16le@{osmo\_load16le}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_load16le()}
{\footnotesize\ttfamily static uint16\+\_\+t osmo\+\_\+load16le (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned 16-\/bit integer (little-\/endian encoding) 



References \textbf{ osmo\+\_\+load16le\+\_\+ext()}.

\mbox{\label{bit16gen_8h_adaa9cbfc6f37448b137dceb82eb9b799}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_load16le\_ext@{osmo\_load16le\_ext}}
\index{osmo\_load16le\_ext@{osmo\_load16le\_ext}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_load16le\_ext()}
{\footnotesize\ttfamily static uint16\+\_\+t osmo\+\_\+load16le\+\_\+ext (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



load unaligned n-\/byte integer (little-\/endian encoding) into uint16\+\_\+t, into the least significant octets. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em p} & Buffer where integer is stored \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes stored in p \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
16 bit unsigned integer 
\end{DoxyReturn}


References \textbf{ n}, and \textbf{ OSMO\+\_\+\+ASSERT}.



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

\mbox{\label{bit16gen_8h_a1b4030030fde2f0d8ff27ea8ac3875fb}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_store16be@{osmo\_store16be}}
\index{osmo\_store16be@{osmo\_store16be}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_store16be()}
{\footnotesize\ttfamily static void osmo\+\_\+store16be (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{x,  }\item[{void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned 16-\/bit integer (big-\/endian encoding) 



References \textbf{ osmo\+\_\+store16be\+\_\+ext()}, and \textbf{ x}.



Referenced by \textbf{ bitvec\+\_\+shiftl()}, \textbf{ msgb\+\_\+push\+\_\+u16()}, and \textbf{ msgb\+\_\+put\+\_\+u16()}.

\mbox{\label{bit16gen_8h_a6a99c7969c0b344390345c9a3fa2caec}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_store16be\_ext@{osmo\_store16be\_ext}}
\index{osmo\_store16be\_ext@{osmo\_store16be\_ext}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_store16be\_ext()}
{\footnotesize\ttfamily static void osmo\+\_\+store16be\+\_\+ext (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{x,  }\item[{void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned n-\/byte integer (big-\/endian encoding) from uint16\+\_\+t 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & unsigned 16 bit integer \\
\hline
\mbox{\texttt{ out}}  & {\em p} & Buffer to store integer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes to store \\
\hline
\end{DoxyParams}


References \textbf{ n}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ x}.



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

\mbox{\label{bit16gen_8h_a940ae5f8a6b23f79393b3d12085b1a40}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_store16le@{osmo\_store16le}}
\index{osmo\_store16le@{osmo\_store16le}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_store16le()}
{\footnotesize\ttfamily static void osmo\+\_\+store16le (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{x,  }\item[{void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned 16-\/bit integer (little-\/endian encoding) 



References \textbf{ osmo\+\_\+store16le\+\_\+ext()}, and \textbf{ x}.

\mbox{\label{bit16gen_8h_a0a17886ab7c6a2fcccb2cdad11d98edb}} 
\index{bit16gen.h@{bit16gen.h}!osmo\_store16le\_ext@{osmo\_store16le\_ext}}
\index{osmo\_store16le\_ext@{osmo\_store16le\_ext}!bit16gen.h@{bit16gen.h}}
\doxysubsubsection{osmo\_store16le\_ext()}
{\footnotesize\ttfamily static void osmo\+\_\+store16le\+\_\+ext (\begin{DoxyParamCaption}\item[{uint16\+\_\+t}]{x,  }\item[{void $\ast$}]{p,  }\item[{uint8\+\_\+t}]{n }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



store unaligned n-\/byte integer (little-\/endian encoding) from uint16\+\_\+t 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & unsigned 16 bit integer \\
\hline
\mbox{\texttt{ out}}  & {\em p} & Buffer to store integer \\
\hline
\mbox{\texttt{ in}}  & {\em n} & Number of bytes to store \\
\hline
\end{DoxyParams}


References \textbf{ n}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ x}.



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

