* estickies,
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Feb 2009 11:03:47 +0000 (11:03 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 25 Feb 2009 11:03:47 +0000 (11:03 +0000)
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.

NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@39200 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

15 files changed:
src/bin/hal.c
src/bin/notification_daemon.c
src/lib/dbus/e_dbus.c
src/lib/dbus/e_dbus_object.c
src/lib/dbus/e_dbus_private.h
src/lib/dbus/e_dbus_signal.c
src/lib/hal/E_Hal.h
src/lib/hal/e_hal_device.c
src/lib/hal/e_hal_manager.c
src/lib/hal/e_hal_util.c
src/lib/hal/e_hal_util.h
src/lib/notification/E_Notify.h
src/lib/notification/e_notify_private.h
src/lib/notification/marshal.c
src/lib/notification/notification.c

index 238e423..89ee35d 100644 (file)
@@ -47,7 +47,7 @@ struct Storage {
     char *volume;
   } icon;
 
-  Ecore_List *volumes;
+  Eina_List *volumes;
 };
 
 
@@ -67,8 +67,10 @@ struct Volume {
   Storage *storage;
 };
 
-static Ecore_List *storage_devices;
-static Ecore_List *volumes;
+void volume_free(Volume *volume);
+
+static Eina_List *storage_devices;
+static Eina_List *volumes;
 
 void
 devices_dirty(void)
@@ -88,7 +90,7 @@ storage_new(void)
   Storage *s;
   s = calloc(1, sizeof(Storage));
   s->type = DEVICE_TYPE_STORAGE;
-  s->volumes = ecore_list_new();
+  s->volumes = NULL;
   return s;
 }
 
@@ -96,13 +98,18 @@ void
 storage_free(Storage *storage)
 {
   Volume *v;
+  Eina_List *l;
   printf("storage_free: %s\n", storage->udi);
 
   /* disconnect storage from volume */
-  ecore_list_first_goto(storage->volumes);
-  while ((v = ecore_list_next(storage->volumes)))
+  EINA_LIST_FOREACH(storage->volumes, l, v)
     v->storage = NULL;
-  ecore_list_destroy(storage->volumes);
+  while (storage->volumes)
+    {
+       v = eina_list_data_get(storage->volumes);
+       volume_free(v);
+       storage->volumes = eina_list_remove_list(storage->volumes, storage->volumes);
+    }
     
   if (storage->udi) free(storage->udi);
   if (storage->bus) free(storage->bus);
@@ -129,16 +136,19 @@ storage_find(const char *udi)
 {
   Storage *s = NULL;
   if (!udi) return NULL;
-  s = ecore_list_find(storage_devices, ECORE_COMPARE_CB(storage_find_helper), udi);
+  s = eina_list_search_unsorted(storage_devices, (Eina_Compare_Cb)storage_find_helper, udi);
   return s;
 }
 
 void
 storage_remove(const char *udi)
 {
-  if (storage_find(udi))
+  Storage *sto;
+
+  if ((sto = storage_find(udi)))
   {
-    ecore_list_remove_destroy(storage_devices);
+    storage_devices = eina_list_remove(storage_devices, sto);
+    storage_free(sto);
     devices_dirty();
   }
 }
@@ -200,7 +210,7 @@ storage_append(const char *udi)
   if (!udi) return NULL;
   s = storage_new();
   s->udi = strdup(udi);
-  ecore_list_append(storage_devices, s);
+  storage_devices = eina_list_append(storage_devices, s);
   e_hal_device_get_all_properties(conn, s->udi, cb_storage_properties, s);
   devices_dirty();
   return s;
@@ -223,8 +233,8 @@ volume_free(Volume *volume)
   /* disconnect volume from storage */
   if (volume->storage)
   {
-    if (ecore_list_goto(volume->storage->volumes, volume))
-      ecore_list_remove(volume->storage->volumes);
+    volume->storage->volumes = eina_list_remove(volume->storage->volumes, volume);
+    volume_free(volume);
   }
 
   if (volume->udi) free(volume->udi);
@@ -248,15 +258,18 @@ Volume *
 volume_find(const char *udi)
 {
   if (!udi) return NULL;
-  return ecore_list_find(volumes, ECORE_COMPARE_CB(volume_find_helper), udi);
+  return eina_list_search_unsorted(volumes, (Eina_Compare_Cb)volume_find_helper, udi);
 }
 
 void
 volume_remove(const char *udi)
 {
-  if (volume_find(udi))
+  Volume *vol;
+
+  if ((vol = volume_find(udi)))
   {
-    ecore_list_remove_destroy(volumes);
+    volumes = eina_list_remove(volumes, vol);
+    volume_free(vol);
     devices_dirty();
   }
 }
@@ -319,7 +332,7 @@ cb_volume_properties(void *data, void *reply_data, DBusError *error)
     if (s)
     {
       v->storage = s;
-      ecore_list_append(s->volumes, v);
+      s->volumes = eina_list_append(s->volumes, v);
     }
     free(str);
     str = NULL;
@@ -353,7 +366,7 @@ volume_append(const char *udi)
   printf("ADDING %s\n", udi);
   v = volume_new();
   v->udi = strdup(udi);
-  ecore_list_append(volumes, v);
+  volumes = eina_list_append(volumes, v);
   volume_setup(v);
 
   //this will get called when volume_setup() returns, which is more important
@@ -366,6 +379,7 @@ static void
 cb_test_get_all_devices(void *user_data, void *reply_data, DBusError *error)
 {
   E_Hal_Manager_Get_All_Devices_Return *ret = reply_data;
+  Eina_List *l;
   char *device;
   
   if (!ret || !ret->strings) return;
@@ -377,8 +391,7 @@ cb_test_get_all_devices(void *user_data, void *reply_data, DBusError *error)
     return;
   }
 
-  ecore_list_first_goto(ret->strings);
-  while ((device = ecore_list_next(ret->strings)))
+  EINA_LIST_FOREACH(ret->strings, l, device)
   {
     printf("device: %s\n", device);
   }
@@ -388,6 +401,7 @@ static void
 cb_test_find_device_by_capability_storage(void *user_data, void *reply_data, DBusError *error)
 {
   E_Hal_Manager_Find_Device_By_Capability_Return *ret = reply_data;
+  Eina_List *l;
   char *device;
   
   if (!ret || !ret->strings) return;
@@ -399,8 +413,7 @@ cb_test_find_device_by_capability_storage(void *user_data, void *reply_data, DBu
     return;
   }
 
-  ecore_list_first_goto(ret->strings);
-  while ((device = ecore_list_next(ret->strings)))
+  EINA_LIST_FOREACH(ret->strings, l, device)
     storage_append(device);
 }
 
@@ -408,6 +421,7 @@ static void
 cb_test_find_device_by_capability_volume(void *user_data, void *reply_data, DBusError *error)
 {
   E_Hal_Manager_Find_Device_By_Capability_Return *ret = reply_data;
+  Eina_List *l;
   char *device;
   
   if (!ret || !ret->strings) return;
@@ -419,8 +433,7 @@ cb_test_find_device_by_capability_volume(void *user_data, void *reply_data, DBus
     return;
   }
 
-  ecore_list_first_goto(ret->strings);
-  while ((device = ecore_list_next(ret->strings)))
+  EINA_LIST_FOREACH(ret->strings, l, device)
     volume_append(device);
 }
 
@@ -653,19 +666,19 @@ cb_device_view_header_fetch(void *data, int column)
 static int
 cb_device_tree_expandable_get(void *data, unsigned int row)
 {
-  Ecore_List *devices;
+  Eina_List *devices;
   Device *dev;
 
   devices = data;
   if (!devices) return FALSE;
 
-  dev = ecore_list_index_goto(devices, row);
+  dev = eina_list_nth(devices, row);
   if (!dev) return FALSE;
 
   if (dev->type == DEVICE_TYPE_STORAGE)
   {
     Storage *s = (Storage *)dev;
-    if (ecore_list_count(s->volumes) > 0)
+    if (eina_list_count(s->volumes) > 0)
       return TRUE;
   }
 
@@ -675,7 +688,7 @@ cb_device_tree_expandable_get(void *data, unsigned int row)
 static void *
 cb_device_tree_expansion_data_fetch(void *data, unsigned int parent)
 {
-  Ecore_List *devices;
+  Eina_List *devices;
   Device *dev;
   Storage *s;
   dev = data;
@@ -683,7 +696,7 @@ cb_device_tree_expansion_data_fetch(void *data, unsigned int parent)
   devices = data;
   if (!devices) return NULL;
 
-  dev = ecore_list_index_goto(devices, parent);
+  dev = eina_list_nth(devices, parent);
   
   if (!dev) return NULL;
   if (dev->type != DEVICE_TYPE_STORAGE) return NULL;
@@ -774,6 +787,8 @@ main(int argc, char **argv)
 #if EWL_GUI
   Ewl_Widget *win;
 #endif
+  Storage *sto;
+  Volume *vol;
 
   ecore_init();
   eina_stringshare_init();
@@ -795,10 +810,8 @@ main(int argc, char **argv)
     return 1;
   }
 
-  storage_devices = ecore_list_new();
-  ecore_list_free_cb_set(storage_devices, ECORE_FREE_CB(storage_free));
-  volumes = ecore_list_new();
-  ecore_list_free_cb_set(volumes, ECORE_FREE_CB(volume_free));
+  storage_devices = NULL;
+  volumes = NULL;
 
 #if EWL_GUI
   win = mountbox_mainwin_new();
@@ -820,8 +833,18 @@ main(int argc, char **argv)
 #else
   ecore_main_loop_begin();
 #endif
-  ecore_list_destroy(storage_devices);
-  ecore_list_destroy(volumes);
+  while (storage_devices)
+    {
+       sto = eina_list_data_get(storage_devices);
+       storage_free(sto);
+       storage_devices = eina_list_remove_list(storage_devices, storage_devices);
+    }
+  while (volumes)
+    {
+       vol = eina_list_data_get(volumes);
+       volume_free(vol);
+       volumes = eina_list_remove_list(volumes, volumes);
+    }
   e_dbus_connection_close(conn);
   e_dbus_shutdown();
   eina_stringshare_shutdown();
index aeb8c17..3acc21a 100644 (file)
@@ -12,9 +12,9 @@ struct Timer_Data
 struct Daemon_Data
 {
   E_Notification_Daemon *daemon;
-  Ecore_List *open_notes;
+  Eina_List *open_notes;
 
-  Ecore_List *history;
+  Eina_List *history;
   int history_start;
   int max_history_length;
   int default_timeout;
@@ -27,9 +27,9 @@ daemon_note_close(Daemon_Data *dd, E_Notification *n, int reason)
 {
   printf("Close notification #%d\n", e_notification_id_get(n));
 
-  if (ecore_list_goto(dd->open_notes, n))
+  if (eina_list_data_find(dd->open_notes, n))
   {
-    ecore_list_remove(dd->open_notes);
+    dd->open_notes = eina_list_remove(dd->open_notes, n);
     e_notification_closed_set(n, 1);
     e_notification_daemon_signal_notification_closed(dd->daemon, e_notification_id_get(n), reason);
     e_notification_unref(n);
@@ -54,15 +54,16 @@ void
 daemon_note_show(Daemon_Data *d, E_Notification *n)
 {
   e_notification_ref(n);
-  ecore_list_append(d->open_notes, n); 
+  d->open_notes = eina_list_append(d->open_notes, n); 
   e_notification_ref(n);
-  ecore_list_append(d->history, n); 
+  d->history = eina_list_append(d->history, n); 
 
   // adjust history
-  if (ecore_list_count(d->history) > d->max_history_length)
+  if (eina_list_count(d->history) > d->max_history_length)
   {
     E_Notification *old;
-    old = ecore_list_first_remove(d->history);
+    old = eina_list_data_get(d->history);
+    d->history = eina_list_remove_list(d->history, d->history);
     d->history_start = e_notification_id_get(old) + 1;
     e_notification_unref(old);
   }
@@ -88,8 +89,9 @@ E_Notification *
 daemon_note_open_find(Daemon_Data *d, int id)
 {
   E_Notification *n;
-  ecore_list_first_goto(d->open_notes);
-  while ((n = ecore_list_next(d->open_notes)))
+  Eina_List *l;
+
+  EINA_LIST_FOREACH(d->open_notes, l, n)
     if (e_notification_id_get(n) == id) return n;
 
   return NULL;
@@ -146,15 +148,15 @@ int
 main(int argc, char **argv)
 {
   E_Notification_Daemon *d;
+  E_Notification *n;
   Daemon_Data *dd;
 
+
   ecore_init();
 
   dd = calloc(1, sizeof(Daemon_Data));
-  dd->open_notes = ecore_list_new();
-  dd->history = ecore_list_new();
-  ecore_list_free_cb_set(dd->open_notes, ECORE_FREE_CB(e_notification_unref));
-  ecore_list_free_cb_set(dd->history, ECORE_FREE_CB(e_notification_unref));
+  dd->open_notes = NULL;
+  dd->history = NULL;
   dd->next_id = dd->history_start = 1;
   dd->max_history_length = 5;
   dd->default_timeout = 5;
@@ -167,9 +169,21 @@ main(int argc, char **argv)
   e_notification_daemon_callback_close_notification_set(d, cb_close_notification);
 
   ecore_main_loop_begin();
-  ecore_list_destroy(dd->open_notes);
-  ecore_list_destroy(dd->history);
+  while (dd->open_notes)
+    {
+       n = eina_list_data_get(dd->open_notes);
+       e_notification_unref(n);
+       dd->open_notes = eina_list_remove_list(dd->open_notes, dd->open_notes);
+    }
+  while (dd->history)
+    {
+       n = eina_list_data_get(dd->history);
+       e_notification_unref(n);
+       dd->history = eina_list_remove_list(dd->history, dd->history);
+    }
   free(dd);
   e_notification_daemon_free(d);
   ecore_shutdown();
+
+  return 0;
 }
index b043090..252d8ca 100644 (file)
@@ -100,7 +100,7 @@ e_dbus_fd_handler_add(E_DBus_Handler_Data *hd)
                                              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);
 }
 
 
@@ -112,8 +112,7 @@ e_dbus_handler_data_free(void *data)
   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->cd->fd_handlers);
     ecore_main_fd_handler_del(hd->fd_handler);
   }
   free(hd);
@@ -130,11 +129,7 @@ e_dbus_connection_data_watch_add(E_DBus_Connection *cd, DBusWatch *watch)
   hd->watch = watch;
 
   hd->enabled = dbus_watch_get_enabled(watch);
-#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MAJOR > 1) || (DBUS_VERSION_MAJOR > 1)
   hd->fd = dbus_watch_get_unix_fd(hd->watch);
-#else
-  hd->fd = dbus_watch_get_fd(hd->watch);
-#endif
   DEBUG(5, "watch add (enabled: %d)\n", hd->enabled);
   if (hd->enabled) e_dbus_fd_handler_add(hd);
 }
@@ -159,8 +154,8 @@ e_dbus_connection_new(DBusConnection *conn)
     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;
 }
@@ -171,23 +166,24 @@ e_dbus_connection_free(void *data)
   E_DBus_Connection *cd = data;
   Ecore_Fd_Handler *fd_handler;
   Ecore_Timer *timer;
+  Eina_List *l;
   DEBUG(5, "e_dbus_connection free!\n");
 
-  ecore_list_first_goto(cd->fd_handlers);
-  while ((fd_handler = ecore_list_next(cd->fd_handlers)))
+  EINA_LIST_FOREACH(cd->fd_handlers, l, fd_handler)
     ecore_main_fd_handler_del(fd_handler);
-  ecore_list_destroy(cd->fd_handlers);
+  while (cd->fd_handlers)
+     cd->fd_handlers = eina_list_remove_list(cd->fd_handlers, cd->fd_handlers);
 
-  ecore_list_first_goto(cd->timeouts);
-  while ((timer = ecore_list_next(cd->timeouts)))
+  EINA_LIST_FOREACH(cd->timeouts, l, timer)
     ecore_timer_del(timer);
-  ecore_list_destroy(cd->timeouts);
+  while (cd->timeouts)
+     cd->timeouts = eina_list_remove_list(cd->timeouts, cd->timeouts);
 
   if (cd->shared_type != -1)
     shared_connections[cd->shared_type] = NULL;
 
-  if (cd->signal_handlers)
-    ecore_list_destroy(cd->signal_handlers);
+  while (cd->signal_handlers)
+     cd->signal_handlers = eina_list_remove_list(cd->signal_handlers, cd->signal_handlers);
 
   if (cd->conn_name) free(cd->conn_name);
 
@@ -279,7 +275,7 @@ cb_timeout_add(DBusTimeout *timeout, void *data)
   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);
+  td->cd->timeouts = eina_list_append(td->cd->timeouts, td->handler);
 
   return true;
 }
@@ -294,8 +290,7 @@ cb_timeout_del(DBusTimeout *timeout, void *data)
 
   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);
     ecore_timer_del(td->handler);
     td->handler = NULL;
   }
@@ -347,8 +342,7 @@ cb_watch_del(DBusWatch *watch, void *data)
 
   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->cd->fd_handlers);
     ecore_main_fd_handler_del(hd->fd_handler);
     hd->fd_handler = NULL;
   }
index ea2c926..8119a41 100644 (file)
@@ -26,7 +26,7 @@ static void _introspect_method_append(Ecore_Strbuf *buf, E_DBus_Method *method,
 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 @@ struct E_DBus_Object
 {
   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_Object
 struct E_DBus_Interface
 {
   char *name;
-  Ecore_List *methods;
+  Eina_List *methods;
   int refcount;
 };
 
@@ -219,8 +219,7 @@ e_dbus_object_add(E_DBus_Connection *conn, const char *object_path, void *data)
   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);
 
@@ -235,6 +234,8 @@ e_dbus_object_add(E_DBus_Connection *conn, const char *object_path, void *data)
 EAPI void
 e_dbus_object_free(E_DBus_Object *obj)
 {
+  E_DBus_Interface *iface;
+
   if (!obj) return;
 
   DEBUG(5, "e_dbus_object_free (%s)\n", obj->path);
@@ -242,7 +243,12 @@ e_dbus_object_free(E_DBus_Object *obj)
   e_dbus_connection_close(obj->conn);
 
   if (obj->path) free(obj->path);
-  ecore_list_destroy(obj->interfaces);
+  while (obj->interfaces)
+    {
+       iface = eina_list_data_get(obj->interfaces);
+       e_dbus_interface_unref(iface);
+       obj->interfaces = eina_list_remove_list(obj->interfaces, obj->interfaces);
+    }
   if (obj->introspection_data) free(obj->introspection_data);
 
   free(obj);
@@ -284,7 +290,7 @@ EAPI void
 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 +301,10 @@ e_dbus_object_interface_detach(E_DBus_Object *obj, E_DBus_Interface *iface)
   E_DBus_Interface *found;
 
   DEBUG(4, "e_dbus_object_interface_detach (%s, %s) ", obj->path, iface->name);
-  found = ecore_list_goto(obj->interfaces, iface);
+  found = eina_list_data_find(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 @@ e_dbus_interface_unref(E_DBus_Interface *iface)
 static void
 e_dbus_interface_free(E_DBus_Interface *iface)
 {
+  E_DBus_Method *m;
+
   if (iface->name) free(iface->name);
-  if (iface->methods) ecore_list_destroy(iface->methods);
+  while (iface->methods)
+    {
+       m = eina_list_data_get(iface->methods);
+       e_dbus_object_method_free(m);
+       iface->methods = eina_list_remove_list(iface->methods, iface->methods);
+    }
   free(iface);
 }
 
@@ -348,7 +361,7 @@ e_dbus_interface_method_add(E_DBus_Interface *iface, const char *member, const c
   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;
 }
 
@@ -364,8 +377,7 @@ e_dbus_interface_new(const char *interface)
 
   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;
 }
@@ -408,14 +420,14 @@ e_dbus_object_method_find(E_DBus_Object *obj, const char *interface, const char
 {
   E_DBus_Method *m;
   E_DBus_Interface *iface;
+  Eina_List *l, *ll;
+
   if (!obj || !member) return NULL;
 
-  ecore_list_first_goto(obj->interfaces);
-  while ((iface = ecore_list_next(obj->interfaces)))
+  EINA_LIST_FOREACH(obj->interfaces, l, iface)
   {
     if (strcmp(interface, iface->name)) continue;
-    ecore_list_first_goto(iface->methods);
-    while ((m = ecore_list_next(iface->methods)))
+    EINA_LIST_FOREACH(iface->methods, ll, m)
     {
       if (!strcmp(member, m->member))
         return m;
@@ -465,6 +477,7 @@ e_dbus_object_introspect(E_DBus_Object *obj)
   Ecore_Strbuf *buf;
   int level = 0;
   E_DBus_Interface *iface;
+  Eina_List *l;
 
   buf = ecore_strbuf_new();
 
@@ -476,8 +489,7 @@ e_dbus_object_introspect(E_DBus_Object *obj)
   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");
@@ -496,6 +508,8 @@ static void
 _introspect_interface_append(Ecore_Strbuf *buf, E_DBus_Interface *iface, int level)
 {
   E_DBus_Method *method;
+  Eina_List *l;
+
   _introspect_indent_append(buf, level);
   ecore_strbuf_append(buf, "<interface name=\"");
   ecore_strbuf_append(buf, iface->name);
@@ -503,8 +517,7 @@ _introspect_interface_append(Ecore_Strbuf *buf, E_DBus_Interface *iface, int lev
   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 375cae7..fe0748c 100644 (file)
@@ -13,9 +13,9 @@ struct E_DBus_Connection
   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 d3deda4..21bd918 100644 (file)
@@ -69,8 +69,7 @@ cb_name_owner(void *data, DBusMessage *msg, DBusError *err)
     DEBUG(1, "ERROR: %s %s\n", err->name, err->message);
 /* FIXME: this is bad. the handler gets silently freed and the caller has no
  * idea that it was freed - or if, or when.
-  if (ecore_list_goto(conn->signal_handlers, sh))
-    ecore_list_remove(conn->signal_handlers);
+  conn->signal_handlers = eina_list_remove(conn->signal_handlers, sh);
   e_dbus_signal_handler_free(sh);
  */
   dbus_error_free(err);
@@ -183,9 +182,7 @@ e_dbus_signal_handler_add(E_DBus_Connection *conn, const char *sender, const cha
 
   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;
     }
 
@@ -204,7 +201,7 @@ e_dbus_signal_handler_add(E_DBus_Connection *conn, const char *sender, const cha
        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;
 }
 
@@ -248,8 +245,7 @@ e_dbus_signal_handler_del(E_DBus_Connection *conn, E_DBus_Signal_Handler *sh)
   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);
 }
 
@@ -257,9 +253,9 @@ static void
 cb_signal_dispatcher(E_DBus_Connection *conn, DBusMessage *msg)
 {
   E_DBus_Signal_Handler *sh;
+  Eina_List *l;
 
-  ecore_list_first_goto(conn->signal_handlers);
-  while ((sh = ecore_list_next(conn->signal_handlers)))
+  EINA_LIST_FOREACH(conn->signal_handlers, l, sh)
   {
     if ((!sh->cb_signal) || (sh->delete_me)) continue;
 
@@ -276,11 +272,11 @@ void
 e_dbus_signal_handlers_clean(E_DBus_Connection *conn)
 {
   E_DBus_Signal_Handler *sh;
+  Eina_List *l;
 
   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)))
+  EINA_LIST_FOREACH(conn->signal_handlers, l, sh)
   {
     if (sh->delete_me)
       e_dbus_signal_handler_del(conn, sh);
index 7fabb01..58c79a9 100644 (file)
@@ -38,7 +38,7 @@ typedef struct E_Hal_Properties E_Hal_Properties;
 
 struct E_Hal_String_List_Return
 {
-  Ecore_List *strings; /* list of const char * */
+  Eina_List *strings; /* list of const char * */
 };
 
 struct E_Hal_Bool_Return
@@ -77,7 +77,7 @@ struct E_Hal_Property
     dbus_bool_t b;
     double d;
     dbus_uint64_t u64;
-    Ecore_List *strlist;
+    Eina_List *strlist;
   } val;
 };
 
@@ -122,12 +122,12 @@ extern "C" {
    EAPI int            e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err);
    EAPI dbus_uint64_t  e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err);
    EAPI double         e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err);
-   EAPI Ecore_List    *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
+   EAPI Eina_List     *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
 
 /* (un)mount */
-   EAPI int e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data);
-   EAPI int e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data);
-   EAPI int e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data);
+   EAPI int e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Eina_List *options, E_DBus_Callback_Func cb_func, void *data);
+   EAPI int e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Eina_List *options, E_DBus_Callback_Func cb_func, void *data);
+   EAPI int e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Eina_List *options, E_DBus_Callback_Func cb_func, void *data);
 
 #ifdef __cplusplus
 }
index b2447dc..3dc0ecc 100644 (file)
@@ -127,13 +127,13 @@ unmarshal_device_get_all_properties(DBusMessage *msg, DBusError *err)
         prop->type = E_HAL_PROPERTY_TYPE_STRLIST;
         {
           DBusMessageIter list_iter;
-          prop->val.strlist = ecore_list_new();
+          prop->val.strlist = NULL;
           dbus_message_iter_recurse(&v_iter, &list_iter);
           while (dbus_message_iter_get_arg_type(&list_iter) != DBUS_TYPE_INVALID)
           {
             char *str;
             dbus_message_iter_get_basic(&list_iter, &str);
-            ecore_list_append(prop->val.strlist, str);
+            prop->val.strlist = eina_list_append(prop->val.strlist, str);
             dbus_message_iter_next(&list_iter);
           }
         }
@@ -240,10 +240,11 @@ e_hal_device_query_capability(E_DBus_Connection *conn, const char *udi, const ch
  * @param data custom data pointer for the callback function
  */
 EAPI int
-e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data)
+e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *mount_point, const char *fstype, Eina_List *options, E_DBus_Callback_Func cb_func, void *data)
 {
   DBusMessage *msg;
   DBusMessageIter iter, subiter;
+  Eina_List *l;
   int ret;
 
   msg = e_hal_device_volume_call_new(udi, "Mount");
@@ -256,8 +257,8 @@ e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *
   if (options)
   {
     const char *opt;
-    ecore_list_first_goto(options);
-    while ((opt = ecore_list_next(options)))
+
+    EINA_LIST_FOREACH(options, l, opt)
     {
       dbus_message_iter_append_basic(&subiter, DBUS_TYPE_STRING, &opt);
     }
@@ -281,10 +282,11 @@ e_hal_device_volume_mount(E_DBus_Connection *conn, const char *udi, const char *
  * @param data cuatom data pointer for the callback function
  */
 EAPI int
-e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data)
+e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Eina_List *options, E_DBus_Callback_Func cb_func, void *data)
 {
   DBusMessage *msg;
   DBusMessageIter iter, subiter;
+  Eina_List *l;
   int ret;
 
   msg = e_hal_device_volume_call_new(udi, "Unmount");
@@ -294,8 +296,8 @@ e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Ecore_List
   if (options)
   {
     const char *opt;
-    ecore_list_first_goto(options);
-    while ((opt = ecore_list_next(options)))
+
+    EINA_LIST_FOREACH(options, l, opt)
     {
       dbus_message_iter_append_basic(&subiter, DBUS_TYPE_STRING, &opt);
     }
@@ -317,10 +319,11 @@ e_hal_device_volume_unmount(E_DBus_Connection *conn, const char *udi, Ecore_List
  * @param data cuatom data pointer for the callback function
  */
 EAPI int
-e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Ecore_List *options, E_DBus_Callback_Func cb_func, void *data)
+e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Eina_List *options, E_DBus_Callback_Func cb_func, void *data)
 {
   DBusMessage *msg;
   DBusMessageIter iter, subiter;
+  Eina_List *l;
   int ret;
 
   msg = e_hal_device_volume_call_new(udi, "Eject");
@@ -330,8 +333,8 @@ e_hal_device_volume_eject(E_DBus_Connection *conn, const char *udi, Ecore_List *
   if (options)
   {
     const char *opt;
-    ecore_list_first_goto(options);
-    while ((opt = ecore_list_next(options)))
+
+    EINA_LIST_FOREACH(options, l, opt)
     {
       dbus_message_iter_append_basic(&subiter, DBUS_TYPE_STRING, &opt);
     }
index ff52311..f514a06 100644 (file)
@@ -23,13 +23,7 @@ unmarshal_string_list(DBusMessage *msg, DBusError *err)
     return NULL;
   }
 
-  ret->strings = ecore_list_new();
-  if (!ret->strings)
-  {
-    dbus_set_error(err, DBUS_ERROR_NO_MEMORY, "");
-    free(ret);
-    return NULL;
-  }
+  ret->strings = NULL;
 
   dbus_message_iter_init(msg, &iter);
   dbus_message_iter_recurse(&iter, &sub);
@@ -38,7 +32,7 @@ unmarshal_string_list(DBusMessage *msg, DBusError *err)
     char *dev = NULL;
 
     dbus_message_iter_get_basic(&sub, &dev);
-    if (dev) ecore_list_append(ret->strings, dev);
+    if (dev) ret->strings = eina_list_append(ret->strings, dev);
     dbus_message_iter_next(&sub);
   }
 
@@ -51,7 +45,9 @@ free_string_list(void *data)
   E_Hal_String_List_Return *ret = data;
 
   if (!ret) return;
-  ecore_list_destroy(ret->strings);
+  while (ret->strings)
+    ret->strings = eina_list_remove_list(ret->strings, ret->strings);
+
   free(ret);
 }
 
index 8714292..0661123 100644 (file)
@@ -10,7 +10,8 @@ EAPI void
 e_hal_property_free(E_Hal_Property *prop)
 {
   if (prop->type == E_HAL_PROPERTY_TYPE_STRLIST)
-    ecore_list_destroy(prop->val.strlist);
+    while (prop->val.strlist)
+       prop->val.strlist = eina_list_remove_list(prop->val.strlist, prop->val.strlist);
   free(prop);
 }
 
@@ -85,7 +86,7 @@ e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *er
   return 0;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err)
 {
   E_Hal_Property *prop;
index fa0f471..5a01838 100644 (file)
@@ -9,6 +9,6 @@ char e_hal_property_bool_get(E_Hal_Properties *properties, const char *key, int
 int e_hal_property_int_get(E_Hal_Properties *properties, const char *key, int *err);
 dbus_uint64_t e_hal_property_uint64_get(E_Hal_Properties *properties, const char *key, int *err);
 double e_hal_property_double_get(E_Hal_Properties *properties, const char *key, int *err);
-Ecore_List *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
+Eina_List *e_hal_property_strlist_get(E_Hal_Properties *properties, const char *key, int *err);
 
 #endif
index 36bcbd2..a9b5680 100644 (file)
@@ -83,7 +83,7 @@ struct E_Notification_Return_Notify
 
 struct E_Notification_Return_Get_Capabilities
 {
-  Ecore_List *capabilities;
+  Eina_List *capabilities;
 };
 
 struct E_Notification_Return_Get_Server_Information
@@ -155,7 +155,7 @@ extern "C" {
 
 /* actions */
    EAPI void e_notification_action_add(E_Notification *n, const char *action_id, const char *action_name);
-   EAPI Ecore_List *e_notification_actions_get(E_Notification *n);
+   EAPI Eina_List *e_notification_actions_get(E_Notification *n);
 
 /* hint mutators */
    EAPI void e_notification_hint_urgency_set(E_Notification *n, char urgency);
index e68fac7..c4a669c 100644 (file)
@@ -16,8 +16,8 @@ void e_notify_marshal_dict_byte(DBusMessageIter *iter, const char *key, char val
 void e_notify_marshal_dict_int(DBusMessageIter *iter, const char *key, int value);
 
 void e_notify_marshal_string_array(DBusMessageIter *iter, const char **strings);
-void e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Ecore_List *strings);
-Ecore_List * e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err);
+void e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Eina_List *strings);
+Eina_List * e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err);
 DBusMessage * e_notify_marshal_get_capabilities();
 DBusMessage * e_notify_marshal_get_capabilities_return(DBusMessage *method_call, const char **capabilities);
 void * e_notify_unmarshal_get_capabilities_return(DBusMessage *msg, DBusError *err);
@@ -63,7 +63,7 @@ struct E_Notification
   char *body;
   int expire_timeout;
 
-  Ecore_List *actions;
+  Eina_List *actions;
 
   struct
   {
index f0db570..6b517fb 100644 (file)
@@ -74,24 +74,24 @@ e_notify_marshal_string_array(DBusMessageIter *iter, const char **strings)
 }
 
 void
-e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Ecore_List *strings)
+e_notify_marshal_string_list_as_array(DBusMessageIter *iter, Eina_List *strings)
 {
   const char *str;
   DBusMessageIter arr;
+  Eina_List *l;
 
   dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "s", &arr);
 
-  ecore_list_first_goto(strings);
-  while((str = ecore_list_next(strings)))
+  EINA_LIST_FOREACH(strings, l, str)
     dbus_message_iter_append_basic(&arr, DBUS_TYPE_STRING, &str);
 
   dbus_message_iter_close_container(iter, &arr);
 }
 
-Ecore_List *
+Eina_List *
 e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err)
 {
-  Ecore_List *strings;
+  Eina_List *strings;
   char *sig;
   int ret;
   DBusMessageIter arr;
@@ -101,15 +101,14 @@ e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err)
   dbus_free(sig);
   if (!ret) return NULL;
 
-  strings = ecore_list_new();
-  ecore_list_free_cb_set(strings, ECORE_FREE_CB(free)); //XXX use eina_stringshare_release?
+  strings = NULL;
 
   dbus_message_iter_recurse(iter, &arr);
   while(dbus_message_iter_has_next(&arr))
   {
     const char *str;
     dbus_message_iter_get_basic(&arr, &str);
-    ecore_list_append(strings, strdup(str)); //XXX use eina_stringshare_instance?
+    strings = eina_list_append(strings, strdup(str)); //XXX use eina_stringshare_instance?
     dbus_message_iter_next(&arr);
   }
   return strings;
@@ -160,7 +159,8 @@ e_notify_free_get_capabilities_return(void *data)
   E_Notification_Return_Get_Capabilities *ret = data;
 
   if (!ret) return;
-  ecore_list_destroy(ret->capabilities);
+  while (ret->capabilities)
+    ret->capabilities = eina_list_remove_list(ret->capabilities, ret->capabilities);
   free(ret);
 }
 
@@ -298,6 +298,7 @@ e_notify_marshal_notify(E_Notification *n)
 {
   DBusMessage *msg;
   DBusMessageIter iter, sub;
+  Eina_List *l;
 
   if (!n->app_name) n->app_name = strdup("");
   if (!n->app_icon) n->app_icon = strdup("");
@@ -319,8 +320,7 @@ e_notify_marshal_notify(E_Notification *n)
   if (n->actions)
   {
     E_Notification_Action *action;
-    ecore_list_first_goto(n->actions);
-    while ((action = ecore_list_next(n->actions)))
+    EINA_LIST_FOREACH(n->actions, l, action)
     {
       dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &(action->id));
       dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &(action->name));
index cf2f40d..aa50b90 100644 (file)
@@ -7,7 +7,7 @@
 #include "e_notify_private.h"
 
 /* private functions */
-static Ecore_List * e_notification_action_list_new();
+static Eina_List * e_notification_action_list_new();
 static E_Notification_Action *e_notification_action_new(const char *id, const char *name);
 static void e_notification_action_free(E_Notification_Action *act);
 
@@ -65,7 +65,8 @@ e_notification_free(E_Notification *n)
   if (n->summary) free(n->summary);
   if (n->body) free(n->body);
 
-  if (n->actions) ecore_list_destroy(n->actions);
+  while (n->actions) 
+    n->actions = eina_list_remove_list(n->actions, n->actions);
 
   if (n->hints.category) free(n->hints.category);
   if (n->hints.desktop) free(n->hints.desktop);
@@ -119,7 +120,7 @@ e_notification_action_add(E_Notification *n, const char *action_id, const char *
     n->actions = e_notification_action_list_new();
 
   a = e_notification_action_new(action_id, action_name);
-  ecore_list_append(n->actions, a);
+  n->actions = eina_list_append(n->actions, a);
 }
 
 
@@ -173,7 +174,7 @@ e_notification_body_get(E_Notification *note)
   return note->body;
 }
 
-EAPI Ecore_List *
+EAPI Eina_List *
 e_notification_actions_get(E_Notification *note)
 {
   return note->actions;
@@ -199,12 +200,12 @@ e_notification_closed_get(E_Notification *note)
 
 /***** actions *****/
 
-static Ecore_List *
+static Eina_List *
 e_notification_action_list_new()
 {
-  Ecore_List *alist;
-  alist = ecore_list_new();
-  ecore_list_free_cb_set(alist, (Ecore_Free_Cb)e_notification_action_free);
+  Eina_List *alist;
+
+  alist = NULL;
   return alist;
 }