Thu, 11 Oct 2012 11:42:31 +0200
added some qualifiers + removed pointer alias in mergesort
1 /*
2 *
3 */
5 #ifndef LIST_H
6 #define LIST_H
8 #include "ucx.h"
9 #include <stddef.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
15 typedef struct UcxList UcxList;
16 struct UcxList {
17 void *data;
18 UcxList *next;
19 };
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);
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);
34 UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);
36 /* list specific functions */
37 UcxList *ucx_list_remove(UcxList *l, UcxList *e);
39 #ifdef __cplusplus
40 }
41 #endif
43 #endif /* LIST_H */