-
Notifications
You must be signed in to change notification settings - Fork 0
/
lists.h
53 lines (36 loc) · 1.14 KB
/
lists.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Author: Humberto Naves (hsnaves@gmail.com)
*/
#ifndef __LISTS_H
#define __LISTS_H
#include <stddef.h>
struct _element;
typedef struct _element *element;
struct _list;
typedef struct _list *list;
struct _listpool;
typedef struct _listpool *listpool;
listpool listpool_create (size_t numelms, size_t numlsts);
void listpool_destroy (listpool pool);
list list_alloc (listpool pool);
void list_free (list l);
void list_reset (list l);
int list_size (list l);
element list_head (list l);
element list_tail (list l);
void *list_headvalue (list l);
void *list_tailvalue (list l);
element list_inserthead (list l, void *val);
element list_inserttail (list l, void *val);
void *list_removehead (list l);
void *list_removetail (list l);
void *element_getvalue (element el);
void element_setvalue (element el, void *val);
void element_insertbefore (element el, element inserted);
void element_insertafter (element el, element inserted);
element element_next (element el);
element element_previous (element el);
element element_alloc (listpool pool, void *val);
void element_remove (element el);
void *element_free (element el);
#endif /* __LISTS_H */