
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{1 \textcolor{comment}{//Compile with:}}
\DoxyCodeLine{2 \textcolor{comment}{// gcc -\/o eet-\/data-\/nested eet-\/data-\/nested.c `pkg-\/config -\/-\/cflags -\/-\/libs eet eina`}}
\DoxyCodeLine{3 }
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eet_8h}{Eet.h}}>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <limits.h>}}
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <sys/stat.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <unistd.h>}}
\DoxyCodeLine{11 }
\DoxyCodeLine{12 \textcolor{comment}{// The struct that will be loaded and saved.}}
\DoxyCodeLine{13 \textcolor{comment}{// note that only the members described in the eet\_data\_descriptor}}
\DoxyCodeLine{14 \textcolor{comment}{// will be automatically handled. The other members will have their}}
\DoxyCodeLine{15 \textcolor{comment}{// space reserved and zeroed (as it uses calloc()), but not}}
\DoxyCodeLine{16 \textcolor{comment}{// saved or loaded from eet files.}}
\DoxyCodeLine{17 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}}
\DoxyCodeLine{18 \{}
\DoxyCodeLine{19    \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} version; \textcolor{comment}{// it is recommended to use versioned configuration!}}
\DoxyCodeLine{20    \textcolor{keyword}{const} \textcolor{keywordtype}{char}  *name;}
\DoxyCodeLine{21    \textcolor{keywordtype}{int}          id;}
\DoxyCodeLine{22    \textcolor{keywordtype}{int}          not\_saved\_value; \textcolor{comment}{// example of not saved data inside!}}
\DoxyCodeLine{23    \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}    enabled;}
\DoxyCodeLine{24    \mbox{\hyperlink{struct__Eina__List}{Eina\_List}}   *subs;}
\DoxyCodeLine{25 \} My\_Conf\_Type;}
\DoxyCodeLine{26 }
\DoxyCodeLine{27 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}}
\DoxyCodeLine{28 \{}
\DoxyCodeLine{29    \textcolor{keyword}{const} \textcolor{keywordtype}{char} *server;}
\DoxyCodeLine{30    \textcolor{keywordtype}{int}         port;}
\DoxyCodeLine{31 \} My\_Conf\_Subtype;}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{comment}{// string that represents the entry in eet file, you might like to have}}
\DoxyCodeLine{34 \textcolor{comment}{// different profiles or so in the same file, this is possible with}}
\DoxyCodeLine{35 \textcolor{comment}{// different strings}}
\DoxyCodeLine{36 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} MY\_CONF\_FILE\_ENTRY[] = \textcolor{stringliteral}{"config"};}
\DoxyCodeLine{37 }
\DoxyCodeLine{38 \textcolor{comment}{// keep the descriptor static global, so it can be}}
\DoxyCodeLine{39 \textcolor{comment}{// shared by different functions (load/save) of this and only this}}
\DoxyCodeLine{40 \textcolor{comment}{// file.}}
\DoxyCodeLine{41 \textcolor{keyword}{static} \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\_Data\_Descriptor}} *\_my\_conf\_descriptor;}
\DoxyCodeLine{42 \textcolor{keyword}{static} \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\_Data\_Descriptor}} *\_my\_conf\_sub\_descriptor;}
\DoxyCodeLine{43 }
\DoxyCodeLine{44 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{45 \_my\_conf\_descriptor\_init(\textcolor{keywordtype}{void})}
\DoxyCodeLine{46 \{}
\DoxyCodeLine{47    \mbox{\hyperlink{struct__Eet__Data__Descriptor__Class}{Eet\_Data\_Descriptor\_Class}} eddc;}
\DoxyCodeLine{48 }
\DoxyCodeLine{49    \textcolor{comment}{// The class describe the functions to use to create the type and its}}
\DoxyCodeLine{50    \textcolor{comment}{// full allocated size.}}
\DoxyCodeLine{51    \textcolor{comment}{//}}
\DoxyCodeLine{52    \textcolor{comment}{// Eina types are very convenient, so use them to create the descriptor,}}
\DoxyCodeLine{53    \textcolor{comment}{// so we get eina\_list,  eina\_hash and eina\_stringshare automatically!}}
\DoxyCodeLine{54    \textcolor{comment}{//}}
\DoxyCodeLine{55    \textcolor{comment}{// The STREAM variant is better for configuration files as the values}}
\DoxyCodeLine{56    \textcolor{comment}{// will likely change a lot.}}
\DoxyCodeLine{57    \textcolor{comment}{//}}
\DoxyCodeLine{58    \textcolor{comment}{// The other variant, FILE, is good for caches and things that are just}}
\DoxyCodeLine{59    \textcolor{comment}{// appended, but needs to take care when changing strings and files must}}
\DoxyCodeLine{60    \textcolor{comment}{// be kept open so mmap()ed strings will be kept alive.}}
\DoxyCodeLine{61    \mbox{\hyperlink{group__Eet__Data__Group_ga941b1fcd6c6c72221d9390f9a0ed751c}{EET\_EINA\_STREAM\_DATA\_DESCRIPTOR\_CLASS\_SET}}(\&eddc, My\_Conf\_Type);}
\DoxyCodeLine{62    \_my\_conf\_descriptor = \mbox{\hyperlink{group__Eet__Data__Group_gae300b4a97dbaab30a200edbb97f108c1}{eet\_data\_descriptor\_stream\_new}}(\&eddc);}
\DoxyCodeLine{63 }
\DoxyCodeLine{64    \mbox{\hyperlink{group__Eet__Data__Group_ga941b1fcd6c6c72221d9390f9a0ed751c}{EET\_EINA\_STREAM\_DATA\_DESCRIPTOR\_CLASS\_SET}}(\&eddc, My\_Conf\_Subtype);}
\DoxyCodeLine{65    \_my\_conf\_sub\_descriptor = \mbox{\hyperlink{group__Eet__Data__Group_gae300b4a97dbaab30a200edbb97f108c1}{eet\_data\_descriptor\_stream\_new}}(\&eddc);}
\DoxyCodeLine{66 }
\DoxyCodeLine{67    \textcolor{comment}{// Describe the members to be saved:}}
\DoxyCodeLine{68    \textcolor{comment}{// Use a temporary macro so we don't type a lot, also avoid errors:}}
\DoxyCodeLine{69 \textcolor{preprocessor}{\#define MY\_CONF\_ADD\_BASIC(member, eet\_type) \(\backslash\)}}
\DoxyCodeLine{70 \textcolor{preprocessor}{  EET\_DATA\_DESCRIPTOR\_ADD\_BASIC             \(\backslash\)}}
\DoxyCodeLine{71 \textcolor{preprocessor}{    (\_my\_conf\_descriptor, My\_Conf\_Type, \# member, member, eet\_type)}}
\DoxyCodeLine{72 \textcolor{preprocessor}{\#define MY\_CONF\_SUB\_ADD\_BASIC(member, eet\_type) \(\backslash\)}}
\DoxyCodeLine{73 \textcolor{preprocessor}{  EET\_DATA\_DESCRIPTOR\_ADD\_BASIC                 \(\backslash\)}}
\DoxyCodeLine{74 \textcolor{preprocessor}{    (\_my\_conf\_sub\_descriptor, My\_Conf\_Subtype, \# member, member, eet\_type)}}
\DoxyCodeLine{75 }
\DoxyCodeLine{76    MY\_CONF\_SUB\_ADD\_BASIC(server, \mbox{\hyperlink{group__Eet__Data__Group_ga0d2cf409bf3f151156d74d18ac59e3d1}{EET\_T\_STRING}});}
\DoxyCodeLine{77    MY\_CONF\_SUB\_ADD\_BASIC(port, \mbox{\hyperlink{group__Eet__Data__Group_ga4e196733795867f14c6e387af7287baa}{EET\_T\_INT}});}
\DoxyCodeLine{78 }
\DoxyCodeLine{79    MY\_CONF\_ADD\_BASIC(version, \mbox{\hyperlink{group__Eet__Data__Group_gacf6a3c9f06e10e20be5b02cd8c6a220b}{EET\_T\_UINT}});}
\DoxyCodeLine{80    MY\_CONF\_ADD\_BASIC(name, \mbox{\hyperlink{group__Eet__Data__Group_ga0d2cf409bf3f151156d74d18ac59e3d1}{EET\_T\_STRING}});}
\DoxyCodeLine{81    MY\_CONF\_ADD\_BASIC(\textcolor{keywordtype}{id}, \mbox{\hyperlink{group__Eet__Data__Group_ga4e196733795867f14c6e387af7287baa}{EET\_T\_INT}});}
\DoxyCodeLine{82    MY\_CONF\_ADD\_BASIC(enabled, \mbox{\hyperlink{group__Eet__Data__Group_ga09a1341cc158fda0ba60ad2386ecd795}{EET\_T\_UCHAR}});}
\DoxyCodeLine{83 }
\DoxyCodeLine{84    \textcolor{comment}{// And add the sub descriptor as a linked list at 'subs' in the main struct}}
\DoxyCodeLine{85    \mbox{\hyperlink{group__Eet__Data__Group_gabb4c7833ba053f2322e6b667a9ec7f04}{EET\_DATA\_DESCRIPTOR\_ADD\_LIST}}}
\DoxyCodeLine{86      (\_my\_conf\_descriptor, My\_Conf\_Type, \textcolor{stringliteral}{"subs"}, subs, \_my\_conf\_sub\_descriptor);}
\DoxyCodeLine{87 }
\DoxyCodeLine{88 \textcolor{preprocessor}{\#undef MY\_CONF\_ADD\_BASIC}}
\DoxyCodeLine{89 \textcolor{preprocessor}{\#undef MY\_CONF\_SUB\_ADD\_BASIC}}
\DoxyCodeLine{90 \} \textcolor{comment}{/* \_my\_conf\_descriptor\_init */}}
\DoxyCodeLine{91 }
\DoxyCodeLine{92 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{93 \_my\_conf\_descriptor\_shutdown(\textcolor{keywordtype}{void})}
\DoxyCodeLine{94 \{}
\DoxyCodeLine{95    \mbox{\hyperlink{group__Eet__Data__Group_ga3e2b601720973d0e1f4683768a593c4d}{eet\_data\_descriptor\_free}}(\_my\_conf\_sub\_descriptor);}
\DoxyCodeLine{96    \mbox{\hyperlink{group__Eet__Data__Group_ga3e2b601720973d0e1f4683768a593c4d}{eet\_data\_descriptor\_free}}(\_my\_conf\_descriptor);}
\DoxyCodeLine{97 \} \textcolor{comment}{/* \_my\_conf\_descriptor\_shutdown */}}
\DoxyCodeLine{98 }
\DoxyCodeLine{99 \textcolor{keyword}{static} My\_Conf\_Type *}
\DoxyCodeLine{100 \_my\_conf\_new(\textcolor{keywordtype}{void})}
\DoxyCodeLine{101 \{}
\DoxyCodeLine{102    My\_Conf\_Type *my\_conf = calloc(1, \textcolor{keyword}{sizeof}(My\_Conf\_Type));}
\DoxyCodeLine{103    My\_Conf\_Subtype *sub;}
\DoxyCodeLine{104    \textcolor{keywordflow}{if} (!my\_conf)}
\DoxyCodeLine{105      \{}
\DoxyCodeLine{106         fprintf(stderr, \textcolor{stringliteral}{"ERROR: could not calloc My\_Conf\_Type\(\backslash\)n"});}
\DoxyCodeLine{107         \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{108      \}}
\DoxyCodeLine{109 }
\DoxyCodeLine{110    my\_conf-\/>version = 0x112233;}
\DoxyCodeLine{111    my\_conf-\/>enabled = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{112 }
\DoxyCodeLine{113    sub = calloc(1, \textcolor{keyword}{sizeof}(My\_Conf\_Subtype));}
\DoxyCodeLine{114    \textcolor{keywordflow}{if} (sub)}
\DoxyCodeLine{115      \{}
\DoxyCodeLine{116         sub-\/>server = \mbox{\hyperlink{group__Eina__Stringshare__Group_ga5293082680141132ffcacc28866ef0ef}{eina\_stringshare\_add}}(\textcolor{stringliteral}{"my-\/server.com"});}
\DoxyCodeLine{117         sub-\/>port = 1234;}
\DoxyCodeLine{118         my\_conf-\/>subs = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(my\_conf-\/>subs, sub);}
\DoxyCodeLine{119      \}}
\DoxyCodeLine{120 }
\DoxyCodeLine{121    \textcolor{keywordflow}{return} my\_conf;}
\DoxyCodeLine{122 \} \textcolor{comment}{/* \_my\_conf\_new */}}
\DoxyCodeLine{123 }
\DoxyCodeLine{124 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{125 \_my\_conf\_free(My\_Conf\_Type *my\_conf)}
\DoxyCodeLine{126 \{}
\DoxyCodeLine{127    My\_Conf\_Subtype *sub;}
\DoxyCodeLine{128    \mbox{\hyperlink{group__Eina__List__Group_gae27a2c686a0a11693f9b06957c9bba83}{EINA\_LIST\_FREE}}(my\_conf-\/>subs, sub)}
\DoxyCodeLine{129      \{}
\DoxyCodeLine{130         \mbox{\hyperlink{group__Eina__Stringshare__Group_ga495411b0bc85b9c0d59ec7255a025260}{eina\_stringshare\_del}}(sub-\/>server);}
\DoxyCodeLine{131         free(sub);}
\DoxyCodeLine{132      \}}
\DoxyCodeLine{133 }
\DoxyCodeLine{134    \mbox{\hyperlink{group__Eina__Stringshare__Group_ga495411b0bc85b9c0d59ec7255a025260}{eina\_stringshare\_del}}(my\_conf-\/>name);}
\DoxyCodeLine{135    free(my\_conf);}
\DoxyCodeLine{136 \} \textcolor{comment}{/* \_my\_conf\_free */}}
\DoxyCodeLine{137 }
\DoxyCodeLine{138 \textcolor{keyword}{static} My\_Conf\_Type *}
\DoxyCodeLine{139 \_my\_conf\_load(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *filename)}
\DoxyCodeLine{140 \{}
\DoxyCodeLine{141    My\_Conf\_Type *my\_conf;}
\DoxyCodeLine{142    \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\_File}} *ef = \mbox{\hyperlink{group__Eet__File__Group_ga5f55956b860aa2c77af9b1a880c4c256}{eet\_open}}(filename, \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a416f7e9a76b8131a44bbeedb13060c81}{EET\_FILE\_MODE\_READ}});}
\DoxyCodeLine{143    \textcolor{keywordflow}{if} (!ef)}
\DoxyCodeLine{144      \{}
\DoxyCodeLine{145         fprintf(stderr, \textcolor{stringliteral}{"ERROR: could not open '\%s' for read\(\backslash\)n"}, filename);}
\DoxyCodeLine{146         \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{147      \}}
\DoxyCodeLine{148 }
\DoxyCodeLine{149    my\_conf = \mbox{\hyperlink{group__Eet__Data__Group_ga4d1807cbbc448304f22a8808318a3429}{eet\_data\_read}}(ef, \_my\_conf\_descriptor, MY\_CONF\_FILE\_ENTRY);}
\DoxyCodeLine{150    \textcolor{keywordflow}{if} (!my\_conf)}
\DoxyCodeLine{151      \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{152 }
\DoxyCodeLine{153    \textcolor{keywordflow}{if} (my\_conf-\/>version < 0x112233)}
\DoxyCodeLine{154      \{}
\DoxyCodeLine{155         fprintf(stderr,}
\DoxyCodeLine{156                 \textcolor{stringliteral}{"WARNING: version \%\#x was too old, upgrading it to \%\#x\(\backslash\)n"},}
\DoxyCodeLine{157                 my\_conf-\/>version, 0x112233);}
\DoxyCodeLine{158 }
\DoxyCodeLine{159         my\_conf-\/>version = 0x112233;}
\DoxyCodeLine{160         my\_conf-\/>enabled = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{161      \}}
\DoxyCodeLine{162 }
\DoxyCodeLine{163 end:}
\DoxyCodeLine{164    \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{165    \textcolor{keywordflow}{return} my\_conf;}
\DoxyCodeLine{166 \} \textcolor{comment}{/* \_my\_conf\_load */}}
\DoxyCodeLine{167 }
\DoxyCodeLine{168 \textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{169 \_my\_conf\_save(\textcolor{keyword}{const} My\_Conf\_Type *my\_conf,}
\DoxyCodeLine{170               \textcolor{keyword}{const} \textcolor{keywordtype}{char}         *filename)}
\DoxyCodeLine{171 \{}
\DoxyCodeLine{172    \textcolor{keywordtype}{char} tmp[PATH\_MAX];}
\DoxyCodeLine{173    \mbox{\hyperlink{group__Eet__File__Group_ga8d9779184a9870c1a225f1f40c76e8a7}{Eet\_File}} *ef;}
\DoxyCodeLine{174    \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} ret;}
\DoxyCodeLine{175    \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i, len;}
\DoxyCodeLine{176    \textcolor{keyword}{struct }stat st;}
\DoxyCodeLine{177 }
\DoxyCodeLine{178    len = \mbox{\hyperlink{group__Eina__String__Group_ga6bda31d2e1b6d2737b7fe1784780cd2f}{eina\_strlcpy}}(tmp, filename, \textcolor{keyword}{sizeof}(tmp));}
\DoxyCodeLine{179    \textcolor{keywordflow}{if} (len + 12 >= (\textcolor{keywordtype}{int})\textcolor{keyword}{sizeof}(tmp))}
\DoxyCodeLine{180      \{}
\DoxyCodeLine{181         fprintf(stderr, \textcolor{stringliteral}{"ERROR: file name is too big: \%s\(\backslash\)n"}, filename);}
\DoxyCodeLine{182         \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{183      \}}
\DoxyCodeLine{184 }
\DoxyCodeLine{185    i = 0;}
\DoxyCodeLine{186    \textcolor{keywordflow}{do}}
\DoxyCodeLine{187      \{}
\DoxyCodeLine{188         snprintf(tmp + len, 12, \textcolor{stringliteral}{".\%u"}, i);}
\DoxyCodeLine{189         i++;}
\DoxyCodeLine{190      \}}
\DoxyCodeLine{191    \textcolor{keywordflow}{while} (stat(tmp, \&st) == 0);}
\DoxyCodeLine{192 }
\DoxyCodeLine{193    ef = \mbox{\hyperlink{group__Eet__File__Group_ga5f55956b860aa2c77af9b1a880c4c256}{eet\_open}}(tmp, \mbox{\hyperlink{group__Eet__File__Group_ggaa8e1a7af50fefaf15eb2f69543d24998a8f395f56fba48be007c65be51d799ee9}{EET\_FILE\_MODE\_WRITE}});}
\DoxyCodeLine{194    \textcolor{keywordflow}{if} (!ef)}
\DoxyCodeLine{195      \{}
\DoxyCodeLine{196         fprintf(stderr, \textcolor{stringliteral}{"ERROR: could not open '\%s' for write\(\backslash\)n"}, tmp);}
\DoxyCodeLine{197         \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{198      \}}
\DoxyCodeLine{199 }
\DoxyCodeLine{200    ret = \mbox{\hyperlink{group__Eet__Data__Group_gac66d1c49e3490bc5d803982d833ff8aa}{eet\_data\_write}}}
\DoxyCodeLine{201        (ef, \_my\_conf\_descriptor, MY\_CONF\_FILE\_ENTRY, my\_conf, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{202    \mbox{\hyperlink{group__Eet__File__Group_ga1675fef1f6012c1e02ae313d13dc3e03}{eet\_close}}(ef);}
\DoxyCodeLine{203 }
\DoxyCodeLine{204    \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{205      \{}
\DoxyCodeLine{206         unlink(filename);}
\DoxyCodeLine{207         rename(tmp, filename);}
\DoxyCodeLine{208      \}}
\DoxyCodeLine{209 }
\DoxyCodeLine{210    \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{211 \} \textcolor{comment}{/* \_my\_conf\_save */}}
\DoxyCodeLine{212 }
\DoxyCodeLine{213 \textcolor{keywordtype}{int}}
\DoxyCodeLine{214 main(\textcolor{keywordtype}{int}   argc,}
\DoxyCodeLine{215      \textcolor{keywordtype}{char} *argv[])}
\DoxyCodeLine{216 \{}
\DoxyCodeLine{217    My\_Conf\_Type *my\_conf;}
\DoxyCodeLine{218    \textcolor{keyword}{const} My\_Conf\_Subtype *sub;}
\DoxyCodeLine{219    \textcolor{keyword}{const} \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *l;}
\DoxyCodeLine{220    \textcolor{keywordtype}{int} ret = 0;}
\DoxyCodeLine{221 }
\DoxyCodeLine{222    \textcolor{keywordflow}{if} (argc != 3)}
\DoxyCodeLine{223      \{}
\DoxyCodeLine{224         fprintf(stderr, \textcolor{stringliteral}{"Usage:\(\backslash\)n\(\backslash\)t\%s <input> <output>\(\backslash\)n\(\backslash\)n"}, argv[0]);}
\DoxyCodeLine{225         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{226      \}}
\DoxyCodeLine{227 }
\DoxyCodeLine{228    \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}();}
\DoxyCodeLine{229    \mbox{\hyperlink{group__Eet__Group_ga9903687bfa20fe9a9e59d4c1d213e89a}{eet\_init}}();}
\DoxyCodeLine{230    \_my\_conf\_descriptor\_init();}
\DoxyCodeLine{231 }
\DoxyCodeLine{232    my\_conf = \_my\_conf\_load(argv[1]);}
\DoxyCodeLine{233    \textcolor{keywordflow}{if} (!my\_conf)}
\DoxyCodeLine{234      \{}
\DoxyCodeLine{235         printf(\textcolor{stringliteral}{"creating new configuration.\(\backslash\)n"});}
\DoxyCodeLine{236         my\_conf = \_my\_conf\_new();}
\DoxyCodeLine{237         \textcolor{keywordflow}{if} (!my\_conf)}
\DoxyCodeLine{238           \{}
\DoxyCodeLine{239              ret = -\/2;}
\DoxyCodeLine{240              \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{241           \}}
\DoxyCodeLine{242      \}}
\DoxyCodeLine{243 }
\DoxyCodeLine{244    printf(\textcolor{stringliteral}{"My\_Conf\_Type:\(\backslash\)n"}}
\DoxyCodeLine{245           \textcolor{stringliteral}{"\(\backslash\)tversion: \%\#x\(\backslash\)n"}}
\DoxyCodeLine{246           \textcolor{stringliteral}{"\(\backslash\)tname...: '\%s'\(\backslash\)n"}}
\DoxyCodeLine{247           \textcolor{stringliteral}{"\(\backslash\)tid.....: \%d\(\backslash\)n"}}
\DoxyCodeLine{248           \textcolor{stringliteral}{"\(\backslash\)tenabled: \%hhu\(\backslash\)n"}}
\DoxyCodeLine{249           \textcolor{stringliteral}{"\(\backslash\)tsubs...:\(\backslash\)n"},}
\DoxyCodeLine{250           my\_conf-\/>version,}
\DoxyCodeLine{251           my\_conf-\/>name ? my\_conf-\/>name : \textcolor{stringliteral}{""},}
\DoxyCodeLine{252           my\_conf-\/>id,}
\DoxyCodeLine{253           my\_conf-\/>enabled);}
\DoxyCodeLine{254 }
\DoxyCodeLine{255    \mbox{\hyperlink{group__Eina__List__Group_gac6efafc19f526d916cdb9757240a8773}{EINA\_LIST\_FOREACH}}(my\_conf-\/>subs, l, sub)}
\DoxyCodeLine{256      printf(\textcolor{stringliteral}{"\(\backslash\)t\(\backslash\)tserver: '\%s', port: \%d\(\backslash\)n"},}
\DoxyCodeLine{257             sub-\/>server ? sub-\/>server : \textcolor{stringliteral}{""},}
\DoxyCodeLine{258             sub-\/>port);}
\DoxyCodeLine{259 }
\DoxyCodeLine{260    \textcolor{keywordflow}{if} (!\_my\_conf\_save(my\_conf, argv[2]))}
\DoxyCodeLine{261      ret = -\/3;}
\DoxyCodeLine{262 }
\DoxyCodeLine{263    \_my\_conf\_free(my\_conf);}
\DoxyCodeLine{264 }
\DoxyCodeLine{265 end:}
\DoxyCodeLine{266    \_my\_conf\_descriptor\_shutdown();}
\DoxyCodeLine{267    \mbox{\hyperlink{group__Eet__Group_gacbc7583179399d3b3e7b003e911f866f}{eet\_shutdown}}();}
\DoxyCodeLine{268    \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{269 }
\DoxyCodeLine{270    \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{271 \} \textcolor{comment}{/* main */}}
\DoxyCodeLine{272 }
\end{DoxyCodeInclude}
 