\hypertarget{complex-types-client-eina-value_8c-example}{}\doxysection{complex-\/types-\/client-\/eina-\/value.\+c}
Client to test complex types (arrays, structs, dicts) against a provided server (\mbox{\hyperlink{complex-types-server_8c-example}{complex-\/types-\/server.\+c}}) returning them as \mbox{\hyperlink{group__Eina__Value}{Eina\+\_\+\+Value to/from Message}}.

Client to test complex types (arrays, structs, dicts) against a provided server (\mbox{\hyperlink{complex-types-server_8c-example}{complex-\/types-\/server.\+c}}) returning them as \mbox{\hyperlink{group__Eina__Value}{Eina\+\_\+\+Value to/from Message}}.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile\ with:}}
\DoxyCodeLine{\textcolor{comment}{//\ gcc\ -\/o\ complex-\/types-\/client-\/eina-\/value\ complex-\/types-\/client-\/eina-\/value.c\ `pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ eldbus\ ecore\ eina`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}Eldbus.h"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Ecore.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ BUS\ "{}com.profusion"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ PATH\ "{}/com/profusion/Test"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ IFACE\ "{}com.profusion.Test"{}}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ size\_of\_array\ 5}}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *array\_string[]\ =\ \{}
\DoxyCodeLine{\ \ \ \textcolor{stringliteral}{"{}aaaa"{}},\ \textcolor{stringliteral}{"{}bbbb"{}},\ \textcolor{stringliteral}{"{}cccc"{}},\ \textcolor{stringliteral}{"{}dddd"{}},\ \textcolor{stringliteral}{"{}eeee"{}}}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\_sub\_struct}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{char}\ *txt;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ num;}
\DoxyCodeLine{\}\ sub\_struct;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\_main\_struct}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ size;}
\DoxyCodeLine{\ \ \ sub\_struct\ array[];}
\DoxyCodeLine{\}\ main\_struct;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{\_type\_offset(\textcolor{keywordtype}{unsigned}\ base,\ \textcolor{keywordtype}{unsigned}\ size)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{unsigned}\ padding;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!(base\ \%\ size))}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return}\ base;}
\DoxyCodeLine{\ \ \ padding\ =\ base\ -\/\ size;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ base\ +\ padding;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_fill\_receive\_array\_of\_string\_int\_with\_size(\mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg,\ \textcolor{keywordtype}{int}\ size,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *array[])}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *value\_struct,\ *value\_array;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ i;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{unsigned}\ offset;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct__Member}{Eina\_Value\_Struct\_Member}}\ main\_members[2];}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct__Member}{Eina\_Value\_Struct\_Member}}\ sub\_members[]\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \mbox{\hyperlink{group__Eina__Value__Struct__Group_ga139206ef35b0b76e87eef56a202c0ae9}{EINA\_VALUE\_STRUCT\_MEMBER}}(\mbox{\hyperlink{group__Eina__Value__Group_ga916f76c8d5ffd4c3ee3c322a54efd0b7}{EINA\_VALUE\_TYPE\_STRING}},\ sub\_struct,\ txt),}
\DoxyCodeLine{\ \ \ \ \ \ \mbox{\hyperlink{group__Eina__Value__Struct__Group_ga139206ef35b0b76e87eef56a202c0ae9}{EINA\_VALUE\_STRUCT\_MEMBER}}(\mbox{\hyperlink{group__Eina__Value__Group_ga17974fd9ab773a3efefd591ffde58f77}{EINA\_VALUE\_TYPE\_INT}},\ sub\_struct,\ num)}
\DoxyCodeLine{\ \ \ \};}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct__Desc}{Eina\_Value\_Struct\_Desc}}\ desc\_sub\_struct\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \mbox{\hyperlink{group__Eina__Value__Struct__Group_gae76aada4965672ce991f1f41baf71975}{EINA\_VALUE\_STRUCT\_DESC\_VERSION}},}
\DoxyCodeLine{\ \ \ \ \ \ NULL,\ \textcolor{comment}{//\ no\ special\ operations}}
\DoxyCodeLine{\ \ \ \ \ \ sub\_members,}
\DoxyCodeLine{\ \ \ \ \ \ 2,}
\DoxyCodeLine{\ \ \ \ \ \ \textcolor{keyword}{sizeof}(sub\_struct)}
\DoxyCodeLine{\ \ \ \};}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct__Desc}{Eina\_Value\_Struct\_Desc}}\ desc\_struct\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \mbox{\hyperlink{group__Eina__Value__Struct__Group_gae76aada4965672ce991f1f41baf71975}{EINA\_VALUE\_STRUCT\_DESC\_VERSION}},}
\DoxyCodeLine{\ \ \ \ \ \ NULL,\ \textcolor{comment}{//\ no\ special\ operations}}
\DoxyCodeLine{\ \ \ \ \ \ main\_members,}
\DoxyCodeLine{\ \ \ \ \ \ 2,}
\DoxyCodeLine{\ \ \ \ \ \ 0\textcolor{comment}{//will\ be\ set\ below}}
\DoxyCodeLine{\ \ \ \};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ offset\ =\ \_type\_offset(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}),\ \textcolor{keyword}{sizeof}(\mbox{\hyperlink{struct__Eina__Value__Array}{Eina\_Value\_Array}}));}
\DoxyCodeLine{\ \ \ main\_members[0].\mbox{\hyperlink{struct__Eina__Value__Struct__Member_a96da971e28b1eef6a37f4c8b9d080b53}{name}}\ =\ \textcolor{stringliteral}{"{}size"{}};}
\DoxyCodeLine{\ \ \ main\_members[0].\mbox{\hyperlink{struct__Eina__Value__Struct__Member_a615cdf08597bd18623c8c7daec7b4641}{type}}\ =\ \mbox{\hyperlink{group__Eina__Value__Group_ga17974fd9ab773a3efefd591ffde58f77}{EINA\_VALUE\_TYPE\_INT}};}
\DoxyCodeLine{\ \ \ main\_members[0].\mbox{\hyperlink{struct__Eina__Value__Struct__Member_a5fe4db5cf87d3a7eeb865524fd615182}{offset}}\ =\ 0;}
\DoxyCodeLine{\ \ \ main\_members[1].\mbox{\hyperlink{struct__Eina__Value__Struct__Member_a96da971e28b1eef6a37f4c8b9d080b53}{name}}\ =\ \textcolor{stringliteral}{"{}array"{}};}
\DoxyCodeLine{\ \ \ main\_members[1].\mbox{\hyperlink{struct__Eina__Value__Struct__Member_a615cdf08597bd18623c8c7daec7b4641}{type}}\ =\ \mbox{\hyperlink{group__Eina__Value__Group_ga8ec6d5bfa2fed9250e2dabc6d82d12c4}{EINA\_VALUE\_TYPE\_ARRAY}};}
\DoxyCodeLine{\ \ \ main\_members[1].\mbox{\hyperlink{struct__Eina__Value__Struct__Member_a5fe4db5cf87d3a7eeb865524fd615182}{offset}}\ =\ offset;}
\DoxyCodeLine{\ \ \ desc\_struct.\mbox{\hyperlink{struct__Eina__Value__Struct__Desc_a76afd6890747f7d2da944878060efec0}{size}}\ =\ offset\ +\ \textcolor{keyword}{sizeof}(\mbox{\hyperlink{group__Eina__Value__Array__Group_gaf031f54b3d2530ec31b5cd73a5b08fc2}{Eina\_Value\_Array}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ value\_struct\ =\ \mbox{\hyperlink{group__Eina__Value__Struct__Group_gaeda31142675d09af1863096a4f4ac707}{eina\_value\_struct\_new}}(\&desc\_struct);}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_set(value\_struct,\ \textcolor{stringliteral}{"{}size"{}},\ size);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ value\_array\ =\ \mbox{\hyperlink{group__Eina__Value__Array__Group_gad1d85a52d53b4dbf729d894f1e031400}{eina\_value\_array\_new}}(\mbox{\hyperlink{group__Eina__Value__Group_ga8147143699c5f5a686415090080d3f9e}{EINA\_VALUE\_TYPE\_STRUCT}},\ size);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ size;\ i++)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *value\_sub\_struct\ =\ \mbox{\hyperlink{group__Eina__Value__Struct__Group_gaeda31142675d09af1863096a4f4ac707}{eina\_value\_struct\_new}}(\&desc\_sub\_struct);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct}{Eina\_Value\_Struct}}\ st;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_struct\_set(value\_sub\_struct,\ \textcolor{stringliteral}{"{}txt"{}},\ array[i]);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_struct\_set(value\_sub\_struct,\ \textcolor{stringliteral}{"{}num"{}},\ i);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_get(value\_sub\_struct,\ \&st);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_array\_append(value\_array,\ st);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(value\_sub\_struct);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_value\_set(value\_struct,\ \textcolor{stringliteral}{"{}array"{}},\ value\_array);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value_ga525bec3d976a9489b27eb6ffa78cc4a6}{eldbus\_message\_from\_eina\_value}}(\textcolor{stringliteral}{"{}ia(si)"{}},\ msg,\ value\_struct);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(value\_struct);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(value\_array);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{on\_send\_array(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg,\ \mbox{\hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending}}\ *pending\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *v,\ array;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *txt;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{unsigned}\ i;}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}2\ -\/\ on\_send\_array()\(\backslash\)n"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}}(msg,\ NULL,\ NULL))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Message\ error\(\backslash\)n\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eina__Value_gad4dfe479e6b19b2fdbb196f37d769214}{eldbus\_message\_to\_eina\_value}}(msg);}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_value\_get(v,\ \textcolor{stringliteral}{"{}arg0"{}},\ \&array);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ eina\_value\_array\_count(\&array);\ i++)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_array\_get(\&array,\ i,\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)t\%s\(\backslash\)n"{}},\ txt);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(v);}
\DoxyCodeLine{\ \ \ eina\_value\_flush(\&array);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{on\_receive\_array\_with\_size(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg,\ \mbox{\hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending}}\ *pending\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *errname;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *errmsg;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}1\ -\/\ on\_receive\_array\_with\_size()\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}}(msg,\ \&errname,\ \&errmsg))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}Error:\ \%s\ \%s\(\backslash\)n"{}},\ errname,\ errmsg);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{on\_plus\_one(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg,\ \mbox{\hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending}}\ *pending\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *v;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ num2;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}}(msg,\ NULL,\ NULL))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Message\ error\(\backslash\)n\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eina__Value_gad4dfe479e6b19b2fdbb196f37d769214}{eldbus\_message\_to\_eina\_value}}(msg);}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_get(v,\ \textcolor{stringliteral}{"{}arg0"{}},\ \&num2);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}3\ -\/\ on\_plus\_one()\ \%d\(\backslash\)n"{}},\ num2);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(v);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{receive\_variant\_cb(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg,\ \mbox{\hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending}}\ *pending\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *v,\ variant,\ array;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{unsigned}\ i;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}4\ -\/\ receive\ a\ variant\ with\ an\ array\ of\ strings\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}}(msg,\ NULL,\ NULL))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Message\ error\(\backslash\)n\(\backslash\)n"{}});}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eina__Value_gad4dfe479e6b19b2fdbb196f37d769214}{eldbus\_message\_to\_eina\_value}}(msg);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_value\_get(v,\ \textcolor{stringliteral}{"{}arg0"{}},\ \&variant);}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_value\_get(\&variant,\ \textcolor{stringliteral}{"{}arg0"{}},\ \&array);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ eina\_value\_array\_count(\&array);\ i++)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *txt;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_array\_get(\&array,\ i,\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)t\%s\(\backslash\)n"{}},\ txt);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ eina\_value\_flush(\&array);}
\DoxyCodeLine{\ \ \ eina\_value\_flush(\&variant);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(v);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_property\_removed(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \mbox{\hyperlink{group__Eldbus_ga82047f6a5efc1980ae445a898c2ed9c0}{Eldbus\_Proxy}}\ *proxy\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eldbus__Proxy__Event__Property__Removed}{Eldbus\_Proxy\_Event\_Property\_Removed}}\ *\textcolor{keyword}{event}\ =\ event\_info;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)nproperty\ removed:\ \%s"{}},\ event-\/>name);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_property\_changed(\textcolor{keywordtype}{void}\ *data\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \mbox{\hyperlink{group__Eldbus_ga82047f6a5efc1980ae445a898c2ed9c0}{Eldbus\_Proxy}}\ *proxy\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eldbus__Proxy__Event__Property__Changed}{Eldbus\_Proxy\_Event\_Property\_Changed}}\ *\textcolor{keyword}{event}\ =\ event\_info;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *value;}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}\(\backslash\)nproperty\ changed\(\backslash\)n"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ name\ =\ \textcolor{keyword}{event}-\/>name;}
\DoxyCodeLine{\ \ \ value\ =\ \textcolor{keyword}{event}-\/>value;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!strcmp(name,\ \textcolor{stringliteral}{"{}text"{}})\ ||\ !strcmp(name,\ \textcolor{stringliteral}{"{}Resp2"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *txt;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_get(value,\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}[\%s]\ =\ \%s\(\backslash\)n"{}},\ name,\ txt);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(name,\ \textcolor{stringliteral}{"{}int32"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ num;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_get(value,\ \&num);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}[\%s]\ =\ \%d\(\backslash\)n"{}},\ name,\ num);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(name,\ \textcolor{stringliteral}{"{}st"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *txt;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_struct\_get(value,\ \textcolor{stringliteral}{"{}arg0"{}},\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}[\%s]\ \%s\ |\ "{}},\ name,\ txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_struct\_get(value,\ \textcolor{stringliteral}{"{}arg1"{}},\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}},\ txt);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_read\_cache(\textcolor{keywordtype}{void}\ *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus_ga82047f6a5efc1980ae445a898c2ed9c0}{Eldbus\_Proxy}}\ *proxy\ =\ data;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *txt;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ num;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *v;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eldbus__FDO__Properties_ga6bd1b003082f9e7c398a299f82feb9df}{eldbus\_proxy\_property\_local\_get}}(proxy,\ \textcolor{stringliteral}{"{}text"{}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (v)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_get(v,\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Read\ cache:\ [txt]\ =\ \%s\(\backslash\)n"{}},\ txt);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eldbus__FDO__Properties_ga6bd1b003082f9e7c398a299f82feb9df}{eldbus\_proxy\_property\_local\_get}}(proxy,\ \textcolor{stringliteral}{"{}int32"{}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (v)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_get(v,\ \&num);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Read\ cache:\ [int32]\ =\ \%d\(\backslash\)n"{}},\ num);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eldbus__FDO__Properties_ga6bd1b003082f9e7c398a299f82feb9df}{eldbus\_proxy\_property\_local\_get}}(proxy,\ \textcolor{stringliteral}{"{}st"{}});}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (v)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_struct\_get(v,\ \textcolor{stringliteral}{"{}arg0"{}},\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Read\ cache:\ [st]\ \%s\ |\ "{}},\ txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ eina\_value\_struct\_get(v,\ \textcolor{stringliteral}{"{}arg1"{}},\ \&txt);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}},\ txt);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_fill\_plus\_one(\mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg,\ \textcolor{keywordtype}{int}\ num)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value}{Eina\_Value}}\ *v;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct__Member}{Eina\_Value\_Struct\_Member}}\ main\_members[]\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \{\textcolor{stringliteral}{"{}num"{}},\ \mbox{\hyperlink{group__Eina__Value__Group_ga17974fd9ab773a3efefd591ffde58f77}{EINA\_VALUE\_TYPE\_INT}},\ 0\}}
\DoxyCodeLine{\ \ \ \};}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__Value__Struct__Desc}{Eina\_Value\_Struct\_Desc}}\ desc\_struct\ =\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Eina__Value__Struct__Group_gae76aada4965672ce991f1f41baf71975}{EINA\_VALUE\_STRUCT\_DESC\_VERSION}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ NULL,\ \textcolor{comment}{//\ no\ special\ operations}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ main\_members,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ 1,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \textcolor{keyword}{sizeof}(int)}
\DoxyCodeLine{\ \ \ \};}
\DoxyCodeLine{\ \ \ v\ =\ \mbox{\hyperlink{group__Eina__Value__Struct__Group_gaeda31142675d09af1863096a4f4ac707}{eina\_value\_struct\_new}}(\&desc\_struct);}
\DoxyCodeLine{\ \ \ eina\_value\_struct\_set(v,\ \textcolor{stringliteral}{"{}num"{}},\ num);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value_ga525bec3d976a9489b27eb6ffa78cc4a6}{eldbus\_message\_from\_eina\_value}}(\textcolor{stringliteral}{"{}i"{}},\ msg,\ v);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__Value__Value__Group_ga27a121e20a7109d5eae7203fc0f54850}{eina\_value\_free}}(v);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus_ga1de8233c3e9240291bb952776810c831}{Eldbus\_Connection}}\ *conn;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus_gab374430ed25089e7c5213767cc637191}{Eldbus\_Object}}\ *obj;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus_ga82047f6a5efc1980ae445a898c2ed9c0}{Eldbus\_Proxy}}\ *proxy;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message}}\ *msg;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}();}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Core_gadd7c8b8a43b5dd590f7fd06166288754}{eldbus\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ conn\ =\ \mbox{\hyperlink{group__Eldbus__Connection_gac73e69791d7b884af458390b9c30925a}{eldbus\_connection\_get}}(ELDBUS\_CONNECTION\_TYPE\_SESSION);}
\DoxyCodeLine{\ \ \ obj\ =\ \mbox{\hyperlink{group__Eldbus__Object__Mapper_ga88ed939f56f83494e69a8d34212c202a}{eldbus\_object\_get}}(conn,\ BUS,\ PATH);}
\DoxyCodeLine{\ \ \ proxy\ =\ \mbox{\hyperlink{group__Eldbus__Proxy_ga817e6172d2edc6ca0d932e7de7f9c8a0}{eldbus\_proxy\_get}}(obj,\ IFACE);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ msg\ =\ \mbox{\hyperlink{group__Eldbus__Proxy_gacec54383c19900dc53fd443e4c122c6e}{eldbus\_proxy\_method\_call\_new}}(proxy,\ \textcolor{stringliteral}{"{}ReceiveArrayOfStringIntWithSize"{}});}
\DoxyCodeLine{\ \ \ \_fill\_receive\_array\_of\_string\_int\_with\_size(msg,\ size\_of\_array,\ array\_string);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_gaf026b9b3a74edff4c46d7fbeabe88d0d}{eldbus\_proxy\_send}}(proxy,\ msg,\ on\_receive\_array\_with\_size,\ NULL,\ -\/1);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_ga60ece4a728aeddb3ba2b30589c329c40}{eldbus\_proxy\_call}}(proxy,\ \textcolor{stringliteral}{"{}SendArray"{}},\ on\_send\_array,\ NULL,\ -\/1\ ,\ \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ msg\ =\ \mbox{\hyperlink{group__Eldbus__Proxy_gacec54383c19900dc53fd443e4c122c6e}{eldbus\_proxy\_method\_call\_new}}(proxy,\ \textcolor{stringliteral}{"{}PlusOne"{}});}
\DoxyCodeLine{\ \ \ \_fill\_plus\_one(msg,\ 14);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_gaf026b9b3a74edff4c46d7fbeabe88d0d}{eldbus\_proxy\_send}}(proxy,\ msg,\ on\_plus\_one,\ NULL,\ -\/1);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_ga4b7ab0db8ac6ab9ea3e7f0912b2432e9}{eldbus\_proxy\_event\_callback\_add}}(proxy,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_ggae2651588bfdfc934519b1167ae42a14dac2f80df568c56bdfa293214c8de95add}{ELDBUS\_PROXY\_EVENT\_PROPERTY\_CHANGED}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_property\_changed,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_ga4b7ab0db8ac6ab9ea3e7f0912b2432e9}{eldbus\_proxy\_event\_callback\_add}}(proxy,\ \mbox{\hyperlink{group__Eldbus__Proxy_ggae2651588bfdfc934519b1167ae42a14daa2f041c65a6d134c2ae14043f4b24295}{ELDBUS\_PROXY\_EVENT\_PROPERTY\_REMOVED}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_property\_removed,\ NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__FDO__Properties_gaa2a20ccdb8dfe3fae539c9366eac9fb5}{eldbus\_proxy\_properties\_monitor}}(proxy,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Timer__Group_ga926423e464d7ef71105dd822d90e1187}{ecore\_timer\_add}}(10,\ \_read\_cache,\ proxy);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_ga60ece4a728aeddb3ba2b30589c329c40}{eldbus\_proxy\_call}}(proxy,\ \textcolor{stringliteral}{"{}ReceiveVariantData"{}},\ receive\_variant\_cb,\ NULL,\ -\/1,\ \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Proxy_gaa0c972c94ccaf39b0ca3586c5d549af4}{eldbus\_proxy\_event\_callback\_del}}(proxy,\ \mbox{\hyperlink{group__Eldbus__Proxy_ggae2651588bfdfc934519b1167ae42a14dac2f80df568c56bdfa293214c8de95add}{ELDBUS\_PROXY\_EVENT\_PROPERTY\_CHANGED}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_property\_changed,\ NULL);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Connection_ga1c035aac8b601b416bba11d0d68f80ae}{eldbus\_connection\_unref}}(conn);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eldbus__Core_ga255ee3e090da6704d009ee74ba9d8a79}{eldbus\_shutdown}}();}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 