summaryrefslogtreecommitdiff
path: root/kernel/lib/list.h
blob: 2d1fa0f5433c301abecd3b9326e01e9dc03c220d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef LIST_H
#define LIST_H
struct list {
  void **entries;
  int capacity;
  int tail_index;
};

void list_init(struct list *list);
void list_reset(struct list *list);
void list_free(struct list *list);
int list_clone(struct list *in, struct list *out);
int list_add(struct list *list, void *entry, int *index);
int list_set(struct list *list, int index, void *entry);
int list_get(const struct list *list, int index, void **out);
#endif