aboutsummaryrefslogtreecommitdiff
path: root/src/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/list.h b/src/list.h
index 083e239..b621f06 100644
--- a/src/list.h
+++ b/src/list.h
@@ -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