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


\doxysubsection{Function Documentation}
\mbox{\label{bit64gen_8h_ac37a729baf4be619a2e50a960754b17b}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_load64be@{osmo\_load64be}}
\index{osmo\_load64be@{osmo\_load64be}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_load64be()}
{\footnotesize\ttfamily static uint64\+\_\+t osmo\+\_\+load64be (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



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



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

\mbox{\label{bit64gen_8h_aaf77aa28a4f0e968e28c6f498a2e8ea9}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_load64be\_ext@{osmo\_load64be\_ext}}
\index{osmo\_load64be\_ext@{osmo\_load64be\_ext}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_load64be\_ext()}
{\footnotesize\ttfamily static uint64\+\_\+t osmo\+\_\+load64be\+\_\+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 uint64\+\_\+t, into the MOST significant octets. 

WARNING\+: for n $<$ sizeof(uint64\+\_\+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\+\_\+store64be\+\_\+ext()}{p.}{bit64gen_8h_acd56fa8fc8e4ed1d4956769fa8862dbb} before, use \doxyref{osmo\+\_\+load64be\+\_\+ext\+\_\+2()}{p.}{bit64gen_8h_ad04fd7112f2b0b5c532ab48598807171}. 
\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}
64 bit unsigned integer 
\end{DoxyReturn}


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



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

\mbox{\label{bit64gen_8h_ad04fd7112f2b0b5c532ab48598807171}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_load64be\_ext\_2@{osmo\_load64be\_ext\_2}}
\index{osmo\_load64be\_ext\_2@{osmo\_load64be\_ext\_2}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_load64be\_ext\_2()}
{\footnotesize\ttfamily static uint64\+\_\+t osmo\+\_\+load64be\+\_\+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 uint64\+\_\+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}
64 bit unsigned integer 
\end{DoxyReturn}


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

\mbox{\label{bit64gen_8h_a807ef287aed34ef394e0296c2199ab9d}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_load64le@{osmo\_load64le}}
\index{osmo\_load64le@{osmo\_load64le}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_load64le()}
{\footnotesize\ttfamily static uint64\+\_\+t osmo\+\_\+load64le (\begin{DoxyParamCaption}\item[{const void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



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



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

\mbox{\label{bit64gen_8h_a1dbb4054dc1c02e53b4f74835e8ea712}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_load64le\_ext@{osmo\_load64le\_ext}}
\index{osmo\_load64le\_ext@{osmo\_load64le\_ext}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_load64le\_ext()}
{\footnotesize\ttfamily static uint64\+\_\+t osmo\+\_\+load64le\+\_\+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 uint64\+\_\+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}
64 bit unsigned integer 
\end{DoxyReturn}


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



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

\mbox{\label{bit64gen_8h_aa6c599f3b43767a7771fc93e1723c07a}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_store64be@{osmo\_store64be}}
\index{osmo\_store64be@{osmo\_store64be}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_store64be()}
{\footnotesize\ttfamily static void osmo\+\_\+store64be (\begin{DoxyParamCaption}\item[{uint64\+\_\+t}]{x,  }\item[{void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



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



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

\mbox{\label{bit64gen_8h_acd56fa8fc8e4ed1d4956769fa8862dbb}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_store64be\_ext@{osmo\_store64be\_ext}}
\index{osmo\_store64be\_ext@{osmo\_store64be\_ext}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_store64be\_ext()}
{\footnotesize\ttfamily static void osmo\+\_\+store64be\+\_\+ext (\begin{DoxyParamCaption}\item[{uint64\+\_\+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 uint64\+\_\+t 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & unsigned 64 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\+\_\+encode\+\_\+big\+\_\+endian()}, and \textbf{ osmo\+\_\+store64be()}.

\mbox{\label{bit64gen_8h_af9603548303f49aaac70953a2ee63046}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_store64le@{osmo\_store64le}}
\index{osmo\_store64le@{osmo\_store64le}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_store64le()}
{\footnotesize\ttfamily static void osmo\+\_\+store64le (\begin{DoxyParamCaption}\item[{uint64\+\_\+t}]{x,  }\item[{void $\ast$}]{p }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



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



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

\mbox{\label{bit64gen_8h_afb48fab8193e98a7986bc4657e66c9c4}} 
\index{bit64gen.h@{bit64gen.h}!osmo\_store64le\_ext@{osmo\_store64le\_ext}}
\index{osmo\_store64le\_ext@{osmo\_store64le\_ext}!bit64gen.h@{bit64gen.h}}
\doxysubsubsection{osmo\_store64le\_ext()}
{\footnotesize\ttfamily static void osmo\+\_\+store64le\+\_\+ext (\begin{DoxyParamCaption}\item[{uint64\+\_\+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 uint64\+\_\+t 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & unsigned 64 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\+\_\+store64le()}.

