/*------------------------------------------------------------------*/ /* list.h (Version 4: Iterator) */ /*------------------------------------------------------------------*/ #ifndef LIST_INCLUDED #define LIST_INCLUDED typedef struct List *List_T; typedef struct ListIter *ListIter_T; extern List_T List_new(); extern void List_free(List_T oList); extern unsigned long List_length(List_T oList); extern void *List_getFirst(List_T oList); extern void *List_getLast(List_T oList); extern void List_addFirst(List_T oList, void *pvItem); extern void List_addLast(List_T oList, void *pvItem); extern void List_removeFirst(List_T oList); extern void List_removeLast(List_T oList); extern void List_toArray(List_T oList, void **ppvArray); extern void List_map(List_T oList, void (*pfApply)(void **ppvItem, void *pvExtra), void *pvExtra); extern ListIter_T ListIter_new(List_T oList); extern void ListIter_free(ListIter_T oListIter); extern void ListIter_selectFirst(ListIter_T oListIter); extern void ListIter_selectLast(ListIter_T oListIter); extern void ListIter_selectNext(ListIter_T oListIter); extern void ListIter_selectPrev(ListIter_T oListIter); extern int ListIter_selectionValid(ListIter_T oListIter); extern void *ListIter_selectedItem(ListIter_T oListIter); #endif