char *volume;
} icon;
- Ecore_List *volumes;
+ Eina_List *volumes;
};
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)
Storage *s;
s = calloc(1, sizeof(Storage));
s->type = DEVICE_TYPE_STORAGE;
- s->volumes = ecore_list_new();
+ s->volumes = NULL;
return s;
}
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);
{
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();
}
}
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;
/* 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);
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();
}
}
if (s)
{
v->storage = s;
- ecore_list_append(s->volumes, v);
+ s->volumes = eina_list_append(s->volumes, v);
}
free(str);
str = NULL;
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
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;
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);
}
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;
return;
}
- ecore_list_first_goto(ret->strings);
- while ((device = ecore_list_next(ret->strings)))
+ EINA_LIST_FOREACH(ret->strings, l, device)
storage_append(device);
}
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;
return;
}
- ecore_list_first_goto(ret->strings);
- while ((device = ecore_list_next(ret->strings)))
+ EINA_LIST_FOREACH(ret->strings, l, device)
volume_append(device);
}
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;
}
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;
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;
#if EWL_GUI
Ewl_Widget *win;
#endif
+ Storage *sto;
+ Volume *vol;
ecore_init();
eina_stringshare_init();
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();
#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();
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;
{
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);
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);
}
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;
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;
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;
}
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);
}
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);
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);
}
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;
}
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);
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;
}
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;
}
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;
}
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 = {
{
E_DBus_Connection *conn;
char *path;
- Ecore_List *interfaces;
+ Eina_List *interfaces;
char *introspection_data;
int introspection_dirty;
struct E_DBus_Interface
{
char *name;
- Ecore_List *methods;
+ Eina_List *methods;
int refcount;
};
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);
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);
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);
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);
}
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);
}
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);
}
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;
}
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;
}
{
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;
Ecore_Strbuf *buf;
int level = 0;
E_DBus_Interface *iface;
+ Eina_List *l;
buf = ecore_strbuf_new();
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");
_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);
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--;
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;
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);
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;
}
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;
}
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);
}
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;
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);
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
dbus_bool_t b;
double d;
dbus_uint64_t u64;
- Ecore_List *strlist;
+ Eina_List *strlist;
} val;
};
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
}
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);
}
}
* @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");
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);
}
* @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");
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);
}
* @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");
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);
}
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);
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);
}
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);
}
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);
}
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;
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
struct E_Notification_Return_Get_Capabilities
{
- Ecore_List *capabilities;
+ Eina_List *capabilities;
};
struct E_Notification_Return_Get_Server_Information
/* 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);
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);
char *body;
int expire_timeout;
- Ecore_List *actions;
+ Eina_List *actions;
struct
{
}
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;
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;
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);
}
{
DBusMessage *msg;
DBusMessageIter iter, sub;
+ Eina_List *l;
if (!n->app_name) n->app_name = strdup("");
if (!n->app_icon) n->app_icon = strdup("");
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));
#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);
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);
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);
}
return note->body;
}
-EAPI Ecore_List *
+EAPI Eina_List *
e_notification_actions_get(E_Notification *note)
{
return note->actions;
/***** 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;
}