aboutsummaryrefslogtreecommitdiff
path: root/src/list.h
blob: b621f0650d47ea2bc9078db4289d74c9aad23724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 {
  struct list_item_t *first;
  struct list_item_t *last;
  int    size;
} List;

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