\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 \hyperlink{group__Eet__Data__Group}{Eet Data Serialization} 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__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}{eet\-\_\-data\-\_\-read\-\_\-cipher} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\-\_\-\-File} $\ast$ef, \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 Read a data structure from an eet file and decodes it using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} void $\ast$ \hyperlink{group__Eet__Data__Cipher__Group_ga6faefbe585855ab98aebeaf0cdc503b9}{eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-get} (const char $\ast$filename, const char $\ast$attribute, \hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$edd, const char $\ast$cipher\-\_\-key)
\begin{DoxyCompactList}\small\item\em Read a data structure from an eet extended attribute and decodes it using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} int \hyperlink{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}{eet\-\_\-data\-\_\-write\-\_\-cipher} (\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\-\_\-\-File} $\ast$ef, \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 Write a data structure from memory and store in an eet file using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\-\_\-\-Bool} \hyperlink{group__Eet__Data__Cipher__Group_ga4aae479401e75a035a4d1e9185223546}{eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-set} (const char $\ast$filename, const char $\ast$attribute, \hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$edd, const char $\ast$cipher\-\_\-key, const void $\ast$data, \hyperlink{group__Eina__Tools__Group_ga016f6b7c97a22104a6ba6d1b042548c8}{Eina\-\_\-\-Xattr\-\_\-\-Flags} flags)
\begin{DoxyCompactList}\small\item\em Write a data structure from memory and store in an eet extended attribute using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} int \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 Dump an eet encoded data structure into ascii text using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} void $\ast$ \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 Take an ascii encoding from \hyperlink{group__Eet__Data__Group_ga4160a247c086955b4734af896b6fd270}{eet\-\_\-data\-\_\-text\-\_\-dump()} and re-\/encode in binary using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} int \hyperlink{group__Eet__Data__Cipher__Group_ga5f80e7c90720422ee595f229fd8fcbef}{eet\-\_\-data\-\_\-dump\-\_\-cipher} (\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 Dump an eet encoded data structure from an eet file into ascii text using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} int \hyperlink{group__Eet__Data__Cipher__Group_ga58060eca71513b8634a32e076dc8dd85}{eet\-\_\-data\-\_\-undump\-\_\-cipher} (\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 Take an ascii encoding from \hyperlink{group__Eet__Data__Group_ga33b90cc41fe0e6fffc6b4fb0c8c62a99}{eet\-\_\-data\-\_\-dump()} and re-\/encode in binary using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} void $\ast$ \hyperlink{group__Eet__Data__Cipher__Group_ga139dd65b6d66537da27f3e9dd620a631}{eet\-\_\-data\-\_\-descriptor\-\_\-decode\-\_\-cipher} (\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 Decode a data structure from an arbitrary location in memory using a cipher. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\-A\-P\-I} void $\ast$ \hyperlink{group__Eet__Data__Cipher__Group_gab765474a660b0dfe5f00d99a960206db}{eet\-\_\-data\-\_\-descriptor\-\_\-encode\-\_\-cipher} (\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 Encode a data struct to memory and return that encoded data using a cipher. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Most of the \hyperlink{group__Eet__Data__Group}{Eet Data Serialization} 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__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[{eet\-\_\-data\-\_\-read\-\_\-cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} void$\ast$ eet\-\_\-data\-\_\-read\-\_\-cipher (
\begin{DoxyParamCaption}
\item[{{\bf Eet\-\_\-\-File} $\ast$}]{ef, }
\item[{{\bf Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$}]{edd, }
\item[{const char $\ast$}]{name, }
\item[{const char $\ast$}]{cipher\-\_\-key}
\end{DoxyParamCaption}
)}}\label{group__Eet__Data__Cipher__Group_ga418b7f00fc7f2e0cc94b33787eddbe08}


Read 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\-L\-L 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}
\hyperlink{group__Eet__Data__Group_ga4d1807cbbc448304f22a8808318a3429}{eet\-\_\-data\-\_\-read()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\-0.\-0 
\end{DoxySince}


References eet\-\_\-dictionary\-\_\-get(), eet\-\_\-read\-\_\-cipher(), and eet\-\_\-read\-\_\-direct().



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

\hypertarget{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[{eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} void$\ast$ eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-get (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename, }
\item[{const char $\ast$}]{attribute, }
\item[{{\bf Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$}]{edd, }
\item[{const char $\ast$}]{cipher\-\_\-key}
\end{DoxyParamCaption}
)}}\label{group__Eet__Data__Cipher__Group_ga6faefbe585855ab98aebeaf0cdc503b9}


Read 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\-L\-L 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}


References eet\-\_\-data\-\_\-descriptor\-\_\-decode\-\_\-cipher(), and eina\-\_\-xattr\-\_\-get().

\hypertarget{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[{eet\-\_\-data\-\_\-write\-\_\-cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} int eet\-\_\-data\-\_\-write\-\_\-cipher (
\begin{DoxyParamCaption}
\item[{{\bf Eet\-\_\-\-File} $\ast$}]{ef, }
\item[{{\bf 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}
)}}\label{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}


Write 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 \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}


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



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

\hypertarget{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[{eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-set}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} {\bf Eina\-\_\-\-Bool} eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-set (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename, }
\item[{const char $\ast$}]{attribute, }
\item[{{\bf Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$}]{edd, }
\item[{const char $\ast$}]{cipher\-\_\-key, }
\item[{const void $\ast$}]{data, }
\item[{{\bf Eina\-\_\-\-Xattr\-\_\-\-Flags}}]{flags}
\end{DoxyParamCaption}
)}}\label{group__Eet__Data__Cipher__Group_ga4aae479401e75a035a4d1e9185223546}


Write 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\-U\-E on success, E\-I\-N\-A\-\_\-\-F\-A\-L\-S\-E on failure.
\end{DoxyReturn}
This function is the reverse of \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}


References eet\-\_\-data\-\_\-descriptor\-\_\-encode\-\_\-cipher(), E\-I\-N\-A\-\_\-\-F\-A\-L\-S\-E, and eina\-\_\-xattr\-\_\-set().

\hypertarget{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[{eet\-\_\-data\-\_\-text\-\_\-dump\-\_\-cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} 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}
)}}\label{group__Eet__Data__Cipher__Group_gac85bb8a9b46804288bb5e37caf21fd1c}


Dump 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}
1 on success, 0 on failure
\end{DoxyReturn}
This function will take a chunk of data encoded by \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}{"r"});
  fseek(f, 0, SEEK\_END);
  len = ftell(f);
  rewind(f);
  data = malloc(len);
  fread(data, len, 1, f);
  fclose(f);
  \hyperlink{group__Eet__Data__Cipher__Group_gac85bb8a9b46804288bb5e37caf21fd1c}{eet\_data\_text\_dump\_cipher}(data, cipher\_key, len, output, NULL);
\}
\end{DoxyCode}


\begin{DoxySeeAlso}{See Also}
\hyperlink{group__Eet__Data__Group_ga4160a247c086955b4734af896b6fd270}{eet\-\_\-data\-\_\-text\-\_\-dump()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\-0.\-0 
\end{DoxySince}


References eet\-\_\-node\-\_\-del(), and eet\-\_\-node\-\_\-dump().



Referenced by eet\-\_\-data\-\_\-text\-\_\-dump().

\hypertarget{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[{eet\-\_\-data\-\_\-text\-\_\-undump\-\_\-cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} 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}
)}}\label{group__Eet__Data__Cipher__Group_ga99e8a3acd6c3fbe552b0f9d474ae4f0d}


Take an ascii encoding from \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\-L\-L on failure.
\end{DoxyReturn}
This function will parse the string pointed to by {\ttfamily text} and return an encoded data lump the same way \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}
\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().

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


Dump 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}
1 on success, 0 on failure
\end{DoxyReturn}
This function will take an open and valid eet file from \hyperlink{group__Eet__File__Group_ga5f55956b860aa2c77af9b1a880c4c256}{eet\-\_\-open()} request the data encoded by \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}
\hyperlink{group__Eet__Data__Group_ga33b90cc41fe0e6fffc6b4fb0c8c62a99}{eet\-\_\-data\-\_\-dump()}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\-0.\-0 
\end{DoxySince}


References eet\-\_\-dictionary\-\_\-get(), eet\-\_\-node\-\_\-del(), eet\-\_\-node\-\_\-dump(), eet\-\_\-read\-\_\-cipher(), and eet\-\_\-read\-\_\-direct().



Referenced by eet\-\_\-data\-\_\-dump().

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


Take an ascii encoding from \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't compress). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 on failure
\end{DoxyReturn}
This function will parse the string pointed to by {\ttfamily text}, encode it the same way \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}
\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().

\hypertarget{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[{eet\-\_\-data\-\_\-descriptor\-\_\-decode\-\_\-cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} void$\ast$ eet\-\_\-data\-\_\-descriptor\-\_\-decode\-\_\-cipher (
\begin{DoxyParamCaption}
\item[{{\bf Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$}]{edd, }
\item[{const void $\ast$}]{data\-\_\-in, }
\item[{const char $\ast$}]{cipher\-\_\-key, }
\item[{int}]{size\-\_\-in}
\end{DoxyParamCaption}
)}}\label{group__Eet__Data__Cipher__Group_ga139dd65b6d66537da27f3e9dd620a631}


Decode 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\-L\-L on failure, or a valid decoded struct pointer on success.
\end{DoxyReturn}
This function will decode a data structure that has been encoded using \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\-L\-L 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\-P\-C or socket connection, raw files, shared memory etc.

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

\begin{DoxySeeAlso}{See Also}
\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(), and eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-get().

\hypertarget{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[{eet\-\_\-data\-\_\-descriptor\-\_\-encode\-\_\-cipher}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-A\-P\-I} void$\ast$ eet\-\_\-data\-\_\-descriptor\-\_\-encode\-\_\-cipher (
\begin{DoxyParamCaption}
\item[{{\bf Eet\-\_\-\-Data\-\_\-\-Descriptor} $\ast$}]{edd, }
\item[{const void $\ast$}]{data\-\_\-in, }
\item[{const char $\ast$}]{cipher\-\_\-key, }
\item[{int $\ast$}]{size\-\_\-ret}
\end{DoxyParamCaption}
)}}\label{group__Eet__Data__Cipher__Group_gab765474a660b0dfe5f00d99a960206db}


Encode 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\-L\-L 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 \hyperlink{group__Eet__Data__Group_gaad95530fdaec27047c41a5ceace5c231}{eet\-\_\-data\-\_\-descriptor\-\_\-decode()}. This is useful for being able to transmit data structures across sockets, pipes, I\-P\-C or shared file mechanisms, without having to worry about memory space, machine type, endianess 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\-L\-L 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\-L\-L is returned and what {\ttfamily size\-\_\-ret} points to is set to 0.

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

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


Referenced by eet\-\_\-connection\-\_\-send(), eet\-\_\-data\-\_\-descriptor\-\_\-encode(), and eet\-\_\-data\-\_\-xattr\-\_\-cipher\-\_\-set().

