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


\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{// gcc -o complex-types-client-eina-value complex-types-client-eina-value.c `pkg-config --cflags --libs
       eldbus ecore eina`}

\textcolor{preprocessor}{#include "Eldbus.h"}
\textcolor{preprocessor}{#include <Ecore.h>}

\textcolor{preprocessor}{#define BUS "com.profusion"}
\textcolor{preprocessor}{#define PATH "/com/profusion/Test"}
\textcolor{preprocessor}{#define IFACE "com.profusion.Test"}

\textcolor{preprocessor}{#define size\_of\_array 5}
\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *array\_string[] = \{
   \textcolor{stringliteral}{"aaaa"}, \textcolor{stringliteral}{"bbbb"}, \textcolor{stringliteral}{"cccc"}, \textcolor{stringliteral}{"dddd"}, \textcolor{stringliteral}{"eeee"}
\};

\textcolor{keyword}{typedef} \textcolor{keyword}{struct }\_sub\_struct
\{
   \textcolor{keywordtype}{char} *txt;
   \textcolor{keywordtype}{int} num;
\} sub\_struct;

\textcolor{keyword}{typedef} \textcolor{keyword}{struct }\_main\_struct
\{
   \textcolor{keywordtype}{int} size;
   sub\_struct array[];
\} main\_struct;

\textcolor{keyword}{static} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}
\_type\_offset(\textcolor{keywordtype}{unsigned} base, \textcolor{keywordtype}{unsigned} size)
\{
   \textcolor{keywordtype}{unsigned} padding;
   \textcolor{keywordflow}{if} (!(base % size))
     \textcolor{keywordflow}{return} base;
   padding = abs(base - size);
   \textcolor{keywordflow}{return} base + padding;
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_fill\_receive\_array\_of\_string\_int\_with\_size(\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg, \textcolor{keywordtype}{int} size, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *array[
      ])
\{
   \hyperlink{struct__Eina__Value}{Eina\_Value} *value\_struct, *value\_array;
   \textcolor{keywordtype}{int} i;
   \textcolor{keywordtype}{unsigned} offset;
   \hyperlink{struct__Eina__Value__Struct__Member}{Eina\_Value\_Struct\_Member} main\_members[2];
   \hyperlink{struct__Eina__Value__Struct__Member}{Eina\_Value\_Struct\_Member} sub\_members[] = \{
      \hyperlink{group__Eina__Value__Struct__Group_ga139206ef35b0b76e87eef56a202c0ae9}{EINA\_VALUE\_STRUCT\_MEMBER}(\hyperlink{group__Eina__Value__Group_ga916f76c8d5ffd4c3ee3c322a54efd0b7}{EINA\_VALUE\_TYPE\_STRING}, 
      sub\_struct, txt),
      \hyperlink{group__Eina__Value__Struct__Group_ga139206ef35b0b76e87eef56a202c0ae9}{EINA\_VALUE\_STRUCT\_MEMBER}(\hyperlink{group__Eina__Value__Group_ga17974fd9ab773a3efefd591ffde58f77}{EINA\_VALUE\_TYPE\_INT}, sub\_struct, 
      num)
   \};
   \hyperlink{struct__Eina__Value__Struct__Desc}{Eina\_Value\_Struct\_Desc} desc\_sub\_struct = \{
      \hyperlink{group__Eina__Value__Struct__Group_gae76aada4965672ce991f1f41baf71975}{EINA\_VALUE\_STRUCT\_DESC\_VERSION},
      NULL, \textcolor{comment}{// no special operations}
      sub\_members,
      2,
      \textcolor{keyword}{sizeof}(sub\_struct)
   \};
   \hyperlink{struct__Eina__Value__Struct__Desc}{Eina\_Value\_Struct\_Desc} desc\_struct = \{
      \hyperlink{group__Eina__Value__Struct__Group_gae76aada4965672ce991f1f41baf71975}{EINA\_VALUE\_STRUCT\_DESC\_VERSION},
      NULL, \textcolor{comment}{// no special operations}
      main\_members,
      2,
      0\textcolor{comment}{//will be set below}
   \};

   offset = \_type\_offset(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}), \textcolor{keyword}{sizeof}(\hyperlink{struct__Eina__Value__Array}{Eina\_Value\_Array}));
   main\_members[0].\hyperlink{struct__Eina__Value__Struct__Member_a96da971e28b1eef6a37f4c8b9d080b53}{name} = \textcolor{stringliteral}{"size"};
   main\_members[0].\hyperlink{struct__Eina__Value__Struct__Member_a615cdf08597bd18623c8c7daec7b4641}{type} = \hyperlink{group__Eina__Value__Group_ga17974fd9ab773a3efefd591ffde58f77}{EINA\_VALUE\_TYPE\_INT};
   main\_members[0].\hyperlink{struct__Eina__Value__Struct__Member_a5fe4db5cf87d3a7eeb865524fd615182}{offset} = 0;
   main\_members[1].\hyperlink{struct__Eina__Value__Struct__Member_a96da971e28b1eef6a37f4c8b9d080b53}{name} = \textcolor{stringliteral}{"array"};
   main\_members[1].\hyperlink{struct__Eina__Value__Struct__Member_a615cdf08597bd18623c8c7daec7b4641}{type} = \hyperlink{group__Eina__Value__Group_ga8ec6d5bfa2fed9250e2dabc6d82d12c4}{EINA\_VALUE\_TYPE\_ARRAY};
   main\_members[1].\hyperlink{struct__Eina__Value__Struct__Member_a5fe4db5cf87d3a7eeb865524fd615182}{offset} = offset;
   desc\_struct.size = offset + \textcolor{keyword}{sizeof}(\hyperlink{group__Eina__Value__Array__Group_gaf031f54b3d2530ec31b5cd73a5b08fc2}{Eina\_Value\_Array});

   value\_struct = \hyperlink{group__Eina__Value__Struct__Group_gaf469abb97ac59b73e8b2c726a58a78f8}{eina\_value\_struct\_new}(&desc\_struct);
   \hyperlink{group__Eina__Value__Struct__Group_ga476aa64a399aba776fa14f2fb065b268}{eina\_value\_struct\_set}(value\_struct, \textcolor{stringliteral}{"size"}, size);

   value\_array = \hyperlink{group__Eina__Value__Array__Group_ga48893089e10fa1244e9fd82643b50c10}{eina\_value\_array\_new}(\hyperlink{group__Eina__Value__Group_ga8147143699c5f5a686415090080d3f9e}{EINA\_VALUE\_TYPE\_STRUCT}, 
      size);
   \textcolor{keywordflow}{for} (i = 0; i < size; i++)
     \{
        \hyperlink{struct__Eina__Value}{Eina\_Value} *value\_sub\_struct = \hyperlink{group__Eina__Value__Struct__Group_gaf469abb97ac59b73e8b2c726a58a78f8}{eina\_value\_struct\_new}(&
      desc\_sub\_struct);
        \hyperlink{struct__Eina__Value__Struct}{Eina\_Value\_Struct} st;
        \hyperlink{group__Eina__Value__Struct__Group_ga476aa64a399aba776fa14f2fb065b268}{eina\_value\_struct\_set}(value\_sub\_struct, \textcolor{stringliteral}{"txt"}, array[i]);
        \hyperlink{group__Eina__Value__Struct__Group_ga476aa64a399aba776fa14f2fb065b268}{eina\_value\_struct\_set}(value\_sub\_struct, \textcolor{stringliteral}{"num"}, i);
        \hyperlink{group__Eina__Value__Value__Group_ga6f088fe6c6127d808cdf214b355cbdeb}{eina\_value\_get}(value\_sub\_struct, &st);
        \hyperlink{group__Eina__Value__Array__Group_ga82efa324a5f4b1d4d99002e1c9c78868}{eina\_value\_array\_append}(value\_array, st);
        \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(value\_sub\_struct);
     \}
   \hyperlink{group__Eina__Value__Struct__Group_gac22dc4bbaef8213a2ee79e2f03e9528b}{eina\_value\_struct\_value\_set}(value\_struct, \textcolor{stringliteral}{"array"}, value\_array);

   \hyperlink{group__Eina__Value_ga525bec3d976a9489b27eb6ffa78cc4a6}{eldbus\_message\_from\_eina\_value}(\textcolor{stringliteral}{"ia(si)"}, msg, value\_struct);

   \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(value\_struct);
   \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(value\_array);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
on\_send\_array(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keyword}{const} \hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg, 
      \hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending} *pending \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED})
\{
   \hyperlink{struct__Eina__Value}{Eina\_Value} *v, array;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *txt;
   \textcolor{keywordtype}{unsigned} i;
   printf(\textcolor{stringliteral}{"2 - on\_send\_array()\(\backslash\)n"});

   \textcolor{keywordflow}{if} (\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}(msg, NULL, NULL))
     \{
        printf(\textcolor{stringliteral}{"Message error\(\backslash\)n\(\backslash\)n"});
        \textcolor{keywordflow}{return};
     \}

   v = \hyperlink{group__Eina__Value_gaca1d745634fc1077b23d64ea0e4e7bca}{eldbus\_message\_to\_eina\_value}(msg);
   \hyperlink{group__Eina__Value__Struct__Group_gadbe2da54625edad4a63dbce2cbbdf6ec}{eina\_value\_struct\_value\_get}(v, \textcolor{stringliteral}{"arg0"}, &array);
   \textcolor{keywordflow}{for} (i = 0; i < \hyperlink{group__Eina__Value__Array__Group_ga758e2a63aa537f872bdbd07b87ea6115}{eina\_value\_array\_count}(&array); i++)
     \{
        \hyperlink{group__Eina__Value__Array__Group_ga9358dce2404ed0926db502539f8a1318}{eina\_value\_array\_get}(&array, i, &txt);
        printf(\textcolor{stringliteral}{"\(\backslash\)t%s\(\backslash\)n"}, txt);
     \}

   \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(v);
   \hyperlink{group__Eina__Value__Value__Group_ga940660709a2862bafac92f47bb721a68}{eina\_value\_flush}(&array);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
on\_receive\_array\_with\_size(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keyword}{const} 
      \hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg, \hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending} *pending 
      \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED})
\{
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errname;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg;

   printf(\textcolor{stringliteral}{"1 - on\_receive\_array\_with\_size()\(\backslash\)n"});
   \textcolor{keywordflow}{if} (\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}(msg, &errname, &errmsg))
     \{
        fprintf(stderr, \textcolor{stringliteral}{"Error: %s %s\(\backslash\)n"}, errname, errmsg);
     \}
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
on\_plus\_one(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keyword}{const} \hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg, 
      \hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending} *pending \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED})
\{
   \hyperlink{struct__Eina__Value}{Eina\_Value} *v;
   \textcolor{keywordtype}{int} num2;

   \textcolor{keywordflow}{if} (\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}(msg, NULL, NULL))
     \{
        printf(\textcolor{stringliteral}{"Message error\(\backslash\)n\(\backslash\)n"});
        \textcolor{keywordflow}{return};
     \}

   v = \hyperlink{group__Eina__Value_gaca1d745634fc1077b23d64ea0e4e7bca}{eldbus\_message\_to\_eina\_value}(msg);
   \hyperlink{group__Eina__Value__Struct__Group_ga07a7cc420f03a247dffe4d13ce1ad6c5}{eina\_value\_struct\_get}(v, \textcolor{stringliteral}{"arg0"}, &num2);

   printf(\textcolor{stringliteral}{"3 - on\_plus\_one() %d\(\backslash\)n"}, num2);
   \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(v);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
receive\_variant\_cb(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keyword}{const} \hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg, 
      \hyperlink{group__Eldbus__Core_ga7a5d4dc070bd925034de6e52c4260be7}{Eldbus\_Pending} *pending \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED})
\{
   \hyperlink{struct__Eina__Value}{Eina\_Value} *v, variant, array;
   \textcolor{keywordtype}{unsigned} i;

   printf(\textcolor{stringliteral}{"4 - receive a variant with an array of strings\(\backslash\)n"});
   \textcolor{keywordflow}{if} (\hyperlink{group__Eldbus__Message_ga3aeec7d275bef2bb244ed9a045540921}{eldbus\_message\_error\_get}(msg, NULL, NULL))
     \{
        printf(\textcolor{stringliteral}{"Message error\(\backslash\)n\(\backslash\)n"});
        \textcolor{keywordflow}{return};
     \}

   v = \hyperlink{group__Eina__Value_gaca1d745634fc1077b23d64ea0e4e7bca}{eldbus\_message\_to\_eina\_value}(msg);

   \hyperlink{group__Eina__Value__Struct__Group_gadbe2da54625edad4a63dbce2cbbdf6ec}{eina\_value\_struct\_value\_get}(v, \textcolor{stringliteral}{"arg0"}, &variant);
   \hyperlink{group__Eina__Value__Struct__Group_gadbe2da54625edad4a63dbce2cbbdf6ec}{eina\_value\_struct\_value\_get}(&variant, \textcolor{stringliteral}{"arg0"}, &array);
   \textcolor{keywordflow}{for} (i = 0; i < \hyperlink{group__Eina__Value__Array__Group_ga758e2a63aa537f872bdbd07b87ea6115}{eina\_value\_array\_count}(&array); i++)
     \{
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *txt;
        \hyperlink{group__Eina__Value__Array__Group_ga9358dce2404ed0926db502539f8a1318}{eina\_value\_array\_get}(&array, i, &txt);
        printf(\textcolor{stringliteral}{"\(\backslash\)t%s\(\backslash\)n"}, txt);
     \}

   \hyperlink{group__Eina__Value__Value__Group_ga940660709a2862bafac92f47bb721a68}{eina\_value\_flush}(&array);
   \hyperlink{group__Eina__Value__Value__Group_ga940660709a2862bafac92f47bb721a68}{eina\_value\_flush}(&variant);
   \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(v);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_property\_removed(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \hyperlink{group__Eldbus__Core_ga5598fdabe4f36f8c13ef7a07dc219a3c}{Eldbus\_Proxy} *proxy 
      \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keywordtype}{void} *event\_info)
\{
   \hyperlink{struct__Eldbus__Proxy__Event__Property__Removed}{Eldbus\_Proxy\_Event\_Property\_Removed} *\textcolor{keyword}{event} = event\_info;

   printf(\textcolor{stringliteral}{"\(\backslash\)nproperty removed: %s"}, event->name);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_property\_changed(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \hyperlink{group__Eldbus__Core_ga5598fdabe4f36f8c13ef7a07dc219a3c}{Eldbus\_Proxy} *proxy 
      \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}, \textcolor{keywordtype}{void} *event\_info)
\{
   \hyperlink{struct__Eldbus__Proxy__Event__Property__Changed}{Eldbus\_Proxy\_Event\_Property\_Changed} *\textcolor{keyword}{event} = event\_info;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name;
   \textcolor{keyword}{const} \hyperlink{struct__Eina__Value}{Eina\_Value} *value;
   printf(\textcolor{stringliteral}{"\(\backslash\)nproperty changed\(\backslash\)n"});

   name = \textcolor{keyword}{event}->name;
   value = \textcolor{keyword}{event}->\hyperlink{struct__Eina__Value_a3b07134cb8ddb664e83d414f99d55bf6}{value};

   \textcolor{keywordflow}{if} (!strcmp(name, \textcolor{stringliteral}{"text"}) || !strcmp(name, \textcolor{stringliteral}{"Resp2"}))
     \{
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *txt;
        \hyperlink{group__Eina__Value__Value__Group_ga6f088fe6c6127d808cdf214b355cbdeb}{eina\_value\_get}(value, &txt);
        printf(\textcolor{stringliteral}{"[%s] = %s\(\backslash\)n"}, name, txt);
     \}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(name, \textcolor{stringliteral}{"int32"}))
     \{
        \textcolor{keywordtype}{int} num;
        \hyperlink{group__Eina__Value__Value__Group_ga6f088fe6c6127d808cdf214b355cbdeb}{eina\_value\_get}(value, &num);
        printf(\textcolor{stringliteral}{"[%s] = %d\(\backslash\)n"}, name, num);
     \}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(name, \textcolor{stringliteral}{"st"}))
     \{
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *txt;
        \hyperlink{group__Eina__Value__Struct__Group_ga07a7cc420f03a247dffe4d13ce1ad6c5}{eina\_value\_struct\_get}(value, \textcolor{stringliteral}{"arg0"}, &txt);
        printf(\textcolor{stringliteral}{"[%s] %s | "}, name, txt);
        \hyperlink{group__Eina__Value__Struct__Group_ga07a7cc420f03a247dffe4d13ce1ad6c5}{eina\_value\_struct\_get}(value, \textcolor{stringliteral}{"arg1"}, &txt);
        printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, txt);
     \}
\}

\textcolor{keyword}{static} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}
\_read\_cache(\textcolor{keywordtype}{void} *data)
\{
   \hyperlink{group__Eldbus__Core_ga5598fdabe4f36f8c13ef7a07dc219a3c}{Eldbus\_Proxy} *proxy = data;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *txt;
   \textcolor{keywordtype}{int} num;
   \hyperlink{struct__Eina__Value}{Eina\_Value} *v;

   v = \hyperlink{group__Eldbus__FDO__Properties_ga07e236d5f577453308c1f80e48f1d2a3}{eldbus\_proxy\_property\_local\_get}(proxy, \textcolor{stringliteral}{"text"});
   \textcolor{keywordflow}{if} (v)
     \{
        \hyperlink{group__Eina__Value__Value__Group_ga6f088fe6c6127d808cdf214b355cbdeb}{eina\_value\_get}(v, &txt);
        printf(\textcolor{stringliteral}{"Read cache: [txt] = %s\(\backslash\)n"}, txt);
     \}

   v = \hyperlink{group__Eldbus__FDO__Properties_ga07e236d5f577453308c1f80e48f1d2a3}{eldbus\_proxy\_property\_local\_get}(proxy, \textcolor{stringliteral}{"int32"});
   \textcolor{keywordflow}{if} (v)
     \{
        \hyperlink{group__Eina__Value__Value__Group_ga6f088fe6c6127d808cdf214b355cbdeb}{eina\_value\_get}(v, &num);
        printf(\textcolor{stringliteral}{"Read cache: [int32] = %d\(\backslash\)n"}, num);
     \}

   v = \hyperlink{group__Eldbus__FDO__Properties_ga07e236d5f577453308c1f80e48f1d2a3}{eldbus\_proxy\_property\_local\_get}(proxy, \textcolor{stringliteral}{"st"});
   \textcolor{keywordflow}{if} (v)
     \{
        \hyperlink{group__Eina__Value__Struct__Group_ga07a7cc420f03a247dffe4d13ce1ad6c5}{eina\_value\_struct\_get}(v, \textcolor{stringliteral}{"arg0"}, &txt);
        printf(\textcolor{stringliteral}{"Read cache: [st] %s | "}, txt);
        \hyperlink{group__Eina__Value__Struct__Group_ga07a7cc420f03a247dffe4d13ce1ad6c5}{eina\_value\_struct\_get}(v, \textcolor{stringliteral}{"arg1"}, &txt);
        printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, txt);
     \}

   \textcolor{keywordflow}{return} \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE};
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_fill\_plus\_one(\hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg, \textcolor{keywordtype}{int} num)
\{
   \hyperlink{struct__Eina__Value}{Eina\_Value} *v;
   \hyperlink{struct__Eina__Value__Struct__Member}{Eina\_Value\_Struct\_Member} main\_members[] = \{
      \{\textcolor{stringliteral}{"num"}, \hyperlink{group__Eina__Value__Group_ga17974fd9ab773a3efefd591ffde58f77}{EINA\_VALUE\_TYPE\_INT}, 0\}
   \};
   \hyperlink{struct__Eina__Value__Struct__Desc}{Eina\_Value\_Struct\_Desc} desc\_struct = \{
         \hyperlink{group__Eina__Value__Struct__Group_gae76aada4965672ce991f1f41baf71975}{EINA\_VALUE\_STRUCT\_DESC\_VERSION},
         NULL, \textcolor{comment}{// no special operations}
         main\_members,
         1,
         \textcolor{keyword}{sizeof}(int)
   \};
   v = \hyperlink{group__Eina__Value__Struct__Group_gaf469abb97ac59b73e8b2c726a58a78f8}{eina\_value\_struct\_new}(&desc\_struct);
   \hyperlink{group__Eina__Value__Struct__Group_ga476aa64a399aba776fa14f2fb065b268}{eina\_value\_struct\_set}(v, \textcolor{stringliteral}{"num"}, num);

   \hyperlink{group__Eina__Value_ga525bec3d976a9489b27eb6ffa78cc4a6}{eldbus\_message\_from\_eina\_value}(\textcolor{stringliteral}{"i"}, msg, v);

   \hyperlink{group__Eina__Value__Value__Group_gaa2aa7ac9d1fcd7c4497cf104cb374a52}{eina\_value\_free}(v);
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{void})
\{
   \hyperlink{group__Eldbus__Core_ga5f0557a7e65ed263fcc1678874b8f7e7}{Eldbus\_Connection} *conn;
   \hyperlink{group__Eldbus__Core_ga49914ed24559a149426b5f2bb8294a06}{Eldbus\_Object} *obj;
   \hyperlink{group__Eldbus__Core_ga5598fdabe4f36f8c13ef7a07dc219a3c}{Eldbus\_Proxy} *proxy;
   \hyperlink{group__Eldbus__Core_ga14e8c4d4b96af5fb8bb5c66dc315593a}{Eldbus\_Message} *msg;

   \hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}();
   \hyperlink{group__Eldbus__Core_gadd7c8b8a43b5dd590f7fd06166288754}{eldbus\_init}();

   conn = \hyperlink{group__Eldbus__Conneciton_ga203ec794fc0c7e1bddce4eb18b628c04}{eldbus\_connection\_get}(ELDBUS\_CONNECTION\_TYPE\_SESSION);
   obj = \hyperlink{group__Eldbus__Object__Mapper_ga067d5c8eba2590fb58e7dc39de87d203}{eldbus\_object\_get}(conn, BUS, PATH);
   proxy = \hyperlink{group__Eldbus__Proxy_ga58b8d61188435800e1e866ab3fdc7090}{eldbus\_proxy\_get}(obj, IFACE);

   msg = \hyperlink{group__Eldbus__Proxy_ga443bd02f44bf6c61c7b6c5ca4fde87de}{eldbus\_proxy\_method\_call\_new}(proxy, \textcolor{stringliteral}{"ReceiveArrayOfStringIntWithSize"})
      ;
   \_fill\_receive\_array\_of\_string\_int\_with\_size(msg, size\_of\_array, array\_string);
   \hyperlink{group__Eldbus__Proxy_ga8e4268bf0000bd0ab9596bb2c4d86489}{eldbus\_proxy\_send}(proxy, msg, on\_receive\_array\_with\_size, NULL, -1);

   \hyperlink{group__Eldbus__Proxy_ga0eaac8e928bd7605855bf61d97eea37c}{eldbus\_proxy\_call}(proxy, \textcolor{stringliteral}{"SendArray"}, on\_send\_array, NULL, -1 , \textcolor{stringliteral}{""});

   msg = \hyperlink{group__Eldbus__Proxy_ga443bd02f44bf6c61c7b6c5ca4fde87de}{eldbus\_proxy\_method\_call\_new}(proxy, \textcolor{stringliteral}{"PlusOne"});
   \_fill\_plus\_one(msg, 14);
   \hyperlink{group__Eldbus__Proxy_ga8e4268bf0000bd0ab9596bb2c4d86489}{eldbus\_proxy\_send}(proxy, msg, on\_plus\_one, NULL, -1);

   \hyperlink{group__Eldbus__Proxy_ga4b7ab0db8ac6ab9ea3e7f0912b2432e9}{eldbus\_proxy\_event\_callback\_add}(proxy,
                                  \hyperlink{group__Eldbus__Proxy_ggae2651588bfdfc934519b1167ae42a14dac2f80df568c56bdfa293214c8de95add}{ELDBUS\_PROXY\_EVENT\_PROPERTY\_CHANGED},
                                  \_property\_changed, NULL);
   \hyperlink{group__Eldbus__Proxy_ga4b7ab0db8ac6ab9ea3e7f0912b2432e9}{eldbus\_proxy\_event\_callback\_add}(proxy, 
      \hyperlink{group__Eldbus__Proxy_ggae2651588bfdfc934519b1167ae42a14daa2f041c65a6d134c2ae14043f4b24295}{ELDBUS\_PROXY\_EVENT\_PROPERTY\_REMOVED},
                                  \_property\_removed, NULL);

   \hyperlink{group__Eldbus__FDO__Properties_gaa2a20ccdb8dfe3fae539c9366eac9fb5}{eldbus\_proxy\_properties\_monitor}(proxy, 
      \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE});
   \hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}(10, \_read\_cache, proxy);

   \hyperlink{group__Eldbus__Proxy_ga0eaac8e928bd7605855bf61d97eea37c}{eldbus\_proxy\_call}(proxy, \textcolor{stringliteral}{"ReceiveVariantData"}, receive\_variant\_cb, NULL, -1, \textcolor{stringliteral}{""});

   \hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();

   \hyperlink{group__Eldbus__Proxy_gaa0c972c94ccaf39b0ca3586c5d549af4}{eldbus\_proxy\_event\_callback\_del}(proxy, 
      \hyperlink{group__Eldbus__Proxy_ggae2651588bfdfc934519b1167ae42a14dac2f80df568c56bdfa293214c8de95add}{ELDBUS\_PROXY\_EVENT\_PROPERTY\_CHANGED},
                                  \_property\_changed, NULL);
   \hyperlink{group__Eldbus__Conneciton_ga1c035aac8b601b416bba11d0d68f80ae}{eldbus\_connection\_unref}(conn);

   \hyperlink{group__Eldbus__Core_ga255ee3e090da6704d009ee74ba9d8a79}{eldbus\_shutdown}();
   \hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}();
   \textcolor{keywordflow}{return} 0;
\}
\end{DoxyCodeInclude}
 