ucx/list.h

changeset 1
1bcaac272cdf
child 5
88625853ae74
equal deleted inserted replaced
0:0f94d369bb02 1:1bcaac272cdf
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 *restrict ucx_list_clone(UcxList *restrict l,
22 copy_func fnc, void *data);
23 int ucx_list_equals(const UcxList *l1, const UcxList *l2,
24 cmp_func fnc, void *data);
25
26 void ucx_list_free(UcxList *l);
27 UcxList *ucx_list_append(UcxList *l, void *data);
28 UcxList *ucx_list_prepend(UcxList *l, void *data);
29 UcxList *ucx_list_concat(UcxList *restrict l1, UcxList *restrict l2);
30 UcxList *ucx_list_last(const UcxList *l);
31 UcxList *ucx_list_get(const UcxList *l, int index);
32 size_t ucx_list_size(const UcxList *l);
33
34 UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);
35
36 /* list specific functions */
37 UcxList *ucx_list_remove(UcxList *l, UcxList *e);
38
39 #ifdef __cplusplus
40 }
41 #endif
42
43 #endif /* LIST_H */
44

mercurial