\hypertarget{group__Eet__File__Cipher__Group}{}\section{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.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eet__File__Cipher__Group_gafde124ec4aa3d6ad934e7cc43c24ae3a}{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 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} 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}


\subsection{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}


\subsection{Function Documentation}
\mbox{\Hypertarget{group__Eet__File__Cipher__Group_gafde124ec4aa3d6ad934e7cc43c24ae3a}\label{group__Eet__File__Cipher__Group_gafde124ec4aa3d6ad934e7cc43c24ae3a}} 
\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}}
\subsubsection{\texorpdfstring{eet\+\_\+read\+\_\+cipher()}{eet\_read\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} 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. N\+U\+LL 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 N\+U\+LL is returned and size\+\_\+ret is filled with {\ttfamily 0}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__File__Group_gac13cdf7782d1e513f5b1abcc529962f4}{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 E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+AD, E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE, and emile\+\_\+binbuf\+\_\+decipher().



Referenced by eet\+\_\+data\+\_\+image\+\_\+colorspace\+\_\+get(), eet\+\_\+data\+\_\+image\+\_\+header\+\_\+read\+\_\+cipher(), eet\+\_\+data\+\_\+image\+\_\+read\+\_\+cipher(), eet\+\_\+data\+\_\+image\+\_\+read\+\_\+to\+\_\+cspace\+\_\+surface\+\_\+cipher(), eet\+\_\+data\+\_\+node\+\_\+read\+\_\+cipher(), and eet\+\_\+read().

\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}}
\subsubsection{\texorpdfstring{eet\+\_\+write\+\_\+cipher()}{eet\_write\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} 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 N\+U\+LL, and size must be $>$ 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 E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE, E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+W\+R\+I\+TE, eina\+\_\+binbuf\+\_\+manage\+\_\+new(), E\+I\+N\+A\+\_\+\+T\+R\+UE, and emile\+\_\+compress().



Referenced by eet\+\_\+data\+\_\+image\+\_\+write\+\_\+cipher(), eet\+\_\+data\+\_\+node\+\_\+write\+\_\+cipher(), eet\+\_\+data\+\_\+undump\+\_\+cipher(), and eet\+\_\+write().

