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


Functions to create, destroy and do basic manipulation of \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} handles.  


\doxysubsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eet__File__Cipher__Group}{Eet File Ciphered Main Functions}}
\begin{DoxyCompactList}\small\item\em Most of the \mbox{\hyperlink{group__Eet__File__Group}{Eet File Main Functions}} have alternative versions that accounts for ciphers to protect their content. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct__Eet__Entry}{\+\_\+\+Eet\+\_\+\+Entry}}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga24b2559f539042a2414a9fed47b8e911}\label{group__Eet__File__Group_ga24b2559f539042a2414a9fed47b8e911}} 
\#define {\bfseries EET\+\_\+\+IMAGE\+\_\+\+LOSSLESS}~EMILE\+\_\+\+IMAGE\+\_\+\+LOSSLESS
\item 
\mbox{\Hypertarget{group__Eet__File__Group_gad7a958d8561297c24ea035548e5bccb4}\label{group__Eet__File__Group_gad7a958d8561297c24ea035548e5bccb4}} 
\#define {\bfseries EET\+\_\+\+IMAGE\+\_\+\+JPEG}~EMILE\+\_\+\+IMAGE\+\_\+\+JPEG
\item 
\mbox{\Hypertarget{group__Eet__File__Group_gab00cdecb86b126af82e831409485e88b}\label{group__Eet__File__Group_gab00cdecb86b126af82e831409485e88b}} 
\#define {\bfseries EET\+\_\+\+IMAGE\+\_\+\+ETC1}~EMILE\+\_\+\+IMAGE\+\_\+\+ETC1
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga6f0325bc074b1a11004aa3d5c5484004}\label{group__Eet__File__Group_ga6f0325bc074b1a11004aa3d5c5484004}} 
\#define {\bfseries EET\+\_\+\+IMAGE\+\_\+\+ETC2\+\_\+\+RGB}~EMILE\+\_\+\+IMAGE\+\_\+\+ETC2\+\_\+\+RGB
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga9ed3bf8d75fd2ab88ccedcbb0d1e6564}\label{group__Eet__File__Group_ga9ed3bf8d75fd2ab88ccedcbb0d1e6564}} 
\#define {\bfseries EET\+\_\+\+IMAGE\+\_\+\+ETC2\+\_\+\+RGBA}~EMILE\+\_\+\+IMAGE\+\_\+\+ETC2\+\_\+\+RGBA
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga8ab2b3d77315d1eceb72afc1d4386772}\label{group__Eet__File__Group_ga8ab2b3d77315d1eceb72afc1d4386772}} 
\#define {\bfseries EET\+\_\+\+IMAGE\+\_\+\+ETC1\+\_\+\+ALPHA}~EMILE\+\_\+\+IMAGE\+\_\+\+ETC1\+\_\+\+ALPHA
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga098bb8eac2734aad31f7598e20b195f5}\label{group__Eet__File__Group_ga098bb8eac2734aad31f7598e20b195f5}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+ARGB8888}~\mbox{\hyperlink{group__Emile__Image__Group_gga6bbda446d5ddf75fd911fbc0dff6876fa063317d9465b70ef466bd0c6e466caa9}{EMILE\+\_\+\+COLORSPACE\+\_\+\+ARGB8888}}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_gaa326066dd666e89d363018f630699a2d}\label{group__Eet__File__Group_gaa326066dd666e89d363018f630699a2d}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+GRY8}~EMILE\+\_\+\+COLORSPACE\+\_\+\+GRY8
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga7204c6542a0ee5faf02a0cdb5add8ddd}\label{group__Eet__File__Group_ga7204c6542a0ee5faf02a0cdb5add8ddd}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+AGRY88}~\mbox{\hyperlink{group__Emile__Image__Group_gga6bbda446d5ddf75fd911fbc0dff6876fa3c0600b436f608f0809fff5adfa541a3}{EMILE\+\_\+\+COLORSPACE\+\_\+\+AGRY88}}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga37a12528c21639d5bd5a5e772a3a5b2e}\label{group__Eet__File__Group_ga37a12528c21639d5bd5a5e772a3a5b2e}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+ETC1}~\mbox{\hyperlink{group__Emile__Image__Group_gga6bbda446d5ddf75fd911fbc0dff6876fa1033c7d2c7aca562859d2e3aef609989}{EMILE\+\_\+\+COLORSPACE\+\_\+\+ETC1}}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga778dcc5c34a12df218420cfd6309451b}\label{group__Eet__File__Group_ga778dcc5c34a12df218420cfd6309451b}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+RGB8\+\_\+\+ETC2}~\mbox{\hyperlink{group__Emile__Image__Group_gga6bbda446d5ddf75fd911fbc0dff6876fad3319deeb70798b8138eb24f788d92b4}{EMILE\+\_\+\+COLORSPACE\+\_\+\+RGB8\+\_\+\+ETC2}}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_ga2245f1492b0e03fcdce401356dbbf032}\label{group__Eet__File__Group_ga2245f1492b0e03fcdce401356dbbf032}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+RGBA8\+\_\+\+ETC2\+\_\+\+EAC}~\mbox{\hyperlink{group__Emile__Image__Group_gga6bbda446d5ddf75fd911fbc0dff6876fa5efb8e475746b3b748c5db143ce57032}{EMILE\+\_\+\+COLORSPACE\+\_\+\+RGBA8\+\_\+\+ETC2\+\_\+\+EAC}}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_gadf95731a21b5be273ff56d94b1eaddbe}\label{group__Eet__File__Group_gadf95731a21b5be273ff56d94b1eaddbe}} 
\#define {\bfseries EET\+\_\+\+COLORSPACE\+\_\+\+ETC1\+\_\+\+ALPHA}~\mbox{\hyperlink{group__Emile__Image__Group_gga6bbda446d5ddf75fd911fbc0dff6876fadb771419dcfe343f10db016b862d3bc8}{EMILE\+\_\+\+COLORSPACE\+\_\+\+ETC1\+\_\+\+ALPHA}}
\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eet__File__Group_gaaffe4b3f04b9306abf105c89c8934331}\label{group__Eet__File__Group_gaaffe4b3f04b9306abf105c89c8934331}} 
typedef enum \mbox{\hyperlink{group__Eet__File__Group_gaa8e1a7af50fefaf15eb2f69543d24998}{\+\_\+\+Eet\+\_\+\+File\+\_\+\+Mode}} {\bfseries Eet\+\_\+\+File\+\_\+\+Mode}
\begin{DoxyCompactList}\small\item\em Modes that a file can be opened. \end{DoxyCompactList}\item 
typedef \mbox{\hyperlink{group__Emile__Image__Group_ga3dcc86fe594217afb40befc71d0a6d8a}{Emile\+\_\+\+Image\+\_\+\+Encoding}} \mbox{\hyperlink{group__Eet__File__Group_ga836650d7ec0a965edf51040e9b82bfeb}{Eet\+\_\+\+Image\+\_\+\+Encoding}}
\begin{DoxyCompactList}\small\item\em Specify lossy encoding for image. \end{DoxyCompactList}\item 
typedef \mbox{\hyperlink{group__Emile__Image__Group_gae4022652475a28417c2780ad5217c8f4}{Emile\+\_\+\+Colorspace}} \mbox{\hyperlink{group__Eet__File__Group_ga4efad323325b6ad0d525849eb402b067}{Eet\+\_\+\+Colorspace}}
\begin{DoxyCompactList}\small\item\em Specify colorspace for image. \end{DoxyCompactList}\item 
typedef struct \+\_\+\+Eet\+\_\+\+File \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}}
\begin{DoxyCompactList}\small\item\em Opaque handle that defines an Eet file (or memory). \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}\label{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}} 
typedef struct \+\_\+\+Eet\+\_\+\+Dictionary {\bfseries Eet\+\_\+\+Dictionary}
\begin{DoxyCompactList}\small\item\em Opaque handle that defines a file-\/backed (mmaped) dictionary of strings. \end{DoxyCompactList}\item 
typedef struct \mbox{\hyperlink{struct__Eet__Entry}{\+\_\+\+Eet\+\_\+\+Entry}} \mbox{\hyperlink{group__Eet__File__Group_ga9bb1ee9b79483d1c9603b1959215f354}{Eet\+\_\+\+Entry}}
\begin{DoxyCompactList}\small\item\em Eet files may contains multiple Entries per file, this handle describe them. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{group__Eet__File__Group_gaa8e1a7af50fefaf15eb2f69543d24998}{\+\_\+\+Eet\+\_\+\+File\+\_\+\+Mode}} \{ \newline
{\bfseries EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+INVALID} = -\/1
, \newline
\mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}
, \newline
\mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+WRITE}}
, \newline
\mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}
 \}
\begin{DoxyCompactList}\small\item\em Modes that a file can be opened. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open}} (const char $\ast$file, \mbox{\hyperlink{group__Eet__File__Group_gaaffe4b3f04b9306abf105c89c8934331}{Eet\+\_\+\+File\+\_\+\+Mode}} mode)
\begin{DoxyCompactList}\small\item\em Opens an eet file on disk, and returns a handle to it. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ \mbox{\hyperlink{group__Eet__File__Group_gab6c2e3d0ef53d273f30f359c3e151665}{eet\+\_\+mmap}} (const \mbox{\hyperlink{group__Eina__File__Group_ga20697123547cbc937c6c9dd845af0403}{Eina\+\_\+\+File}} $\ast$file)
\begin{DoxyCompactList}\small\item\em Opens an eet file on disk from an Eina\+\_\+\+File handle, and returns a handle to it. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ \mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\+\_\+memopen\+\_\+read}} (const void $\ast$data, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Opens an eet file directly from a memory location. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eet__File__Group_gaaffe4b3f04b9306abf105c89c8934331}{Eet\+\_\+\+File\+\_\+\+Mode}} \mbox{\hyperlink{group__Eet__File__Group_ga806f64e7ad3463cd40337c5022c7e83c}{eet\+\_\+mode\+\_\+get}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Gets the mode an Eet\+\_\+\+File was opened with. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eet__Group_ga966e47d17fb3f81293bc0ada3c031d95}{Eet\+\_\+\+Error}} \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\+\_\+close}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Closes an eet file handle and flush pending writes. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eet__Group_ga966e47d17fb3f81293bc0ada3c031d95}{Eet\+\_\+\+Error}} \mbox{\hyperlink{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}{eet\+\_\+sync}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Syncs content of an eet file handle, flushing pending writes. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}{Eet\+\_\+\+Dictionary}} $\ast$ \mbox{\hyperlink{group__Eet__File__Group_gabac3fef94bb732840b9ac9cc2917c4c6}{eet\+\_\+dictionary\+\_\+get}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Returns a handle to the shared string dictionary of the Eet file. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__File__Group_ga53290da52edb929b85e51f25e79d27c8}{eet\+\_\+dictionary\+\_\+string\+\_\+check}} (\mbox{\hyperlink{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}{Eet\+\_\+\+Dictionary}} $\ast$ed, const char $\ast$string)
\begin{DoxyCompactList}\small\item\em Checks if a given string comes from a given dictionary. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__File__Group_ga1cadbf9178be9abf9578e429f93bc0a6}{eet\+\_\+dictionary\+\_\+count}} (const \mbox{\hyperlink{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}{Eet\+\_\+\+Dictionary}} $\ast$ed)
\begin{DoxyCompactList}\small\item\em Returns the number of strings inside a dictionary. \end{DoxyCompactList}\item 
EAPI void $\ast$ \mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\+\_\+read}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, int $\ast$size\+\_\+ret)
\begin{DoxyCompactList}\small\item\em Reads a specified entry from an eet file and return data. \end{DoxyCompactList}\item 
EAPI const void $\ast$ \mbox{\hyperlink{group__Eet__File__Group_ga250ac882b4530dc8112b0c9517a5b44d}{eet\+\_\+read\+\_\+direct}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, int $\ast$size\+\_\+ret)
\begin{DoxyCompactList}\small\item\em Reads a specified entry from an eet file and return data. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\+\_\+write}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, const void $\ast$data, int size, int compress)
\begin{DoxyCompactList}\small\item\em Write a specified entry to an eet file handle. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__File__Group_gaa8a980d684123dfbaf12e7efefdb57f5}{eet\+\_\+delete}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Deletes a specified entry from an Eet file being written or re-\/written. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eet__File__Group_ga8b73391dcfad6b71ae1cabe90a020f03}{eet\+\_\+alias}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name, const char $\ast$destination, int compress)
\begin{DoxyCompactList}\small\item\em Alias a specific section to another one. \end{DoxyCompactList}\item 
EAPI const char $\ast$ \mbox{\hyperlink{group__Eet__File__Group_ga0c008ff2e81978782c5a45a2b17753ae}{eet\+\_\+file\+\_\+get}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Retrieves the filename of an Eet\+\_\+\+File. \end{DoxyCompactList}\item 
EAPI const char $\ast$ \mbox{\hyperlink{group__Eet__File__Group_ga39594e7ee4d23fbe1be7f21766646329}{eet\+\_\+alias\+\_\+get}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Retrieves the destination name of an alias. \end{DoxyCompactList}\item 
EAPI char $\ast$$\ast$ \mbox{\hyperlink{group__Eet__File__Group_gaab7f9d6d7460b8ec90039b6d82323aa1}{eet\+\_\+list}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef, const char $\ast$glob, int $\ast$count\+\_\+ret)
\begin{DoxyCompactList}\small\item\em Lists all entries in eet file matching shell glob. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Iterator__Group_ga15b975bb881d955249ce13d4ebc96948}{Eina\+\_\+\+Iterator}} $\ast$ \mbox{\hyperlink{group__Eet__File__Group_ga7509b0c13057a2a4066b592c70e69279}{eet\+\_\+list\+\_\+entries}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Returns an iterator that will describe each entry of an Eet\+\_\+\+File. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__File__Group_ga53bf1cf96267787aa93a99a0fe7ba8f7}{eet\+\_\+num\+\_\+entries}} (\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ef)
\begin{DoxyCompactList}\small\item\em Returns the number of entries in the specified eet file. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Functions to create, destroy and do basic manipulation of \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} handles. 

This section explains how to use the most basic Eet functions, which are used to work with eet files, read data from them, store it back in or take a look at what entries it contains, without making use of the serialization capabilities explained in \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}}.

The following example will serve as an introduction to most, if not all, of these functions.

If you are only using Eet, this is the only header you need to include.  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <\mbox{\hyperlink{Eet_8h}{Eet.h}}>}}

\end{DoxyCodeInclude}
 Now let\textquotesingle{}s create ourselves an eet file to play with. The following function shows step by step how to open a file and write some data in it. First, we define our file handler and some other things we\textquotesingle{}ll put in it. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\_File}}\ *ef;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{char}\ buf[1024],\ *ptr;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ size,\ len,\ i;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *some\_strings[]\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \textcolor{stringliteral}{"{}And\ some\ more\ strings"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \textcolor{stringliteral}{"{}spread\ across\ several"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \textcolor{stringliteral}{"{}elements\ of\ an\ array!"{}}}
\DoxyCodeLine{\ \ \ \};}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ some\_data[]\ =}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x1e\(\backslash\)xe7\(\backslash\)x0f\(\backslash\)x42\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x01\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x35"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)xa0\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)xa0\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x24\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x11"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x00\(\backslash\)x2f\(\backslash\)x6d\(\backslash\)x69\(\backslash\)x73\(\backslash\)x74\(\backslash\)x65\(\backslash\)x72\(\backslash\)x69\(\backslash\)x6f\(\backslash\)x75\(\backslash\)x73\(\backslash\)x2f"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x64\(\backslash\)x61\(\backslash\)x74\(\backslash\)x61\(\backslash\)x00\(\backslash\)x41\(\backslash\)x6e\(\backslash\)x20\(\backslash\)x45\(\backslash\)x45\(\backslash\)x54\(\backslash\)x20\(\backslash\)x69\(\backslash\)x6e\(\backslash\)x73\(\backslash\)x69"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x64\(\backslash\)x65\(\backslash\)x20\(\backslash\)x6f\(\backslash\)x66\(\backslash\)x20\(\backslash\)x61\(\backslash\)x6e\(\backslash\)x20\(\backslash\)x45\(\backslash\)x45\(\backslash\)x54\(\backslash\)x21\(\backslash\)x0a\(\backslash\)x54\(\backslash\)x68"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x69\(\backslash\)x73\(\backslash\)x20\(\backslash\)x77\(\backslash\)x61\(\backslash\)x73\(\backslash\)x6e\(\backslash\)x27\(\backslash\)x74\(\backslash\)x20\(\backslash\)x72\(\backslash\)x65\(\backslash\)x61\(\backslash\)x6c\(\backslash\)x6c\(\backslash\)x79"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x20\(\backslash\)x75\(\backslash\)x73\(\backslash\)x65\(\backslash\)x66\(\backslash\)x75\(\backslash\)x6c\(\backslash\)x20\(\backslash\)x62\(\backslash\)x75\(\backslash\)x74\(\backslash\)x20\(\backslash\)x69\(\backslash\)x74\(\backslash\)x20\(\backslash\)x68"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x65\(\backslash\)x6c\(\backslash\)x70\(\backslash\)x65\(\backslash\)x64\(\backslash\)x20\(\backslash\)x74\(\backslash\)x6f\(\backslash\)x20\(\backslash\)x73\(\backslash\)x68\(\backslash\)x6f\(\backslash\)x77\(\backslash\)x20\(\backslash\)x68\(\backslash\)x6f"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x77\(\backslash\)x0a\(\backslash\)x74\(\backslash\)x6f\(\backslash\)x20\(\backslash\)x75\(\backslash\)x73\(\backslash\)x65\(\backslash\)x20\(\backslash\)x65\(\backslash\)x65\(\backslash\)x74\(\backslash\)x5f\(\backslash\)x6d\(\backslash\)x65\(\backslash\)x6d"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x6f\(\backslash\)x70\(\backslash\)x65\(\backslash\)x6e\(\backslash\)x5f\(\backslash\)x72\(\backslash\)x65\(\backslash\)x61\(\backslash\)x64\(\backslash\)x28\(\backslash\)x29\(\backslash\)x20\(\backslash\)x74\(\backslash\)x6f\(\backslash\)x20\(\backslash\)x6f"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x70\(\backslash\)x65\(\backslash\)x6e\(\backslash\)x20\(\backslash\)x61\(\backslash\)x6e\(\backslash\)x20\(\backslash\)x65\(\backslash\)x65\(\backslash\)x74\(\backslash\)x20\(\backslash\)x66\(\backslash\)x69\(\backslash\)x6c\(\backslash\)x65\(\backslash\)x20"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x66\(\backslash\)x72\(\backslash\)x6f\(\backslash\)x6d\(\backslash\)x0a\(\backslash\)x64\(\backslash\)x61\(\backslash\)x74\(\backslash\)x61\(\backslash\)x20\(\backslash\)x61\(\backslash\)x6c\(\backslash\)x72\(\backslash\)x65\(\backslash\)x61\(\backslash\)x64"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x79\(\backslash\)x20\(\backslash\)x6c\(\backslash\)x6f\(\backslash\)x61\(\backslash\)x64\(\backslash\)x65\(\backslash\)x64\(\backslash\)x20\(\backslash\)x69\(\backslash\)x6e\(\backslash\)x20\(\backslash\)x6d\(\backslash\)x65\(\backslash\)x6d\(\backslash\)x6f"{}}}
\DoxyCodeLine{\ \ \ \ \ \textcolor{stringliteral}{"{}\(\backslash\)x72\(\backslash\)x79\(\backslash\)x2e\(\backslash\)x0a\(\backslash\)x00"{}};}

\end{DoxyCodeInclude}
 We open a new file in write mode, and if it fails, we just return, since there\textquotesingle{}s not much more we can do about it.. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(\textcolor{stringliteral}{"{}/tmp/my\_file.eet"{}},\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\_FILE\_MODE\_WRITE}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!ef)\ \textcolor{keywordflow}{return}\ 0;}

\end{DoxyCodeInclude}
 Now, we need to write some data in our file. For now, strings will suffice, so let\textquotesingle{}s just dump a bunch of them in there. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ strcpy(buf,\ \textcolor{stringliteral}{"{}Here\ is\ a\ string\ of\ data\ to\ save!"{}});}
\DoxyCodeLine{\ \ \ size\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\_write}}(ef,\ \textcolor{stringliteral}{"{}/key/to\_store/at"{}},\ buf,\ \textcolor{keyword}{sizeof}(buf),\ 1);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!size)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}Error\ writing\ data!\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\ \ \ \ \ \}}

\end{DoxyCodeInclude}
 As you can see, we copied a string into our static buffer, which is a bit bigger than the full length of the string, and then told Eet to write it into the file, compressed, returning the size of the data written into the file. This is all to show that Eet treats data as just data. It doesn\textquotesingle{}t matter what that data represents (for now), it\textquotesingle{}s all just bytes for it. As running the following code will show, we took a string of around 30 bytes and put it in a buffer of 1024 bytes, but the returned size won\textquotesingle{}t be any of those. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ len\ =\ strlen(buf);}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}strlen()\ =\ \%d,\ eet\_write()\ =\ \%d\(\backslash\)n"{}},\ len,\ size);}

\end{DoxyCodeInclude}
 Next, we copy into our buffer our set of strings, including their null terminators and write them into the file. No error checking for the sake of brevity. And a call to \mbox{\hyperlink{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}{eet\+\_\+sync()}} to make sure all out data is properly written down to disk, even though we haven\textquotesingle{}t yet closed the file. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ptr\ =\ buf;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ 3;\ i++)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ len\ =\ strlen(some\_strings[i])\ +\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ memcpy(ptr,\ some\_strings[i],\ len);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ ptr\ +=\ len;}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\_write}}(ef,\ \textcolor{stringliteral}{"{}/several/strings"{}},\ buf,\ \textcolor{keyword}{sizeof}(buf),\ 1);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}{eet\_sync}}(ef);}

\end{DoxyCodeInclude}
 One more write, this time our large array of binary data and... well, I couldn\textquotesingle{}t come up with a valid use of the last set of strings we stored, so let\textquotesingle{}s take it out from the file with \mbox{\hyperlink{group__Eet__File__Group_gaa8a980d684123dfbaf12e7efefdb57f5}{eet\+\_\+delete()}}. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\_write}}(ef,\ \textcolor{stringliteral}{"{}/some/mysterious/data"{}},\ some\_data,\ \textcolor{keyword}{sizeof}(some\_data)\ -\/\ 1,\ 1);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_gaa8a980d684123dfbaf12e7efefdb57f5}{eet\_delete}}(ef,\ \textcolor{stringliteral}{"{}/several/strings"{}});}

\end{DoxyCodeInclude}
 Finally, we close the file, saving any changes back to disk and return. Notice how, if there\textquotesingle{}s any error closing the file or saving its contents, the return value from the function will be a false one, which later on will make the program exit with an error code. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef)\ ==\ \mbox{\hyperlink{group__Eet__Group_ggaa9142d865094701672375485d4a6284da2e3af24c66d0decf7c97fe4e5a7f75d4}{EET\_ERROR\_NONE}};}

\end{DoxyCodeInclude}
 Moving onto our main function, we will open the same file and read it back. Trivial, but it\textquotesingle{}ll show how we can do so in more than one way. We\textquotesingle{}ll skip the variable declarations, as they aren\textquotesingle{}t very different from what we\textquotesingle{}ve seen already.

We start from the beginning by initializing Eet so things in general work. Forgetting to do so will result in weird results or crashes when calling any eet function, so if you experience something like that, the first thing to look at is whether \mbox{\hyperlink{group__Eet__Group_ga9903687bfa20fe9a9e59d4c1d213e89a}{eet\+\_\+init()}} is missing. Then we call our {\ttfamily create\+\_\+eet\+\_\+file} function, described above, to make sure we have something to work with. If the function fails it will return 0 and we just exit, since nothing from here onwards will work anyway. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__Group_ga9903687bfa20fe9a9e59d4c1d213e89a}{eet\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!create\_eet\_file())}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}

\end{DoxyCodeInclude}
 Let\textquotesingle{}s take a look now at what entries our file has. For this, we use \mbox{\hyperlink{group__Eet__File__Group_gaab7f9d6d7460b8ec90039b6d82323aa1}{eet\+\_\+list()}}, which will return a list of strings, each being the name of one entry. Since we skipped before, it may be worth noting that {\ttfamily list} is declared as a {\ttfamily char} $\ast$$\ast$. The {\ttfamily num} parameter will, of course, have the number of entries contained in our file. If everything\textquotesingle{}s fine, we\textquotesingle{}ll get our list and print it to the screen, and once done with it, we free the list. That\textquotesingle{}s just the list, not its contents, as they are internal strings used by Eet and trying to free them will surely break things. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ef\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\_open}}(\textcolor{stringliteral}{"{}/tmp/my\_file.eet"{}},\ \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!ef)\ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ list\ =\ \mbox{\hyperlink{group__Eet__File__Group_gaab7f9d6d7460b8ec90039b6d82323aa1}{eet\_list}}(ef,\ \textcolor{stringliteral}{"{}*"{}},\ \&num);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (list)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ num;\ i++)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Key\ stored:\ \%s\(\backslash\)n"{}},\ list[i]);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ free(list);}
\DoxyCodeLine{\ \ \ \ \ \}}

\end{DoxyCodeInclude}
 Reading back plain data is simple. Just a call to \mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\+\_\+read()}} with the file to read from, and the name of the entry we are interested in. We get back our data and the passed {\ttfamily size} parameter will contain the size of it. If the data was stored compressed, it will decompressed first. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ret\ =\ \mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\_read}}(ef,\ \textcolor{stringliteral}{"{}/key/to\_store/at"{}},\ \&size);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (ret)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Data\ read\ (\%i\ bytes):\(\backslash\)n\%s\(\backslash\)n"{}},\ size,\ ret);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ free(ret);}
\DoxyCodeLine{\ \ \ \ \ \}}

\end{DoxyCodeInclude}
 Another simple read for the set of strings from before, except those were deleted, so we should get a NULL return and continue normally. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ret\ =\ \mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\_read}}(ef,\ \textcolor{stringliteral}{"{}/several/strings"{}},\ \&size);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (ret)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}More\ data\ read\ (\%i\ bytes):\(\backslash\)n\%s\(\backslash\)n"{}},\ size,\ ret);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ free(ret);}
\DoxyCodeLine{\ \ \ \ \ \}}

\end{DoxyCodeInclude}
 Finally, we\textquotesingle{}ll get our binary data in the same way we got the strings. Once again, it makes no difference for Eet what the data is, it\textquotesingle{}s up to us to know how to handle it. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ret\ =\ \mbox{\hyperlink{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}{eet\_read}}(ef,\ \textcolor{stringliteral}{"{}/some/mysterious/data"{}},\ \&size);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (ret)}
\DoxyCodeLine{\ \ \ \ \ \{}

\end{DoxyCodeInclude}
 Now some cheating, we know that this data is an Eet file because, well... we just know it. So we are going to open it and take a look at its insides. For this, \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open()}} won\textquotesingle{}t work, as it needs to have a file on disk to read from and all we have is some data in RAM.

So how do we do? One way would be to create a normal file and write down our data, then open it with \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open()}}. Another, faster and more efficient if all we want to do is read the file, is to use \mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\+\_\+memopen\+\_\+read()}}. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\_File}}\ *ef2;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ ef2\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\_memopen\_read}}(ret,\ size);}

\end{DoxyCodeInclude}
 As you can see, the size we got from our previous read was put to good use this time. Unlike the first one where all we had were strings, the size of the data read only serves to demonstrate that we are reading back the entire size of our original {\ttfamily buf} variable.

A little peeking to see how many entries the file has and to make an example of \mbox{\hyperlink{group__Eet__File__Group_ga53bf1cf96267787aa93a99a0fe7ba8f7}{eet\+\_\+num\+\_\+entries()}} to get that number when we don\textquotesingle{}t care about their names. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ num\ =\ \mbox{\hyperlink{group__Eet__File__Group_ga53bf1cf96267787aa93a99a0fe7ba8f7}{eet\_num\_entries}}(ef2);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Mysterious\ data\ has\ \%d\ entries\(\backslash\)n"{}},\ num);}

\end{DoxyCodeInclude}
 More cheating follows. Just like we knew this was an Eet file, we also know what key to read from, and on top of that we know that the data in it is not compressed. Knowing all this allows us to take some shortcuts. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Mysterious\ data:\(\backslash\)n\%s\(\backslash\)n"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{char}\ *)\mbox{\hyperlink{group__Eet__File__Group_ga250ac882b4530dc8112b0c9517a5b44d}{eet\_read\_direct}}(ef2,\ \textcolor{stringliteral}{"{}/mysterious/data"{}},\ NULL));}

\end{DoxyCodeInclude}
 That\textquotesingle{}s a direct print of our data, whatever that data is. We don\textquotesingle{}t want to worry about having to free it later, so we just used eet\+\_\+direct\+\_\+read() to tell Eet to gives a pointer to the internal data in the file, without duplicating it. Since we said that data was not compressed, we shouldn\textquotesingle{}t worry about printing garbage to the screen (and yes, we also know the data is yet another string). We also don\textquotesingle{}t care about the size of the data as it was stored in the file, so we passed NULL as the size parameter. One very important note about this, however, is that we don\textquotesingle{}t care about the size parameter because the data in the file contains the null terminator for the string. So when using Eet to store strings this way, it\textquotesingle{}s very important to consider whether you will keep that final null byte, or to always get the size read and do the necessary checks and copies. It\textquotesingle{}s up to the user and the particular use cases to decide how this will be done.

With everything done, close this second file and free the data used to open it. And this is important, we can\textquotesingle{}t free that data until we are done with the file, as Eet is using it. When opening with \mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\+\_\+memopen\+\_\+read()}}, the data passed to it must be available for as long as the the file is open. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef2);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ free(ret);}
\DoxyCodeLine{\ \ \ \ \ \}}

\end{DoxyCodeInclude}
 Finally, we close the first file, shutdown all internal resources used by Eet and leave our main function, thus terminating our program. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eet__Group_gacbc7583179399d3b3e7b003e911f866f}{eet\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}

\end{DoxyCodeInclude}
 You can look at the full code of the example \mbox{\hyperlink{eet-file_8c-example}{here}}. 

\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{group__Eet__File__Group_ga836650d7ec0a965edf51040e9b82bfeb}\label{group__Eet__File__Group_ga836650d7ec0a965edf51040e9b82bfeb}} 
\index{Eet File Main Functions@{Eet File Main Functions}!Eet\_Image\_Encoding@{Eet\_Image\_Encoding}}
\index{Eet\_Image\_Encoding@{Eet\_Image\_Encoding}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{Eet\_Image\_Encoding}{Eet\_Image\_Encoding}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eet__File__Group_ga836650d7ec0a965edf51040e9b82bfeb}{Eet\+\_\+\+Image\+\_\+\+Encoding}}}



Specify lossy encoding for image. 

\begin{DoxySince}{Since}
1.\+10 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__File__Group_ga4efad323325b6ad0d525849eb402b067}\label{group__Eet__File__Group_ga4efad323325b6ad0d525849eb402b067}} 
\index{Eet File Main Functions@{Eet File Main Functions}!Eet\_Colorspace@{Eet\_Colorspace}}
\index{Eet\_Colorspace@{Eet\_Colorspace}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{Eet\_Colorspace}{Eet\_Colorspace}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eet__File__Group_ga4efad323325b6ad0d525849eb402b067}{Eet\+\_\+\+Colorspace}}}



Specify colorspace for image. 

\begin{DoxySince}{Since}
1.\+10 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}\label{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}} 
\index{Eet File Main Functions@{Eet File Main Functions}!Eet\_File@{Eet\_File}}
\index{Eet\_File@{Eet\_File}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{Eet\_File}{Eet\_File}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}}}



Opaque handle that defines an Eet file (or memory). 

This handle will be returned by the functions \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open()}} and \mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\+\_\+memopen\+\_\+read()}} and is used by every other function that affects the file in any way. When you are done with it, call \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\+\_\+close()}} to close it and, if the file was open for writing, write down to disk any changes made to it.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open()}} 

\mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\+\_\+memopen\+\_\+read()}} 

\mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\+\_\+close()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__Eet__File__Group_ga9bb1ee9b79483d1c9603b1959215f354}\label{group__Eet__File__Group_ga9bb1ee9b79483d1c9603b1959215f354}} 
\index{Eet File Main Functions@{Eet File Main Functions}!Eet\_Entry@{Eet\_Entry}}
\index{Eet\_Entry@{Eet\_Entry}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{Eet\_Entry}{Eet\_Entry}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eet__File__Group_ga9bb1ee9b79483d1c9603b1959215f354}{Eet\+\_\+\+Entry}}}



Eet files may contains multiple Entries per file, this handle describe them. 

You can get that handle from an iterator given by \mbox{\hyperlink{group__Eet__File__Group_ga7509b0c13057a2a4066b592c70e69279}{eet\+\_\+list\+\_\+entries()}}.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__File__Group_ga7509b0c13057a2a4066b592c70e69279}{eet\+\_\+list\+\_\+entries()}} 
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+8.\+0 
\end{DoxySince}


\doxysubsection{Enumeration Type Documentation}
\mbox{\Hypertarget{group__Eet__File__Group_gaa8e1a7af50fefaf15eb2f69543d24998}\label{group__Eet__File__Group_gaa8e1a7af50fefaf15eb2f69543d24998}} 
\index{Eet File Main Functions@{Eet File Main Functions}!\_Eet\_File\_Mode@{\_Eet\_File\_Mode}}
\index{\_Eet\_File\_Mode@{\_Eet\_File\_Mode}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{\_Eet\_File\_Mode}{\_Eet\_File\_Mode}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__Eet__File__Group_gaa8e1a7af50fefaf15eb2f69543d24998}{\+\_\+\+Eet\+\_\+\+File\+\_\+\+Mode}}}



Modes that a file can be opened. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{EET\_FILE\_MODE\_READ@{EET\_FILE\_MODE\_READ}!Eet File Main Functions@{Eet File Main Functions}}\index{Eet File Main Functions@{Eet File Main Functions}!EET\_FILE\_MODE\_READ@{EET\_FILE\_MODE\_READ}}}\mbox{\Hypertarget{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}\label{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}} 
EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ&File is read-\/only. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{EET\_FILE\_MODE\_WRITE@{EET\_FILE\_MODE\_WRITE}!Eet File Main Functions@{Eet File Main Functions}}\index{Eet File Main Functions@{Eet File Main Functions}!EET\_FILE\_MODE\_WRITE@{EET\_FILE\_MODE\_WRITE}}}\mbox{\Hypertarget{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}\label{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}} 
EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+WRITE&File is write-\/only. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{EET\_FILE\_MODE\_READ\_WRITE@{EET\_FILE\_MODE\_READ\_WRITE}!Eet File Main Functions@{Eet File Main Functions}}\index{Eet File Main Functions@{Eet File Main Functions}!EET\_FILE\_MODE\_READ\_WRITE@{EET\_FILE\_MODE\_READ\_WRITE}}}\mbox{\Hypertarget{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}\label{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}} 
EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE&File is for both read and write. \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}\label{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_open@{eet\_open}}
\index{eet\_open@{eet\_open}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_open()}{eet\_open()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ eet\+\_\+open (\begin{DoxyParamCaption}\item[{const char $\ast$}]{file,  }\item[{\mbox{\hyperlink{group__Eet__File__Group_gaaffe4b3f04b9306abf105c89c8934331}{Eet\+\_\+\+File\+\_\+\+Mode}}}]{mode }\end{DoxyParamCaption})}



Opens an eet file on disk, and returns a handle to it. 


\begin{DoxyParams}{Parameters}
{\em file} & The file path to the eet file. eg\+: {\ttfamily \char`\"{}/tmp/file.\+eet\char`\"{}}. \\
\hline
{\em mode} & The mode for opening. Either \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}, \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+WRITE}} or \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An opened eet file handle.
\end{DoxyReturn}
This function will open an exiting eet file for reading, and build the directory table in memory and return a handle to the file, if it exists and can be read, and no memory errors occur on the way, otherwise NULL will be returned.

It will also open an eet file for writing. This will, if successful, delete the original file and replace it with a new empty file, till the eet file handle is closed or flushed. If it cannot be opened for writing or a memory error occurs, NULL is returned.

You can also open the file for read/write. If you then write a key that does not exist it will be created, if the key exists it will be replaced by the new data.

If the same file is opened multiple times, then the same file handle will be returned as eet maintains an internal list of all currently open files. Note that it considers files opened for read only and those opened for read/write and write only as 2 separate sets. Those that do not write to the file and those that do. Eet will allow 2 handles to the same file if they are in the 2 separate lists/groups. That means opening a file for read only looks in the read only set, and returns a handle to that file handle and increments its reference count. If you open a file for read/write or write only it looks in the write set and returns a handle after incrementing the reference count. You need to close an eet file handle as many times as it has been opened to maintain correct reference counts. Files whose modified timestamp or size do not match those of the existing referenced file handles will not be returned and a new handle will be returned instead.

\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-basic_8c-example}{eet-\/basic.\+c}}, \mbox{\hyperlink{eet-data-cipher_decipher_8c-example}{eet-\/data-\/cipher\+\_\+decipher.\+c}}, \mbox{\hyperlink{eet-data-file_descriptor_01_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+01.\+c}}, \mbox{\hyperlink{eet-data-file_descriptor_02_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+02.\+c}}, \mbox{\hyperlink{eet-data-nested_8c-example}{eet-\/data-\/nested.\+c}}, \mbox{\hyperlink{eet-data-simple_8c-example}{eet-\/data-\/simple.\+c}}, and \mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+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__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+WRITE}}, \mbox{\hyperlink{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}{eet\+\_\+sync()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__File__Group_ga6b19a0682a3747cb5c313dc7d0e41a90}{eina\+\_\+file\+\_\+close()}}, \mbox{\hyperlink{group__Eina__File__Group_gaae165c21af09fca39c2d1f89a92cb6b1}{eina\+\_\+file\+\_\+map\+\_\+all()}}, \mbox{\hyperlink{group__Eina__File__Group_ga9579ba508358c74ea57bd8906801cfe5}{eina\+\_\+file\+\_\+open()}}, \mbox{\hyperlink{group__Eina__File__Group_gga2788825dfdd797282112148f2f65ec7aabb92031c2d448a1659117121866229b2}{EINA\+\_\+\+FILE\+\_\+\+SEQUENTIAL}}, \mbox{\hyperlink{group__Eina__File__Group_ga2f57057d1d66e6392a832674a69c1278}{eina\+\_\+file\+\_\+size\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga1901668fffca5f06ace9b150715dfc76}{eina\+\_\+stringshare\+\_\+add\+\_\+length()}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a66d968607aef3bc41ac5844208e49a2b}{edje\+\_\+edit\+\_\+clean\+\_\+save\+\_\+as()}}, \mbox{\hyperlink{group__Elm__Prefs_ga3f5a79c40a17ca1565503a30f810c463}{elm\+\_\+prefs\+\_\+data\+\_\+new()}}, and \mbox{\hyperlink{group__Emotion__API_ga5959f96c419207924c9935a9793706a5}{emotion\+\_\+init()}}.

\mbox{\Hypertarget{group__Eet__File__Group_gab6c2e3d0ef53d273f30f359c3e151665}\label{group__Eet__File__Group_gab6c2e3d0ef53d273f30f359c3e151665}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_mmap@{eet\_mmap}}
\index{eet\_mmap@{eet\_mmap}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_mmap()}{eet\_mmap()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ eet\+\_\+mmap (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Eina__File__Group_ga20697123547cbc937c6c9dd845af0403}{Eina\+\_\+\+File}} $\ast$}]{file }\end{DoxyParamCaption})}



Opens an eet file on disk from an Eina\+\_\+\+File handle, and returns a handle to it. 


\begin{DoxyParams}{Parameters}
{\em file} & The Eina\+\_\+\+File handle to map to an eet file. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An opened eet file handle.
\end{DoxyReturn}
This function will open an exiting eet file for reading, and build the directory table in memory and return a handle to the file, if it exists and can be read, and no memory errors occur on the way, otherwise NULL will be returned.

This function can\textquotesingle{}t open file for writing only read only mode is supported for now.

If the same file is opened multiple times, then the same file handle will be returned as eet maintains an internal list of all currently open files. That means opening a file for read only looks in the read only set, and returns a handle to that file handle and increments its reference count. You need to close an eet file handle as many times as it has been opened to maintain correct reference counts.

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


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}, \mbox{\hyperlink{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}{eet\+\_\+sync()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__File__Group_gad4bdb938ea01bafc6b194306f890e086}{eina\+\_\+file\+\_\+dup()}}, \mbox{\hyperlink{group__Eina__File__Group_gae5b1bd03a9dc86e3262ef606ba92bb26}{eina\+\_\+file\+\_\+filename\+\_\+get()}}, \mbox{\hyperlink{group__Eina__File__Group_gaae165c21af09fca39c2d1f89a92cb6b1}{eina\+\_\+file\+\_\+map\+\_\+all()}}, \mbox{\hyperlink{group__Eina__File__Group_gga2788825dfdd797282112148f2f65ec7aabb92031c2d448a1659117121866229b2}{EINA\+\_\+\+FILE\+\_\+\+SEQUENTIAL}}, \mbox{\hyperlink{group__Eina__File__Group_ga2f57057d1d66e6392a832674a69c1278}{eina\+\_\+file\+\_\+size\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}\label{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_memopen\_read@{eet\_memopen\_read}}
\index{eet\_memopen\_read@{eet\_memopen\_read}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_memopen\_read()}{eet\_memopen\_read()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$ eet\+\_\+memopen\+\_\+read (\begin{DoxyParamCaption}\item[{const void $\ast$}]{data,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Opens an eet file directly from a memory location. 

The data is not copied, so you must keep it around as long as the eet file is open. There is currently no cache for this kind of Eet\+\_\+\+File, so it\textquotesingle{}s reopened every time you use eet\+\_\+memopen\+\_\+read. 
\begin{DoxyParams}{Parameters}
{\em data} & Address of file in memory. \\
\hline
{\em size} & Size of memory to be read. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A handle to the file.
\end{DoxyReturn}
Files opened this way will always be in read-\/only mode.

\begin{DoxySince}{Since}
1.\+1.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga806f64e7ad3463cd40337c5022c7e83c}\label{group__Eet__File__Group_ga806f64e7ad3463cd40337c5022c7e83c}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_mode\_get@{eet\_mode\_get}}
\index{eet\_mode\_get@{eet\_mode\_get}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_mode\_get()}{eet\_mode\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__File__Group_gaaffe4b3f04b9306abf105c89c8934331}{Eet\+\_\+\+File\+\_\+\+Mode}} eet\+\_\+mode\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Gets the mode an Eet\+\_\+\+File was opened with. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The mode ef was opened with.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}\label{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_close@{eet\_close}}
\index{eet\_close@{eet\_close}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_close()}{eet\_close()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__Group_ga966e47d17fb3f81293bc0ada3c031d95}{Eet\+\_\+\+Error}} eet\+\_\+close (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Closes an eet file handle and flush pending writes. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An eet error identifier.
\end{DoxyReturn}
This function will flush any pending writes to disk if the eet file was opened for write, and free all data associated with the file handle and file, and close the file. If it was opened for read (or read/write), the file handle may still be held open internally for caching purposes. To flush speculatively held eet file handles use \mbox{\hyperlink{group__Eet__Group_ga5b3f70f4842551426befbff648e4094b}{eet\+\_\+clearcache()}}.

If the eet file handle is not valid nothing will be done.

\begin{DoxySince}{Since}
1.\+0.\+0
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Group_ga5b3f70f4842551426befbff648e4094b}{eet\+\_\+clearcache()}} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-basic_8c-example}{eet-\/basic.\+c}}, \mbox{\hyperlink{eet-data-cipher_decipher_8c-example}{eet-\/data-\/cipher\+\_\+decipher.\+c}}, \mbox{\hyperlink{eet-data-file_descriptor_01_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+01.\+c}}, \mbox{\hyperlink{eet-data-file_descriptor_02_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+02.\+c}}, \mbox{\hyperlink{eet-data-nested_8c-example}{eet-\/data-\/nested.\+c}}, \mbox{\hyperlink{eet-data-simple_8c-example}{eet-\/data-\/simple.\+c}}, and \mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a66d968607aef3bc41ac5844208e49a2b}{edje\+\_\+edit\+\_\+clean\+\_\+save\+\_\+as()}}, \mbox{\hyperlink{group__Elm__Prefs_ga3f5a79c40a17ca1565503a30f810c463}{elm\+\_\+prefs\+\_\+data\+\_\+new()}}, and \mbox{\hyperlink{group__Emotion__API_gac2efae65442ca95289fb273693195265}{emotion\+\_\+shutdown()}}.

\mbox{\Hypertarget{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}\label{group__Eet__File__Group_gaf343f344180955ed898aa86b90ebefda}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_sync@{eet\_sync}}
\index{eet\_sync@{eet\_sync}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_sync()}{eet\_sync()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__Group_ga966e47d17fb3f81293bc0ada3c031d95}{Eet\+\_\+\+Error}} eet\+\_\+sync (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Syncs content of an eet file handle, flushing pending writes. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An eet error identifier.
\end{DoxyReturn}
This function will flush any pending writes to disk. The eet file must be opened for write.

If the eet file handle is not valid nothing will be done.

\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__Group_ggaa9142d865094701672375485d4a6284da624f64fe9803c1a4229a60214d675fa4}{EET\+\_\+\+ERROR\+\_\+\+BAD\+\_\+\+OBJECT}}, \mbox{\hyperlink{group__Eet__Group_ggaa9142d865094701672375485d4a6284da2e3af24c66d0decf7c97fe4e5a7f75d4}{EET\+\_\+\+ERROR\+\_\+\+NONE}}, \mbox{\hyperlink{group__Eet__Group_ggaa9142d865094701672375485d4a6284da0cf54c8e55c541d80273ba9297756217}{EET\+\_\+\+ERROR\+\_\+\+NOT\+\_\+\+WRITABLE}}, \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}, and \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+WRITE}}.



Referenced by \mbox{\hyperlink{group__Eet__File__Group_gab6c2e3d0ef53d273f30f359c3e151665}{eet\+\_\+mmap()}}, and \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open()}}.

\mbox{\Hypertarget{group__Eet__File__Group_gabac3fef94bb732840b9ac9cc2917c4c6}\label{group__Eet__File__Group_gabac3fef94bb732840b9ac9cc2917c4c6}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_dictionary\_get@{eet\_dictionary\_get}}
\index{eet\_dictionary\_get@{eet\_dictionary\_get}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_dictionary\_get()}{eet\_dictionary\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}{Eet\+\_\+\+Dictionary}} $\ast$ eet\+\_\+dictionary\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Returns a handle to the shared string dictionary of the Eet file. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A handle to the dictionary of the file
\end{DoxyReturn}
This function returns a handle to the dictionary of an Eet file whose handle is {\ttfamily ef}, if a dictionary exists. NULL is returned otherwise or if the file handle is known to be invalid.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__File__Group_ga53290da52edb929b85e51f25e79d27c8}{eet\+\_\+dictionary\+\_\+string\+\_\+check()}} to know if given string came from the dictionary or it was dynamically allocated using the \mbox{\hyperlink{group__Eet__Data__Group_gace5d1ff83e06ad08d15aadef3916082f}{Eet\+\_\+\+Data\+\_\+\+Descriptor\+\_\+\+Class}} instructions.
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-data-file_descriptor_01_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+01.\+c}}, and \mbox{\hyperlink{eet-data-file_descriptor_02_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+02.\+c}}.\end{Desc}


Referenced by \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga5f80e7c90720422ee595f229fd8fcbef}{eet\+\_\+data\+\_\+dump\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Node__Group_gac06efd635c519fcd1aa7ce07462ac1e9}{eet\+\_\+data\+\_\+node\+\_\+read\+\_\+cipher()}}, \mbox{\hyperlink{group__Eet__Node__Group_gab40746777c4b47e38416c1b77425aa96}{eet\+\_\+data\+\_\+node\+\_\+write\+\_\+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__Data__Cipher__Group_ga58060eca71513b8634a32e076dc8dd85}{eet\+\_\+data\+\_\+undump\+\_\+cipher()}}, and \mbox{\hyperlink{group__Eet__Data__Cipher__Group_ga9e46230c55006296f141ed9a5807c759}{eet\+\_\+data\+\_\+write\+\_\+cipher()}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga53290da52edb929b85e51f25e79d27c8}\label{group__Eet__File__Group_ga53290da52edb929b85e51f25e79d27c8}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_dictionary\_string\_check@{eet\_dictionary\_string\_check}}
\index{eet\_dictionary\_string\_check@{eet\_dictionary\_string\_check}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_dictionary\_string\_check()}{eet\_dictionary\_string\_check()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+dictionary\+\_\+string\+\_\+check (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}{Eet\+\_\+\+Dictionary}} $\ast$}]{ed,  }\item[{const char $\ast$}]{string }\end{DoxyParamCaption})}



Checks if a given string comes from a given dictionary. 


\begin{DoxyParams}{Parameters}
{\em ed} & A valid dictionary handle \\
\hline
{\em string} & A valid 0 byte terminated C string \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily 1} if it is in the dictionary, {\ttfamily 0} otherwise
\end{DoxyReturn}
This checks the given dictionary to see if the given string is actually inside that dictionary (i.\+e. comes from it) and returns {\ttfamily 1} if it does. If the dictionary handle is invalid, the string is NULL or the string is not in the dictionary, {\ttfamily 0} is returned.

\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-data-file_descriptor_01_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+01.\+c}}, and \mbox{\hyperlink{eet-data-file_descriptor_02_8c-example}{eet-\/data-\/file\+\_\+descriptor\+\_\+02.\+c}}.\end{Desc}
\mbox{\Hypertarget{group__Eet__File__Group_ga1cadbf9178be9abf9578e429f93bc0a6}\label{group__Eet__File__Group_ga1cadbf9178be9abf9578e429f93bc0a6}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_dictionary\_count@{eet\_dictionary\_count}}
\index{eet\_dictionary\_count@{eet\_dictionary\_count}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_dictionary\_count()}{eet\_dictionary\_count()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+dictionary\+\_\+count (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Eet__File__Group_gaf0984c8280699ca5a3c4966f5580324c}{Eet\+\_\+\+Dictionary}} $\ast$}]{ed }\end{DoxyParamCaption})}



Returns the number of strings inside a dictionary. 


\begin{DoxyParams}{Parameters}
{\em ed} & A valid dictionary handle \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the number of strings inside a dictionary
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+6.\+0 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}\label{group__Eet__File__Group_gab525b8d547c3542f6e430eeb6d919558}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_read@{eet\_read}}
\index{eet\_read@{eet\_read}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_read()}{eet\_read()}}
{\footnotesize\ttfamily EAPI void $\ast$ eet\+\_\+read (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name,  }\item[{int $\ast$}]{size\+\_\+ret }\end{DoxyParamCaption})}



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


\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
\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__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\+\_\+read\+\_\+cipher()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-basic_8c-example}{eet-\/basic.\+c}}, and \mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Cipher__Group_gac6d14b588c7e192dc621f466749f3177}{eet\+\_\+read\+\_\+cipher()}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a66d968607aef3bc41ac5844208e49a2b}{edje\+\_\+edit\+\_\+clean\+\_\+save\+\_\+as()}}, \mbox{\hyperlink{Edje__Edit_8h_ad260faf7c12f8f81f3194f970f17fd13}{edje\+\_\+edit\+\_\+group\+\_\+copy()}}, \mbox{\hyperlink{Edje__Edit_8h_afc78fedfb5b185e45580b8f5598ff9ed}{edje\+\_\+edit\+\_\+image\+\_\+del()}}, \mbox{\hyperlink{Edje__Edit_8h_a72b0ddd60fa1b06deb7394a4d0e59e48}{edje\+\_\+edit\+\_\+sound\+\_\+samplebuffer\+\_\+get()}}, and \mbox{\hyperlink{Edje__Edit_8h_ac4a9060a36bd89f49e0d027a2134dcb0}{edje\+\_\+edit\+\_\+vector\+\_\+del()}}.

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



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


\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
\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 if not compressed and successful. NULL is returned if the lookup fails or if memory errors are encountered or if the data is compressed. The calling program must never 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{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+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__Group_ga250ac882b4530dc8112b0c9517a5b44d}{eet\+\_\+read\+\_\+direct()}}, \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_ga3810a1ca5efb83920182575f7c4de9dc}{eina\+\_\+binbuf\+\_\+string\+\_\+get()}}, and \mbox{\hyperlink{group__Emile__Group__Compression_ga7d82a8d7e46633742993c4127187574d}{emile\+\_\+decompress()}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a66d968607aef3bc41ac5844208e49a2b}{edje\+\_\+edit\+\_\+clean\+\_\+save\+\_\+as()}}, \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()}}, and \mbox{\hyperlink{group__Eet__File__Group_ga250ac882b4530dc8112b0c9517a5b44d}{eet\+\_\+read\+\_\+direct()}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}\label{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_write@{eet\_write}}
\index{eet\_write@{eet\_write}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_write()}{eet\_write()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+write (\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 }\end{DoxyParamCaption})}



Write a specified entry to an eet file handle. 


\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
\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 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__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\+\_\+write\+\_\+cipher()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-basic_8c-example}{eet-\/basic.\+c}}, and \mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Cipher__Group_ga0c08a5881d6fd3474a8cbe03a445aff3}{eet\+\_\+write\+\_\+cipher()}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a66d968607aef3bc41ac5844208e49a2b}{edje\+\_\+edit\+\_\+clean\+\_\+save\+\_\+as()}}, \mbox{\hyperlink{Edje__Edit_8h_ad260faf7c12f8f81f3194f970f17fd13}{edje\+\_\+edit\+\_\+group\+\_\+copy()}}, \mbox{\hyperlink{Edje__Edit_8h_afc78fedfb5b185e45580b8f5598ff9ed}{edje\+\_\+edit\+\_\+image\+\_\+del()}}, and \mbox{\hyperlink{Edje__Edit_8h_ac4a9060a36bd89f49e0d027a2134dcb0}{edje\+\_\+edit\+\_\+vector\+\_\+del()}}.

\mbox{\Hypertarget{group__Eet__File__Group_gaa8a980d684123dfbaf12e7efefdb57f5}\label{group__Eet__File__Group_gaa8a980d684123dfbaf12e7efefdb57f5}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_delete@{eet\_delete}}
\index{eet\_delete@{eet\_delete}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_delete()}{eet\_delete()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+delete (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Deletes a specified entry from an Eet file being written or re-\/written. 


\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
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Success or failure of the delete.
\end{DoxyReturn}
This function will delete the specified chunk of data from 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, must not be NULL, otherwise 0 will be returned.

\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a9adf4fab5cc6855216fd6307e8dbf375}{edje\+\_\+edit\+\_\+font\+\_\+del()}}, \mbox{\hyperlink{Edje__Edit_8h_a66f994a35f0ecd65b3fe109833b3dc53}{edje\+\_\+edit\+\_\+group\+\_\+del()}}, \mbox{\hyperlink{Edje__Edit_8h_afc78fedfb5b185e45580b8f5598ff9ed}{edje\+\_\+edit\+\_\+image\+\_\+del()}}, \mbox{\hyperlink{Edje__Edit_8h_a9a49ae19044a97e95a65bd4f12cafcba}{edje\+\_\+edit\+\_\+sound\+\_\+sample\+\_\+del()}}, and \mbox{\hyperlink{Edje__Edit_8h_ac4a9060a36bd89f49e0d027a2134dcb0}{edje\+\_\+edit\+\_\+vector\+\_\+del()}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga8b73391dcfad6b71ae1cabe90a020f03}\label{group__Eet__File__Group_ga8b73391dcfad6b71ae1cabe90a020f03}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_alias@{eet\_alias}}
\index{eet\_alias@{eet\_alias}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_alias()}{eet\_alias()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eet\+\_\+alias (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name,  }\item[{const char $\ast$}]{destination,  }\item[{int}]{compress }\end{DoxyParamCaption})}



Alias a specific section to another one. 

Destination may exist or not, no checks are done. 
\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for writing. \\
\hline
{\em name} & Name of the new entry. eg\+: \char`\"{}/base/file\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em destination} & Actual source of the aliased entry eg\+: \char`\"{}/base/the\+\_\+real\+\_\+stuff\+\_\+i\+\_\+want\char`\"{}. \\
\hline
{\em compress} & Compression flags (1 == compress, 0 = don\textquotesingle{}t compress). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE on success, EINA\+\_\+\+FALSE on failure.
\end{DoxyReturn}
Name and Destination must not be NULL, otherwise EINA\+\_\+\+FALSE will be returned. The equivalent of this would be calling \textquotesingle{}ln -\/s destination name\textquotesingle{}

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


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_ga6a5ab6afc496ad8e92964b71dd9ffef9}{eina\+\_\+binbuf\+\_\+manage\+\_\+new()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}, and \mbox{\hyperlink{group__Emile__Group__Compression_ga5b145482e6b6243ca1923b8ce2c3007b}{emile\+\_\+compress()}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga0c008ff2e81978782c5a45a2b17753ae}\label{group__Eet__File__Group_ga0c008ff2e81978782c5a45a2b17753ae}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_file\_get@{eet\_file\_get}}
\index{eet\_file\_get@{eet\_file\_get}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_file\_get()}{eet\_file\_get()}}
{\footnotesize\ttfamily EAPI const char $\ast$ eet\+\_\+file\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Retrieves the filename of an Eet\+\_\+\+File. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle opened for writing. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The stringshared file string opened with \mbox{\hyperlink{group__Eet__File__Group_ga675160a758832ee812edf7f64ed30ee6}{eet\+\_\+open()}}, or NULL on error
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This function will return NULL for files opened with \mbox{\hyperlink{group__Eet__File__Group_ga19dfe0a39087f16b07a82e0fafa09ca2}{eet\+\_\+memopen\+\_\+read()}}
\end{DoxyNote}
\begin{DoxySince}{Since}
1.\+6 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__File__Group_ga39594e7ee4d23fbe1be7f21766646329}\label{group__Eet__File__Group_ga39594e7ee4d23fbe1be7f21766646329}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_alias\_get@{eet\_alias\_get}}
\index{eet\_alias\_get@{eet\_alias\_get}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_alias\_get()}{eet\_alias\_get()}}
{\footnotesize\ttfamily EAPI const char $\ast$ eet\+\_\+alias\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Retrieves the destination name of an alias. 


\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
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Destination of the alias. eg\+: \char`\"{}/base/the\+\_\+real\+\_\+stuff\+\_\+i\+\_\+want\char`\"{}, NULL on failure
\end{DoxyReturn}
Name must not be NULL, otherwise NULL will be returned.

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


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__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_ga3810a1ca5efb83920182575f7c4de9dc}{eina\+\_\+binbuf\+\_\+string\+\_\+get()}}, \mbox{\hyperlink{group__Eina__Stringshare__Group_ga4e3ce40744291c1fb8574e26883c0bf2}{eina\+\_\+stringshare\+\_\+add()}}, and \mbox{\hyperlink{group__Emile__Group__Compression_ga7d82a8d7e46633742993c4127187574d}{emile\+\_\+decompress()}}.

\mbox{\Hypertarget{group__Eet__File__Group_gaab7f9d6d7460b8ec90039b6d82323aa1}\label{group__Eet__File__Group_gaab7f9d6d7460b8ec90039b6d82323aa1}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_list@{eet\_list}}
\index{eet\_list@{eet\_list}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_list()}{eet\_list()}}
{\footnotesize\ttfamily EAPI char $\ast$$\ast$ eet\+\_\+list (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef,  }\item[{const char $\ast$}]{glob,  }\item[{int $\ast$}]{count\+\_\+ret }\end{DoxyParamCaption})}



Lists all entries in eet file matching shell glob. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
{\em glob} & A shell glob to match against. \\
\hline
{\em count\+\_\+ret} & Number of entries found to match. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to an array of strings.
\end{DoxyReturn}
This function will list all entries in the eet file matching the supplied shell glob and return an allocated list of their names, if there are any, and if no memory errors occur.

The eet file handle must be valid and glob must not be NULL, or NULL will be returned and count\+\_\+ret will be filled with {\ttfamily 0}.

The calling program must call free() on the array returned, but NOT on the string pointers in the array. They are taken as read-\/only internals from the eet file handle. They are only valid as long as the file handle is not closed. When it is closed those pointers in the array are now not valid and should not be used.

On success, the array returned will have a list of string pointers that are the names of the entries that matched, and count\+\_\+ret will have the number of entries in this array placed in it.

Hint\+: an easy way to list all entries in an eet file is to use a glob value of \char`\"{}$\ast$\char`\"{}.

\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}, and \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}.



Referenced by \mbox{\hyperlink{Edje__Edit_8h_a66d968607aef3bc41ac5844208e49a2b}{edje\+\_\+edit\+\_\+clean\+\_\+save\+\_\+as()}}, \mbox{\hyperlink{Edje__Edit_8h_ad260faf7c12f8f81f3194f970f17fd13}{edje\+\_\+edit\+\_\+group\+\_\+copy()}}, and \mbox{\hyperlink{Edje__Edit_8h_a66f994a35f0ecd65b3fe109833b3dc53}{edje\+\_\+edit\+\_\+group\+\_\+del()}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga7509b0c13057a2a4066b592c70e69279}\label{group__Eet__File__Group_ga7509b0c13057a2a4066b592c70e69279}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_list\_entries@{eet\_list\_entries}}
\index{eet\_list\_entries@{eet\_list\_entries}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_list\_entries()}{eet\_list\_entries()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Iterator__Group_ga15b975bb881d955249ce13d4ebc96948}{Eina\+\_\+\+Iterator}} $\ast$ eet\+\_\+list\+\_\+entries (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Returns an iterator that will describe each entry of an Eet\+\_\+\+File. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An iterator of Eet\+\_\+\+Entry.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+8.\+0 
\end{DoxySince}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Magic__Group_ga470f5ce28eaaf59ce80523be8471c5e0}{EINA\+\_\+\+MAGIC\+\_\+\+SET}}, \mbox{\hyperlink{group__Eina__Iterator__Group_gad1ea4d3a7e58b47b23073a58e869d167}{FUNC\+\_\+\+ITERATOR\+\_\+\+FREE}}, \mbox{\hyperlink{group__Eina__Iterator__Group_gab41f5a30f0a2030f4a832548d18332db}{FUNC\+\_\+\+ITERATOR\+\_\+\+GET\+\_\+\+CONTAINER}}, \mbox{\hyperlink{group__Eina__Iterator__Group_ga71905e8fc8ce5d31aea26362da620eff}{FUNC\+\_\+\+ITERATOR\+\_\+\+LOCK}}, and \mbox{\hyperlink{group__Eina__Iterator__Group_gaec80e80b2867e391b0b27f5f20c3a5b3}{FUNC\+\_\+\+ITERATOR\+\_\+\+NEXT}}.

\mbox{\Hypertarget{group__Eet__File__Group_ga53bf1cf96267787aa93a99a0fe7ba8f7}\label{group__Eet__File__Group_ga53bf1cf96267787aa93a99a0fe7ba8f7}} 
\index{Eet File Main Functions@{Eet File Main Functions}!eet\_num\_entries@{eet\_num\_entries}}
\index{eet\_num\_entries@{eet\_num\_entries}!Eet File Main Functions@{Eet File Main Functions}}
\doxysubsubsection{\texorpdfstring{eet\_num\_entries()}{eet\_num\_entries()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+num\+\_\+entries (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\+\_\+\+File}} $\ast$}]{ef }\end{DoxyParamCaption})}



Returns the number of entries in the specified eet file. 


\begin{DoxyParams}{Parameters}
{\em ef} & A valid eet file handle. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Number of entries in ef or {\ttfamily -\/1} if the number of entries cannot be read due to open mode restrictions.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+0.\+0 
\end{DoxySince}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{eet-file_8c-example}{eet-\/file.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ}}, and \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a763d29c19960a4e0d4eb7bc7bb512481}{EET\+\_\+\+FILE\+\_\+\+MODE\+\_\+\+READ\+\_\+\+WRITE}}.

