
\begin{DoxyCodeInclude}
1 \textcolor{comment}{//Compile with:}
2 \textcolor{comment}{// gcc -o eet-basic eet-basic.c `pkg-config --cflags --libs eet`}
3 
4 \textcolor{preprocessor}{#include <\hyperlink{Eet_8h}{Eet.h}>}
5 
6 \textcolor{keywordtype}{int}
7 main(\textcolor{keywordtype}{void})
8 \{
9    \hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\_File} *ef;
10    \textcolor{keywordtype}{char} *ret;
11    \textcolor{keywordtype}{int} size;
12    \textcolor{keywordtype}{char} *entries[] =
13    \{
14       \textcolor{stringliteral}{"Entry 1"},
15       \textcolor{stringliteral}{"Big text string here compared to others"},
16       \textcolor{stringliteral}{"Eet is cool"}
17    \};
18 
19    \hyperlink{group__Eet__Group_ga9903687bfa20fe9a9e59d4c1d213e89a}{eet\_init}();
20 
21    \textcolor{comment}{// blindly open an file for output and write strings with their NUL char}
22    ef = \hyperlink{group__Eet__File__Group_ga5f55956b860aa2c77af9b1a880c4c256}{eet\_open}(\textcolor{stringliteral}{"test.eet"}, \hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\_FILE\_MODE\_WRITE});
23    \hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\_write}(ef, \textcolor{stringliteral}{"Entry 1"}, entries[0], strlen(entries[0]) + 1, 0);
24    \hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\_write}(ef, \textcolor{stringliteral}{"Entry 2"}, entries[1], strlen(entries[1]) + 1, 1);
25    \hyperlink{group__Eet__File__Group_ga682d04715f0e11380c460814c4a9bd21}{eet\_write}(ef, \textcolor{stringliteral}{"Entry 3"}, entries[2], strlen(entries[2]) + 1, 0);
26    \hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}(ef);
27 
28    \textcolor{comment}{// open the file again and blindly get the entries we wrote}
29    ef = \hyperlink{group__Eet__File__Group_ga5f55956b860aa2c77af9b1a880c4c256}{eet\_open}(\textcolor{stringliteral}{"test.eet"}, \hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ});
30    ret = \hyperlink{group__Eet__File__Group_gac13cdf7782d1e513f5b1abcc529962f4}{eet\_read}(ef, \textcolor{stringliteral}{"Entry 1"}, &size);
31    printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, ret);
32    free(ret);
33    ret = \hyperlink{group__Eet__File__Group_gac13cdf7782d1e513f5b1abcc529962f4}{eet\_read}(ef, \textcolor{stringliteral}{"Entry 2"}, &size);
34    printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, ret);
35    free(ret);
36    ret = \hyperlink{group__Eet__File__Group_gac13cdf7782d1e513f5b1abcc529962f4}{eet\_read}(ef, \textcolor{stringliteral}{"Entry 3"}, &size);
37    printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, ret);
38    free(ret);
39    \hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}(ef);
40 
41    \hyperlink{group__Eet__Group_gacbc7583179399d3b3e7b003e911f866f}{eet\_shutdown}();
42 \}
43 
\end{DoxyCodeInclude}
 