Server to test complex types (arrays, structs, dicts).
#include "Eldbus.h"
#include <Ecore.h>
#define BUS "com.profusion"
#define PATH "/com/profusion/Test"
#define IFACE "com.profusion.Test"
static char *resp2;
static int int32 = 35;
{
   const char *txt;
   printf("- receiveArray\n");
     {
        printf("Error on eldbus_message_arguments_get()\n");
        return reply;
     }
     printf("%s\n", txt);
   printf("}\n\n");
   return reply;
}
{
   int size, i = 0;
   printf("- receiveArrayOfStringIntWithSize\n{\n");
     {
        printf("Error on eldbus_message_arguments_get()\n");
        return reply;
     }
     {
        const char *txt;
        int num;
          {
             printf("Error on eldbus_message_arguments_get()\n");
             return reply;
          }
        printf("%s | %d\n", txt, num);
        i++;
     }
   printf("size in msg %d | size read %d\n", size, i);
   printf("}\n\n");
   return reply;
}
{
   return reply;
}
{
   char *type;
   printf("- sendVariantData\n{\n");
     {
        printf("Error on eldbus_message_arguments_get()\n");
        return reply;
     }
   if (type[1])
     {
        printf("It is a complex type, not handle yet.\n");
        free(type);
        return reply;
     }
   switch (type[0])
     {
      case 's':
      case 'o':
        {
           char *txt;
           printf("type = %c value = %s\n", type[0], txt);
           break;
        }
      case 'i':
        {
           int num;
           printf("type = %c value = %d\n", type[0], num);
           break;
        }
      default:
        {
           printf("Unhandled type\n");
        }
     }
   printf("}\n\n");
   free(type);
   return reply;
}
{
   int numbers[] = { 10, 9, 8, 7, 6, 5 };
   printf("- sendArrayInt\n\n");
   return reply;
}
{
   const char *array_string[5] = {"qqqq", "wwwww", "eeeeee", "rrrrr", "ttttt"};
   int i;
   printf("sendArray\n\n");
   for (i = 0; i < 5; i++)
   return reply;
}
{
   int num;
   printf("- plusOne\n\n");
     {
        printf("Error on eldbus_message_arguments_get()\n");
        return reply;
     }
   num++;
   return reply;
}
{
   int num1, num2;
     {
        printf("Error on eldbus_message_arguments_get()\n");
        return NULL;
     }
   printf("DoubleCountainer\n{\nArray1:\n");
     {
        printf("1 %d - 2 %d\n", num1, num2);
     }
   printf("Array2:\n");
     {
         printf("1 %d - 2 %d\n", num1, num2);
     }
   printf("}\n\n");
   return reply;
}
{
   printf("Properties_get - %s\n", propname);
   if (!strcmp(propname, "Resp2"))
   else if (!strcmp(propname, "text"))
   else if (!strcmp(propname, "int32"))
     {
        int32++;
     }
   else if (!strcmp(propname, "st"))
     {
     }
}
{
   char *type;
   if (!strcmp(propname, "int32"))
     {
        int num;
        if (type[0] != 'i')
          goto invalid_signature;
        printf("int32 was set to: %d, previously was: %d\n", num, int32);
        int32 = num;
     }
   else if (!strcmp(propname, "Resp2"))
     {
        const char *txt;
        if (type[0] != 's')
          goto invalid_signature;
        printf("Resp2 was set to: %s, previously was: %s\n", txt, resp2);
        free(resp2);
        resp2 = strdup(txt);
     }
   free(type);
invalid_signature:
   free(type);
                                  "Invalid type.");
}
      {
        "ReceiveArray", 
ELDBUS_ARGS({
"as", 
"array_of_strings"}),
         NULL, _receive_array, 0
      },
      {
        "ReceiveArrayOfStringIntWithSize",
        ELDBUS_ARGS({
"i", 
"size_of_array"}, {
"a(si)", 
"array"}),
         NULL, _receive_array_of_string_int_with_size, 0
      },
      {
        NULL, _send_variant, 0
      },
      {
       "ReceiveVariantData", NULL, 
ELDBUS_ARGS({
"v", 
"variant_data"}),
        _receive_variant, 0
      },
      {
        "SendArrayInt", NULL,
        ELDBUS_ARGS({
"ai", 
"array_of_int"}), _send_array_int, 0
       },
      {
        "SendArray", NULL, 
ELDBUS_ARGS({
"as", 
"array_string"}),
         _send_array, 0
      },
      {
      },
      {
        "DoubleContainner", 
ELDBUS_ARGS({
"a(ii)", 
"array1"}, {
"a(ii)", 
"array2"}),
         NULL, _double_container, 0
      },
      { }
};
      { "Resp2", "s", NULL, _properties_set, 0 },
      { "text", "s", NULL, NULL, 0 },
      { "int32", "i", NULL, _properties_set, 0 },
      { "st", "(ss)", NULL, NULL, 0 },
      { }
};
   IFACE, methods, NULL, properties, _properties_get, NULL
};
{
   Eldbus_Service_Interface *iface = data;
   eldbus_service_property_invalidate_set(iface, 
"Resp2", 
EINA_TRUE);
}
static void
{
   unsigned int reply;
   Eldbus_Service_Interface *iface = data;
     {
        printf("error on on_name_request\n");
        return;
     }
     {
        printf("error geting arguments on on_name_request\n");
        return;
     }
     {
        printf("error name already in use\n");
        return;
     }
}
int
main(void)
{
   Eldbus_Service_Interface *iface;
   resp2 = malloc(sizeof(char) * 5);
   strcpy(resp2, "test");
                      on_name_request, iface);
   free(resp2);
   return 0;
}