00001
00011 #ifndef _LIST_
00012 #define _LIST_
00013
00014 #include "iterator.h"
00015
00019 typedef struct sListNode
00020 {
00022 void *inf;
00024 struct sListNode *prev;
00026 struct sListNode *next;
00027 }SListNode;
00028
00032 typedef SListNode* ListNode;
00033
00037 typedef struct sList
00038 {
00040 int size;
00042 ListNode first;
00044 ListNode last;
00045 }SList;
00046
00050 typedef SList* List;
00051
00052
00053
00060 List newList();
00061
00070 void listDelete(List list);
00071
00083 int listInsertFst(List list,void* inf);
00084
00096 int listInsertLst(List list,void* inf);
00097
00112 int listInsertAt(List list,int index,void* inf);
00113
00128 int listRemoveFst(List list,void** inf);
00129
00144 int listRemoveLst(List list,void** inf);
00145
00164 int listRemoveAt(List list,int index,void** inf);
00165
00181 int listFst(List list,void** inf);
00182
00198 int listLst(List list,void** inf);
00199
00218 int listAt(List list,int index,void** inf);
00219
00228 int listSize(List list);
00229
00240 int listMap(List list,void(*fun)(void*));
00241
00252 Iterator listIterator(List list);
00253
00254 #endif