Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : libs/ecore

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


Modified Files:
        Ecore.h Makefile.am ecore_events.c ecore_exe.c 
        ecore_idle_enterer.c ecore_idle_exiter.c ecore_idler.c 
        ecore_list.c ecore_main.c ecore_private.h ecore_timer.c 
Added Files:
        Ecore_Data.h ecore_hash.c ecore_path.c ecore_plugin.c 
        ecore_sheap.c ecore_strings.c ecore_tree.c ecore_value.c 


Log Message:
Merge Ewd code into Ecore.
The new functions (Ecore_Data.h) have not been tested yet, be warned! :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Ecore.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- Ecore.h     17 Mar 2004 05:14:12 -0000      1.7
+++ Ecore.h     18 Mar 2004 05:29:54 -0000      1.8
@@ -6,12 +6,32 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
+#include <dlfcn.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <limits.h>
+
+#include <Ecore_Data.h>
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* Convenience macros */
+/* FIXME: [deprecated] Convenience macros */
 #define ECORE_MIN(x, y)          (((x) > (y)) ? (y) : (x))
 #define ECORE_MAX(x, y)          (((x) > (y)) ? (x) : (y))
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 17 Mar 2004 05:14:13 -0000      1.3
+++ Makefile.am 18 Mar 2004 05:29:54 -0000      1.4
@@ -4,22 +4,30 @@
 
 lib_LTLIBRARIES = libecore.la
 include_HEADERS = \
-Ecore.h
+Ecore.h \
+Ecore_Data.h
 
 libecore_la_SOURCES = \
 ecore.c \
 ecore_app.c \
 ecore_events.c \
 ecore_exe.c \
+ecore_hash.c \
 ecore_idle_enterer.c \
 ecore_idle_exiter.c \
 ecore_idler.c \
 ecore_list.c \
 ecore_main.c \
+ecore_path.c \
+ecore_plugin.c \
+ecore_sheap.c \
 ecore_signal.c \
+ecore_strings.c \
 ecore_time.c \
 ecore_timer.c \
+ecore_tree.c \
+ecore_value.c \
 ecore_private.h
 
-libecore_la_LIBADD = 
+libecore_la_LIBADD = -lm @dlopen_libs@
 libecore_la_LDFLAGS = -version-info 1:0:0
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_events.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_events.c      20 Feb 2004 07:06:25 -0000      1.7
+++ ecore_events.c      18 Mar 2004 05:29:54 -0000      1.8
@@ -353,20 +353,20 @@
 void
 _ecore_event_call(void)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
 
-   for (l = (Ecore_List *)event_filters; l; l = l->next)
+   for (l = (Ecore_Oldlist *)event_filters; l; l = l->next)
      {
        Ecore_Event_Filter *ef;
        
        ef = (Ecore_Event_Filter *)l;
        if (!ef->delete_me)
          {
-            Ecore_List *ll;
+            Ecore_Oldlist *ll;
             
             if (ef->func_start)
               ef->loop_data = ef->func_start(ef->data);
-            for (ll = (Ecore_List *)events; ll; ll = ll->next)
+            for (ll = (Ecore_Oldlist *)events; ll; ll = ll->next)
               {
                  Ecore_Event *e;
                  
@@ -381,7 +381,7 @@
      }
    if (event_filters_delete_me)
      {
-       for (l = (Ecore_List *)event_filters; l;)
+       for (l = (Ecore_Oldlist *)event_filters; l;)
          {
             Ecore_Event_Filter *ef;
        
@@ -396,9 +396,9 @@
          }
        event_filters_delete_me = 0;
      }
-   for (l = (Ecore_List *)events; l; l = l->next)
+   for (l = (Ecore_Oldlist *)events; l; l = l->next)
      {
-       Ecore_List *ll; 
+       Ecore_Oldlist *ll;      
        Ecore_Event *e;
        
        e = (Ecore_Event *)l;
@@ -409,7 +409,7 @@
             handle_count = 0;
             ecore_raw_event_type = e->type;
             ecore_raw_event_event = e->event;
-            for (ll = (Ecore_List *)event_handlers; ll; ll = ll->next)
+            for (ll = (Ecore_Oldlist *)event_handlers; ll; ll = ll->next)
               {
                  Ecore_Event_Handler *eh;
                  
@@ -434,7 +434,7 @@
      }
    while (events) _ecore_event_del(events);
    if (!event_handlers_delete_me) return;
-   for (l = (Ecore_List *)event_handlers; l;)
+   for (l = (Ecore_Oldlist *)event_handlers; l;)
      {
        Ecore_Event_Handler *eh;
        
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_exe.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_exe.c 20 Feb 2004 07:06:25 -0000      1.3
+++ ecore_exe.c 18 Mar 2004 05:29:54 -0000      1.4
@@ -237,9 +237,9 @@
 Ecore_Exe *
 _ecore_exe_find(pid_t pid)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
    
-   for (l = (Ecore_List *)exes; l; l = l->next)
+   for (l = (Ecore_Oldlist *)exes; l; l = l->next)
      {
        Ecore_Exe *exe;
        
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_idle_enterer.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_idle_enterer.c        20 Feb 2004 07:06:25 -0000      1.3
+++ ecore_idle_enterer.c        18 Mar 2004 05:29:54 -0000      1.4
@@ -75,9 +75,9 @@
 void
 _ecore_idle_enterer_call(void)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
    
-   for (l = (Ecore_List *)idle_enterers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)idle_enterers; l; l = l->next)
      {
        Ecore_Idle_Enterer *ie;
        
@@ -89,7 +89,7 @@
      }
    if (idle_enterers_delete_me)
      {
-       for (l = (Ecore_List *)idle_enterers; l;)
+       for (l = (Ecore_Oldlist *)idle_enterers; l;)
          {
             Ecore_Idle_Enterer *ie;
             
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_idle_exiter.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_idle_exiter.c 17 Mar 2004 05:44:17 -0000      1.1
+++ ecore_idle_exiter.c 18 Mar 2004 05:29:54 -0000      1.2
@@ -72,9 +72,9 @@
 void
 _ecore_idle_exiter_call(void)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
    
-   for (l = (Ecore_List *)idle_exiters; l; l = l->next)
+   for (l = (Ecore_Oldlist *)idle_exiters; l; l = l->next)
      {
        Ecore_Idle_Exiter *ie;
        
@@ -86,7 +86,7 @@
      }
    if (idle_exiters_delete_me)
      {
-       for (l = (Ecore_List *)idle_exiters; l;)
+       for (l = (Ecore_Oldlist *)idle_exiters; l;)
          {
             Ecore_Idle_Exiter *ie;
             
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_idler.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_idler.c       20 Feb 2004 07:06:25 -0000      1.3
+++ ecore_idler.c       18 Mar 2004 05:29:54 -0000      1.4
@@ -76,9 +76,9 @@
 int
 _ecore_idler_call(void)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
 
-   for (l = (Ecore_List *)idlers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)idlers; l; l = l->next)
      {
        Ecore_Idler *ie;
        
@@ -90,7 +90,7 @@
      }
    if (idlers_delete_me)
      {
-       for (l = (Ecore_List *)idlers; l;)
+       for (l = (Ecore_Oldlist *)idlers; l;)
          {
             Ecore_Idler *ie;
             
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_list.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_list.c        23 Sep 2003 08:09:29 -0000      1.2
+++ ecore_list.c        18 Mar 2004 05:29:54 -0000      1.3
@@ -1,11 +1,40 @@
 #include "ecore_private.h"
 #include "Ecore.h"
 
+/* Return information about the list */
+static void *_ecore_list_current(Ecore_List * list);
+
+/* Adding functions */
+static int _ecore_list_insert(Ecore_List * list, Ecore_List_Node *node);
+static int _ecore_list_append_0(Ecore_List * list, Ecore_List_Node *node);
+static int _ecore_list_prepend_0(Ecore_List * list, Ecore_List_Node *node);
+
+/* Remove functions */
+static void *_ecore_list_remove_0(Ecore_List * list);
+static void *_ecore_list_remove_first(Ecore_List * list);
+static void *_ecore_list_remove_last(Ecore_List * list);
+
+/* Basic traversal functions */
+static void *_ecore_list_next(Ecore_List * list);
+static void *_ecore_list_goto_last(Ecore_List * list);
+static void *_ecore_list_goto_first(Ecore_List * list);
+static void *_ecore_list_goto(Ecore_List * list, void *data);
+static void *_ecore_list_goto_index(Ecore_List *list, int index);
+
+/* Iterative function */
+static int _ecore_list_for_each(Ecore_List *list, Ecore_For_Each function);
+
+/* Private double linked list functions */
+static void *_ecore_dlist_previous(Ecore_DList * list);
+static void *_ecore_dlist_remove_first(Ecore_DList *list);
+static void *_ecore_dlist_goto_index(Ecore_DList *list, int index);
+
+/* XXX: Begin deprecated code */
 void *
 _ecore_list_append(void *in_list, void *in_item)
 {
-   Ecore_List *l, *new_l;
-   Ecore_List *list, *item;
+   Ecore_Oldlist *l, *new_l;
+   Ecore_Oldlist *list, *item;
    
    list = in_list;
    item = in_item;
@@ -28,8 +57,8 @@
 void *
 _ecore_list_prepend(void *in_list, void *in_item)
 {
-   Ecore_List *new_l;
-   Ecore_List *list, *item;
+   Ecore_Oldlist *new_l;
+   Ecore_Oldlist *list, *item;
    
    list = in_list;
    item = in_item;   
@@ -51,8 +80,8 @@
 void *
 _ecore_list_append_relative(void *in_list, void *in_item, void *in_relative)
 {
-   Ecore_List *l;
-   Ecore_List *list, *item, *relative;
+   Ecore_Oldlist *l;
+   Ecore_Oldlist *list, *item, *relative;
    
    list = in_list;
    item = in_item;
@@ -61,7 +90,7 @@
      {
        if (l == relative)
          {
-            Ecore_List *new_l;
+            Ecore_Oldlist *new_l;
             
             new_l = item;
             if (l->next)
@@ -84,8 +113,8 @@
 void *
 _ecore_list_prepend_relative(void *in_list, void *in_item, void *in_relative)
 {
-   Ecore_List *l;
-   Ecore_List *list, *item, *relative;
+   Ecore_Oldlist *l;
+   Ecore_Oldlist *list, *item, *relative;
    
    list = in_list;
    item = in_item;
@@ -94,7 +123,7 @@
      {
        if (l == relative)
          {
-            Ecore_List *new_l;
+            Ecore_Oldlist *new_l;
             
             new_l = item;
             new_l->prev = l->prev;
@@ -126,8 +155,8 @@
 void *
 _ecore_list_remove(void *in_list, void *in_item)
 {
-   Ecore_List *return_l;
-   Ecore_List *list, *item;
+   Ecore_Oldlist *return_l;
+   Ecore_Oldlist *list, *item;
 
    /* checkme */
    if(!in_list)
@@ -159,8 +188,8 @@
 void *
 _ecore_list_find(void *in_list, void *in_item)
 {
-   Ecore_List *l;
-   Ecore_List *list, *item;
+   Ecore_Oldlist *l;
+   Ecore_Oldlist *list, *item;
    
    list = in_list;
    item = in_item;   
@@ -170,3 +199,1410 @@
      }
    return NULL;
 }
+/* XXX: End deprecated code */
+
+/**
+ * ecore_list_new - create and initialize a new list.
+ *
+ * Returns a new initialized list on success, NULL on failure.
+ */
+Ecore_List *ecore_list_new()
+{
+       Ecore_List *list;
+
+       list = (Ecore_List *)malloc(sizeof(Ecore_List));
+       if (!list)
+               return NULL;
+
+       if (!ecore_list_init(list)) {
+               FREE(list);
+               return NULL;
+       }
+
+       return list;
+}
+
+/**
+ * ecore_list_init - initialize a list to some sane starting values.
+ * @list: the list to initialize
+ *
+ * Returns FALSE if an error occurs, TRUE if successful
+ */
+int ecore_list_init(Ecore_List *list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       memset(list, 0, sizeof(Ecore_List));
+
+       ECORE_INIT_LOCKS(list);
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_destroy - Free a list and all of it's nodes.
+ * @list: the list to be freed
+ *
+ * Returns no value
+ */
+void ecore_list_destroy(Ecore_List * list)
+{
+       void *data;
+
+       CHECK_PARAM_POINTER("list", list);
+
+       ECORE_WRITE_LOCK(list);
+
+       while (list->first) {
+               data = _ecore_list_remove_first(list);
+               if (list->free_func)
+                       list->free_func(data);
+       }
+
+       ECORE_WRITE_UNLOCK(list);
+       ECORE_DESTROY_LOCKS(list);
+
+       FREE(list);
+}
+
+/**
+ * ecore_list_set_free_cb - set the function for freeing data
+ * @list: the list that will use this function when nodes are destroyed.
+ * @free_func: the function that will free the key data
+ *
+ * Returns TRUE on successful set, FALSE otherwise.
+ */
+int ecore_list_set_free_cb(Ecore_List * list, Ecore_Free_Cb free_func)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       list->free_func = free_func;
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_is_empty - checks the list for any nodes.
+ * @list: the list to check for nodes
+ *
+ * Returns TRUE if no nodes in list, FALSE if the list contains nodes
+ */
+int ecore_list_is_empty(Ecore_List * list)
+{
+       int ret = TRUE;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_READ_LOCK(list);
+
+       if (list->nodes)
+               ret = FALSE;
+
+       ECORE_READ_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_list_index - returns the number of the current node
+ * @list: the list to return the number of the current node
+ *
+ * Returns the number of the current node in the list.
+ */
+int ecore_list_index(Ecore_List * list)
+{
+       int ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_READ_LOCK(list);
+
+       ret = list->index;
+
+       ECORE_READ_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_list_nodes - find the number of nodes in the list.
+ * @list: the list to find the number of nodes
+ *
+ * Returns the number of nodes in the list.
+ */
+int ecore_list_nodes(Ecore_List * list)
+{
+       int ret = 0;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_READ_LOCK(list);
+
+       ret = list->nodes;
+
+       ECORE_READ_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_list_append - append data to the list.
+ * @list: the list to append @data
+ * @data: the data to append to @list.
+ *
+ * Returns FALSE if an error occurs, TRUE if @data is appended successfully
+ */
+inline int ecore_list_append(Ecore_List * list, void *data)
+{
+       int ret;
+       Ecore_List_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       node = ecore_list_node_new();
+       node->data = data;
+
+       ECORE_WRITE_LOCK(list);
+
+       ret = _ecore_list_append_0(list, node);
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* For adding items to the end of the list */
+static int _ecore_list_append_0(Ecore_List * list, Ecore_List_Node *end)
+{
+       if (list->last) {
+               ECORE_WRITE_LOCK(list->last);
+               list->last->next = end;
+               ECORE_WRITE_UNLOCK(list->last);
+       }
+
+       list->last = end;
+
+       if (list->first == NULL) {
+               list->first = end;
+               list->index = 1;
+       }
+
+       list->nodes++;
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_prepend - prepend data to the beginning of the list
+ * @list: the list to prepend @data
+ * @data: the data to prepend to @list
+ *
+ * Returns FALSE if an error occurs, TRUE if data prepended successfully
+ */
+inline int ecore_list_prepend(Ecore_List * list, void *data)
+{
+       int ret;
+       Ecore_List_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       node = ecore_list_node_new();
+       node->data = data;
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_prepend_0(list, node);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* For adding items to the beginning of the list */
+static int _ecore_list_prepend_0(Ecore_List * list, Ecore_List_Node *start)
+{
+       /* Put it at the beginning of the list */
+       ECORE_WRITE_LOCK(start);
+       start->next = list->first;
+       ECORE_WRITE_UNLOCK(start);
+
+       list->first = start;
+
+       /* If no last node, then the first node is the last node */
+       if (list->last == NULL)
+               list->last = list->first;
+
+       list->nodes++;
+       list->index++;
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_insert - insert data at the current point in the list
+ * @list: the list to hold the inserted @data
+ * @data: the data to insert into @list
+ *
+ * Returns FALSE on an error, TRUE on success
+ */
+inline int ecore_list_insert(Ecore_List * list, void *data)
+{
+       int ret;
+       Ecore_List_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       node = ecore_list_node_new();
+       node->data = data;
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_insert(list, node);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* For adding items in front of the current position in the list */
+static int _ecore_list_insert(Ecore_List * list, Ecore_List_Node *new_node)
+{
+       /*
+        * If the current point is at the beginning of the list, then it's the
+        * same as prepending it to the list.
+        */
+       if (list->current == list->first)
+               return _ecore_list_prepend_0(list, new_node);
+
+       if (list->current == NULL) {
+               int ret_value;
+
+               ret_value = _ecore_list_append_0(list, new_node);
+               list->current = list->last;
+
+               return ret_value;
+       }
+
+       /* Setup the fields of the new node */
+       ECORE_WRITE_LOCK(new_node);
+       new_node->next = list->current;
+       ECORE_WRITE_UNLOCK(new_node);
+
+       /* And hook the node into the list */
+       _ecore_list_goto_index(list, ecore_list_index(list) - 1);
+
+       ECORE_WRITE_LOCK(list->current);
+       list->current->next = new_node;
+       ECORE_WRITE_UNLOCK(list->current);
+
+       /* Now move the current item to the inserted item */
+       list->current = new_node;
+       list->index++;
+       list->nodes++;
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_remove - remove the current item from the list.
+ * @list: the list to remove the current item
+ *
+ * Returns a pointer to the removed data on success, NULL on failure.
+ */
+inline void *ecore_list_remove(Ecore_List * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_remove_0(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* Remove the current item from the list */
+static void *_ecore_list_remove_0(Ecore_List * list)
+{
+       void *ret = NULL;
+       Ecore_List_Node *old;
+
+       if (!list)
+               return FALSE;
+
+       if (ecore_list_is_empty(list))
+               return FALSE;
+
+       if (!list->current)
+               return FALSE;
+
+       if (list->current == list->first)
+               return _ecore_list_remove_first(list);
+
+       if (list->current == list->last)
+               return _ecore_list_remove_last(list);
+
+       old = list->current;
+
+       _ecore_list_goto_index(list, list->index - 1);
+
+       ECORE_WRITE_LOCK(list->current);
+       ECORE_WRITE_LOCK(old);
+
+       list->current->next = old->next;
+       old->next = NULL;
+       ret = old->data;
+       old->data = NULL;
+
+       _ecore_list_next(list);
+
+       ECORE_WRITE_UNLOCK(old);
+       ECORE_WRITE_UNLOCK(list->current);
+
+       ecore_list_node_destroy(old, NULL);
+       list->nodes--;
+
+       return ret;
+}
+
+/**
+ * ecore_list_remove_destroy - remove and free the data in lists current position
+ * @list: the list to remove and free the current item
+ *
+ * Returns TRUE on success, FALSE on error
+ */
+int ecore_list_remove_destroy(Ecore_List *list)
+{
+       void *data;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       data = _ecore_list_remove_0(list);
+       if (list->free_func)
+               list->free_func(data);
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_remove_first - remove the first item from the list.
+ * @list: the list to remove the current item
+ *
+ * Returns a pointer to the removed data on success, NULL on failure.
+ */
+inline void *ecore_list_remove_first(Ecore_List * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_remove_first(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* Remove the first item from the list */
+static void *_ecore_list_remove_first(Ecore_List * list)
+{
+       void *ret = NULL;
+       Ecore_List_Node *old;
+
+       if (!list)
+               return FALSE;
+
+       ECORE_WRITE_UNLOCK(list);
+       if (ecore_list_is_empty(list))
+               return FALSE;
+       ECORE_WRITE_LOCK(list);
+
+       if (!list->first)
+               return FALSE;
+
+       old = list->first;
+
+       list->first = list->first->next;
+
+       if (list->current == old)
+               list->current = list->first;
+       else
+               list->index--;
+
+       if (list->last == old)
+               list->last = list->first;
+
+       ECORE_WRITE_LOCK(old);
+       ret = old->data;
+       old->data = NULL;
+       ECORE_WRITE_UNLOCK(old);
+
+       ecore_list_node_destroy(old, NULL);
+       list->nodes--;
+
+       return ret;
+}
+
+/**
+ * ecore_list_remove_first - remove the last item from the list.
+ * @list: the list to remove the last node from
+ *
+ * Returns a pointer to the removed data on success, NULL on failure.
+ */
+inline void *ecore_list_remove_last(Ecore_List * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_remove_last(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* Remove the last item from the list */
+static void *_ecore_list_remove_last(Ecore_List * list)
+{
+       void *ret = NULL;
+       Ecore_List_Node *old, *prev;
+
+       if (!list)
+               return FALSE;
+
+       if (ecore_list_is_empty(list))
+               return FALSE;
+
+       if (!list->last)
+               return FALSE;
+
+       old = list->last;
+       if (list->current == old)
+               list->current = NULL;
+
+       if (list->first == old)
+               list->first = NULL;
+       for (prev = list->first; prev && prev->next != old; prev = prev->next);
+       if (prev) {
+               prev->next = NULL;
+               list->last = prev;
+               if (list->current == old) {
+                       list->current = NULL;
+               }
+       }
+
+
+       ECORE_WRITE_LOCK(old);
+       if (old) {
+               old->next = NULL;
+               ret = old->data;
+               old->data = NULL;
+       }
+       ECORE_WRITE_UNLOCK(old);
+
+       ecore_list_node_destroy(old, NULL);
+       list->nodes--;
+
+       return ret;
+}
+
+/**
+ * ecore_list_goto_index - move the current item to the index number
+ * @list: the list to move the current item
+ * @index: the position to move the current item
+ *
+ * Returns a pointer to the new current item on success, NULL on failure.
+ */
+inline void *ecore_list_goto_index(Ecore_List * list, int index)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_goto_index(list, index);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* This is the non-threadsafe version, use this inside internal functions that
+ * already lock the list */
+static void *_ecore_list_goto_index(Ecore_List *list, int index)
+{
+       int i;
+
+       if (!list)
+               return FALSE;
+
+       if (ecore_list_is_empty(list))
+               return FALSE;
+
+       if (index > ecore_list_nodes(list) || index < 0)
+               return FALSE;
+
+       _ecore_list_goto_first(list);
+
+       for (i = 1; i < index && _ecore_list_next(list); i++);
+
+       list->index = i;
+
+       return list->current->data;
+}
+
+/**
+ * ecore_list_goto - move the current item to the node that contains data
+ * @list: the list to move the current item in
+ * @data: the data to find and set the current item to
+ *
+ * Returns a pointer to @data on success, NULL on failure.
+ */
+inline void *ecore_list_goto(Ecore_List * list, void *data)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_goto(list, data);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* Set the current position to the node containing data */
+static void *_ecore_list_goto(Ecore_List * list, void *data)
+{
+       int index;
+       Ecore_List_Node *node;
+
+       if (!list)
+               return NULL;
+
+       index = 1;
+
+       node = list->first;
+       ECORE_READ_LOCK(node);
+       while (node && node->data) {
+               Ecore_List_Node *next;
+
+               if (node->data == data)
+                       break;
+
+               next = node->next;
+               ECORE_READ_UNLOCK(node);
+
+               node = next;
+
+               ECORE_READ_LOCK(node);
+               index++;
+       }
+
+       ECORE_READ_UNLOCK(node);
+       if (!node)
+               return NULL;
+
+       list->current = node;
+       list->index = index;
+
+       return list->current->data;
+}
+
+/**
+ * ecore_list_goto_first - move the current pointer to the first item in the list
+ * @list: the list to move the current pointer in
+ *
+ * Returns a pointer to the first item on success, NULL on failure
+ */
+inline void *ecore_list_goto_first(Ecore_List *list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       ret = _ecore_list_goto_first(list);
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* Set the current position to the start of the list */
+static void *_ecore_list_goto_first(Ecore_List * list)
+{
+       if (!list || !list->first)
+               return NULL;
+
+       list->current = list->first;
+       list->index = 1;
+
+       return list->current->data;
+}
+
+/**
+ * ecore_list_goto_last - move the pointer to current to the last item in the list
+ * @list: the list to move the current pointer in
+ *
+ * Returns a pointer to the last item on success, NULL on failure.
+ */
+inline void *ecore_list_goto_last(Ecore_List * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_goto_last(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* Set the current position to the end of the list */
+static void *_ecore_list_goto_last(Ecore_List * list)
+{
+       if (!list || !list->last)
+               return NULL;
+
+       list->current = list->last;
+       list->index = list->nodes;
+
+       return list->current->data;
+}
+
+/**
+ * ecore_list_current - retrieve the data in the current node
+ * @list: the list to retrieve the current data from
+ *
+ * Returns the data at the current position on success, NULL on failure or if
+ * no current item set.
+ */
+inline void *ecore_list_current(Ecore_List * list)
+{
+       void *ret;
+
+       ECORE_READ_LOCK(list);
+       ret = _ecore_list_current(list);
+       ECORE_READ_UNLOCK(list);
+
+       return ret;
+}
+
+/* Return the data of the current node without incrementing */
+static void *_ecore_list_current(Ecore_List * list)
+{
+       void *ret;
+
+       if (!list->current)
+               return NULL;
+
+       ECORE_READ_LOCK(list->current);
+       ret = list->current->data;
+       ECORE_READ_UNLOCK(list->current);
+
+       return ret;
+}
+
+/**
+ * ecore_list_next - retrieve the data at the current node and move to the next
+ * @list: the list to move to the next item
+ *
+ * Returns the current item in the list on success, NULL on failure.
+ */
+inline void *ecore_list_next(Ecore_List * list)
+{
+       void *data;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       data = _ecore_list_next(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return data;
+}
+
+/* Return the data contained in the current node and go to the next node */
+static void *_ecore_list_next(Ecore_List * list)
+{
+       void *data;
+       Ecore_List_Node *ret;
+       Ecore_List_Node *next;
+
+       if (!list->current)
+               return NULL;
+
+       ECORE_READ_LOCK(list->current);
+       ret = list->current;
+       next = list->current->next;
+       ECORE_READ_UNLOCK(list->current);
+
+       list->current = next;
+       list->index++;
+
+       ECORE_READ_LOCK(ret);
+       data = ret->data;
+       ECORE_READ_UNLOCK(ret);
+
+       return data;
+}
+
+/**
+ * ecore_list_clear - remove all nodes from the list
+ * @list: the list that will have it's nodes removed
+ *
+ * Returns TRUE on success, FALSE on error. The data for each item on the list
+ * is not freed by ecore_list_clear.
+ */
+int ecore_list_clear(Ecore_List * list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       while (!ecore_list_is_empty(list))
+               _ecore_list_remove_first(list);
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return TRUE;
+}
+
+/**
+ * ecore_list_for_each - execute function for each node in the list.
+ * @list: the list to retrieve nodes from.
+ * @function: The function to pass each node from the list to.
+ *
+ * Returns TRUE on success, FALSE on failure.
+ */
+int ecore_list_for_each(Ecore_List *list, Ecore_For_Each function)
+{
+       int ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_READ_LOCK(list);
+       ret = _ecore_list_for_each(list, function);
+       ECORE_READ_UNLOCK(list);
+
+       return ret;
+}
+
+/* The real meat of executing the function for each data node */
+static int _ecore_list_for_each(Ecore_List *list, Ecore_For_Each function)
+{
+       void *value;
+
+       if (!list || !function)
+               return FALSE;
+
+       _ecore_list_goto_first(list);
+       while ((value = _ecore_list_next(list)) != NULL)
+               function(value);
+
+       return TRUE;
+}
+
+/* Initialize a node to starting values */
+int ecore_list_node_init(Ecore_List_Node * node)
+{
+
+       CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+
+       node->next = NULL;
+       node->data = NULL;
+
+       ECORE_INIT_LOCKS(node);
+
+       return TRUE;
+}
+
+/* Allocate and initialize a new list node */
+Ecore_List_Node *ecore_list_node_new()
+{
+       Ecore_List_Node *new_node;
+
+       new_node = malloc(sizeof(Ecore_List_Node));
+
+       if (!ecore_list_node_init(new_node)) {
+               FREE(new_node);
+               return NULL;
+       }
+
+       return new_node;
+}
+
+/* Here we actually call the function to free the data and free the node */
+int ecore_list_node_destroy(Ecore_List_Node * node, Ecore_Free_Cb free_func)
+{
+       CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+
+       ECORE_WRITE_LOCK(node);
+
+       if (free_func && node->data)
+               free_func(node->data);
+
+       ECORE_WRITE_UNLOCK(node);
+       ECORE_DESTROY_LOCKS(node);
+
+       FREE(node);
+
+       return TRUE;
+}
+
+/**
+ * ecore_dlist_new - create and initialize a new list.
+ *
+ * Returns a new initialized list on success, NULL on failure.
+ */
+Ecore_DList *ecore_dlist_new()
+{
+       Ecore_DList *list = NULL;
+
+       list = (Ecore_DList *)malloc(sizeof(Ecore_DList));
+       if (!list)
+               return NULL;
+
+       if (!ecore_dlist_init(list)) {
+               IF_FREE(list);
+               return NULL;
+       }
+
+       return list;
+}
+
+/**
+ * ecore_dlist_init - initialize a list to some sane starting values.
+ * @list: the list to initialize
+ *
+ * Returns FALSE if an error occurs, TRUE if successful
+ */
+int ecore_dlist_init(Ecore_DList *list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       memset(list, 0, sizeof(Ecore_DList));
+
+       ECORE_INIT_LOCKS(list);
+
+       return TRUE;
+}
+
+/**
+ * ecore_dlist_destroy - free a list and all of it's nodes.
+ * @list: the list to be freed
+ *
+ * Returns no value
+ */
+void ecore_dlist_destroy(Ecore_DList * list)
+{
+       void *data;
+       CHECK_PARAM_POINTER("list", list);
+
+       ECORE_WRITE_LOCK(list);
+
+       while (list->first) {
+               data = _ecore_dlist_remove_first(list);
+               if (list->free_func)
+                       list->free_func(data);
+       }
+
+       ECORE_WRITE_UNLOCK(list);
+       ECORE_DESTROY_LOCKS(list);
+
+       FREE(list);
+}
+
+/**
+ * ecore_dlist_set_free_cb - set the function for freeing data
+ * @list: the list that will use this function when nodes are destroyed.
+ * @free_func: the function that will free the key data
+ *
+ * Returns TRUE on success, FALSE on failure.
+ */
+int ecore_dlist_set_free_cb(Ecore_DList * list, Ecore_Free_Cb free_func)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       return ecore_list_set_free_cb(ECORE_LIST(list), free_func);
+}
+
+/**
+ * ecore_dlist_is_empty - checks the list for any nodes.
+ * @list: the list to check for nodes
+ *
+ * Returns TRUE if no nodes in list, FALSE if the list contains nodes
+ */
+int ecore_dlist_is_empty(Ecore_DList * list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       return ecore_list_is_empty(ECORE_LIST(list));
+}
+
+/**
+ * ecore_dlist_index - returns the number of the current node
+ * @list: the list to return the number of the current node
+ *
+ * Returns the number of the current node in the list.
+ */
+inline int ecore_dlist_index(Ecore_DList * list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       return ecore_list_index(ECORE_LIST(list));
+}
+
+/**
+ * ecore_dlist_append - append data to the list.
+ * @list: the list to append @data
+ * @data: the data to append to @list
+ *
+ * Returns FALSE if an error occurs, TRUE if the data is appended successfully
+ */
+int ecore_dlist_append(Ecore_DList * list, void *data)
+{
+       int ret;
+       Ecore_DList_Node *prev;
+       Ecore_DList_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       node = ecore_dlist_node_new();
+       ECORE_LIST_NODE(node)->data = data;
+
+       prev = ECORE_DLIST_NODE(ECORE_LIST(list)->last);
+       ret = _ecore_list_append_0(ECORE_LIST(list), ECORE_LIST_NODE(node));
+       if (ret) {
+               node->previous = prev;
+       }
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_prepend - prepend data to the beginning of the list
+ * @list: the list to prepend @data
+ * @data: the data to prepend to @list
+ *
+ * Returns FALSE if an error occurs, TRUE if data prepended successfully
+ */
+int ecore_dlist_prepend(Ecore_DList * list, void *data)
+{
+       int ret;
+       Ecore_DList_Node *prev;
+       Ecore_DList_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       node = ecore_dlist_node_new();
+       ECORE_LIST_NODE(node)->data = data;
+
+       prev = ECORE_DLIST_NODE(ECORE_LIST(list)->first);
+       ret = _ecore_list_prepend_0(ECORE_LIST(list), ECORE_LIST_NODE(node));
+       if (ret && prev)
+               prev->previous = node;
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_insert - insert data at the current point in the list
+ * @list: the list to hold the inserted @data
+ * @data: the data to insert into @list
+ *
+ * Returns FALSE on an error, TRUE on success
+ */
+int ecore_dlist_insert(Ecore_DList * list, void *data)
+{
+       int ret;
+       Ecore_DList_Node *prev;
+       Ecore_DList_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       prev = ECORE_DLIST_NODE(ECORE_LIST(list)->current);
+       if (!prev)
+               prev = ECORE_DLIST_NODE(ECORE_LIST(list)->last);
+
+       if (prev)
+               prev = prev->previous;
+
+       node = ecore_dlist_node_new();
+       ECORE_LIST_NODE(node)->data = data;
+
+       ret = _ecore_list_insert(list, ECORE_LIST_NODE(node));
+       if (!ret) {
+               ECORE_WRITE_UNLOCK(list);
+               return ret;
+       }
+
+       if (ECORE_LIST_NODE(node)->next)
+               ECORE_DLIST_NODE(ECORE_LIST_NODE(node)->next)->previous = node;
+
+       if (prev)
+               node->previous = prev;
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_remove - remove the current item from the list.
+ * @list: the list to remove the current item
+ *
+ * Returns a pointer to the removed data on success, NULL on failure.
+ */
+void *ecore_dlist_remove(Ecore_DList * list)
+{
+       void *ret;
+       Ecore_List_Node *node;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+
+       if (list->current) {
+               node = list->current->next;
+               ECORE_DLIST_NODE(node)->previous =
+                       ECORE_DLIST_NODE(ECORE_LIST(list)->current)->previous;
+       }
+       ret = _ecore_list_remove_0(list);
+
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_remove_first - remove the first item from the list.
+ * @list: the list to remove the current item
+ *
+ * Returns a pointer to the removed data on success, NULL on failure.
+ */
+void *ecore_dlist_remove_first(Ecore_DList * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_dlist_remove_first(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_remove_destroy - remove and free the data at the current position
+ * @list: the list to remove the data from
+ *
+ * Returns TRUE on success, FALSE on error
+ */
+int ecore_dlist_remove_destroy(Ecore_DList *list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       return ecore_list_remove_destroy(list);
+}
+
+static void *_ecore_dlist_remove_first(Ecore_DList *list)
+{
+       void *ret;
+
+       if (!list)
+               return FALSE;
+
+       ret = _ecore_list_remove_first(list);
+       if (ret && ECORE_LIST(list)->first)
+               ECORE_DLIST_NODE(ECORE_LIST(list)->first)->previous = NULL;
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_remove_last - remove the last item from the list
+ * @list: the list to remove the last node from
+ *
+ * Returns a pointer to the removed data on success, NULL on failure.
+ */
+void *ecore_dlist_remove_last(Ecore_DList * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_remove_last(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_goto_index - move the current item to the index number
+ * @list: the list to move the current item
+ * @index: the position to move the current item
+ *
+ * Returns node at specified index on success, NULL on error
+ */
+void *ecore_dlist_goto_index(Ecore_DList * list, int index)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_dlist_goto_index(list, index);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/* This is the non-threadsafe version, use this inside internal functions that
+ * already lock the list */
+static void *_ecore_dlist_goto_index(Ecore_DList *list, int index)
+{
+       int i, increment;
+
+       if (!list)
+               return FALSE;
+
+       if (ecore_list_is_empty(ECORE_LIST(list)))
+               return FALSE;
+
+       if (index > ecore_list_nodes(ECORE_LIST(list)) || index < 1)
+               return FALSE;
+
+       if (ECORE_LIST(list)->index > ECORE_LIST(list)->nodes)
+               _ecore_list_goto_last(ECORE_LIST(list));
+
+       if (index < ECORE_LIST(list)->index)
+               increment = -1;
+       else
+               increment = 1;
+
+       for (i = ECORE_LIST(list)->index; i != index; i += increment) {
+               if (increment > 0)
+                       _ecore_list_next(list);
+               else
+                       _ecore_dlist_previous(list);
+       }
+
+       return _ecore_list_current(list);
+}
+
+/**
+ * ecore_dlist_goto - move the current item to the node that contains data
+ * @list: the list to move the current item in
+ * @data: the data to find and set the current item to
+ *
+ * Returns specified data on success, NULL on error
+ */
+void *ecore_dlist_goto(Ecore_DList * list, void *data)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_goto(ECORE_LIST(list), data);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_goto_first - move the current pointer to the first item in the list
+ * @list: the list to change the current to the first item
+ *
+ * Returns a pointer to the first item on success, NULL on failure.
+ */
+void *ecore_dlist_goto_first(Ecore_DList *list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_goto_first(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_goto_last - move the pointer to the current item to the last item
+ * @list: the list to move the current item pointer to the last
+ *
+ * Returns a pointer to the last item in the list on success, NULL on failure.
+ */
+void *ecore_dlist_goto_last(Ecore_DList * list)
+{
+       void *ret;
+
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ECORE_WRITE_LOCK(list);
+       ret = _ecore_list_goto_last(ECORE_LIST(list));
+       ECORE_WRITE_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_current - return the data in the current list item
+ * @list: the list to the return the current data
+ *
+ * Returns value of the current data item, NULL if no current item
+ */
+void *ecore_dlist_current(Ecore_DList * list)
+{
+       void *ret;
+
+       ECORE_READ_LOCK(list);
+       ret = _ecore_list_current(ECORE_LIST(list));
+       ECORE_READ_UNLOCK(list);
+
+       return ret;
+}
+
+/**
+ * ecore_dlist_next - move to the next item in the list and return current item
+ * @list: the list to move to the next item in.
+ *
+ * Returns data in the current list node, or NULL on error
+ */
+void *ecore_dlist_next(Ecore_DList * list)
+{
+       void *data;
+
+       ECORE_WRITE_LOCK(list);
+       data = _ecore_list_next(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return data;
+}
+
+/**
+ * ecore_dlist_previous - move to the previous item and return current item
+ * @list: the list to move to the previous item in.
+ *
+ * Returns data in the current list node, or NULL on error
+ */
+void *ecore_dlist_previous(Ecore_DList * list)
+{
+       void *data;
+
+       ECORE_WRITE_LOCK(list);
+       data = _ecore_dlist_previous(list);
+       ECORE_WRITE_UNLOCK(list);
+
+       return data;
+}
+
+static void *_ecore_dlist_previous(Ecore_DList * list)
+{
+       void *data = NULL;
+
+       if (!list)
+               return NULL;
+
+       if (ECORE_LIST(list)->current) {
+               data = ECORE_LIST(list)->current->data;
+               ECORE_LIST(list)->current = ECORE_LIST_NODE(ECORE_DLIST_NODE(
+                               ECORE_LIST(list)->current)->previous);
+               ECORE_LIST(list)->index--;
+       }
+       else
+               _ecore_list_goto_last(ECORE_LIST(list));
+
+       return data;
+}
+
+/**
+ * ecore_dlist_clear - remove all nodes from the list.
+ * @list: the list to remove all nodes from
+ *
+ * Returns TRUE on success, FALSE on errors
+ */
+int ecore_dlist_clear(Ecore_DList * list)
+{
+       CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
+       ecore_list_clear(ECORE_LIST(list));
+
+       return TRUE;
+}
+
+/*
+ * Description: Initialize a node to sane starting values
+ * Parameters: 1. node - the node to initialize
+ * Returns: TRUE on success, FALSE on errors
+ */
+int ecore_dlist_node_init(Ecore_DList_Node * node)
+{
+       int ret;
+
+       CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+
+       ret = ecore_list_node_init(ECORE_LIST_NODE(node));
+       if (ret)
+               node->previous = NULL;
+
+       return ret;
+}
+
+/*
+ * Description: Allocate and initialize a new list node
+ * Parameters: None
+ * Returns: NULL on error, new list node on success
+ */
+Ecore_DList_Node *ecore_dlist_node_new()
+{
+       Ecore_DList_Node *new_node;
+
+       new_node = malloc(sizeof(Ecore_DList_Node));
+
+       if (!new_node)
+               return NULL;
+
+       if (!ecore_dlist_node_init(new_node)) {
+               FREE(new_node);
+               return NULL;
+       }
+
+       return new_node;
+}
+
+/*
+ * Description: Call the data's free callback function, then free the node
+ * Parameters: 1. node - the node to be freed
+ *             2. free_func - the callback function to execute on the data
+ * Returns: TRUE on success, FALSE on error
+ */
+int ecore_dlist_node_destroy(Ecore_DList_Node * node, Ecore_Free_Cb free_func)
+{
+       CHECK_PARAM_POINTER_RETURN("node", node,
+                       FALSE);
+
+       return ecore_list_node_destroy(ECORE_LIST_NODE(node), free_func);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_main.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_main.c        17 Mar 2004 05:14:13 -0000      1.7
+++ ecore_main.c        18 Mar 2004 05:29:54 -0000      1.8
@@ -239,7 +239,7 @@
    fd_set         rfds, wfds, exfds;
    int            max_fd;
    int            ret;
-   Ecore_List    *l;
+   Ecore_Oldlist    *l;
    
    t = NULL;
    if (timeout > 0.0)
@@ -262,7 +262,7 @@
    FD_ZERO(&rfds);
    FD_ZERO(&wfds);
    FD_ZERO(&exfds);
-   for (l = (Ecore_List *)fd_handlers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)fd_handlers; l; l = l->next)
      {
        Ecore_Fd_Handler *fdh;
        
@@ -291,7 +291,7 @@
      }
    if (ret > 0)
      {
-       for (l = (Ecore_List *)fd_handlers; l; l = l->next)
+       for (l = (Ecore_Oldlist *)fd_handlers; l; l = l->next)
          {
             Ecore_Fd_Handler *fdh;
             
@@ -315,10 +315,10 @@
 static void
 _ecore_main_fd_handlers_cleanup(void)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
    
    if (!fd_handlers_delete_me) return;
-   for (l = (Ecore_List *)fd_handlers; l;)
+   for (l = (Ecore_Oldlist *)fd_handlers; l;)
      {
        Ecore_Fd_Handler *fdh;
        
@@ -337,9 +337,9 @@
 static void
 _ecore_main_fd_handlers_call(void)
 {
-   Ecore_List    *l;
+   Ecore_Oldlist    *l;
    
-   for (l = (Ecore_List *)fd_handlers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)fd_handlers; l; l = l->next)
      {
        Ecore_Fd_Handler *fdh;
        
@@ -366,11 +366,11 @@
 static int
 _ecore_main_fd_handlers_buf_call(void)
 {
-   Ecore_List    *l;
+   Ecore_Oldlist    *l;
    int ret;
    
    ret = 0;
-   for (l = (Ecore_List *)fd_handlers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)fd_handlers; l; l = l->next)
      {
        Ecore_Fd_Handler *fdh;
        
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_private.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ecore_private.h     17 Mar 2004 05:14:13 -0000      1.5
+++ ecore_private.h     18 Mar 2004 05:29:54 -0000      1.6
@@ -31,12 +31,12 @@
 
 typedef int                         Ecore_Magic;
 
-typedef struct _Ecore_List          Ecore_List;
+typedef struct _Ecore_Oldlist          Ecore_Oldlist;
 
-struct _Ecore_List
+struct _Ecore_Oldlist
 {
-   Ecore_List  *next, *prev;
-   Ecore_List  *last;
+   Ecore_Oldlist  *next, *prev;
+   Ecore_Oldlist  *last;
 };
 
 #ifndef _ECORE_H
@@ -60,7 +60,7 @@
 
 struct _Ecore_Exe
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    pid_t        pid;
    void        *data;
@@ -68,7 +68,7 @@
 
 struct _Ecore_Timer
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    double       in;
    double       at;
@@ -80,7 +80,7 @@
 
 struct _Ecore_Idler
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    int          delete_me : 1;
    int        (*func) (void *data);   
@@ -89,7 +89,7 @@
 
 struct _Ecore_Idle_Enterer
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    int          delete_me : 1;
    int        (*func) (void *data);   
@@ -98,7 +98,7 @@
 
 struct _Ecore_Idle_Exiter
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    int          delete_me : 1;
    int        (*func) (void *data);   
@@ -107,7 +107,7 @@
 
 struct _Ecore_Fd_Handler
 {
-   Ecore_List               __list_data;
+   Ecore_Oldlist               __list_data;
    ECORE_MAGIC;
    int                      fd;
    Ecore_Fd_Handler_Flags   flags;
@@ -123,7 +123,7 @@
 
 struct _Ecore_Event_Handler
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    int          type;
    int          delete_me : 1;
@@ -133,7 +133,7 @@
 
 struct _Ecore_Event_Filter
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    int          delete_me : 1;
    void *     (*func_start) (void *data);
@@ -145,7 +145,7 @@
 
 struct _Ecore_Event
 {
-   Ecore_List   __list_data;
+   Ecore_Oldlist   __list_data;
    ECORE_MAGIC;
    int          type;
    void        *event;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_timer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_timer.c       20 Feb 2004 07:06:25 -0000      1.4
+++ ecore_timer.c       18 Mar 2004 05:29:54 -0000      1.5
@@ -124,10 +124,10 @@
 void
 _ecore_timer_cleanup(void)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
 
    if (!timers_delete_me) return;
-   for (l = (Ecore_List *)timers; l;)
+   for (l = (Ecore_Oldlist *)timers; l;)
      {
        Ecore_Timer *timer;
        
@@ -148,11 +148,11 @@
 void
 _ecore_timer_enable_new(void)
 {
-   Ecore_List *l;   
+   Ecore_Oldlist *l;   
 
    if (!timers_added) return;
    timers_added = 0;
-   for (l = (Ecore_List *)timers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)timers; l; l = l->next)
      {
        Ecore_Timer *timer;
        
@@ -177,11 +177,11 @@
 int
 _ecore_timer_call(double when)
 {
-   Ecore_List *l;   
+   Ecore_Oldlist *l;   
    Ecore_Timer *timer;
    
    if (!timers) return 0;
-   for (l = (Ecore_List *)timers; l; l = l->next)
+   for (l = (Ecore_Oldlist *)timers; l; l = l->next)
      {
        timer = (Ecore_Timer *)l;
        if ((timer->at <= when) &&
@@ -203,7 +203,7 @@
 static void
 _ecore_timer_set(Ecore_Timer *timer, double at, double in, int (*func) (void *data), 
void *data)
 {
-   Ecore_List *l;
+   Ecore_Oldlist *l;
    
    timers_added = 1;
    timer->at = at;
@@ -213,7 +213,7 @@
    timer->just_added = 1;
    if (timers)
      {
-       for (l = ((Ecore_List *)(timers))->last; l; l = l->prev)
+       for (l = ((Ecore_Oldlist *)(timers))->last; l; l = l->prev)
          {
             Ecore_Timer *t2;
             




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to