Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_dbus


Modified Files:
        ecore_dbus.c 


Log Message:
Beginning of dbus testing. DBus needs a lot of love.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_dbus/ecore_dbus.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ecore_dbus.c        6 Jan 2006 18:26:36 -0000       1.8
+++ ecore_dbus.c        20 Jul 2006 16:48:32 -0000      1.9
@@ -210,13 +210,15 @@
    type = compl_type;
    switch (type)
      {
+#if 0
      case ECORE_DBUS_BUS_SESSION:
        svr->server =
           ecore_con_server_connect(ECORE_CON_LOCAL_USER | extra, name, port, 
svr);
        break;
+#endif
      case ECORE_DBUS_BUS_SYSTEM:
        svr->server =
-          ecore_con_server_connect(ECORE_CON_LOCAL_USER | extra, name, port, 
svr);
+          ecore_con_server_connect(ECORE_CON_LOCAL_SYSTEM | extra, name, port, 
svr);
        break;
      default:
        free(svr);
@@ -317,53 +319,56 @@
    /* header length */
    *(msg->header + 4) = msg->hlength = msg->hpos;
    /* message body */
-   va_start(ap, fmt);
-   while (*fmt)
+   if (fmt)
      {
-       switch (*fmt)
+       va_start(ap, fmt);
+       while (*fmt)
          {
-          case ECORE_DBUS_DATA_TYPE_BYTE:
-             f = _ecore_dbus_message_marshal_byte(&msg->body, &msg->bpos,
-                                                  va_arg(ap, int));
-             msg->body_fields = _ecore_list2_append(msg->body_fields, f);
-             break;
-          case ECORE_DBUS_DATA_TYPE_UINT32:
-             f = _ecore_dbus_message_marshal_uint32(&msg->body, &msg->bpos,
-                                                    va_arg(ap, unsigned long));
-             msg->body_fields = _ecore_list2_append(msg->body_fields, f);
-             break;
-          case ECORE_DBUS_DATA_TYPE_STRING:
-             f = _ecore_dbus_message_marshal_string(&msg->body, &msg->bpos,
-                                                    (char *)va_arg(ap, char 
*));
-             msg->body_fields = _ecore_list2_append(msg->body_fields, f);
-             break;
-          case ECORE_DBUS_DATA_TYPE_OBJECT_PATH:
-             f = _ecore_dbus_message_marshal_object_path(&msg->body, 
&msg->bpos,
+            switch (*fmt)
+              {
+               case ECORE_DBUS_DATA_TYPE_BYTE:
+                  f = _ecore_dbus_message_marshal_byte(&msg->body, &msg->bpos,
+                                                       va_arg(ap, int));
+                  msg->body_fields = _ecore_list2_append(msg->body_fields, f);
+                  break;
+               case ECORE_DBUS_DATA_TYPE_UINT32:
+                  f = _ecore_dbus_message_marshal_uint32(&msg->body, 
&msg->bpos,
+                                                         va_arg(ap, unsigned 
long));
+                  msg->body_fields = _ecore_list2_append(msg->body_fields, f);
+                  break;
+               case ECORE_DBUS_DATA_TYPE_STRING:
+                  f = _ecore_dbus_message_marshal_string(&msg->body, 
&msg->bpos,
                                                          (char *)va_arg(ap, 
char *));
-             msg->body_fields = _ecore_list2_append(msg->body_fields, f);
-             break;
-          case ECORE_DBUS_DATA_TYPE_INT32:
-          case ECORE_DBUS_DATA_TYPE_BOOLEAN:
-          case ECORE_DBUS_DATA_TYPE_INT64:
-          case ECORE_DBUS_DATA_TYPE_UINT64:
-          case ECORE_DBUS_DATA_TYPE_DOUBLE:
-          case ECORE_DBUS_DATA_TYPE_ARRAY:
-          case ECORE_DBUS_DATA_TYPE_DICT_ENTRY:
-          case ECORE_DBUS_DATA_TYPE_INVALID:
+                  msg->body_fields = _ecore_list2_append(msg->body_fields, f);
+                  break;
+               case ECORE_DBUS_DATA_TYPE_OBJECT_PATH:
+                  f = _ecore_dbus_message_marshal_object_path(&msg->body, 
&msg->bpos,
+                                                              (char 
*)va_arg(ap, char *));
+                  msg->body_fields = _ecore_list2_append(msg->body_fields, f);
+                  break;
+               case ECORE_DBUS_DATA_TYPE_INT32:
+               case ECORE_DBUS_DATA_TYPE_BOOLEAN:
+               case ECORE_DBUS_DATA_TYPE_INT64:
+               case ECORE_DBUS_DATA_TYPE_UINT64:
+               case ECORE_DBUS_DATA_TYPE_DOUBLE:
+               case ECORE_DBUS_DATA_TYPE_ARRAY:
+               case ECORE_DBUS_DATA_TYPE_DICT_ENTRY:
+               case ECORE_DBUS_DATA_TYPE_INVALID:
 #if 0
-          default:
+               default:
 #endif
-             printf("[ecore_dbus] unknown/unhandled data type %c\n", *fmt);
-             break;
+                  printf("[ecore_dbus] unknown/unhandled data type %c\n", 
*fmt);
+                  break;
+              }
+            fmt++;
          }
-       fmt++;
+       va_end(ap);
      }
-   va_end(ap);
    *(unsigned int *)(msg->header + 8) = msg->blength = msg->bpos;
    /* show message */
    /*ecore_dbus_message_print(msg);
-    * _ecore_dbus_message_print_raw(msg->header,msg->hlength);
-    * _ecore_dbus_message_print_raw(msg->body,msg->blength); */
+    * _ecore_dbus_message_print_raw(msg->header, msg->hlength);
+    * _ecore_dbus_message_print_raw(msg->body, msg->blength); */
    /* send message */
    ecore_dbus_server_send(svr, (char *)msg->header, msg->hlength);
    if (msg->body)
@@ -1144,7 +1149,7 @@
          }
        else if (!strncmp(e->data, "DATA", 4))
          {
-            printf("[ecore_dbus] requering data (unaivable)\n");
+            printf("[ecore_dbus] requiring data (unavailable)\n");
          }
        else if (!strncmp(e->data, "ERROR", 5))
          {



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to