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
9
typedef
struct
cons
{
void
*car;
struct
cons
*cdr;}
cons
, *
list
;
10
11
//returns NULL on error and if so no side effect
12
list
list_push(
list
l,
void
* e);
13
14
void
*list_pop(
list
*l_p);
15
16
// precondition : if destroy_fn_t non null, it must properly frees the l'cars
17
void
list_free_list(
list
l,
void
(*destroy_fn_t)(
void
*item,
void
*user_data),
void
*user_data);
18
19
bool
list_contains(
list
l,
void
*item);
20
21
// DEBUG TOOLS
22
23
size_t
list_length(
list
l);
24
25
#endif
//LIST_H
cons
Definition
list.h:9
src
foundation
data_structures
include
list.h
Generated by
1.9.8