0
|
1 #ifndef _LIST_H
|
|
2 #define _LIST_H
|
|
3
|
|
4 typedef struct _List {
|
|
5 void *data;
|
|
6 struct _List *next;
|
|
7 struct _List *prev;
|
|
8 } List;
|
|
9
|
2
|
10 typedef struct _ListIter {
|
|
11 struct _List *head;
|
|
12 struct _List *next;
|
|
13 } ListIter;
|
|
14
|
0
|
15 List * _listAddFirst(List*, void *);
|
|
16 List * _listRemove(List *, void *);
|
|
17 void * _listGetnthData(List *, int);
|
2
|
18 void * _listGetLastData(List *);
|
|
19 List * _listMoveLasttoFirst(List *);
|
0
|
20
|
|
21 typedef int (*ApplyFn)(void*,void*);
|
|
22 void _listApply(List *, ApplyFn, void *);
|
|
23
|
2
|
24
|
|
25 ListIter * _listIterator(List *);
|
|
26 void * _listIterNext(ListIter *);
|
|
27 void _listIterEnd(ListIter *);
|
|
28 List * _listIterRemoveCurrent(ListIter *);
|
|
29
|
|
30
|
0
|
31 #endif /* !_LIST_H */
|