\hypertarget{group__Emile__Group__Compression}{}\section{Non destructive general purpose compression functions.}
\label{group__Emile__Group__Compression}\index{Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}}


Function that allow the compression and expansion of Eina\+\_\+\+Binbuf with non destructive algorithm.  


\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__Emile__Group__Compression_ga7291d875e7ec4d21417399b46fd5e3d5}{Emile\+\_\+\+Compressor\+\_\+\+Type} \{ \\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+Z\+L\+I\+B}, 
\\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+L\+Z4}, 
\\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+L\+Z4\+H\+C}
 \}\begin{DoxyCompactList}\small\item\em Supported type of compression algorithm. \end{DoxyCompactList}
\item 
enum \hyperlink{group__Emile__Group__Compression_ga85e2dba6ce06a5b2b2e45628a1af1cf9}{Emile\+\_\+\+Compressor\+\_\+\+Level} \{ \\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+O\+R\+\_\+\+D\+E\+F\+A\+U\+L\+T} = -\/1, 
\\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+O\+R\+\_\+\+N\+O\+N\+E} = 0, 
\\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+O\+R\+\_\+\+F\+A\+S\+T} = 1, 
\\*
{\bfseries E\+M\+I\+L\+E\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+O\+R\+\_\+\+B\+E\+S\+T} = 9
 \}\begin{DoxyCompactList}\small\item\em Compression level to apply. \end{DoxyCompactList}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Binary__Buffer__Group_ga914e43cfe068d65db0dd3fbb80bcfd2a}{Eina\+\_\+\+Binbuf} $\ast$ \hyperlink{group__Emile__Group__Compression_gab4809e8eaef6421421d7ca31bdf28f94}{emile\+\_\+compress} (const \hyperlink{group__Eina__Binary__Buffer__Group_ga914e43cfe068d65db0dd3fbb80bcfd2a}{Eina\+\_\+\+Binbuf} $\ast$in, \hyperlink{group__Emile__Group__Compression_ga7291d875e7ec4d21417399b46fd5e3d5}{Emile\+\_\+\+Compressor\+\_\+\+Type} t, \hyperlink{group__Emile__Group__Compression_ga85e2dba6ce06a5b2b2e45628a1af1cf9}{Emile\+\_\+\+Compressor\+\_\+\+Level} level)
\begin{DoxyCompactList}\small\item\em Compress an Eina\+\_\+\+Binbuf into a new Eina\+\_\+\+Binbuf. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Binary__Buffer__Group_ga914e43cfe068d65db0dd3fbb80bcfd2a}{Eina\+\_\+\+Binbuf} $\ast$ \hyperlink{group__Emile__Group__Compression_ga2ac27325e29e05b214ccfc8f9d2e4992}{emile\+\_\+decompress} (const \hyperlink{group__Eina__Binary__Buffer__Group_ga914e43cfe068d65db0dd3fbb80bcfd2a}{Eina\+\_\+\+Binbuf} $\ast$in, \hyperlink{group__Emile__Group__Compression_ga7291d875e7ec4d21417399b46fd5e3d5}{Emile\+\_\+\+Compressor\+\_\+\+Type} t, unsigned int dest\+\_\+length)
\begin{DoxyCompactList}\small\item\em Uncompress a buffer into a newly allocated buffer. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Emile__Group__Compression_gaf1d864952f97411de8cbab4888b2dd92}{emile\+\_\+expand} (const \hyperlink{group__Eina__Binary__Buffer__Group_ga914e43cfe068d65db0dd3fbb80bcfd2a}{Eina\+\_\+\+Binbuf} $\ast$in, \hyperlink{group__Eina__Binary__Buffer__Group_ga914e43cfe068d65db0dd3fbb80bcfd2a}{Eina\+\_\+\+Binbuf} $\ast$out, \hyperlink{group__Emile__Group__Compression_ga7291d875e7ec4d21417399b46fd5e3d5}{Emile\+\_\+\+Compressor\+\_\+\+Type} t)
\begin{DoxyCompactList}\small\item\em Uncompress a buffer into an existing buffer. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Function that allow the compression and expansion of Eina\+\_\+\+Binbuf with non destructive algorithm. 



\subsection{Enumeration Type Documentation}
\hypertarget{group__Emile__Group__Compression_ga7291d875e7ec4d21417399b46fd5e3d5}{}\index{Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}!Emile\+\_\+\+Compressor\+\_\+\+Type@{Emile\+\_\+\+Compressor\+\_\+\+Type}}
\index{Emile\+\_\+\+Compressor\+\_\+\+Type@{Emile\+\_\+\+Compressor\+\_\+\+Type}!Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}}
\subsubsection[{Emile\+\_\+\+Compressor\+\_\+\+Type}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Emile\+\_\+\+Compressor\+\_\+\+Type}}\label{group__Emile__Group__Compression_ga7291d875e7ec4d21417399b46fd5e3d5}


Supported type of compression algorithm. 

\begin{DoxySince}{Since}
1.\+14
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
emile\+\_\+binbuf\+\_\+compress() 

emile\+\_\+binbuf\+\_\+uncompress() 

emile\+\_\+binbuf\+\_\+expand() 
\end{DoxySeeAlso}
\hypertarget{group__Emile__Group__Compression_ga85e2dba6ce06a5b2b2e45628a1af1cf9}{}\index{Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}!Emile\+\_\+\+Compressor\+\_\+\+Level@{Emile\+\_\+\+Compressor\+\_\+\+Level}}
\index{Emile\+\_\+\+Compressor\+\_\+\+Level@{Emile\+\_\+\+Compressor\+\_\+\+Level}!Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}}
\subsubsection[{Emile\+\_\+\+Compressor\+\_\+\+Level}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Emile\+\_\+\+Compressor\+\_\+\+Level}}\label{group__Emile__Group__Compression_ga85e2dba6ce06a5b2b2e45628a1af1cf9}


Compression level to apply. 

\begin{DoxySince}{Since}
1.\+14
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
emile\+\_\+binbuf\+\_\+compress(); 
\end{DoxySeeAlso}


\subsection{Function Documentation}
\hypertarget{group__Emile__Group__Compression_gab4809e8eaef6421421d7ca31bdf28f94}{}\index{Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}!emile\+\_\+compress@{emile\+\_\+compress}}
\index{emile\+\_\+compress@{emile\+\_\+compress}!Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}}
\subsubsection[{emile\+\_\+compress(const Eina\+\_\+\+Binbuf $\ast$in, Emile\+\_\+\+Compressor\+\_\+\+Type t, Emile\+\_\+\+Compressor\+\_\+\+Level level)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Eina\+\_\+\+Binbuf}$\ast$ emile\+\_\+compress (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Binbuf} $\ast$}]{in, }
\item[{{\bf Emile\+\_\+\+Compressor\+\_\+\+Type}}]{t, }
\item[{{\bf Emile\+\_\+\+Compressor\+\_\+\+Level}}]{level}
\end{DoxyParamCaption}
)}\label{group__Emile__Group__Compression_gab4809e8eaef6421421d7ca31bdf28f94}


Compress an Eina\+\_\+\+Binbuf into a new Eina\+\_\+\+Binbuf. 


\begin{DoxyParams}{Parameters}
{\em in} & Buffer to compress. \\
\hline
{\em t} & Type of compression logic to use. \\
\hline
{\em level} & Level of compression to apply.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
On success it will return a buffer that contains the compressed data, {\ttfamily N\+U\+L\+L} otherwise.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+14 
\end{DoxySince}


References eina\+\_\+binbuf\+\_\+length\+\_\+get(), eina\+\_\+binbuf\+\_\+manage\+\_\+new(), eina\+\_\+binbuf\+\_\+string\+\_\+get(), E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, and E\+I\+N\+A\+\_\+\+T\+R\+U\+E.



Referenced by eet\+\_\+alias(), and eet\+\_\+write\+\_\+cipher().

\hypertarget{group__Emile__Group__Compression_ga2ac27325e29e05b214ccfc8f9d2e4992}{}\index{Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}!emile\+\_\+decompress@{emile\+\_\+decompress}}
\index{emile\+\_\+decompress@{emile\+\_\+decompress}!Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}}
\subsubsection[{emile\+\_\+decompress(const Eina\+\_\+\+Binbuf $\ast$in, Emile\+\_\+\+Compressor\+\_\+\+Type t, unsigned int dest\+\_\+length)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Eina\+\_\+\+Binbuf}$\ast$ emile\+\_\+decompress (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Binbuf} $\ast$}]{in, }
\item[{{\bf Emile\+\_\+\+Compressor\+\_\+\+Type}}]{t, }
\item[{unsigned int}]{dest\+\_\+length}
\end{DoxyParamCaption}
)}\label{group__Emile__Group__Compression_ga2ac27325e29e05b214ccfc8f9d2e4992}


Uncompress a buffer into a newly allocated buffer. 


\begin{DoxyParams}{Parameters}
{\em in} & Buffer to uncompress. \\
\hline
{\em t} & Type of compression logic to use. \\
\hline
{\em dest\+\_\+length} & Expected length of the decompressed data.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated buffer with the uncompressed data, {\ttfamily N\+U\+L\+L} if it failed.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+14
\end{DoxySince}
\begin{DoxyNote}{Note}
That if dest\+\_\+length doesn\textquotesingle{}t match the expanded data, it will just fail and return {\ttfamily N\+U\+L\+L}. 
\end{DoxyNote}


References eina\+\_\+binbuf\+\_\+free(), eina\+\_\+binbuf\+\_\+manage\+\_\+new(), E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, and emile\+\_\+expand().



Referenced by eet\+\_\+alias\+\_\+get(), eet\+\_\+read\+\_\+cipher(), and eet\+\_\+read\+\_\+direct().

\hypertarget{group__Emile__Group__Compression_gaf1d864952f97411de8cbab4888b2dd92}{}\index{Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}!emile\+\_\+expand@{emile\+\_\+expand}}
\index{emile\+\_\+expand@{emile\+\_\+expand}!Non destructive general purpose compression functions.@{Non destructive general purpose compression functions.}}
\subsubsection[{emile\+\_\+expand(const Eina\+\_\+\+Binbuf $\ast$in, Eina\+\_\+\+Binbuf $\ast$out, Emile\+\_\+\+Compressor\+\_\+\+Type t)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Eina\+\_\+\+Bool} emile\+\_\+expand (
\begin{DoxyParamCaption}
\item[{const {\bf Eina\+\_\+\+Binbuf} $\ast$}]{in, }
\item[{{\bf Eina\+\_\+\+Binbuf} $\ast$}]{out, }
\item[{{\bf Emile\+\_\+\+Compressor\+\_\+\+Type}}]{t}
\end{DoxyParamCaption}
)}\label{group__Emile__Group__Compression_gaf1d864952f97411de8cbab4888b2dd92}


Uncompress a buffer into an existing buffer. 


\begin{DoxyParams}{Parameters}
{\em in} & Buffer to uncompress. \\
\hline
{\em out} & Buffer to expand data into. \\
\hline
{\em t} & Type of compression logic to use.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+U\+E if it succeed, E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E if it failed. 
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+14
\end{DoxySince}
\begin{DoxyNote}{Note}
The out buffer should have the necessary size to hold the expanded data or it will fail. In case of failure, random garbage could fill the out buffer. 
\end{DoxyNote}


References eina\+\_\+binbuf\+\_\+length\+\_\+get(), eina\+\_\+binbuf\+\_\+string\+\_\+get(), E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, and E\+I\+N\+A\+\_\+\+T\+R\+U\+E.



Referenced by emile\+\_\+decompress().

