\hypertarget{group__Eet__File__Cipher__Group}{}\doxysection{Eet File Ciphered Main Functions}
\label{group__Eet__File__Cipher__Group}\index{Eet File Ciphered Main Functions@{Eet File Ciphered Main Functions}}


Most of the \mbox{\hyperlink{group__Eet__File__Group}{Eet File Main Functions}} have alternative versions that accounts for ciphers to protect their content.  


\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI void $\ast$ \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\+\_\+read\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, int $\ast$size\+\_\+ret, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Reads a specified entry from an eet file and return data using a cipher. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\+\_\+write\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, const void $\ast$data, int size, int compress, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Writes a specified entry to an eet file handle using a cipher. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Most of the \mbox{\hyperlink{group__Eet__File__Group}{Eet File Main Functions}} have alternative versions that accounts for ciphers to protect their content. 

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Cipher__Group}{Cipher, Identity and Protection Mechanisms}} 
\end{DoxySeeAlso}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}\label{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}} 
\index{Eet File Ciphered Main Functions@{Eet File Ciphered Main Functions}!eet\_read\_cipher@{eet\_read\_cipher}}
\index{eet\_read\_cipher@{eet\_read\_cipher}!Eet File Ciphered Main Functions@{Eet File Ciphered Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_read\_cipher()}{eet\_read\_cipher()}}
{\footnotesize\ttfamily EAPI void $\ast$ eet\+\_\+read\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name,  }\item[{int $\ast$}]{size\+\_\+ret,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Reads a specified entry from an eet file and return data using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for reading. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em size\+\_\+ret} & Number of bytes read from entry and returned. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The data stored in that entry in the eet file.
\end{DoxyReturn}
This function finds an entry in the eet file that is stored under the name specified, and returns that data, decompressed, if successful. NULL is returned if the lookup fails or if memory errors are encountered. It is the job of the calling program to call free() on the returned data. The number of bytes in the returned data chunk are placed in size\+\_\+ret.

If the eet file handle is not valid NULL is returned and size\+\_\+ret is filled with {\ttfamily 0}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\+\_\+read()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-data-cipher_decipher_8c-example}{eet-\/data-\/cipher\+\_\+decipher.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}, \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}, \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\+\_\+read\+\_\+cipher()}}, \mbox{\hyperlink{group__Eina__Binary__Buffer__Group_ga9d4cb2aa16689f4388f082c18b0ac395}{eina\+\_\+binbuf\+\_\+free()}}, \mbox{\hyperlink{group__Eina__Binary__Buffer__Group_ga70c8dfe71516ea732b4a168f658bcfb3}{eina\+\_\+binbuf\+\_\+length\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Binary__Buffer__Group_ga7b1c3549ff0454056461c0084925baea}{eina\+\_\+binbuf\+\_\+string\+\_\+steal()}}, \mbox{\hyperlink{group__Emile__Cipher__Group_gad8f8a8895108021d06d96de43a02bf0a}{emile\+\_\+binbuf\+\_\+decipher()}}, and \mbox{\hyperlink{group__Emile__Group__Compression_ga7d82a8d7e46633742993c4127187574d}{emile\+\_\+decompress()}}.



Referenced by \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga5f80e7c90720422ee595f229fd8fcbef}{eet\+\_\+data\+\_\+dump\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__File__Image__Group_gaaede1b1c1f586c3ff0a7aea6cc1d589c}{eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get()}}, \mbox{\hyperlink{group__Eet__File__Image__Cipher__Group_ga32c48cbd5dfe3a6f5fc3cace1b83a879}{eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__File__Image__Cipher__Group_ga063a09e2d7b5b03d7e78c2936b1e336e}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__File__Image__Cipher__Group_ga69620a01c0239a1c3405f461525bf2fe}{eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+cspace\+\_\+surface\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Node__Group_gac06efd635c519fcd1aa7ce07462ac1e9}{eet\+\_\+data\+\_\+node\+\_\+read\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Data__Cipher__Group_gae9ce74bcfb4be47d2bb8c7e87090812f}{eet\+\_\+data\+\_\+read\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Data__Cipher__Group_gae20c746ed8ccd528388423d795fcb37f}{eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer()}}, \mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\+\_\+read()}}, and \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\+\_\+read\+\_\+cipher()}}.

\mbox{\Hypertarget{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}\label{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}} 
\index{Eet File Ciphered Main Functions@{Eet File Ciphered Main Functions}!eet\_write\_cipher@{eet\_write\_cipher}}
\index{eet\_write\_cipher@{eet\_write\_cipher}!Eet File Ciphered Main Functions@{Eet File Ciphered Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_write\_cipher()}{eet\_write\_cipher()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+write\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name,  }\item[{const void $\ast$}]{data,  }\item[{int}]{size,  }\item[{int}]{compress,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Writes a specified entry to an eet file handle using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for writing. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em data} & Pointer to the data to be stored. \\
\hline
{\em size} & Length in bytes in the data to be stored. \\
\hline
{\em compress} & Compression flags (1 == compress, 0 = don\textquotesingle{}t compress). \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Bytes written on successful write, {\ttfamily 0} on failure.
\end{DoxyReturn}
This function will write the specified chunk of data to the eet file and return greater than {\ttfamily 0} on success. 0 will be returned on failure.

The eet file handle must be a valid file handle for an eet file opened for writing. If it is not, {\ttfamily 0} will be returned and no action will be performed.

Name, and data must not be NULL, and size must be \texorpdfstring{$>$}{>} 0. If these conditions are not met, 0 will be returned.

The data will be copied (and optionally compressed) in ram, pending a flush to disk (it will stay in ram till the eet file handle is closed though).

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\+\_\+write()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-data-cipher_decipher_8c-example}{eet-\/data-\/cipher\+\_\+decipher.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}, \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+WRITE}}, \mbox{\hyperlink{group__Eina__Binary__Buffer__Group_ga9d4cb2aa16689f4388f082c18b0ac395}{eina\+\_\+binbuf\+\_\+free()}}, \mbox{\hyperlink{group__Eina__Binary__Buffer__Group_ga70c8dfe71516ea732b4a168f658bcfb3}{eina\+\_\+binbuf\+\_\+length\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Binary__Buffer__Group_ga6a5ab6afc496ad8e92964b71dd9ffef9}{eina\+\_\+binbuf\+\_\+manage\+\_\+new()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}, \mbox{\hyperlink{group__Emile__Cipher__Group_gac4498328161d16ca45da65c55b33288a}{emile\+\_\+binbuf\+\_\+cipher()}}, and \mbox{\hyperlink{group__Emile__Group__Compression_ga5b145482e6b6243ca1923b8ce2c3007b}{emile\+\_\+compress()}}.



Referenced by \mbox{\hyperlink{group__Eet__File__Image__Cipher__Group_ga71bcbecdbb40470e722bdb0a5abfc1bb}{eet\+\_\+data\+\_\+image\+\_\+write\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Node__Group_gab40746777c4b47e38416c1b77425aa96}{eet\+\_\+data\+\_\+node\+\_\+write\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga58060eca71513b8634a32e076dc8dd85}{eet\+\_\+data\+\_\+undump\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}{eet\+\_\+data\+\_\+write\+\_\+cipher()}}, and \mbox{\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\+\_\+write()}}.

