|
1 /* |
|
2 * |
|
3 */ |
|
4 |
|
5 #ifndef LIST_H |
|
6 #define LIST_H |
|
7 |
|
8 #include "ucx.h" |
|
9 #include <stddef.h> |
|
10 |
|
11 #ifdef __cplusplus |
|
12 extern "C" { |
|
13 #endif |
|
14 |
|
15 typedef struct UcxList UcxList; |
|
16 struct UcxList { |
|
17 void *data; |
|
18 UcxList *next; |
|
19 }; |
|
20 |
|
21 UcxList *ucx_list_clone(UcxList *l, copy_func fnc, void *data); |
|
22 int ucx_list_equals(UcxList *l1, UcxList *l2, cmp_func fnc, void *data); |
|
23 |
|
24 void ucx_list_free(UcxList *l); |
|
25 UcxList *ucx_list_append(UcxList *l, void *data); |
|
26 UcxList *ucx_list_prepend(UcxList *l, void *data); |
|
27 UcxList *ucx_list_concat(UcxList *l1, UcxList *l2); |
|
28 UcxList *ucx_list_last(UcxList *l); |
|
29 UcxList *ucx_list_get(UcxList *l, int index); |
|
30 size_t ucx_list_size(UcxList *l); |
|
31 void ucx_list_foreach(UcxList *l, ucx_callback fnc, void *data); |
|
32 |
|
33 |
|
34 #ifdef __cplusplus |
|
35 } |
|
36 #endif |
|
37 |
|
38 #endif /* LIST_H */ |
|
39 |