Hi there, i patch e_dbus core to use eina instead of ecore, i have to do e_hal, e_nm,
and other stuff too, but i would like to know what you think about that.

I have no problem using it. It works with dbus exemple and i e in general.
Index: src/lib/dbus/e_dbus_signal.c
===================================================================
--- src/lib/dbus/e_dbus_signal.c	(revision 37413)
+++ src/lib/dbus/e_dbus_signal.c	(working copy)
@@ -187,9 +187,7 @@
 
   if (!conn->signal_handlers)
     {
-       conn->signal_handlers = ecore_list_new();
-       ecore_list_free_cb_set
-	 (conn->signal_handlers, ECORE_FREE_CB(e_dbus_signal_handler_free));
+       conn->signal_handlers = NULL;
        conn->signal_dispatcher = cb_signal_dispatcher;
     }
 
@@ -207,8 +205,7 @@
        data->sh = sh;
        e_dbus_get_name_owner(conn, sender, cb_name_owner, data);
     }
-
-  ecore_list_append(conn->signal_handlers, sh);
+  conn->signal_handlers = eina_list_append(conn->signal_handlers, sh);
   return sh;
 }
 
@@ -252,42 +249,42 @@
   dbus_bus_remove_match(conn->conn, match, NULL);
 
   if (!conn->signal_handlers) return;
-  if (!ecore_list_goto(conn->signal_handlers, sh)) return;
-  ecore_list_remove(conn->signal_handlers);
+  conn->signal_handlers = eina_list_remove(conn->signal_handlers, sh);
   e_dbus_signal_handler_free(sh);
 }
 
 static void
 cb_signal_dispatcher(E_DBus_Connection *conn, DBusMessage *msg)
 {
+  Eina_List *l = NULL;
   E_DBus_Signal_Handler *sh;
 
-  ecore_list_first_goto(conn->signal_handlers);
-  while ((sh = ecore_list_next(conn->signal_handlers)))
-  {
-    if ((!sh->cb_signal) || (sh->delete_me)) continue;
-
-    if (sh->sender && !dbus_message_has_sender(msg, sh->sender)) continue;
-    if (sh->path && !dbus_message_has_path(msg, sh->path)) continue;
-    if (sh->interface && !dbus_message_has_interface(msg, sh->interface)) continue;
-    if (sh->member && !dbus_message_has_member(msg, sh->member)) continue;
-
-    sh->cb_signal(sh->data, msg);
-  }
+  EINA_LIST_FOREACH(conn->signal_handlers, l, sh)
+    {
+      if ((!sh->cb_signal) || (sh->delete_me)) continue;
+      
+      if (sh->sender && !dbus_message_has_sender(msg, sh->sender)) continue;
+      if (sh->path && !dbus_message_has_path(msg, sh->path)) continue;
+      if (sh->interface && !dbus_message_has_interface(msg, sh->interface)) continue;
+      if (sh->member && !dbus_message_has_member(msg, sh->member)) continue;
+      
+      sh->cb_signal(sh->data, msg);
+    }
 }
 
 void
 e_dbus_signal_handlers_clean(E_DBus_Connection *conn)
 {
+  Eina_List *l = NULL;
   E_DBus_Signal_Handler *sh;
 
   if (!e_dbus_handler_deletions) return;
   if (!conn->signal_handlers) return;
-  ecore_list_first_goto(conn->signal_handlers);
-  while ((sh = ecore_list_next(conn->signal_handlers)))
-  {
-    if (sh->delete_me)
-      e_dbus_signal_handler_del(conn, sh);
-  }
+
+  EINA_LIST_FOREACH(conn->signal_handlers, l, sh)
+    {
+      if (sh->delete_me)
+	e_dbus_signal_handler_del(conn, sh);
+    }
   e_dbus_handler_deletions = 0;
 }
Index: src/lib/dbus/e_dbus_private.h
===================================================================
--- src/lib/dbus/e_dbus_private.h	(revision 37413)
+++ src/lib/dbus/e_dbus_private.h	(working copy)
@@ -13,9 +13,9 @@
   DBusConnection *conn;
   char *conn_name;
 
-  Ecore_List *fd_handlers;
-  Ecore_List *timeouts;
-  Ecore_List *signal_handlers;
+  Eina_List *fd_handlers;
+  Eina_List *timeouts;
+  Eina_List *signal_handlers;
   void (*signal_dispatcher)(E_DBus_Connection *conn, DBusMessage *msg);
 
   Ecore_Idler *idler;
Index: src/lib/dbus/e_dbus.c
===================================================================
--- src/lib/dbus/e_dbus.c	(revision 37413)
+++ src/lib/dbus/e_dbus.c	(working copy)
@@ -8,7 +8,6 @@
 #include <string.h>
 
 #include <Ecore.h>
-#include <Ecore_Data.h>
 
 #define NUM_BUS_TYPES 3
 
@@ -103,7 +102,7 @@
                                              NULL,
                                              NULL);
 
-  ecore_list_append(hd->cd->fd_handlers, hd->fd_handler);
+  hd->cd->fd_handlers = eina_list_append(hd->cd->fd_handlers, hd->fd_handler);
 }
 
 
@@ -115,8 +114,7 @@
   DEBUG(5, "e_dbus_handler_data_free\n");
   if (hd->fd_handler)
   {
-    if (ecore_list_goto(hd->cd->fd_handlers, hd->fd_handler))
-      ecore_list_remove(hd->cd->fd_handlers);
+    hd->cd->fd_handlers = eina_list_remove(hd->cd->fd_handlers, hd->fd_handler);
     ecore_main_fd_handler_del(hd->fd_handler);
   }
   free(hd);
@@ -158,8 +156,8 @@
     DEBUG(1, "Not connected\n");
 
   cd->shared_type = -1;
-  cd->fd_handlers = ecore_list_new();
-  cd->timeouts = ecore_list_new();
+  cd->fd_handlers = NULL;
+  cd->timeouts = NULL;
 
   return cd;
 }
@@ -167,26 +165,45 @@
 static void
 e_dbus_connection_free(void *data)
 {
+  Eina_List *l = NULL;
   E_DBus_Connection *cd = data;
   Ecore_Fd_Handler *fd_handler;
   Ecore_Timer *timer;
   DEBUG(5, "e_dbus_connection free!\n");
 
+  l = cd->fd_handlers;
+  while (l)
+    {
+      ecore_main_fd_handler_del(eina_list_data_get(l));
+      l = eina_list_remove_list(l, l);
+    }
+  cd->fd_handlers = eina_list_free(cd->fd_handlers);
+  /*
   ecore_list_first_goto(cd->fd_handlers);
   while ((fd_handler = ecore_list_next(cd->fd_handlers)))
     ecore_main_fd_handler_del(fd_handler);
   ecore_list_destroy(cd->fd_handlers);
+  */
 
+  l = cd->timeouts;
+  while (l)
+    {
+      ecore_timer_del(eina_list_data_get(l));
+      l = eina_list_remove_list(l, l);
+    }
+  cd->timeouts = eina_list_free(cd->timeouts);
+  /*
   ecore_list_first_goto(cd->timeouts);
   while ((timer = ecore_list_next(cd->timeouts)))
     ecore_timer_del(timer);
   ecore_list_destroy(cd->timeouts);
-
+  */
   if (cd->shared_type != -1)
     shared_connections[cd->shared_type] = NULL;
 
   if (cd->signal_handlers)
-    ecore_list_destroy(cd->signal_handlers);
+    cd->signal_handlers = eina_list_free(cd->signal_handlers);
+  //ecore_list_destroy(cd->signal_handlers);
 
   if (cd->conn_name) free(cd->conn_name);
 
@@ -278,23 +295,26 @@
   td->timeout = timeout;
 
   if (dbus_timeout_get_enabled(timeout)) td->handler = ecore_timer_add(td->interval, e_dbus_timeout_handler, td);
-  ecore_list_append(td->cd->timeouts, td->handler);
-
+  //  ecore_list_append(td->cd->timeouts, td->handler);
+  td->cd->timeouts = eina_list_append(td->cd->timeouts, td->handler);
   return true;
 }
 
 static void
 cb_timeout_del(DBusTimeout *timeout, void *data)
 {
+  Eina_List *l = NULL;
   E_DBus_Timeout_Data *td;
+
   DEBUG(5, "timeout del!\n");
 
   td = (E_DBus_Timeout_Data *)dbus_timeout_get_data(timeout);
 
   if (td->handler) 
   {
-    if (ecore_list_goto(td->cd->timeouts, td->handler))
-      ecore_list_remove(td->cd->timeouts);
+    td->cd->timeouts = eina_list_remove(td->cd->timeouts, td->handler);
+    //    if (ecore_list_goto(td->cd->timeouts, td->handler))
+    //  ecore_list_remove(td->cd->timeouts);
     ecore_timer_del(td->handler);
     td->handler = NULL;
   }
@@ -348,8 +368,9 @@
 
   if (hd->fd_handler) 
   {
-    if (ecore_list_goto(hd->cd->fd_handlers, hd->fd_handler))
-      ecore_list_remove(hd->cd->fd_handlers);
+    hd->cd->fd_handlers = eina_list_remove(hd->cd->fd_handlers, hd->fd_handler);
+    //    if (ecore_list_goto(hd->cd->fd_handlers, hd->fd_handler))
+    //  ecore_list_remove(hd->cd->fd_handlers);
     ecore_main_fd_handler_del(hd->fd_handler);
     hd->fd_handler = NULL;
   }
Index: src/lib/dbus/e_dbus_object.c
===================================================================
--- src/lib/dbus/e_dbus_object.c	(revision 37413)
+++ src/lib/dbus/e_dbus_object.c	(working copy)
@@ -26,7 +26,7 @@
 static void _introspect_arg_append(Ecore_Strbuf *buf, const char *type, const char *direction, int level);
 
 
-//static Ecore_List *standard_methods = NULL;
+//static Eina_List *standard_methods = NULL;
 
 
 static DBusObjectPathVTable vtable = {
@@ -42,7 +42,7 @@
 {
   E_DBus_Connection *conn;
   char *path;
-  Ecore_List *interfaces;
+  Eina_List *interfaces;
   char *introspection_data;
   int introspection_dirty;
 
@@ -55,7 +55,7 @@
 struct E_DBus_Interface
 {
   char *name;
-  Ecore_List *methods;
+  Eina_List *methods;
   int refcount;
 };
 
@@ -219,8 +219,7 @@
   e_dbus_connection_ref(conn);
   obj->path = strdup(object_path);
   obj->data = data;
-  obj->interfaces = ecore_list_new();
-  ecore_list_free_cb_set(obj->interfaces, (Ecore_Free_Cb)e_dbus_interface_unref);
+  obj->interfaces = NULL;
 
   e_dbus_object_interface_attach(obj, introspectable_interface);
 
@@ -241,10 +240,19 @@
   dbus_connection_unregister_object_path(obj->conn->conn, obj->path);
   e_dbus_connection_close(obj->conn);
 
-  if (obj->path) free(obj->path);
-  ecore_list_destroy(obj->interfaces);
-  if (obj->introspection_data) free(obj->introspection_data);
+  if (obj->path)
+    free(obj->path);
 
+  while (obj->interfaces)
+    {
+      e_dbus_interface_unref(eina_list_data_get(obj->interfaces));
+      obj->interfaces = eina_list_remove_list(obj->interfaces,
+					      obj->interfaces);
+    }
+
+  if (obj->introspection_data)
+    free(obj->introspection_data);
+
   free(obj);
 }
 
@@ -284,7 +292,7 @@
 e_dbus_object_interface_attach(E_DBus_Object *obj, E_DBus_Interface *iface)
 {
   e_dbus_interface_ref(iface);
-  ecore_list_append(obj->interfaces, iface);
+  obj->interfaces = eina_list_append(obj->interfaces, iface);
   obj->introspection_dirty = 1;
   DEBUG(4, "e_dbus_object_interface_attach (%s, %s) ", obj->path, iface->name);
 }
@@ -295,10 +303,8 @@
   E_DBus_Interface *found;
 
   DEBUG(4, "e_dbus_object_interface_detach (%s, %s) ", obj->path, iface->name);
-  found = ecore_list_goto(obj->interfaces, iface);
-  if (found == NULL) return;
 
-  ecore_list_remove(obj->interfaces);
+  obj->interfaces = eina_list_remove(obj->interfaces, iface);
   obj->introspection_dirty = 1;
   e_dbus_interface_unref(iface);
 }
@@ -321,8 +327,15 @@
 static void
 e_dbus_interface_free(E_DBus_Interface *iface)
 {
-  if (iface->name) free(iface->name);
-  if (iface->methods) ecore_list_destroy(iface->methods);
+  if (iface->name)
+    free(iface->name);
+
+  while (iface->methods)
+    {
+      e_dbus_object_method_free(eina_list_data_get(iface->methods));
+      iface->methods = eina_list_remove_list(iface->methods,
+					     iface->methods);
+    }
   free(iface);
 }
 
@@ -348,7 +361,7 @@
   DEBUG(4, "Add method %s: %p\n", member, m);
   if (!m) return 0;
 
-  ecore_list_append(iface->methods, m);
+  iface->methods = eina_list_append(iface->methods, m);
   return 1;
 }
 
@@ -357,15 +370,15 @@
 {
   E_DBus_Interface *iface;
 
-  if (!interface) return NULL;
+  if (!interface)
+    return NULL;
 
   iface = calloc(1, sizeof(E_DBus_Interface));
   if (!iface) return NULL;
 
   iface->refcount = 1;
   iface->name = strdup(interface);
-  iface->methods = ecore_list_new();
-  ecore_list_free_cb_set(iface->methods, (Ecore_Free_Cb)e_dbus_object_method_free);
+  iface->methods = NULL;
 
   return iface;
 }
@@ -406,21 +419,22 @@
 static E_DBus_Method *
 e_dbus_object_method_find(E_DBus_Object *obj, const char *interface, const char *member)
 {
+  Eina_List *l = NULL, *l2 = NULL;
   E_DBus_Method *m;
   E_DBus_Interface *iface;
+
   if (!obj || !member) return NULL;
 
-  ecore_list_first_goto(obj->interfaces);
-  while ((iface = ecore_list_next(obj->interfaces)))
-  {
-    if (strcmp(interface, iface->name)) continue;
-    ecore_list_first_goto(iface->methods);
-    while ((m = ecore_list_next(iface->methods)))
+  EINA_LIST_FOREACH(obj->interfaces, l, iface)
     {
-      if (!strcmp(member, m->member))
-        return m;
+      if (strcmp(interface, iface->name))
+	continue;
+      EINA_LIST_FOREACH(iface->methods, l2, m)
+	{
+	  if (!strcmp(member, m->member))
+	    return m;
+	}
     }
-  }
   return NULL;
 }
 
@@ -462,6 +476,7 @@
 Ecore_Strbuf *
 e_dbus_object_introspect(E_DBus_Object *obj)
 {
+  Eina_List *l = NULL;
   Ecore_Strbuf *buf;
   int level = 0;
   E_DBus_Interface *iface;
@@ -476,8 +491,7 @@
   ecore_strbuf_append(buf, "\">\n");
   level++;
 
-  ecore_list_first_goto(obj->interfaces);
-  while ((iface = ecore_list_next(obj->interfaces)))
+  EINA_LIST_FOREACH(obj->interfaces, l, iface)
     _introspect_interface_append(buf, iface, level);
 
   ecore_strbuf_append(buf, "</node>\n");
@@ -495,7 +509,9 @@
 static void
 _introspect_interface_append(Ecore_Strbuf *buf, E_DBus_Interface *iface, int level)
 {
+  Eina_List *l = NULL;
   E_DBus_Method *method;
+
   _introspect_indent_append(buf, level);
   ecore_strbuf_append(buf, "<interface name=\"");
   ecore_strbuf_append(buf, iface->name);
@@ -503,8 +519,8 @@
   level++;
 
   DEBUG(4, "introspect iface: %s\n", iface->name);
-  ecore_list_first_goto(iface->methods);
-  while ((method = ecore_list_next(iface->methods))) 
+
+  EINA_LIST_FOREACH(iface->methods, l, method)
     _introspect_method_append(buf, method, level);
 
   level--;
Index: configure.ac
===================================================================
--- configure.ac	(revision 37413)
+++ configure.ac	(working copy)
@@ -110,8 +110,6 @@
 echo "Configuration Options Summary:"
 echo
 echo "  Compilation..........: make"
-echo
 echo "  Installation.........: make install"
+echo "  prefix...............: $prefix"
 echo
-echo "    prefix.............: $prefix"
-echo
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to