\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 \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 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Eet__File__Cipher__Group_gafde124ec4aa3d6ad934e7cc43c24ae3a}{eet\+\_\+read\+\_\+cipher} (\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 Read a specified entry from an eet file and return data using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\+\_\+write\+\_\+cipher} (\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 Write a specified entry to an eet file handle using a cipher. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

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


\subsection{Function Documentation}
\hypertarget{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[{eet\+\_\+read\+\_\+cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void$\ast$ eet\+\_\+read\+\_\+cipher (
\begin{DoxyParamCaption}
\item[{{\bf Eet\+\_\+\+File} $\ast$}]{ef, }
\item[{const char $\ast$}]{name, }
\item[{int $\ast$}]{size\+\_\+ret, }
\item[{const char $\ast$}]{cipher\+\_\+key}
\end{DoxyParamCaption}
)}}\label{group__Eet__File__Cipher__Group_gafde124ec4aa3d6ad934e7cc43c24ae3a}


Read 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\+L\+L 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\+L\+L is returned and size\+\_\+ret is filled with 0.

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


References E\+E\+T\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+I\+O\+N\+\_\+\+S\+U\+P\+E\+R\+F\+A\+S\+T, E\+E\+T\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+I\+O\+N\+\_\+\+V\+E\+R\+Y\+F\+A\+S\+T, E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D, and E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+T\+E.



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

\hypertarget{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[{eet\+\_\+write\+\_\+cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eet\+\_\+write\+\_\+cipher (
\begin{DoxyParamCaption}
\item[{{\bf 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}
)}}\label{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}


Write 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't compress). \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes written on successful write, 0 on failure.
\end{DoxyReturn}
This function will write the specified chunk of data to the eet file and return greater than 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, 0 will be returned and no action will be performed.

Name, and data must not be N\+U\+L\+L, 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}
\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\+\_\+write()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{eet-data-cipher_decipher_8c-example}{eet-\/data-\/cipher\+\_\+decipher.\+c}.\end{Desc}


References E\+E\+T\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+I\+O\+N\+\_\+\+S\+U\+P\+E\+R\+F\+A\+S\+T, E\+E\+T\+\_\+\+C\+O\+M\+P\+R\+E\+S\+S\+I\+O\+N\+\_\+\+V\+E\+R\+Y\+F\+A\+S\+T, E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+T\+E, and E\+E\+T\+\_\+\+F\+I\+L\+E\+\_\+\+M\+O\+D\+E\+\_\+\+W\+R\+I\+T\+E.



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

