1 | #ifndef CR_LIST_H
|
---|
2 | #define CR_LIST_H
|
---|
3 |
|
---|
4 | #include <iprt/cdefs.h>
|
---|
5 |
|
---|
6 | #ifdef __cplusplus
|
---|
7 | extern "C" {
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | typedef struct CRList CRList;
|
---|
11 | typedef struct CRListIterator CRListIterator;
|
---|
12 | typedef int ( *CRListCompareFunc ) ( const void *element1, const void *element2 );
|
---|
13 | typedef void ( *CRListApplyFunc ) ( void *element, void *arg );
|
---|
14 |
|
---|
15 | DECLEXPORT(CRList *) crAllocList( void );
|
---|
16 | DECLEXPORT(void) crFreeList( CRList *l );
|
---|
17 |
|
---|
18 | DECLEXPORT(unsigned) crListSize( const CRList *l );
|
---|
19 | DECLEXPORT(int) crListIsEmpty( const CRList *l );
|
---|
20 |
|
---|
21 | DECLEXPORT(void) crListInsert( CRList *l, CRListIterator *iter, void *elem );
|
---|
22 | DECLEXPORT(void) crListErase( CRList *l, CRListIterator *iter );
|
---|
23 | DECLEXPORT(void) crListClear( CRList *l );
|
---|
24 |
|
---|
25 | DECLEXPORT(void) crListPushBack( CRList *l, void *elem );
|
---|
26 | DECLEXPORT(void) crListPushFront( CRList *l, void *elem );
|
---|
27 |
|
---|
28 | DECLEXPORT(void) crListPopBack( CRList *l );
|
---|
29 | DECLEXPORT(void) crListPopFront( CRList *l );
|
---|
30 |
|
---|
31 | DECLEXPORT(void *) crListFront( CRList *l );
|
---|
32 | DECLEXPORT(void *) crListBack( CRList *l );
|
---|
33 |
|
---|
34 | DECLEXPORT(CRListIterator *) crListBegin( CRList *l );
|
---|
35 | DECLEXPORT(CRListIterator *) crListEnd( CRList *l );
|
---|
36 |
|
---|
37 | DECLEXPORT(CRListIterator *) crListNext( CRListIterator *iter );
|
---|
38 | DECLEXPORT(CRListIterator *) crListPrev( CRListIterator *iter );
|
---|
39 | DECLEXPORT(void *) crListElement( CRListIterator *iter );
|
---|
40 |
|
---|
41 | DECLEXPORT(CRListIterator *) crListFind( CRList *l, void *element, CRListCompareFunc compare );
|
---|
42 | DECLEXPORT(void) crListApply( CRList *l, CRListApplyFunc apply, void *arg );
|
---|
43 |
|
---|
44 | #ifdef __cplusplus
|
---|
45 | } /* extern "C" */
|
---|
46 | #endif
|
---|
47 |
|
---|
48 | #endif /* CR_LIST_H */
|
---|