\hypertarget{group__Eet__Data__Cipher__Group}{}\section{Eet Data Serialization using A Ciphers}
\label{group__Eet__Data__Cipher__Group}\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}


Most of the \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}} 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__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}{eet\+\_\+data\+\_\+read\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const char $\ast$name, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Reads a data structure from an eet file and decodes it using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga34dcdab8c3af830faddd6b9cd74fcb98}{eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const char $\ast$name, const char $\ast$cipher\+\_\+key, char $\ast$buffer, int buffer\+\_\+size)
\begin{DoxyCompactList}\small\item\em Reads a data structure from an eet file and decodes it into a buffer using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga6faefbe585855ab98aebeaf0cdc503b9}{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get}} (const char $\ast$filename, const char $\ast$attribute, \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Reads a data structure from an eet extended attribute and decodes it using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}{eet\+\_\+data\+\_\+write\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const char $\ast$name, const char $\ast$cipher\+\_\+key, const void $\ast$data, int compress)
\begin{DoxyCompactList}\small\item\em Writes a data structure from memory and store in an eet file using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga4aae479401e75a035a4d1e9185223546}{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set}} (const char $\ast$filename, const char $\ast$attribute, \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const char $\ast$cipher\+\_\+key, const void $\ast$data, \mbox{\hyperlink{group__Eina__Tools__Group_ga016f6b7c97a22104a6ba6d1b042548c8}{Eina\+\_\+\+Xattr\+\_\+\+Flags}} flags)
\begin{DoxyCompactList}\small\item\em Writes a data structure from memory and store in an eet extended attribute using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eet__Data__Cipher__Group_gac85bb8a9b46804288bb5e37caf21fd1c}{eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher}} (const void $\ast$data\+\_\+in, const char $\ast$cipher\+\_\+key, int size\+\_\+in, Eet\+\_\+\+Dump\+\_\+\+Callback dumpfunc, void $\ast$dumpdata)
\begin{DoxyCompactList}\small\item\em Dumps an eet encoded data structure into ascii text using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga99e8a3acd6c3fbe552b0f9d474ae4f0d}{eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher}} (const char $\ast$text, const char $\ast$cipher\+\_\+key, int textlen, int $\ast$size\+\_\+ret)
\begin{DoxyCompactList}\small\item\em Takes an ascii encoding from \mbox{\hyperlink{group__Eet__Data__Group_ga4160a247c086955b4734af896b6fd270}{eet\+\_\+data\+\_\+text\+\_\+dump()}} and re-\/encode in binary using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga5f80e7c90720422ee595f229fd8fcbef}{eet\+\_\+data\+\_\+dump\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, const char $\ast$cipher\+\_\+key, Eet\+\_\+\+Dump\+\_\+\+Callback dumpfunc, void $\ast$dumpdata)
\begin{DoxyCompactList}\small\item\em Dumps an eet encoded data structure from an eet file into ascii text using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga58060eca71513b8634a32e076dc8dd85}{eet\+\_\+data\+\_\+undump\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, const char $\ast$cipher\+\_\+key, const char $\ast$text, int textlen, int compress)
\begin{DoxyCompactList}\small\item\em Takes an ascii encoding from \mbox{\hyperlink{group__Eet__Data__Group_ga33b90cc41fe0e6fffc6b4fb0c8c62a99}{eet\+\_\+data\+\_\+dump()}} and re-\/encode in binary using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga139dd65b6d66537da27f3e9dd620a631}{eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const void $\ast$data\+\_\+in, const char $\ast$cipher\+\_\+key, int size\+\_\+in)
\begin{DoxyCompactList}\small\item\em Decodes a data structure from an arbitrary location in memory using a cipher. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void $\ast$ \mbox{\hyperlink{group__Eet__Data__Cipher__Group_gab765474a660b0dfe5f00d99a960206db}{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher}} (\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const void $\ast$data\+\_\+in, const char $\ast$cipher\+\_\+key, int $\ast$size\+\_\+ret)
\begin{DoxyCompactList}\small\item\em Encodes a data struct to memory and return that encoded data using a cipher. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Most of the \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}} 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__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}\label{group__Eet__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+read\+\_\+cipher@{eet\+\_\+data\+\_\+read\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+read\+\_\+cipher@{eet\+\_\+data\+\_\+read\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+read\+\_\+cipher()}{eet\_data\_read\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eet\+\_\+data\+\_\+read\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Reads a data structure from an eet file and decodes it using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & The eet file handle to read from. \\
\hline
{\em edd} & The data descriptor handle to use when decoding. \\
\hline
{\em name} & The key the data is stored under in the eet file. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the decoded data structure.
\end{DoxyReturn}
This function decodes a data structure stored in an eet file, returning a pointer to it if it decoded successfully, or N\+U\+LL on failure. This can save a programmer dozens of hours of work in writing configuration file parsing and writing code, as eet does all that work for the program and presents a program-\/friendly data structure, just as the programmer likes. Eet can handle members being added or deleted from the data in storage and safely zero-\/fills unfilled members if they were not found in the data. It checks sizes and headers whenever it reads data, allowing the programmer to not worry about corrupt data.

Once a data structure has been described by the programmer with the fields they wish to save or load, storing or retrieving a data structure from an eet file, or from a chunk of memory is as simple as a single function call.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Group_ga4d1807cbbc448304f22a8808318a3429}{eet\+\_\+data\+\_\+read()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


Referenced by eet\+\_\+data\+\_\+read().

\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga34dcdab8c3af830faddd6b9cd74fcb98}\label{group__Eet__Data__Cipher__Group_ga34dcdab8c3af830faddd6b9cd74fcb98}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer@{eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer}}
\index{eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer@{eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer()}{eet\_data\_read\_cipher\_buffer()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eet\+\_\+data\+\_\+read\+\_\+cipher\+\_\+buffer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{char $\ast$}]{buffer,  }\item[{int}]{buffer\+\_\+size }\end{DoxyParamCaption})}



Reads a data structure from an eet file and decodes it into a buffer using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & The eet file handle to read from. \\
\hline
{\em edd} & The data descriptor handle to use when decoding. \\
\hline
{\em name} & The key the data is stored under in the eet file. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em buffer} & Buffer. \\
\hline
{\em buffer\+\_\+size} & The buffer size. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to buffer if successful, and N\+U\+LL on error.
\end{DoxyReturn}
This function decodes a data structure stored in an eet file, returning a pointer to it if it decoded successfully, or N\+U\+LL on failure. This can save a programmer dozens of hours of work in writing configuration file parsing and writing code, as eet does all that work for the program and presents a program-\/friendly data structure, just as the programmer likes. Eet can handle members being added or deleted from the data in storage and safely zero-\/fills unfilled members if they were not found in the data. It checks sizes and headers whenever it reads data, allowing the programmer to not worry about corrupt data.

Once a data structure has been described by the programmer with the fields they wish to save or load, storing or retrieving a data structure from an eet file, or from a chunk of memory is as simple as a single function call.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}{eet\+\_\+data\+\_\+read\+\_\+cipher()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+10.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga6faefbe585855ab98aebeaf0cdc503b9}\label{group__Eet__Data__Cipher__Group_ga6faefbe585855ab98aebeaf0cdc503b9}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get@{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get}}
\index{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get@{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get()}{eet\_data\_xattr\_cipher\_get()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get (\begin{DoxyParamCaption}\item[{const char $\ast$}]{filename,  }\item[{const char $\ast$}]{attribute,  }\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Reads a data structure from an eet extended attribute and decodes it using a cipher. 


\begin{DoxyParams}{Parameters}
{\em filename} & The file to extract the extended attribute from. \\
\hline
{\em attribute} & The attribute to get the data from. \\
\hline
{\em edd} & The data descriptor handle to use when decoding. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the decoded data structure.
\end{DoxyReturn}
This function decodes a data structure stored in an eet extended attribute, returning a pointer to it if it decoded successfully, or N\+U\+LL on failure. Eet can handle members being added or deleted from the data in storage and safely zero-\/fills unfilled members if they were not found in the data. It checks sizes and headers whenever it reads data, allowing the programmer to not worry about corrupt data.

Once a data structure has been described by the programmer with the fields they wish to save or load, storing or retrieving a data structure from an eet file, from a chunk of memory or from an extended attribute is as simple as a single function call.

\begin{DoxySince}{Since}
1.\+5.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}\label{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+write\+\_\+cipher@{eet\+\_\+data\+\_\+write\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+write\+\_\+cipher@{eet\+\_\+data\+\_\+write\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+write\+\_\+cipher()}{eet\_data\_write\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eet\+\_\+data\+\_\+write\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{const void $\ast$}]{data,  }\item[{int}]{compress }\end{DoxyParamCaption})}



Writes a data structure from memory and store in an eet file using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & The eet file handle to write to. \\
\hline
{\em edd} & The data descriptor to use when encoding. \\
\hline
{\em name} & The key to store the data under in the eet file. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em data} & A pointer to the data structure to save and encode. \\
\hline
{\em compress} & Compression flags for storage. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes written on successful write, 0 on failure.
\end{DoxyReturn}
This function is the reverse of \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}{eet\+\_\+data\+\_\+read\+\_\+cipher()}}, saving a data structure to an eet file.

\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


Referenced by eet\+\_\+data\+\_\+write().

\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga4aae479401e75a035a4d1e9185223546}\label{group__Eet__Data__Cipher__Group_ga4aae479401e75a035a4d1e9185223546}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set@{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set}}
\index{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set@{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set()}{eet\_data\_xattr\_cipher\_set()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+set (\begin{DoxyParamCaption}\item[{const char $\ast$}]{filename,  }\item[{const char $\ast$}]{attribute,  }\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{const void $\ast$}]{data,  }\item[{\mbox{\hyperlink{group__Eina__Tools__Group_ga016f6b7c97a22104a6ba6d1b042548c8}{Eina\+\_\+\+Xattr\+\_\+\+Flags}}}]{flags }\end{DoxyParamCaption})}



Writes a data structure from memory and store in an eet extended attribute using a cipher. 


\begin{DoxyParams}{Parameters}
{\em filename} & The file to write the extended attribute to. \\
\hline
{\em attribute} & The attribute to store the data to. \\
\hline
{\em edd} & The data descriptor to use when encoding. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em data} & A pointer to the data structure to save and encode. \\
\hline
{\em flags} & The policy to use when setting the data. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+UE on success, E\+I\+N\+A\+\_\+\+F\+A\+L\+SE on failure.
\end{DoxyReturn}
This function is the reverse of \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga6faefbe585855ab98aebeaf0cdc503b9}{eet\+\_\+data\+\_\+xattr\+\_\+cipher\+\_\+get()}}, saving a data structure to an eet extended attribute.

\begin{DoxySince}{Since}
1.\+5.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_gac85bb8a9b46804288bb5e37caf21fd1c}\label{group__Eet__Data__Cipher__Group_gac85bb8a9b46804288bb5e37caf21fd1c}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher@{eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher@{eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher()}{eet\_data\_text\_dump\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eet\+\_\+data\+\_\+text\+\_\+dump\+\_\+cipher (\begin{DoxyParamCaption}\item[{const void $\ast$}]{data\+\_\+in,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{int}]{size\+\_\+in,  }\item[{Eet\+\_\+\+Dump\+\_\+\+Callback}]{dumpfunc,  }\item[{void $\ast$}]{dumpdata }\end{DoxyParamCaption})}



Dumps an eet encoded data structure into ascii text using a cipher. 


\begin{DoxyParams}{Parameters}
{\em data\+\_\+in} & The pointer to the data to decode into a struct. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em size\+\_\+in} & The size of the data pointed to in bytes. \\
\hline
{\em dumpfunc} & The function to call passed a string when new data is converted to text \\
\hline
{\em dumpdata} & The data to pass to the {\ttfamily dumpfunc} callback. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily 1} on success, {\ttfamily 0} on failure
\end{DoxyReturn}
This function will take a chunk of data encoded by \mbox{\hyperlink{group__Eet__Data__Group_gaa7c3b3a8cbeffc34c21dbbb1decc3c2d}{eet\+\_\+data\+\_\+descriptor\+\_\+encode()}} and convert it into human readable ascii text. It does this by calling the {\ttfamily dumpfunc} callback for all new text that is generated. This callback should append to any existing text buffer and will be passed the pointer {\ttfamily dumpdata} as a parameter as well as a string with new text to be appended.

Example\+:


\begin{DoxyCode}
\textcolor{keywordtype}{void} output(\textcolor{keywordtype}{void} *data, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keywordtype}{string})
\{
  printf(\textcolor{stringliteral}{"%s"}, \textcolor{keywordtype}{string});
\}

\textcolor{keywordtype}{void} dump(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *file)
\{
  FILE *f;
  \textcolor{keywordtype}{int} len;
  \textcolor{keywordtype}{void} *data;

  f = fopen(file, \textcolor{stringliteral}{"rb"});
  fseek(f, 0, SEEK\_END);
  len = ftell(f);
  rewind(f);
  data = malloc(len);
  fread(data, len, 1, f);
  fclose(f);
  \mbox{\hyperlink{group__Eet__Data__Cipher__Group_gac85bb8a9b46804288bb5e37caf21fd1c}{eet\_data\_text\_dump\_cipher}}(data, cipher\_key, len, output, NULL);
\}
\end{DoxyCode}


\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Group_ga4160a247c086955b4734af896b6fd270}{eet\+\_\+data\+\_\+text\+\_\+dump()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga99e8a3acd6c3fbe552b0f9d474ae4f0d}\label{group__Eet__Data__Cipher__Group_ga99e8a3acd6c3fbe552b0f9d474ae4f0d}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher@{eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher@{eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher()}{eet\_data\_text\_undump\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eet\+\_\+data\+\_\+text\+\_\+undump\+\_\+cipher (\begin{DoxyParamCaption}\item[{const char $\ast$}]{text,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{int}]{textlen,  }\item[{int $\ast$}]{size\+\_\+ret }\end{DoxyParamCaption})}



Takes an ascii encoding from \mbox{\hyperlink{group__Eet__Data__Group_ga4160a247c086955b4734af896b6fd270}{eet\+\_\+data\+\_\+text\+\_\+dump()}} and re-\/encode in binary using a cipher. 


\begin{DoxyParams}{Parameters}
{\em text} & The pointer to the string data to parse and encode. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em textlen} & The size of the string in bytes (not including 0 byte terminator). \\
\hline
{\em size\+\_\+ret} & This gets filled in with the encoded data blob size in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The encoded data on success, N\+U\+LL on failure.
\end{DoxyReturn}
This function will parse the string pointed to by {\ttfamily text} and return an encoded data lump the same way \mbox{\hyperlink{group__Eet__Data__Group_gaa7c3b3a8cbeffc34c21dbbb1decc3c2d}{eet\+\_\+data\+\_\+descriptor\+\_\+encode()}} takes an in-\/memory data struct and encodes into a binary blob. {\ttfamily text} is a normal C string.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Group_ga7ec4079e08e657a80bee05bd12e1b972}{eet\+\_\+data\+\_\+text\+\_\+undump()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


Referenced by eet\+\_\+data\+\_\+text\+\_\+undump().

\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga5f80e7c90720422ee595f229fd8fcbef}\label{group__Eet__Data__Cipher__Group_ga5f80e7c90720422ee595f229fd8fcbef}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+dump\+\_\+cipher@{eet\+\_\+data\+\_\+dump\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+dump\+\_\+cipher@{eet\+\_\+data\+\_\+dump\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+dump\+\_\+cipher()}{eet\_data\_dump\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eet\+\_\+data\+\_\+dump\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{Eet\+\_\+\+Dump\+\_\+\+Callback}]{dumpfunc,  }\item[{void $\ast$}]{dumpdata }\end{DoxyParamCaption})}



Dumps an eet encoded data structure from an eet file into ascii text using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em dumpfunc} & The function to call passed a string when new data is converted to text \\
\hline
{\em dumpdata} & The data to pass to the {\ttfamily dumpfunc} callback. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily 1} on success, {\ttfamily 0} on failure
\end{DoxyReturn}
This function will take an open and valid eet file from \mbox{\hyperlink{group__Eet__File__Group_ga5f55956b860aa2c77af9b1a880c4c256}{eet\+\_\+open()}} request the data encoded by \mbox{\hyperlink{group__Eet__Data__Group_gaa7c3b3a8cbeffc34c21dbbb1decc3c2d}{eet\+\_\+data\+\_\+descriptor\+\_\+encode()}} corresponding to the key {\ttfamily name} and convert it into human readable ascii text. It does this by calling the {\ttfamily dumpfunc} callback for all new text that is generated. This callback should append to any existing text buffer and will be passed the pointer {\ttfamily dumpdata} as a parameter as well as a string with new text to be appended.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Group_ga33b90cc41fe0e6fffc6b4fb0c8c62a99}{eet\+\_\+data\+\_\+dump()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga58060eca71513b8634a32e076dc8dd85}\label{group__Eet__Data__Cipher__Group_ga58060eca71513b8634a32e076dc8dd85}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+undump\+\_\+cipher@{eet\+\_\+data\+\_\+undump\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+undump\+\_\+cipher@{eet\+\_\+data\+\_\+undump\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+undump\+\_\+cipher()}{eet\_data\_undump\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eet\+\_\+data\+\_\+undump\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{const char $\ast$}]{text,  }\item[{int}]{textlen,  }\item[{int}]{compress }\end{DoxyParamCaption})}



Takes an ascii encoding from \mbox{\hyperlink{group__Eet__Data__Group_ga33b90cc41fe0e6fffc6b4fb0c8c62a99}{eet\+\_\+data\+\_\+dump()}} and re-\/encode in binary using a cipher. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
{\em name} & Name of the entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em text} & The pointer to the string data to parse and encode. \\
\hline
{\em textlen} & The size of the string in bytes (not including 0 byte terminator). \\
\hline
{\em compress} & Compression flags (1 == compress, 0 = don\textquotesingle{}t compress). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily 1} on success, {\ttfamily 0} on failure
\end{DoxyReturn}
This function will parse the string pointed to by {\ttfamily text}, encode it the same way \mbox{\hyperlink{group__Eet__Data__Group_gaa7c3b3a8cbeffc34c21dbbb1decc3c2d}{eet\+\_\+data\+\_\+descriptor\+\_\+encode()}} takes an in-\/memory data struct and encodes into a binary blob.

The data (optionally compressed) will be 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__Data__Group_gafb1d3207c31e349ed184645e21aa838d}{eet\+\_\+data\+\_\+undump()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


References eet\+\_\+dictionary\+\_\+get(), and eet\+\_\+write\+\_\+cipher().



Referenced by eet\+\_\+data\+\_\+undump().

\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_ga139dd65b6d66537da27f3e9dd620a631}\label{group__Eet__Data__Cipher__Group_ga139dd65b6d66537da27f3e9dd620a631}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher@{eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher@{eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher()}{eet\_data\_descriptor\_decode\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eet\+\_\+data\+\_\+descriptor\+\_\+decode\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const void $\ast$}]{data\+\_\+in,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{int}]{size\+\_\+in }\end{DoxyParamCaption})}



Decodes a data structure from an arbitrary location in memory using a cipher. 


\begin{DoxyParams}{Parameters}
{\em edd} & The data descriptor to use when decoding. \\
\hline
{\em data\+\_\+in} & The pointer to the data to decode into a struct. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em size\+\_\+in} & The size of the data pointed to in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
N\+U\+LL on failure, or a valid decoded struct pointer on success.
\end{DoxyReturn}
This function will decode a data structure that has been encoded using \mbox{\hyperlink{group__Eet__Data__Group_gaa7c3b3a8cbeffc34c21dbbb1decc3c2d}{eet\+\_\+data\+\_\+descriptor\+\_\+encode()}}, and return a data structure with all its elements filled out, if successful, or N\+U\+LL on failure.

The data to be decoded is stored at the memory pointed to by {\ttfamily data\+\_\+in}, and is described by the descriptor pointed to by {\ttfamily edd}. The data size is passed in as the value to {\ttfamily size\+\_\+in}, ande must be greater than 0 to succeed.

This function is useful for decoding data structures delivered to the application by means other than an eet file, such as an I\+PC or socket connection, raw files, shared memory etc.

Please see \mbox{\hyperlink{group__Eet__Data__Group_ga4d1807cbbc448304f22a8808318a3429}{eet\+\_\+data\+\_\+read()}} for more information.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Group_gaad95530fdaec27047c41a5ceace5c231}{eet\+\_\+data\+\_\+descriptor\+\_\+decode()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


Referenced by eet\+\_\+data\+\_\+descriptor\+\_\+decode().

\mbox{\Hypertarget{group__Eet__Data__Cipher__Group_gab765474a660b0dfe5f00d99a960206db}\label{group__Eet__Data__Cipher__Group_gab765474a660b0dfe5f00d99a960206db}} 
\index{Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}!eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher@{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher}}
\index{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher@{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher}!Eet Data Serialization using A Ciphers@{Eet Data Serialization using A Ciphers}}
\subsubsection{\texorpdfstring{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher()}{eet\_data\_descriptor\_encode\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} void$\ast$ eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const void $\ast$}]{data\+\_\+in,  }\item[{const char $\ast$}]{cipher\+\_\+key,  }\item[{int $\ast$}]{size\+\_\+ret }\end{DoxyParamCaption})}



Encodes a data struct to memory and return that encoded data using a cipher. 


\begin{DoxyParams}{Parameters}
{\em edd} & The data descriptor to use when encoding. \\
\hline
{\em data\+\_\+in} & The pointer to the struct to encode into data. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
{\em size\+\_\+ret} & pointer to the an int to be filled with the decoded size. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
N\+U\+LL on failure, or a valid encoded data chunk on success.
\end{DoxyReturn}
This function takes a data structutre in memory and encodes it into a serialised chunk of data that can be decoded again by \mbox{\hyperlink{group__Eet__Data__Group_gaad95530fdaec27047c41a5ceace5c231}{eet\+\_\+data\+\_\+descriptor\+\_\+decode()}}. This is useful for being able to transmit data structures across sockets, pipes, I\+PC or shared file mechanisms, without having to worry about memory space, machine type, endianness etc.

The parameter {\ttfamily edd} must point to a valid data descriptor, and {\ttfamily data\+\_\+in} must point to the right data structure to encode. If not, the encoding may fail.

On success a non N\+U\+LL valid pointer is returned and what {\ttfamily size\+\_\+ret} points to is set to the size of this decoded data, in bytes. When the encoded data is no longer needed, call free() on it. On failure N\+U\+LL is returned and what {\ttfamily size\+\_\+ret} points to is set to 0.

Please see \mbox{\hyperlink{group__Eet__Data__Group_gac66d1c49e3490bc5d803982d833ff8aa}{eet\+\_\+data\+\_\+write()}} for more information.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Group_gaa7c3b3a8cbeffc34c21dbbb1decc3c2d}{eet\+\_\+data\+\_\+descriptor\+\_\+encode()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}


Referenced by eet\+\_\+data\+\_\+descriptor\+\_\+encode().

