Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

list.h

Go to the documentation of this file.
00001 /* ndk - [ list.h ]
00002  *
00003  * Routines for maintaining a list of items
00004  *
00005  * (c)2004 dcipher / neuraldk
00006  *           www.neuraldk.org
00007  */
00008 
00017 // TODO: convert void* to Pointer!
00018 
00019 #ifndef __ndk_list_h__
00020 #define __ndk_list_h__
00021 
00022 #include <errorCodes.h>
00023 #include <types.h>
00024 
00025 typedef struct _List *List;
00026 typedef struct _ListIterator *ListIterator;
00027 
00028 typedef Boolean (*ListComparator) (Pointer key, Pointer data);
00029 
00033 ErrorCode listCreate(List *list);
00034 
00038 ErrorCode listDestroy(List *list);
00039 
00043 ErrorCode listAddFront(List list, Pointer data);
00044 
00048 ErrorCode listAddBack(List list, Pointer data);
00049 
00053 ErrorCode listRemove(List list, Pointer data);
00054 
00058 ErrorCode listGetLength(List list, uint32 *length);
00059 
00063 ErrorCode listGetFirst(List list, Pointer *data);
00064 
00068 ErrorCode listGetLast(List list, Pointer *data);
00069 
00073 ErrorCode listFind(List list, ListComparator comparator, Pointer key, Pointer *data);
00074 
00078 ErrorCode listIteratorCreate(ListIterator * li, List list);
00079 
00085 ErrorCode listIteratorReset(ListIterator li);
00086 
00090 ErrorCode listIteratorGetNext(ListIterator li, Pointer *data);
00091 
00095 ErrorCode listIteratorGetPrevious(ListIterator li, Pointer *data);
00096 
00100 ErrorCode listIteratorDestroy(ListIterator * li);
00101 
00102 #endif
00103 

Generated on Wed Mar 22 20:36:33 2006 for ndk by  doxygen 1.4.4