lexLeo
Loading...
Searching...
No Matches
list.h
1// src/foundation/data_structures/include/list.h
2
3#ifndef LIST_H
4#define LIST_H
5
6#include <stddef.h>
7#include <stdbool.h>
8
9typedef struct cons {void *car; struct cons *cdr;} cons, *list;
10
11//returns NULL on error and if so no side effect
12list list_push(list l, void * e);
13
14void *list_pop(list *l_p);
15
16// precondition : if destroy_fn_t non null, it must properly frees the l'cars
17void list_free_list(list l, void (*destroy_fn_t)(void *item, void *user_data), void *user_data);
18
19bool list_contains(list l, void *item);
20
21// DEBUG TOOLS
22
23size_t list_length(list l);
24
25#endif //LIST_H
Definition list.h:9