void *value;
} listNode;
+typedef struct listIter {
+ listNode *next;
+ int direction;
+} listIter;
+
typedef struct list {
listNode *head;
listNode *tail;
void (*free)(void *ptr);
int (*match)(void *ptr, void *key);
unsigned int len;
+ listIter iter;
} list;
-typedef struct listIter {
- listNode *next;
- listNode *prev;
- int direction;
-} listIter;
-
/* Functions implemented as macros */
#define listLength(l) ((l)->len)
#define listFirst(l) ((l)->head)
list *listAddNodeTail(list *list, void *value);
void listDelNode(list *list, listNode *node);
listIter *listGetIterator(list *list, int direction);
-listNode *listNextElement(listIter *iter);
+listNode *listNext(listIter *iter);
void listReleaseIterator(listIter *iter);
list *listDup(list *orig);
listNode *listSearchKey(list *list, void *key);
listNode *listIndex(list *list, int index);
+void listRewind(list *list);
+void listRewindTail(list *list);
+listNode *listYield(list *list);
/* Directions for iterators */
#define AL_START_HEAD 0