diff options
author | 2020-01-09 01:09:15 +0100 | |
---|---|---|
committer | 2020-01-09 01:09:15 +0100 | |
commit | 5492194eee5955738a747184ea98cc3db3d74d40 (patch) | |
tree | 854d2ba2bec03e74bffe1bac49e67a85e3a75d23 /src/list.h | |
parent | 4fff4e6f37f781f7fdb9e6b433524bc61d1ce600 (diff) | |
download | utils-5492194eee5955738a747184ea98cc3db3d74d40.tar.gz utils-5492194eee5955738a747184ea98cc3db3d74d40.zip |
first version, missing some methods
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -1,16 +1,25 @@ #ifndef _LIST_H_ #define _LIST_H_ +typedef struct list_item_t { + void *data; + struct list_item_t *next; +} List_Item; + typedef struct list_t { - void* data; - struct List* next; - struct List* first; - struct List* current; + struct list_item_t *first; + struct list_item_t *last; int size; } List; -List* List_Create(void); -void List_Add (List*, void*, int); -void List_Remove(); +typedef struct iterator_t { + struct list_item_t *current; +} Iterator; + +List List_Create (void); +void List_Add (List *, void *, int); +Iterator List_Iterator (List *); +int Iterator_HasNext(Iterator *); +List_Item *Iterator_Next (Iterator *); #endif |