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